Construction method and system of third-party program library, storage medium and calling method and system

By building and automatically identifying submodules of third-party program libraries, the problem of software platform requiring manual update of calling programs when the interface of third-party program libraries changes is solved, and the solution of automatically importing function interfaces is realized, which improves development efficiency and architectural stability.

CN119690413APending Publication Date: 2025-03-25SHANGHAI TOSUN TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411743658.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When the third-party program library interface functions change, existing software platforms need to manually update the calling program, resulting in high workload and inefficiency, and cannot automatically identify and import the function interface of the third-party program library.

Method used

By building a third-party program library, including initialization submodules, ability acquisition submodules, internal submodules and release submodules, and implementing verification and calling mechanisms in the software platform, automatically identifying and importing the function interface of the third-party program library.

Benefits of technology

It realizes the automatic import solution for third-party program library functions. Whether it is adding or upgrading third-party program libraries, the software platform can automatically identify function interfaces, reducing the user's need for manual updates, and improving development efficiency and architectural stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690413A_ABST
    Figure CN119690413A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computers, and particularly relates to a third-party program library function disassembling and calling method and calling system for a software platform, and the third-party program library function disassembling and calling method for the software platform comprises the following steps: constructing a third-party program library; verifying the legality of the third-party program library; according to the method, a solution for automatically importing the disassembling and calling system of the third-party program library function is achieved, no matter whether the third-party program library is newly added or the existing third-party program library function is changed, a software platform can automatically identify a function interface only by loading the third-party program library, and the function interface can be automatically imported. And a user does not need to manually update the calling program. According to the method, the stability of the software platform architecture can be ensured, and the problems of stability reduction and the like caused by repeated modification of the software platform are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 2021111479715, the application date is: 2021.09.29, and the name of the invention is: Software platform uses third-party program library function disassembly calling method and calling system. Technical Field

[0002] The invention belongs to the field of computer technology, and in particular relates to a method and a system for disassembling and calling third-party program library functions on a software platform. Background Art

[0003] The Windows-based software platform can expand its functions by importing third-party libraries. For the interface functions exported by the third-party libraries, the software platform must know the definitions of these interface functions and update the calling program to implement the function calls of the third-party libraries.

[0004] For newly added third-party libraries or existing third-party libraries that have been upgraded, the software platform developers have to manually update the calling program because the interface function has changed in order to call the corresponding third-party library file function. This method requires the software platform to continuously update the calling program according to the third-party library to maintain the compatibility between the software platform and the third-party program, which is labor-intensive and inefficient.

[0005] Therefore, based on the above technical problems, it is necessary to design a new software platform to disassemble the calling method and calling system using the third-party library function. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for disassembling and calling third-party program library functions on a software platform.

[0007] In order to solve the above technical problems, the present invention provides a method for disassembling and calling a third-party library function on a software platform, comprising:

[0008] Build third-party libraries;

[0009] Verify the legitimacy of third-party libraries; and

[0010] Call third-party libraries.

[0011] Further, the method for building a third-party program library includes:

[0012] Building a third-party program library through the software platform, that is, building an initialization submodule, a capability acquisition submodule and an internal submodule in the third-party program library through the software platform, and building a release submodule in the third-party program library;

[0013] The release submodule is adapted to automatically release the resources applied for by the third-party program library when the third-party program library is uninstalled.

[0014] Further, the method of constructing the initialization submodule through the software platform includes:

[0015] An initialization submodule is generated through the software platform header file and the software platform API list in the software platform, so that after the initialization submodule is called, the third-party program library obtains the address information of each API in the API list provided by the software platform.

[0016] Further, the method of constructing the capability acquisition submodule through the software platform includes:

[0017] The software platform loads the software platform version number and the list of user logic callback submodules to generate a capability acquisition submodule. When an external program calls the capability acquisition submodule, it obtains the version information of the software platform corresponding to the third-party program library, the list information of the user logic callback submodule, and all internal submodule information of this third-party program library.

[0018] Further, the method of constructing the internal submodule through the software platform includes:

[0019] Generate internal sub-modules based on the user function logic sub-modules of the software platform.

[0020] Further, the method for verifying the legitimacy of the third-party library includes:

[0021] The third-party program library is loaded into the software platform, and the software platform calls the initialization submodule of the third-party program library, and the software platform calls the capability acquisition submodule of the third-party program library to obtain the version number of the software platform corresponding to the third-party program library, the list of user logic callback submodules, and the address information and function parameter information of all internal submodules of the third-party program library;

[0022] The software platform compares the version number of the software platform corresponding to the obtained third-party library with its own version number. If the version number of the third-party library is greater than its own version number, the software platform stops calling the third-party library, otherwise it continues to call the third-party library.

[0023] Further, the method of calling the third-party library includes:

[0024] After the software platform continues to call the third-party program library, the software platform is suitable for calling the third-party program library according to the list of user logic callback sub-modules and the list of internal sub-modules obtained in the third-party program library, and releasing the requested resources by calling the release sub-module in the third-party program library after the call is completed.

[0025] In a second aspect, the present invention further provides a software platform for the above-mentioned software platform using a third-party program library function disassembly calling method, comprising:

[0026] Software platform header files, software platform API list, software platform version number, list of user logic callback submodules, user function logic submodules and C++ compiler.

[0027] In a third aspect, the present invention further provides a third-party library for disassembling a calling method of a third-party library function for the software platform, comprising:

[0028] Initialization submodule, capability acquisition submodule, internal submodule and release submodule.

[0029] In a fourth aspect, the present invention further provides a calling system for disassembling a calling method using a third-party library function using the above-mentioned software platform, comprising:

[0030] Build modules and third-party libraries;

[0031] Verification module to verify the legitimacy of third-party libraries; and

[0032] Call module and call third-party program library.

[0033] The beneficial effect of the present invention is that the present invention realizes an automatic import solution for the disassembly calling system of the third-party library function by building a third-party library; checking the legitimacy of the third-party library; and calling the third-party library. Whether a new third-party library is added or an existing third-party library function is modified, the software platform can automatically identify the function interface as long as the third-party library is loaded, without the need for the user to manually update the calling program. This method can ensure the stability of the software platform architecture and reduce the stability degradation caused by repeated modifications of the software platform.

[0034] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.

[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 It is a flow chart of a method for disassembling and calling a third-party program library function on a software platform involved in the present invention;

[0038] Figure 2 is a flow chart of building a third-party program library involved in the present invention;

[0039] Figure 3 It is a flow chart of calling a third-party program library involved in the present invention;

[0040] Figure 4 It is a principle block diagram of the calling system involved in the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Example 1

[0043] Figure 1 It is a flow chart of a method for disassembling and calling a third-party program library function on a software platform involved in the present invention.

[0044] like Figure 1 As shown, this embodiment 1 provides a method for disassembling and calling a third-party library function on a software platform, including: building a third-party library; verifying the legitimacy of the third-party library; and calling the third-party library, realizing an automatic import solution for the disassembly and calling system of the third-party library function. Whether a new third-party library is added or an existing third-party library function is modified, the software platform can automatically identify the function interface as long as the third-party library is loaded, without the need for the user to manually update the calling program. This method can ensure the stability of the software platform architecture and reduce the problems of stability degradation caused by repeated modifications of the software platform.

[0045] Figure 2 It is a flow chart of building a third-party program library involved in the present invention.

[0046] like Figure 2 As shown, in this embodiment, the method for building a third-party program library includes: building a third-party program library by calling a C++ compiler through a software platform, that is, building an initialization submodule (containing an initialization function and corresponding functions), a capability acquisition submodule (containing a capability acquisition function and corresponding functions) and an internal submodule (containing internal functions and corresponding functions) in the third-party program library through the software platform, and building a release submodule (containing a release function and corresponding functions) in the third-party program library; the release submodule is suitable for automatically releasing the resources applied for by the third-party program library when the third-party program library is uninstalled; the initialization submodule, the capability acquisition submodule and the release submodule are public submodules, and the functions in the submodules can be automatically loaded and called by external programs, and the functions in the internal submodules are not visible to the outside.

[0047] In this embodiment, the method of constructing an initialization sub-module through a software platform includes: automatically generating an initialization sub-module through a software platform header file and a software platform API list within the software platform, so that after the initialization sub-module is called, the third-party program library obtains the address information of each API in the API list provided by the software platform, and can perform its normal function.

[0048] In this embodiment, the method of constructing a capability acquisition sub-module through a software platform includes: the software platform loads the software platform version number and a list of user logic callback sub-modules (the list of user logic callback sub-modules is a list of user logic callback functions developed by users in the software platform) to automatically generate a capability acquisition sub-module, and when an external program calls the capability acquisition sub-module, obtains the version information of the software platform corresponding to the third-party program library, the list information of the user logic callback sub-module, and all internal sub-module information of this third-party program library.

[0049] In this embodiment, the method of constructing an internal submodule through a software platform includes: generating an internal submodule according to a user function logic submodule (user function logic program) of the software platform, wherein the internal submodule does not open an interface to the outside world and can only be obtained by an external program by calling a capability acquisition function.

[0050] Figure 3 This is a flow chart of calling a third-party program library involved in the present invention.

[0051] like Figure 3As shown, in this embodiment, the method for verifying the legitimacy of the third-party program library includes: the third-party program library calling process is completed by the software platform and the third-party program library in cooperation; the third-party program library is loaded into the software platform by loading a dynamic link library in the software platform, the software platform calls the initialization submodule of the third-party program library (calls the initialization function), and the software platform calls the capability acquisition submodule of the third-party program library (calls the capability acquisition function), and obtains the version number of the software platform corresponding to the third-party program library, the list of user logic callback submodules (user callback function list) and the address information and function parameter information of all internal submodules (internal functions, such as internal functions a1, a2, ..., internal function an) of the third-party program library; the software platform compares the version number of the software platform corresponding to the third-party program library with its own version number. If the version number of the third-party program library is greater than its own version number, it is said that the software platform is legitimate. If it is known that the third-party library is compiled by a software platform with a newer version than the software platform itself, the third-party library will be stopped from being called. Otherwise, the third-party library will be determined to be legal (meeting the requirements) and the third-party library will continue to be called. When the software platform calls the third-party library, it adopts the method of first calling the capability acquisition function. When the third-party library does not export any internal functions, all the callable function resources in the third-party library can be obtained. After obtaining the function resources of the third-party library, the software platform can automatically identify its internal function parameters and automatically generate a function call interface, thereby improving the development efficiency of the software platform and the third-party library and reducing the possibility of errors. As long as the third-party program is generated by the software platform, it can be called by the software platform of the same version or a higher version. During the calling process, the software platform will automatically obtain the function parameter type of the third-party library, and the user can freely call the third-party library without updating the software platform. This method improves the development and upgrade efficiency of the calling system.

[0052] In this embodiment, the method for calling a third-party program library includes: after the software platform continues to call the third-party program library, the software platform is suitable for calling the third-party program library according to the list of user logic callback sub-modules (user callback function list) and the list of internal sub-modules (internal function list) obtained in the third-party program library, and when the call is completed or there is no need to continue calling the third-party program library, the requested resources are released by calling the release sub-module (release function) in the third-party program library.

[0053] In this embodiment, the software platform includes: a software platform header file, a software platform API list containing API symbol information, a software platform version number, user logic generated by the user through the software platform (embodied in the form of callback functions) and the user's own logic designed by the software platform (embodied in ordinary functions); in the process of the software platform building a third-party program library, it is first necessary to generate an initialization function, the source code of which is generated based on the software platform header file and the software platform API list containing API symbol information; secondly, it is necessary to generate a capability acquisition function, the source code of which is composed of the software platform's own version number and the symbol information of the user logic callback function; thirdly, it is necessary to generate a release function, which is responsible for releasing the applied resources before the third-party program library is uninstalled; finally, it is necessary to generate a series of internal functions, which are free logic designed by the user through the software platform; when all the required functions are generated, the software platform calls the C / C++ compiler to compile the generated functions into a third-party program library executable file.

[0054] In this embodiment, the software platform also includes: a dynamic link library loading function, a function calling function, a version number comparison function, a running function and a stop function; in the process of the software platform calling a third-party program library, it is first necessary to load the third-party program library through the dynamic link library loading function. After the loading is successful, the initialization function of the third-party program library is called through the function calling function, and then the capability acquisition function of the third-party program library is called through the function calling function. The software platform version number and the user logic callback function compiled into the capability acquisition function in this embodiment are read out and input into the software platform. The software platform will know the relationship between the build version number of the third-party program library and the version number of the software platform. Only when the version numbers are the same, or the version number of the software platform is greater than the build version number of the third-party program library, can the software platform continue to call the third-party program library, otherwise the calling process terminates; after the version number comparison function is executed and returns a flag that can continue to be called, the software platform executes the running program function. During the running process, the internal functions of the third-party program library will be freely called by the software platform to provide various functions to the software platform. When the third-party program library is not needed, the software platform executes the stop program function, which calls the release function of the third-party program library. After the resources requested by the third-party program library are released, the calling process ends.

[0055] Specifically, in this embodiment, a third-party library that provides a CRC checksum algorithm is taken as an example. It has a CRC16 algorithm inside. After the software platform loads the library, it can provide the user with an interface function of the CRC16 algorithm for the user to freely call to calculate the CRC16 checksum value. Both traditional software platforms and existing software platforms support this method to provide users with available functions. When the third-party library of the CRC checksum algorithm adds new functions, for example: (1) the parameters of the CRC16 checksum algorithm are changed from 3 to 4; (2) a new CRC32 algorithm is added; when the third-party library of the traditional software platform changes, the items that need to be manually modified by the developer are as follows: make corresponding adjustments to the parameters of the CRC16 checksum algorithm defined in the software platform to support the new parameter form of 4 parameters, add the interface definition of the new CRC32 algorithm, and recompile the relevant components of the software platform to make the modified content effective;

[0056] And the user can only wait until the software platform is updated, and load the third-party function library of the new CRC verification algorithm with the updated software platform, so as to know this change, and modify his own script synchronously, to support function upgrade, so as to finally realize the function desired by the user. This process brings many uncontrollable factors such as time expenditure, research and development expenditure, software platform update and redeployment, etc., because the upgrade of the software platform is inserted therein, so the traditional software platform will encounter the problem of low efficiency when the third-party function library is frequently updated. The software platform provided by the embodiment does not need to experience the process of re-upgrading of the software platform itself, and its specific approach is as follows: directly load the third-party program library of the updated CRC verification, obtain all API function definitions of the program library through the ability acquisition function, including the function parameter definition of the updated CRC16 algorithm, and the function definition of the newly added CRC32 algorithm, provide the latest definition of the third-party program library of the updated CRC verification to the terminal user, the user corrects his program according to the latest definition, and the software platform gives accurate address and symbol information to ensure the smoothness of the calling process when the user calls CRC16 and CRC32 functions. Thereby realizing the desired function based on the new version of the third-party program library.

[0057] Example 2

[0058] Based on Example 1, this Example 2 further provides a software platform for the software platform in Example 1 to use a third-party program library function disassembly and calling method, including: a software platform header file, a software platform API list, a software platform version number, a list of user logic callback sub-modules, a user function logic sub-module and a C++ compiler.

[0059] In this embodiment, the sub-modules and functions included in the software platform have been described in detail in Embodiment 1 and will not be repeated in this embodiment.

[0060] Example 3

[0061] Based on Example 1, this Example 3 also provides a third-party library for the software platform in Example 1 to disassemble the calling method using a third-party library function, including: an initialization submodule, a capability acquisition submodule, an internal submodule and a release submodule.

[0062] In this embodiment, the sub-modules and functions included in the third-party program library have been described in detail in Embodiment 1 and will not be repeated in this embodiment.

[0063] Example 4

[0064] Figure 4 It is a principle block diagram of the calling system involved in the present invention.

[0065] like Figure 4 As shown, based on Example 1, this Example 4 also provides a calling system that adopts the software platform in Example 1 to disassemble the calling method with a third-party program library function, characterized in that it includes: a building module to build a third-party program library; a verification module to verify the legitimacy of the third-party program library; and a calling module to call the third-party program library.

[0066] In this embodiment, the specific functions of each module have been described in detail in Embodiment 1 and will not be repeated in this embodiment.

[0067] Example 5

[0068] On the basis of the above embodiments, this embodiment 5 further provides a calling device, including: a software platform and a third-party program library; the software platform is suitable for building a third-party program library and calling the third-party program library.

[0069] In this embodiment, the functions of the software platform and the third-party program library have been described in detail in the above embodiments and will not be repeated in this embodiment.

[0070] In summary, the present invention realizes an automatic import solution for the disassembly calling system of the third-party library function by constructing a third-party library and calling the third-party library. Whether a new third-party library is added or an existing third-party library function is modified, the software platform can automatically identify the function interface as long as the third-party library is loaded, without the need for the user to manually update the calling program. This method can ensure the stability of the software platform architecture and reduce the stability degradation caused by repeated modifications of the software platform.

[0071] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0072] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0073] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0074] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for constructing a third-party program library, characterized in that: Used in software platforms to disassemble and call methods using third-party library functions, and includes: The third-party program library is constructed through the software platform, that is, the initialization submodule, the capability acquisition submodule and the internal submodule in the third-party program library are constructed through the software platform.

2. The construction method according to claim 1, characterized in that: Methods for constructing initialization submodules through software platforms include: Generate an initialization submodule through the software platform header file and the software platform API list in the software platform, so that after the initialization submodule is called, the third-party program library obtains the address information of each API in the API list provided by the software platform; and Methods for building capability acquisition submodules through software platforms include: The software platform loads the software platform version number and the list of user logic callback submodules to generate a capability acquisition submodule, and when an external program calls the capability acquisition submodule, obtains the software platform version information corresponding to the third-party program library, the list information of the user logic callback submodule, and all internal submodule information of the third-party program library; and Methods for building internal submodules through software platforms include: Generate internal sub-modules based on the user function logic sub-modules of the software platform.

3. A method for disassembling and calling a third-party library function on a software platform, characterized in that: include: The method for constructing a third-party program library as claimed in claim 1 or 2; Methods for verifying the legitimacy of third-party libraries; as well as Calling methods of third-party libraries.

4. The method for disassembling and calling a third-party library function according to claim 3, characterized in that: The method for verifying the legitimacy of the third-party program library includes: The third-party program library is loaded into the software platform, and the software platform calls the initialization submodule of the third-party program library, and the software platform calls the capability acquisition submodule of the third-party program library to obtain the version number of the software platform corresponding to the third-party program library, the list of user logic callback submodules, and the address information and function parameter information of all internal submodules of the third-party program library; The software platform compares the version number of the software platform corresponding to the obtained third-party program library with its own version number. If the version number of the third-party program library is greater than its own version number, the software platform stops calling the third-party program library, otherwise it continues to call the third-party program library.

5. The method for disassembling and calling a third-party library function according to claim 4, characterized in that: The method for calling the third-party library includes: After the software platform continues to call the third-party program library, the software platform is suitable for calling the third-party program library according to the list of user logic callback sub-modules and the list of internal sub-modules obtained in the third-party program library, and releasing the requested resources by calling the release sub-module in the third-party program library after the call is completed.

6. A method for verifying the legitimacy of a third-party program library, comprising: Used in software platforms to disassemble and call methods using third-party library functions, and includes: The third-party program library is loaded into the software platform, and the software platform calls the initialization submodule of the third-party program library, and the software platform calls the capability acquisition submodule of the third-party program library to obtain the version number of the software platform corresponding to the third-party program library, the list of user logic callback submodules, and the address information and function parameter information of all internal submodules of the third-party program library; The software platform compares the version number of the software platform corresponding to the obtained third-party program library with its own version number. If the version number of the third-party program library is greater than its own version number, the software platform stops calling the third-party program library, otherwise it continues to call the third-party program library.

7. A computer-readable storage medium, characterized in that: The computer instructions corresponding to the method for constructing a third-party program library as described in claim 1 or 2, or the method for disassembling and calling a third-party program library function as described in any one of claims 3-5, or the method for verifying the legitimacy of a third-party program library as described in claim 6 are stored.

8. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed on a computer, the computer is enabled to execute the method for constructing a third-party program library as described in claim 1 or 2, or the method for disassembling and calling a third-party program library function as described in any one of claims 3-5, or the method for verifying the legitimacy of a third-party program library as described in claim 6.

9. A computer that executes computer instructions corresponding to the method for constructing a third-party program library as described in claim 1 or 2, or the method for disassembling and calling a third-party program library function as described in any one of claims 3 to 5, or the method for verifying the legitimacy of a third-party program library as described in claim 6.

10. A calling device, characterized in that: include: Build modules and third-party libraries; Verify the module to verify the legitimacy of third-party program libraries; as well as Call module and call third-party program library.