Search

EP-4738111-A2 - SOFTWARE PLATFORM SPECIFIC FUNCTION DISASSEMBLING AND CALLING METHOD FOR THIRD-PARTY PROGRAM LIBRARY AND CALLING SYSTEM

EP4738111A2EP 4738111 A2EP4738111 A2EP 4738111A2EP-4738111-A2

Abstract

The present disclosure provides a method for constructing a third-party program library within a software platform. A construction module in the software platform constructs the third-party program library, wherein the constructing comprises constructing, by the software platform, a capability obtaining submodule and internal submodules in the third-party program library. The capability obtaining submodule is generated by loading, by the software platform, a software platform version number and a list of a user logic callback submodule. When an external program calls the capability obtaining submodule, version information of the software platform corresponding to the third-party program library, list information of the user logic callback submodule, and information of all the internal submodules of the third-party program library are obtained.

Inventors

  • LIU, CHU
  • XIE, YUEYIN
  • MO, Mang

Assignees

  • Shanghai Tosun Technology Ltd.

Dates

Publication Date
20260506
Application Date
20220828

Claims (15)

  1. A method for constructing a third-party program library within a software platform, comprising: constructing, by a construction module in the software platform, the third-party program library; wherein the constructing of the third-party program library comprises constructing, by the software platform, a capability obtaining submodule and internal submodules in the third-party program library; wherein the constructing of the capability obtaining submodule comprises: loading, by the software platform, a software platform version number and a list of a user logic callback submodule to automatically generate the capability obtaining submodule, and obtaining version information of the software platform corresponding to the third-party program library, list information of the user logic callback submodule, and information of all the internal submodules of the third-party program library when an external program calls the capability obtaining submodule.
  2. The construction method according to claim 1, wherein the software platform further constructs, in the third-party program library, an initialization submodule, wherein the constructing of the initialization submodule comprises: generating the initialization submodule by using a software platform header file and a software platform application programming interface (API) list on the software platform, such that after the initialization submodule is called, the third-party program library obtains address information of each API in the API list provided by the software platform.
  3. The construction method according to claim 2, wherein verifying, by a verification module in the software platform, legitimacy of the third-party program library; wherein the verifying of the legitimacy of the third-party program library comprises: loading the third-party program library onto the software platform; calling, by the software platform, the initialization submodule and the capability obtaining submodule of the third-party program library to obtain a version number of the software platform corresponding to the third-party program library, the list of the user logic callback submodule, and address information and function parameter information of all the internal submodules of the third-party program library; and comparing, by the software platform, the version number of the software platform corresponding to the third-party program library with the software platform version number; stopping calling the third-party program library when the version number of the software platform corresponding to the third-party program library is greater than the software platform version number, and continuing calling the third-party program library when the version number of the software platform corresponding to the third-party program library is smaller than or equal to the software platform version number.
  4. The construction method according to any one of claims 1 to 3, wherein the constructing of the internal submodules comprises: generating each internal submodule based on a user function logic submodule of the software platform; wherein each internal submodule does not provide a public interface, and is only obtained by the external program calling a capability obtaining function; and the capability obtaining submodule comprises the capability obtaining function, wherein a source code of the capability obtaining function is constituted by the software platform version number and symbol information of a user logic callback function.
  5. The construction method according to any one of claims 1 to 4, wherein the software platform further constructs, in the third-party program library, a release submodule; wherein the release submodule is adapted to automatically release a resource requested by the third-party program library when the third-party program library is unloaded.
  6. The construction method according to any one of claims 1 to 5, wherein calling a C++ compiler by using the software platform, to construct the third-party program library.
  7. The construction method according to any one of claims 1 to 6, wherein after all internal functions corresponding to required internal submodules are generated, the software platform calls a C/C++ compiler to compile generated functions into an executable file of the third-party program library.
  8. A software platform-specific function disassembling and calling method for a third-party program library, comprising: creating the third-party program library by adopting the construction method according to any one of claims 1 to 7; and calling, by a calling module in the software platform, the third-party program library.
  9. The software platform-specific function disassembling and calling method according to claim 8, wherein a method for calling the third-party program library by the calling module in the software platform comprises: after the software platform continues calling the third-party program library, calling, by the software platform, the third-party program library based on a user logic callback function list and an internal function list that are obtained from the third-party program library, and releasing a requested resource by calling a release function in the third-party program library after the calling is completed or when it is unnecessary to continue calling the third-party program library.
  10. The software platform-specific function disassembling and calling method according to claim 8 or 9, wherein the third-party program library comprises a CRC16 verification algorithm; and after loading the third-party program library, the software platform provides a user with an interface function of the CRC16 verification algorithm, such that the interface function is freely called by the user to calculate a check value of the CRC16 verification algorithm.
  11. A calling system, comprising a computer device; wherein the computer device is configured to comprise: a construction module, configured to construct a third-party program library; wherein the constructing of the third-party program library comprises constructing, by a software platform, a capability obtaining submodule and internal submodules in the third-party program library; wherein the constructing of the capability obtaining submodule comprises: loading, by the software platform, a software platform version number and a list of a user logic callback submodule to automatically generate the capability obtaining submodule, and obtaining version information of the software platform corresponding to the third-party program library, list information of the user logic callback submodule, and information of all the internal submodules of the third-party program library when an external program calls the capability obtaining submodule; wherein the software platform further constructs, in the third-party program library, an initialization submodule, wherein the initialization submodule is an initialization function, and a source code of the initialization function is generated based on a software platform header file and a software platform API list containing API symbol information; wherein the computer device is further configured to comprise: a verification module, configured to verify legitimacy of the third-party program library, comprising: loading the third-party program library onto the software platform; calling, by the software platform, the initialization submodule and the capability obtaining submodule of the third-party program library to obtain a version number of the software platform corresponding to the third-party program library, the list of the user logic callback submodule, and address information and function parameter information of all the internal submodules of the third-party program library; and comparing, by the software platform, the version number of the software platform corresponding to the third-party program library with the software platform version number; stopping calling the third-party program library when the version number of the software platform corresponding to the third-party program library is greater than the software platform version number, and continuing calling the third-party program library when the version number of the software platform corresponding to the third-party program library is smaller than or equal to the software platform version number; wherein the software platform further constructs, in the third-party program library, a release submodule; wherein the release submodule is adapted to automatically release a resource requested by the third-party program library when the third-party program library is unloaded; wherein the computer device is further configured to comprise: a calling module, configured to call the third-party program library, wherein after the software platform continues calling the third-party program library, calling, by the software platform, the third-party program library based on a user logic callback function list.
  12. A third-party program library constructed by using the construction method according to any one of claims 1 to 7, comprising: an initialization submodule, a capability obtaining submodule, and internal submodules.
  13. An electronic device, comprising: a non-transitory computer-readable storage medium; and a processor; wherein the non-transitory computer-readable storage medium stores instructions, wherein when executed by the processor, the instructions allow the processor to perform the construction method according to any one of claims 1 to 7.
  14. A computer program product embodied in a non-transitory computer-readable storage medium, comprising instructions, wherein when executed by a processor, the instructions allow the processor to perform the construction method according to any one of claims 1 to 7.
  15. A non-transitory computer-readable storage medium comprising instructions, wherein when executed by a processor, the instructions allow the processor to perform the construction method according to any one of claims 1 to 7.

Description

TECHNICAL FIELD The present disclosure relates to the technical field of computers, and specifically, to a software platform-specific function disassembling and calling method for a third-party program library, and a calling system. BACKGROUND A Windows-based software platform expands its function by importing a third-party program library. For an interface function exported from the third-party program library, the software platform needs to know a definition of the interface function and update a calling program before calling a function of the third-party program library. For a newly-added third-party program library or an existing third-party program library that has been upgraded, as the interface function changes, a software platform developer has to manually update the calling program to call a file function of the corresponding third-party program library. In this way, the software platform needs to continuously update the calling program based on the third-party program library to maintain compatibility between the software platform and a third-party program, resulting in a heavy workload and low efficiency. Therefore, to resolve the above technical problems, a software platform-specific function disassembling and calling method for a third-party program library, and a calling system need to be designed. SUMMARY The present disclosure is intended to provide a software platform-specific function disassembling and calling method for a third-party program library, and a calling system. In order to resolve the above technical problem, the present disclosure provides a software platform-specific function disassembling and calling method for a third-party program library, including: constructing a third-party program library;verifying legitimacy of the third-party program library; andcalling the third-party program library. Further, a method for constructing the third-party program library includes: constructing the third-party program library by using a software platform, that is, constructing an initialization submodule, a capability obtaining submodule, an internal submodule, and a release submodule in the third-party program library by using the software platform, wherethe release submodule is adapted to automatically release a resource requested by the third-party program library when the third-party program library is unloaded. Further, a method for constructing the initialization submodule by using the software platform includes: generating the initialization submodule by using a software platform header file and a software platform application programming interface (API) list on the software platform, such that after the initialization submodule is called, the third-party program library obtains address information of each API in the API list provided by the software platform. Further, a method for constructing the capability obtaining submodule by using the software platform includes: loading, by the software platform, a software platform version number and a list of a user logic callback submodule to generate the capability obtaining submodule, and obtaining version information of a software platform corresponding to the third-party program library, list information of the user logic callback submodule, and information of all internal submodules of the third-party program library when an external program calls the capability obtaining submodule. Further, a method for constructing the internal submodule by using the software platform includes: generating the internal submodule based on a user function logic submodule of the software platform. Further, a method for verifying the legitimacy of the third-party program library includes: loading the third-party program library onto the software platform, such that the software platform calls the initialization submodule and the capability obtaining submodule of the third-party program library to obtain a version number of the software platform corresponding to the third-party program library, the list of the user logic callback submodule, and address information and function parameter information of all the internal submodules of the third-party program library; andcomparing, by the software platform, the obtained version number of the software platform corresponding to the third-party program library with the software platform version number, and stopping calling the third-party program library if the version number of the software platform corresponding to the third-party program library is greater than the software platform version number, or continuing calling the third-party program library if the version number of the software platform corresponding to the third-party program library is not greater than the software platform version number. Further, a method for calling the third-party program library includes: after the software platform continues calling the third-party program library, calling, by the software platform, the third-party progr