Search

US-20260126992-A1 - SOFTWARE PLATFORM-SPECIFIC MUTUAL CALLING METHOD FOR FUNCTIONS OF THIRD-PARTY PROGRAM LIBRARIES, AND MUTUAL CALLING SYSTEM

US20260126992A1US 20260126992 A1US20260126992 A1US 20260126992A1US-20260126992-A1

Abstract

A software platform–specific mutual calling method for functions of third-party program libraries includes: constructing a plurality of third-party program libraries; verifying validity of the third-party program library; and mutually calling the plurality of third-party program libraries. This implements a general calling framework by using a software platform, such that a function, registered with the software platform, of the third-party program library can be shared among all loaded third-party program libraries. When a current third-party program library needs to call an additional third-party program library, there is no need to load the additional third-party program library, and the additional third-party program library can be accessed only by using a function list that contains the additional third-party program library and that is shared by the software platform for the current third-party program library.

Inventors

  • Chu Liu
  • Yueyin XIE
  • Mang MO

Assignees

  • SHANGHAI TOSUN TECHNOLOGY LTD.

Dates

Publication Date
20260507
Application Date
20251229
Priority Date
20210929

Claims (19)

  1. 1 . A method for constructing a plurality of third-party program libraries, wherein the method is applied to a software platform–specific mutual calling method for functions of the plurality of third-party program libraries, and the method comprises: constructing each of the plurality of third-party program libraries by using a software platform, wherein an initialization submodule, a capability obtaining submodule, an internal submodule, and a release submodule in each of the plurality of third-party program libraries are constructed by using the software platform; whereinthe release submodule is configured to automatically release a resource requested bya corresponding third-party program library of the plurality of third-party program libraries when the third-party program library is unloaded; wherein a method for constructing the initialization submodule by using the software platform 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 corresponding third-party program library obtains address information of each API in the software platform API list provided by the software platform; wherein a method for constructing the capability obtaining submodule by using the software platform comprises: loading, by the software platform, a software platform version number, a list of a corresponding user logic callback submodule, and a list of an external submodule on which the corresponding third-party program library depends 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, information of the external submodule on which the third-party program library depends, and information of all internal submodules of the third-party program library when an external program calls the capability obtaining submodule.
  2. 2 . The method according to claim 1 , wherein a method for constructing the internal submodule by using the software platform comprises: generating the internal submodule based on a user function logic submodule of the software platform.
  3. 3 . A software platform–specific mutual calling method for functions of a plurality of third-party program libraries, comprising: constructing the plurality of third-party program libraries; verifying validity of the plurality of third-party program libraries; and mutually calling the plurality of third-party program libraries.
  4. 4 . The software platform–specific mutual calling methodaccording to claim 3 , wherein a method for verifying the validity of the third-party program library comprises: loading a corresponding third-party program library onto a software platform, such that the software platform calls an initialization submodule and a 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, a list of a user logic callback submodule, address information and function parameter information of all internal submodules of the third-party program library, and information of an external submodule on which the third-party program library depends.
  5. 5 . The software platform–specific mutual calling methodaccording to claim 4 , wherein providing, by the software platform, the third-party program library with a pointer of the external submodule on which the third-party program library depends; when the external submodule on which the third-party program library depends does not exist, providing, by the software platform, the third-party program library with a null pointer; in a calling process of the third-party program library, determining, based on whether the pointer is the null pointer, whether there is an additional third-party program library on which the third-party program library depends; when the pointer is the null pointer, determining that an internal submodule of the additional third-party program library on which the third-party program library depends does not take effect, but functions of other internal submodules of the third-party program library still take effect.
  6. 6 . The software platform–specific mutual calling methodaccording to claim 4 , wherein comparing, by the software platform, the version number of the software platform corresponding to the third-party program library with a software platform version number, and 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, or continuing calling the third-party program library when the version number of the software platform corresponding to the third-party program library is less than or equal to the software platform version number.
  7. 7 . The software platform–specific mutual calling methodaccording to claim 4 , wherein a method for mutually calling the plurality of third-party program libraries comprises: after the software platform continues calling the corresponding third-party program library, calling, by the software platform, the third-party program library based on the list of the user logic callback submodule and a list of the internal submodule, wherein the list of the user logic callback submodule and the list of the internal submodule are obtained from the third-party program library.
  8. 8 . The software platform–specific mutual calling methodaccording to claim 4 , wherein when a current third-party program library needs to call an internal submodule of an additional third-party program library during running, transferring, by the software platform, a pointer of an external submodule on which the current third-party program library depends in the capability obtaining submodule to allow the current third-party program library to call the internal submodule of the additional third-party program library.
  9. 9 . The software platform–specific mutual calling methodaccording to claim 8 , wherein after the calling is completed, releasing, by the software platform, a requested resource by calling a release submodule in the third-party program library.
  10. 10 . A software platform for performing the method according to claim 1 , comprising: the software platform header file, the software platform API list, the software platform version number, the list of the user logic callback submodule, a list of an external submodule on which each of the plurality of third-party program libraries depends, a user function logic submodule,a C++ compiler, a dynamic link library loading function, a function calling function, a dependent-function management function, a version number comparison function, a running function, and a stopping function, one or more of which are included.
  11. 11 . A third-party program library for performing the method according to claim 1 , comprising: the initialization submodule, the capability obtaining submodule, the internal submodule, and the release submodule.
  12. 12 . A mutual calling system using the software platform–specific mutual calling method according to claim 3 , comprising: a construction module configured to construct the plurality of third-party program libraries; a verification module configured to verify the validity of the plurality of third-party program libraries; and a calling module configured to mutually call the plurality of third-party program libraries.
  13. 13 . A software platform for the software platform–specific mutual calling method according to claim 3 , comprising: a software platform header file, a software platform API list, a software platform version number, a list of a user logic callback submodule, a list of an external submodule on which each of the plurality of third-party program libraries depends, a user function logic submodule, a C++ compiler, a dynamic link library loading function, a function calling function, a dependent-function management function, a version number comparison function, a running function, and a stopping function, one or more of which are included.
  14. 14 . A computer program product, comprising a computer program or instructions, wherein the computer program or the instructions, when executed on a computer, cause the computer to execute the method according to claim 1 .
  15. 15 . A computer program product, comprising a computer program or instructions, wherein the computer program or the instructions, when executed on a computer, cause the computer to execute the software platform–specific mutual calling method according to claim 3 .
  16. 16 . A non-transitory computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions are configured to cause at least one processor, when executing the computer-readable instructions, to execute a program for the method according to claim 1 .
  17. 17 . A non-transitory computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions are configured to cause at least one processor, when executing the computer-readable instructions, to execute a program for the software platform–specific mutual calling method according to claim 3 .
  18. 18 . A computer device, wherein the computer device is configured to execute a program for the method according to claim 1 .
  19. 19 . A computer device, wherein the computer device is configured to execute a program for the software platform–specific mutual calling method according to claim 3 .

Description

CROSS REFERENCE TO THE RELATED APPLICATIONS This application is the continuation application of US Application No. 18/267,106 filed on June 14, 2023, which is the national phase entry of International Application No. PCT/CN2022/111298, filed on August 10, 2022, which is based upon and claims priority to Chinese Patent Application No. 202111147972.X, filed on September 29, 2021, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD The present disclosure relates to the technical field of computers, and specifically, to a software platform–specific mutual calling method for functions of third-party program libraries, and a mutual calling system. BACKGROUND A Windows-based software platform expands its function by importing a third-party program library. In the third-party program library imported into the software platform, sometimes one third-party program library calls an additional third-party program library. A traditional approach is to modify a current third-party program library and call an additional third-party program library by implicitly or explicitly loading the additional third-party program library. According to the prior technical solution, when the additional third-party program library is called by modifying the current third-party program library, an additional workload is required for the current third-party program library. As the additional third-party program library changes, the current third-party program library also needs to change synchronously. Moreover, if the current third-party program library calls the additional third-party program library by explicitly loading the additional third-party program library, the current third-party program library cannot load the additional third-party program library if the additional third-party program library does not exist. Therefore, to resolve the above technical problems, it is desirable to design a new software platform–specific mutual calling method for functions of third-party program libraries, and a mutual calling system. SUMMARY The present disclosure is intended to provide a software platform–specific mutual calling method for functions of third-party program libraries, and a mutual calling system. In order to resolve the above technical problem, the present disclosure provides a software platform–specific mutual calling method for functions of third-party program libraries, including: constructing a plurality of third-party program libraries; verifying validity of the third-party program library; and mutually calling the plurality of third-party program libraries. Further, a method for constructing the plurality of third-party program libraries includes: constructing each of the third-party program libraries by using a software platform, that is, constructing an initialization submodule, a capability obtaining submodule, an internal submodule, and a release submodule in each of the third-party program libraries by using the software platform, where the release submodule is configured 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, a list of a corresponding user logic callback submodule, and a list of an external submodule on which the corresponding third-party program library depends 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, information of the external submodule on which the third-party program library depends, 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 validity 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