Method and system for disassembling and calling third party library functions for a software platform

The method automates the process of identifying and calling third-party library functions in software platforms, ensuring stability and reducing manual updates, thus maintaining software platform integrity.

JP7680783B2Active Publication Date: 2025-05-21SHANGHAI TOSUN TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023540877
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-09-29
Filing Date
2022-08-28
Publication Date
2025-05-21
Estimated Expiration
2042-08-28

AI Technical Summary

Technical Problem

Existing software platforms require manual updates to maintain compatibility with third-party libraries due to interface function changes, which is labor-intensive and inefficient.

Method used

A method and system for destructively calling third-party library functions, involving construction, verification, and automatic resource release of third-party libraries, allowing the software platform to identify function interfaces without manual updates.

Benefits of technology

Ensures software platform stability by automating the process of identifying and calling third-party library functions, reducing the need for manual updates and minimizing stability degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007680783000001
    Figure 0007680783000001
  • Figure 0007680783000002
    Figure 0007680783000002
  • Figure 0007680783000003
    Figure 0007680783000003
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology, and particularly relates to a method and a system for disassembling and calling a third-party library function for a software platform. The method for disassembling and calling a third-party library function for a software platform realizes an automatic introduction solution for a system for disassembling and calling a third-party library function by constructing a third-party library, verifying the legitimacy of the third-party library, and calling the third-party library. Whether a third-party library is added or an existing third-party library function is changed, the software platform can automatically identify the function interface by simply loading the third-party library, and the user does not need to manually update the calling program. Such a method can ensure the stability of the software platform architecture and reduce problems such as stability degradation caused by repeated modifications of the software platform.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of computer technology, and more particularly to a method and system for disassembling and calling third party library functions for a software platform. [Background technology]

[0002] A software platform based on Windows extends its functions by introducing third-party libraries. For interface functions derived from third-party libraries, the software platform must know the definitions of these interface functions, and the calling program must be updated before the function calls of the third-party libraries can be realized.

[0003] For an added third-party library or an existing upgraded third-party library, the interface function changes, so the software platform developer must manually update the calling program to realize the calling of the corresponding third-party library file function. This method requires the software platform to keep updating the calling program based on the third-party library to maintain the compatibility between the software platform and the third-party library, which is labor intensive and inefficient.

[0004] Therefore, based on the above technical problems, it is necessary to design a new method and system for disassembling third-party library functions for a software platform. Summary of the Invention

[0005] SUMMARY OF THE PRESENT EMBODIMENT An object of the present invention is to provide a method and system for destructively calling a third party library function for a software platform.

[0006] In order to solve the above technical problems, the present invention provides a method for destructively calling a third party library function for a software platform, including: Building third-party libraries, Verify the legitimacy of third-party libraries, and Calling third-party libraries.

[0007] Furthermore, a method for constructing the third party library includes: The third party library is constructed by a software platform, that is, an initialization sub-module, a capability acquisition sub-module and an internal sub-module in the third party library are constructed by the software platform, and a release sub-module is constructed in the third party library. The release sub-module is adapted to automatically release the claimed resources when the third party library is unloaded.

[0008] Furthermore, the method for constructing the initialization sub-module by the software platform includes: The initialization sub-module is generated according to the header file and software platform API list of the software platform in the software platform, and after the invocation of the initialization sub-module is completed, the third-party library obtains address information of each API in the API list provided by the software platform.

[0009] In addition, the method for constructing the capability acquisition sub-module by the software platform includes: The software platform loads the version number of the software platform, loads a list of user logic callback sub-modules to generate the capability acquisition sub-module. When an external program calls the capability acquisition sub-module, the external program obtains the version information of the software platform corresponding to the third-party library, obtains the list information of the user logic callback sub-modules, and obtains all internal sub-module information of the third-party library.

[0010] Furthermore, the method for constructing the internal sub-module by the software platform includes: The internal sub-module is generated based on the user function logic sub-module of the software platform.

[0011] In addition, the methods for verifying the legitimacy of the above third-party libraries include: The third-party library is loaded into the software platform, the software platform calls the initialization sub-module of the third-party library, the software platform calls the capability acquisition sub-module of the third-party library to obtain a version number of the software platform corresponding to the third-party library, obtain a list of the user callback sub-module, and obtain address information and function parameter information of all the internal sub-modules of the third-party library. The software platform compares the version number of the software platform corresponding to the acquired third-party library with its own version number, and if the version number of the third-party library is greater than its own version number, it stops calling the third-party library, and if not, it continues to call the third-party library.

[0012] In addition, the calling methods of the above third party libraries include: After the software platform continues to call the third-party library, the software platform is suitable to call the third-party library according to the list of the user callback sub-modules and the list of the internal sub-modules obtained from the third-party library, and after the call is completed, release the requested resource by calling the release sub-module in the third-party library.

[0013] In a second aspect, the present invention further provides a software platform for a method of destructively calling a third party library function for the above software platform, comprising: the software platform header file, the software platform API list, the software platform version number, the user logic callback sub-module list, the user function logic sub-module and a C++ compiler.

[0014] In a third aspect, the present invention further provides a third party library for a method of destructively calling a third party library function for the above software platform, comprising: the initialization sub-module, the capability acquisition sub-module, the internal sub-module and the release sub-module.

[0015] In a fourth aspect, the present invention further provides a calling system using the above-mentioned method for disassembling a third party library function for a software platform, comprising: a construction module for constructing said third party library; a verification module for verifying the legitimacy of the third-party library; and A calling module calls the third-party library.

[0016] The advantages of the present invention are as follows: The present invention realizes an automatic introduction solution for a disassembled calling system of a third-party library function by constructing a third-party library, verifying the legitimacy of the third-party library, and calling the third-party library. Whether a third-party library is added or an existing third-party library function is changed, the software platform can automatically identify the function interface by simply loading the third-party library, and the user does not need to manually update the calling program. Such a method can ensure the stability of the software platform architecture and reduce problems such as stability degradation caused by repeated modifications of the software platform.

[0017] Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and obtained by the structure particularly pointed out in the description and drawings. In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. [Brief description of the drawings]

[0018] In order to more clearly describe the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings that need to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative efforts.

[0019] [Figure 1] FIG. 1 is a flowchart of a method for destructively calling a third party library function for a software platform according to the present invention. [Diagram 2] FIG. 2 is a flow chart for constructing a third party library according to the present invention. [Diagram 3]FIG. 3 is a flow chart of calling a third party library according to the present invention. [Figure 4] FIG. 4 is a block diagram showing the principle of the paging system according to the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0020] In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions of the present invention with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative labor are all within the scope of protection of the present invention.

[0021] Example 1 FIG. 1 is a flowchart of a method for destructively calling a third party library function for a software platform according to the present invention.

[0022] As shown in FIG. 1, the first embodiment provides a method for disassembling a third-party library function for a software platform. The method includes constructing a third-party library, verifying the legitimacy of the third-party library, and calling the third-party library. The method realizes an automatic introduction solution for a system for disassembling a third-party library function. Whether a third-party library is added or an existing third-party library function is changed, the software platform can automatically identify the function interface by simply loading the third-party library, and the user does not need to manually update the calling program. Such a method can ensure the stability of the software platform architecture and reduce problems such as stability degradation caused by repeated modifications of the software platform.

[0023] FIG. 2 is a flow chart for constructing a third party library according to the present invention. As shown in Fig. 2, in this embodiment, the method of constructing the third-party library is as follows: the software platform calls a C++ compiler to construct the third-party library. That is, the software platform constructs an initialization submodule (including an initialization function and corresponding functions), a capability acquisition submodule (including a capability acquisition function and corresponding functions) and an internal submodule (including an internal function and corresponding functions) in the third-party library, and constructs a release submodule (including a release function and corresponding functions) in the third-party library. The release submodule is suitable for automatically releasing the applied resources when the third-party library is unloaded. The initialization submodule, the capability acquisition submodule and the release submodule are disclosed submodules, and the functions in the submodules can be automatically loaded and called by an external program. The functions in the internal submodule are not visible from the outside.

[0024] In this embodiment, the method for constructing the initialization sub-module by the above software platform includes: automatically generating the initialization sub-module according to the header file of the software platform and the software platform API list in the software platform, and after the call of the initialization sub-module is completed, the third-party library obtains the address information of each API in the API list provided by the software platform, so that it can function normally.

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

[0026] In this embodiment, the method for constructing an internal sub-module by the above software platform includes the following: an internal sub-module is generated based on a user function logic sub-module (user function logic program) of the software platform, and the internal sub-module does not open an interface to the outside, and the external program can obtain the capability by simply calling the capability acquisition function.

[0027] FIG. 3 is a flow chart of calling a third party library according to the present invention. As shown in FIG. 3, in this embodiment, the method for verifying the legitimacy of the third-party library includes the following: the calling process of the third-party library is completed by the software platform and the third-party library in cooperation with each other. The third-party library is loaded into the software platform by loading the dynamic link library in the software platform. The software platform calls the initialization submodule (calls the initialization function) of the third-party library, and the software platform calls the capability acquisition submodule (calls the capability acquisition function) of the third-party library to obtain the version number of the software platform corresponding to the third-party library, obtains the list of user callback submodules (user callback function list), and obtains the address information and function parameter information of all internal submodules (internal functions include, for example, internal function a1, internal function a2, ..., internal function an) of the third-party library. The software platform compares the version number of the software platform corresponding to the obtained third-party library with its own version number, and if the version number of the third-party library is greater than its own version number, it explains that the third-party library is compiled by a software platform with a newer version than its own version, and stops calling the third-party library; otherwise, it judges the legitimacy of the third-party library (meets the requirements) and continues to call the third-party library. When the software platform calls a third-party library, it first adopts the method of calling the capability acquisition function. If the third-party library does not derive any internal functions, it can know all the callable function resources in the third-party library. After the software platform obtains the function resources of the third-party library, it can automatically identify its internal function parameters and automatically generate the function call interface, which improves the development efficiency of the software platform and the third-party library and reduces the possibility of errors.Once a third-party program is generated by a software platform, it can be called by the same or higher version of the software platform. During the calling process, the software platform automatically obtains the function parameter type of the third-party library, so that the user does not need to update the software platform and can freely call the third-party library. This method improves the development and upgrade efficiency of the calling system.

[0028] In this embodiment, the above-mentioned third-party library calling method includes the following: after the software platform continues to call the third-party library, the software platform is suitable to call the third-party library according to the list of user callback sub-modules (user callback function list) and the list of internal sub-modules (internal function list) obtained from the third-party library, and when the call is completed or there is no need to continue to call the third-party library, the requested resource is released by calling the release sub-module (release function) in the third-party library.

[0029] In this embodiment, the software platform includes a header file of the software platform, a software platform API list including API symbol information, a version number of the software platform, user logic generated by the user through the software platform (expressed in the form of a callback function), and unique logic designed by the user through the software platform (usually expressed as a function). In the process of constructing the third-party library, the software platform first needs to generate an initialization function, the source code of which is generated based on the header file of the software platform and the software platform API list including API symbol information. Next, a capability acquisition function needs to be generated, the source code of which is composed of the version number of the software platform itself and the symbol information of the user logic callback function. In addition, a release function needs to be generated, which is responsible for releasing the requested resources before the third-party library is unloaded. Finally, a set of internal functions needs to be generated, and these internal functions are unique logic designed by the user through the software platform. After the required functions are generated, the software platform calls a C / C++ compiler to compile the generated functions into an executable file of the third-party library.

[0030] In this embodiment, the software platform further includes a dynamic link library load function, a function call function, and a version number comparison function, a run function, and a stop function. In the process of calling a third-party library, the software platform must first load the third-party library through the dynamic link library load function. After the loading is successful, the function call function is used to call the initialization function of the third-party library. Then, the function call function is used to call the capability acquisition function of the third-party library, and the version number of the software platform and the user logic callback function compiled into the capability acquisition function in this embodiment are read and input into the software platform. The software platform knows the relationship between the construction version number of the third-party library and the version number of the software platform. If the version numbers are the same or the version number of the software platform is greater than the construction version number of the third-party library, the software platform can continue to call the third-party library, otherwise the calling process is terminated. After the version number comparison function is executed and returns a continuously callable flag, the software platform executes the execution program function, and during the execution, the internal functions of the third-party library are freely called by the software platform to provide various functions for the software platform. If the third-party library does not need to be used, the software platform executes a program stop function, which calls the release function of the third-party library, and the calling process ends after the third-party library releases the resources it has applied for.

[0031] Specifically, in this embodiment, a third-party library providing a CRC check algorithm is taken as an example. It has a CRC16 algorithm inside, and after the software platform loads the library, it can provide the user with an interface function of the CRC16 algorithm, which the user can freely call to calculate the CRC16 check value. Both the traditional software platform and the existing software platform support this method to provide the user with available functions. When a new function is added to the third-party library of this CRC check algorithm, such as: (1) modifying the parameters of this CRC16 check algorithm from three to four, or (2) adding a new CRC32 algorithm, the traditional software platform needs to manually modify the following items when the third-party library changes: Adjust the parameters of the CRC16 check algorithm defined in the software platform, support the new parameter format of four parameters, add the interface definition of the new CRC32 algorithm, and recompile the relevant modules of the software platform to make the modification effective.

[0032] After the software platform is updated, the user must load the new CRC check algorithm third-party function library using the updated software platform, otherwise the user cannot know the change, and synchronously modify their scripts to support function upgrade, thereby finally realizing the user's desired function. Since the software platform upgrade is inserted into this process, it brings many uncontrollable factors such as time overhead, development overhead, software platform update and relocation, and so on, so that the use of the traditional software platform encounters the problem of frequent updates of the third-party function library and low efficiency. The software platform provided by the embodiment does not need to go through the re-upgrade process of the software platform itself, and the specific method is as follows: directly load the updated CRC check third-party library, and obtain all API function definitions of the library, including the function parameter definition of the updated CRC16 algorithm and the function definition of the newly added CRC32 algorithm through the capability acquisition function. The latest definition of the updated CRC check third-party library is provided to the terminal user, and the user modifies his program based on the latest definition. When the user calls the CRC16 and CRC32 functions, the software platform provides accurate address and symbol information to ensure the smoothness of the call process. This allows the desired functionality to be achieved based on the new version of the third-party library.

[0033] Example 2 In addition to Example 1, Example 2 further provides a software platform for the method of disassembling and calling a third-party library function for a software platform in Example 1, including a header file of the software platform, 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.

[0034] In this embodiment, each sub-module and function included in the software platform has been described in detail in the first embodiment, and the description thereof will be omitted in this embodiment.

[0035] Example 3 In addition to the first embodiment, the third embodiment further provides a third-party library for teardown calling method of a third-party library function for the software platform in the first embodiment, which includes an initialization submodule, a capability acquisition submodule, an internal submodule and a release submodule. In this embodiment, each sub-module and function included in the third-party library is described in detail in the first embodiment, and the description is omitted in this embodiment.

[0036] Example 4 FIG. 4 is a block diagram showing the principle of the paging system according to the present invention. As shown in FIG. 4, in addition to the first embodiment, the fourth embodiment further provides a calling system using the method for disassembling calling a third-party library function for a software platform in the first embodiment, which includes: a construction module for constructing a third-party library; a verification module for verifying the legitimacy of the third-party library; and a calling module for calling the third-party library. In this embodiment, the specific functions of each module have already been described in detail in the first embodiment, and the description thereof will be omitted in this embodiment.

[0037] Example 5 In addition to the above embodiments, this embodiment 5 further provides a calling device, which includes a software platform and a third-party library. The above software platform is suitable for building the third-party library and calling the third-party library. In this embodiment, the functions of the above software platform and the third-party library are described in detail in the above embodiment, and the description is omitted in this embodiment.

[0038] To sum up, the present invention realizes an automatic introduction solution for a disassembled calling system of a third-party library function by constructing a third-party library and calling the third-party library. Whether a third-party library is added or an existing third-party library function is changed, the software platform can automatically identify the function interface by simply loading the third-party library, and the user does not need to manually update the calling program. Such a method can ensure the stability of the software platform architecture and reduce problems such as stability degradation caused by repeated modifications of the software platform.

[0039] In some embodiments provided by the present application, it is to be understood that the disclosed apparatus and method may be realized in other manners. The above-described apparatus embodiments are merely illustrative, and for example, the flowcharts and block diagrams in the drawings illustrate possible architectures, functions, and operations of the apparatus, methods, and computer program products according to several embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code including one or more executable instructions for performing a certain logical function. It is to be noted that in some alternative implementations, the functions depicted in the blocks may occur in a different order than that depicted in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and may sometimes be executed in a reverse order depending on the functions involved. It is also to be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be realized in a dedicated hardware-based system that executes a certain function or operation, or may be realized in a combination of dedicated hardware and computer instructions.

[0040] In addition, each functional module in each embodiment of the present invention may be integrated together to form a single independent part, each module may exist independently, or two or more modules may be integrated together to form a single independent part.

[0041] The above functions can be realized in the form of software functional modules and stored in a computer readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly contributed to the prior art or part of the technical solution can be expressed in the form of a software product. The computer software product is stored in a storage medium and contains a number of commands to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method in each embodiment of the present invention. The aforementioned storage medium includes: U disk, removable disk, read-only memory (ROM), random access memory (RAM), magnetic disk, optical disk, and other media capable of storing various program codes.

[0042] The above-mentioned preferred embodiments of the present invention have been enlightened, and those skilled in the art can make various changes and modifications based on the above description without departing from the technical spirit of the present invention. The technical scope of the present invention is not limited to the contents of the specification, but should be determined based on the claims.

Claims

1. A method for disassembling and calling a third party library function for a software platform, executed by a computer device under control of software, comprising: Building a third-party library; and Verifying the legitimacy of the third-party library whether it meets the requirements of the software platform; calling the third party library; The method for constructing the third party library comprises: constructing the third-party library by the software platform, i.e., constructing an initialization sub-module, a capability acquisition sub-module and an internal sub-module in the third-party library by the software platform, and constructing a release sub-module in the third-party library; The release submodule is adapted to automatically release resources claimed by the third-party library when the third-party library is unloaded; A method for verifying whether the third-party library meets the requirements of the software platform includes: Load the third-party library into the software platform, the software platform calls the initialization sub-module of the third-party library, the software platform calls the capability acquisition sub-module of the third-party library, obtains a version number of the software platform corresponding to the third-party library, obtains a list of user callback sub-modules, and obtains address information and function parameter information of all the internal sub-modules of the third-party library; the software platform compares a version number of the software platform corresponding to the acquired third-party library with its own version number, and if the version number of the third-party library is greater than its own version number, stops calling the third-party library, and otherwise continues calling the third-party library; A method for disassembling and calling a third party library function for a software platform, the method being executed by a computer device under control of software.

2. The method for configuring the initialization sub-module by the software platform includes: generating the initialization submodule according to a header file of the software platform and a software platform API list in the software platform; and after the invocation of the initialization submodule is completed, the third party library obtains address information of each API in the API list provided by the software platform; 2. The method for destructively calling a third party library function for a software platform according to claim 1.

3. The method for constructing the capability acquisition sub-module by the software platform includes: The software platform loads a version number of the software platform and a list of user logic callback sub-modules to generate the capability acquisition sub-module; when an external program calls the capability acquisition sub-module, the external program obtains the version information of the software platform corresponding to the third-party library, obtains the list information of the user logic callback sub-modules, and obtains all internal sub-module information of the third-party library; 3. The method for calling a third party library function for a software platform according to claim 2, further comprising:

4. The method for constructing the internal sub-modules by the software platform includes: generating the internal sub-module based on a user function logic sub-module of the software platform; 4. The method for calling a third party library function for a software platform according to claim 3, further comprising:

5. The method for calling a third party library includes: After the software platform continues to call the third-party library, the software platform is adapted to call the third-party library based on the list of user callback sub-modules and the list of internal sub-modules obtained from the third-party library; after the invocation is completed, releasing the requested resource by invoking the release submodule in the third party library; 2. The method for destructively calling a third party library function for a software platform according to claim 1.

6. including a header file of the software platform, a software platform API list, a software platform version number, a list of user logic callback sub-modules, and a user function logic sub-module; A software platform for the method for disassembling and calling a third party library function for a software platform according to any one of claims 1 to 5.

7. Including an initialization submodule, a capability acquisition submodule, an internal submodule and a release submodule; A third-party library for a method of destructively calling a third-party library function for a software platform according to any one of claims 1 to 5.

8. a construction module for constructing said third party library; a verification module for verifying the legitimacy of the third-party library; a calling module for calling the third party library; A calling system using the method for disassembling and calling a third party library function for a software platform according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for revising library function

    JP2001022560A

  • Method and apparatus for developing autonomous vehicle applications

    JP2018538583A