Dynamic library creation method and device, equipment and storage medium

By automatically creating dynamic libraries, the problem of manually configuring resource files in component integration is solved, efficient and accurate component integration is achieved, and the stability and security of the system are ensured.

CN120653237APending Publication Date: 2025-09-16CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510675451.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In component-based development, especially when integrating components into a host project, existing technologies require manual processing of resource file references and path adjustments, which increases development workload and is prone to errors, affecting system stability and security.

Method used

This paper provides a dynamic library creation method that simplifies the component engineering integration process by automatically traversing the component's source code directory and configuration directory, screening and creating compilation configuration files, obtaining system library dependencies and compilation options, generating and integrating dynamic libraries.

Benefits of technology

It improves the accuracy and consistency of compiled configuration files, reduces the tediousness and error possibility of manual operations, ensures the integrity of dynamic libraries and the correct loading of target systems, and simplifies the component integration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653237A_ABST
    Figure CN120653237A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software development assistance, can be applied to business system platforms of financial science and technology, medical health and the like, and discloses a dynamic library creation method, which comprises the following steps of: traversing a source code directory of a target component, and screening a source code file from the source code directory; creating a compiling configuration file of the target system, copying the source code file to the compiling configuration file, screening an associated configuration operation file from the target component, and adding the configuration operation file to the compiling configuration file; configuring the compiling configuration file according to the dependency relationship and the compiling options; and executing a compiling command on the configured compiling configuration file to generate a dynamic library, integrating the dynamic library into a target system, and loading the dynamic library by using the target system to call the target component. According to the method, the target component is compiled and managed as the independent compiling configuration file, component codes are better organized and maintained, the reusability and maintainability of the codes are improved, and the component engineering integration process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software development auxiliary technology, and in particular to a dynamic library creation method, device, equipment and storage medium. Background Art

[0002] In modern software development, component-based development has become an effective means of improving code maintainability and reusability. Particularly in large-scale application development, splitting an application into multiple independent components can significantly improve development efficiency and code quality. Financial applications often involve complex business logic, high concurrency processing, strict security requirements, and high performance demands, and component-based development can better meet these requirements.

[0003] However, in the actual component-based development process, especially when integrating these components into the host project (target system), there are still many challenges and problems.

[0004] For example, in the healthcare sector, consider a medical software company developing an electronic medical record management system. This system requires integrating multiple functional components, including patient information management, medical image processing, and remote diagnosis. These components are also developed by different development teams, each with its own source code repository, resource files (such as configuration files, patient data templates, and image processing algorithms), and a series of dependencies. When integrating these components into the host project, developers must manually reference and adjust resource file paths. For example, when integrating the medical image processing component, developers must manually configure the image file storage path and the processing algorithm's dependency libraries. These configurations must be readjusted with each component update, increasing developer workload and potentially leading to missing or incorrectly referenced resource files. If the image processing component's configuration files are lost or incorrectly referenced, image data may not load correctly, hindering doctors' diagnostic work and even endangering patients' lives.

[0005] For example, in the fintech sector, consider a fintech company developing a financial services platform that integrates multiple functional components, including payment, loan, and wealth management products. These components are developed by separate development teams, each with its own source code repository, resource files (such as configuration files, certificates, and keys), and a series of dependencies (including system and third-party libraries). When integrating these components into the host project, developers must manually configure and manage dynamic libraries, including creating compilation targets, copying source code files, and configuring dependencies and compilation options. These manual operations are tedious and error-prone, increasing development complexity and the potential for errors. For example, during the integration of the payment component, if the configuration file path is incorrect or the dependent library is not correctly linked, the payment function may not function properly, or even trigger a security vulnerability, resulting in severe financial losses for users.

[0006] Therefore, how to simplify the integration process of component engineering and quickly create high-quality dynamic libraries is a technical problem that needs to be solved urgently. Summary of the Invention

[0007] In view of the above, it is necessary to provide a method for creating a component dynamic library. The purpose is to dynamically create a dynamic library. By simply introducing the generated dynamic library into the target system or host project, the functions of the component project can be called through the dynamic library, without manual operation and configuration of resource file references, thus simplifying the integration process of the component project. In the first aspect, a dynamic library creation method is provided, including:

[0008] receiving a request for creating a dynamic library for a target system, obtaining a target component corresponding to the target system according to the request, traversing a source code directory of the target component, and screening source code files required for compiling to create the dynamic library from the source code directory based on a file extension and a file type of a first preset type;

[0009] Creating a compilation configuration file of the target system according to the directory structure of the target component, copying the first path of the source code file to the compilation configuration file, screening a configuration operation file associated with the operation of the target component from the configuration directory of the target component according to a file extension and a file type of a second preset type, and adding the second path of the configuration operation file to the compilation configuration file;

[0010] Obtaining the system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and using them as dependencies of the compilation configuration file; obtaining the compiler flags, operating architecture, SDK version, and search path of the target system, and using them as compilation options of the compilation configuration file; and configuring the compilation configuration file according to the dependencies and the compilation options;

[0011] A preset compilation command is executed on the configured compilation configuration file to generate a dynamic library, the dynamic library is integrated into the target system, and the dynamic library is loaded by the target system to call the target component.

[0012] In a second aspect, a dynamic library creation device is provided, comprising:

[0013] a traversal module, configured to receive a request for creating a dynamic library for a target system, obtain a target component corresponding to the target system according to the request, traverse a source code directory of the target component, and filter, from the source code directory, source code files required to be compiled for creating the dynamic library based on file extensions and file types of a first preset type;

[0014] a screening module, configured to create a compilation configuration file of the target system according to the directory structure of the target component, copy the first path of the source code file to the compilation configuration file, screen configuration and operation files associated with the operation of the target component from the configuration directory of the target component according to the file extension and file type of a second preset type, and add the second path of the configuration and operation file to the compilation configuration file;

[0015] a configuration module, configured to obtain the system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and use them as dependencies of the compilation configuration file; obtain the compiler flags, operating architecture, SDK version, and search path of the target system, and use them as compilation options of the compilation configuration file; and configure the compilation configuration file according to the dependencies and the compilation options;

[0016] The integration module is used to execute preset compilation commands on the configured compilation configuration file to generate a dynamic library, integrate the dynamic library into the target system, and use the target system to load the dynamic library to call the target component.

[0017] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned dynamic library creation method when executing the computer program.

[0018] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned dynamic library creation method are implemented.

[0019] Compared with the prior art, the present invention receives a request for creating a dynamic library for the target system, obtains the source code path of the target component according to the request, traverses the source code directory, and filters out the source code files that need to be compiled according to the preset file extension and file type, which not only improves efficiency but also reduces omissions or errors caused by manual screening. The accuracy and consistency of the compilation configuration file are ensured. According to the directory structure of the target component, a compilation configuration file is created, and the source code file path is added to the compilation configuration file. According to the preset file extension and file type, the associated configuration run files are filtered out from the target component, and the paths of these files are added to the compilation configuration file. The system library dependency, third-party library dependency and preset type dependency of the target system, as well as the compiler flag, operating architecture, SDK version and search path are obtained, and this information is configured in the compilation configuration file, ensuring that the compilation configuration file contains all necessary information, thereby improving the reliability and efficiency of the compilation process. According to the configured compilation configuration file, the preset compilation command is executed to generate a dynamic library, the compilation process is automated, and it is also ensured that the generated dynamic library meets the requirements of the target system. Integrate the generated dynamic library into the target system and configure the target system to load it, thereby implementing the target component's functional calls. This ensures that the dynamic library can be correctly identified and used by the target system, thus implementing the target component's functional calls. By dynamically creating a dynamic library, you only need to import the generated dynamic library into the target system to call the component project's functions through the dynamic library, eliminating the need for manual operation and configuration of resource file references, simplifying the component project integration process. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of an application environment of a dynamic library creation method according to an embodiment of the present invention;

[0021] Figure 2 1 is a flow chart of a method for creating a dynamic library provided by an embodiment of the present invention;

[0022] Figure 3 This is a module diagram of a dynamic library creation device provided by an embodiment of the present invention;

[0023] Figure 4 is a structural diagram of a computer device in one embodiment of the present invention;

[0024] Figure 5 FIG. 2 is another structural diagram of a computer device according to an embodiment of the present invention.

[0025] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0027] It should be noted that the descriptions of "first", "second", etc. in the present invention are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0028] The dynamic library creation method provided by the embodiment of the present invention can be applied in Figure 1In an application environment, the client communicates with the server through a network. The server can receive a request for creating a dynamic library for a target system, obtain a target component corresponding to the target system according to the request, traverse the source code directory of the target component, and filter the source code file required to compile to create the dynamic library from the source code directory according to the file extension and file type of the first preset type; create a compilation configuration file for the target system according to the directory structure of the target component, copy the first path of the source code file to the compilation configuration file, filter the configuration operation file associated with the operation of the target component from the configuration directory of the target component according to the file extension and file type of the second preset type, and add the second path of the configuration operation file to the compilation configuration file; obtain the system library dependency, third-party library dependency and preset type dependency of the target system, and use them as dependency relationships of the compilation configuration file, obtain the compiler flag, running architecture, SDK version and search path of the target system, and use them as compilation options of the compilation configuration file, and configure the compilation configuration file according to the dependency relationships and compilation options; execute the preset compilation command on the configured compilation configuration file to generate a dynamic library, integrate the dynamic library into the target system, and use the target system to load the dynamic library to call the target component. The present invention is aimed at the fields of financial enterprises, medical health, market analysis and engineering design. It uses a preset script file (Ruby script file) to automatically generate a set of classification reading codes for unified image resource access logic according to the image resource information of each component. The classification reading code is used to ensure that even if the image resource names inside the component are the same, they can be loaded correctly. According to the component relationship list, the compilation command is executed for each component to generate a binary library and resource package. The classification reading code is used to integrate the binary library and resources into the components of the target application. Whenever a new component is added or the image resources of an existing component change, the classification reading code can be re-run to automatically generate the latest image resource access logic to ensure that the target application can quickly adapt to market changes and improve the accuracy of referencing image resources. Among them, the client can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.

[0029] Reference Figure 2 FIG. 1 is a flow chart of a method for creating a dynamic library according to an embodiment of the present invention. The method is executed by a device.

[0030] In this embodiment, the dynamic library creation method includes:

[0031] S1. Receive a request for creating a dynamic library for a target system, obtain a target component corresponding to the target system according to the request, traverse a source code directory of the target component, and filter source code files required for compiling to create the dynamic library from the source code directory based on a file extension and a file type of a first preset type;

[0032] In this embodiment, the server receives a request from a client to create a dynamic library for a target system. The request comes from a developer or an automated build tool and includes request parameters for a target component that the target system needs to integrate.

[0033] Parse the received request and determine the target component's source code storage location, i.e., the source code storage path, from the request parameters. The source code storage path points to the source code directory where all source code files of the target component are located.

[0034] The server traverses the source code directory corresponding to the target component's source code storage path. The server recursively accesses the source code directory and its subdirectories. During the traversal process, the server selects source code files to be compiled based on the file extension and file type of the first preset type. For example, if the target component is written in C++, the server searches for all files with the extension .cpp or .h.

[0035] The present invention is fully illustrated by the following scenarios in the field of financial technology:

[0036] Consider a financial services platform that integrates three components: payment, lending, and wealth management products. Each component has its own source code repository, resource files (such as configuration files, certificates, and keys), and a series of dependencies (including system and third-party libraries). Our goal is to integrate the payment component into the target system as a dynamic library so that the target system can implement payment functions by calling this dynamic library.

[0037] When the development team decides to integrate the payment component into the target system, a request to create a dynamic library is triggered. This request includes the payment component's source code path. Based on the request, the system automatically traverses all files in the payment component path and selects all source code files that need to be compiled (for example, files with extensions such as .m, .mm, and .cpp).

[0038] In one embodiment, the filtering, from the source code directory, source code files required for compilation to create a dynamic library based on the file extension and file type of the first preset type includes:

[0039] Using a preset script to traverse the source code directory and its subdirectories, listing all files and paths of all files;

[0040] Filtering a first initial source code file to be compiled from all listed files according to a file extension of a first preset type, wherein the file extension includes .c, .cpp, .cc, .cxx, .m, .mm, .swift, .h, .hpp, .hh, and .hxx;

[0041] Filtering out a second initial source code file to be compiled from all listed files according to a first preset file type, wherein the file type includes a source code file and a header file;

[0042] The paths of the first initial source code file and the second initial source code file are collected and stored to obtain the source code file.

[0043] Use a preset script to traverse the document. The preset script can be a script written in Python, Shell, Perl, Ruby, etc. The preset script is used to traverse the preset source code directory and its subdirectories, starting from the preset root directory, recursively accessing each subdirectory and listing all source code files.

[0044] According to the file extension and file type of the first preset type, the first initial source code file that needs to be compiled is screened out from all source code files. The preset file extension refers to a predefined set of file extensions used to identify which files are source code files that need to be compiled. This can ensure that only the required source code files are included in the generated dynamic library, avoiding unnecessary file redundancy and size increase.

[0045] Source code file extensions that need to be compiled include, but are not limited to: .m and .mm (Objective-C and Objective-C++ files), .swift (Swift files), .c and .cpp (C and C++ files), .h and .hpp (header files, which are usually not compiled directly but need to be included in the compilation process).

[0046] Exclude files that do not need to be compiled, such as configuration files, resource files, test files, etc. File extensions that do not need to be compiled include but are not limited to: .plist (property list files), .xib and .storyboard (interface files), .png, .jpg, .gif (image files), .mp3, .wav (audio files), .txt, .json, .xml (text and data files), .test, .spec (test files).

[0047] According to the first preset file type, a second initial source code file to be compiled is screened out from all listed files, where the file types include source code files and header files.

[0048] The paths of the first initial source code file and the second initial source code file are collected and stored to obtain a source code file, ensuring the integrity and correctness of the paths for subsequent compilation and linking processes.

[0049] In step S1, by automatically obtaining all source code files that need to be compiled, it can be ensured that only the required files are included in the generated dynamic library, avoiding unnecessary file redundancy and size increase. Developers do not need to manually list and configure these source code files, thereby reducing the tediousness and possibility of errors in manual operations. The automated file search and screening mechanism can ensure that no source code files that need to be compiled are missed, thereby ensuring that the generated dynamic library is complete and correct.

[0050] S2. Creating a compilation configuration file for the target system according to the directory structure of the target component, copying the first path of the source code file to the compilation configuration file, screening configuration and operation files associated with the operation of the target component from the configuration directory of the target component according to the file extension and file type of a second preset type, and adding the second path of the configuration and operation file to the compilation configuration file;

[0051] In this embodiment, a compilation configuration file of the target system is created according to the requirements of the target system. The compilation configuration file is used to instruct the compiler on how to compile and link source code files. The compilation configuration file includes Make file, CMakeLists.txt, Xcode .xcode proj file, etc.

[0052] Add the first paths of all filtered source code files to be compiled to the preset locations in the compilation configuration file. For example, if the target system uses a Make file as the compilation configuration file, copy the source code files to the src directory of the Makefile. Alternatively, if the target system uses an Xcode file as the compilation configuration file, copy the source code files to the Sources directory of the Xcode file.

[0053] There is no limitation on the preset location. Only the compiler knows which files need to be compiled when executing the compilation. It ensures that the compiler can find and compile all necessary source code files to generate the final dynamic library.

[0054] Traverse the target component's directory and identify all associated configuration files. Associated configuration files include resource files (such as images and configuration files), library files (such as static libraries and dynamic libraries), etc.

[0055] Add the paths to these associated configuration files to the preset locations in the build configuration file. For example, if the target system uses a Make file as the build configuration file, add the paths to the associated configuration files to the config directory of the Make file. Alternatively, if the target system uses an Xcode file as the build configuration file, copy the source code files to the Config directory of the Xcode file.

[0056] There is no restriction on the preset location, as long as the compiler can correctly find and link these associated configuration files during the linking phase.

[0057] In one embodiment, creating the compilation configuration file of the target system according to the directory structure of the target component includes:

[0058] Parsing the directory structure of the target component to determine the storage path of the source code file and the associated configuration and operation files of the target component;

[0059] Creating an initial configuration file at a preset location of the target system according to the storage path;

[0060] In the initial configuration file, the configuration structure of the compilation options and dependency relationships corresponding to the target component is initialized to obtain the compilation configuration file of the target system.

[0061] The target component's files are stored in a directory with a specific structure. For example, source code files may be stored in a "source" subdirectory, resource files (such as images and configuration files) in a "resource" subdirectory, and library files (such as static libraries and dynamic libraries) in a "library files" subdirectory. In addition, there may be a "configuration" subdirectory that contains configuration files for compilation options and dependencies.

[0062] First, the target component's directory structure needs to be parsed to determine the paths where the source code files and associated configuration and runtime files are stored. This can be achieved by recursively searching the target component's root directory to identify files with specific extensions. For example, source code files may have extensions such as .c, .cpp, .h, and .hpp, while configuration and runtime files may have extensions such as .json, .xml, .plist, .a, .lib, .so, .dylib, and .dll.

[0063] After parsing the directory structure and determining the file storage path, the next step is to create an initial configuration file in the target system's default location. This initial configuration file will serve as the basis for subsequent compilation configurations. The target system's default location can be a directory dedicated to storing configuration files, such as / targetsystem / configuration.

[0064] In one embodiment, the initial configuration file initializes the configuration structure of the compilation options and dependencies corresponding to the target component to obtain the compilation configuration file of the target system, including:

[0065] Obtain a configuration file containing compilation options and dependencies from the configuration directory of the target component, and parse the configuration file to extract compiler flags, operating architecture, SDK version, system library dependencies, and third-party library dependencies;

[0066] Creating a compilation option subfile in the initial configuration file, writing the compiler flag, operating architecture, and SDK version into the compilation option subfile, and adjusting parameters of the compilation option subfile according to preset properties of the target system to obtain an adjusted compilation option subfile;

[0067] Creating a dependency sub-file in the initial configuration file, writing the system library dependency, third-party library dependency, and preset type dependency items into the dependency sub-file, configuring the version requirement and path information for each dependency item, and obtaining a configured dependency sub-file;

[0068] A compilation configuration file of the target system is obtained according to the adjusted compilation option sub-file and the configured dependency relationship sub-file.

[0069] When creating an initial configuration file, you can write some initial information in the file, for example, stating that the file is a compilation configuration for the target system and that it will be used to initialize compilation options and dependencies.

[0070] Initialize the configuration structure of compilation options and dependencies corresponding to the target component in the initial configuration file. This step involves reading the configuration files in the target component, which may contain specific information about compilation options (such as compiler flags, optimization levels, runtime architecture, etc.) and dependencies (such as system library dependencies, third-party library dependencies, etc.).

[0071] This information is extracted from the target component's configuration file and written to the initial configuration file, thereby building the configuration structure of the build configuration file. For example, build options can be written to the "Build Options" section of the initial configuration file, and dependencies can be written to the "Dependencies" section of the initial configuration file. After these steps, the initial configuration file already contains the basic configuration structure of the target component's build options and dependencies. This file can now serve as the build configuration file for the target system, guiding the subsequent compilation and linking processes.

[0072] The present invention is fully illustrated using the following medical and health field scenarios as examples:

[0073] Consider a medical software company developing a comprehensive electronic medical record (EMR) system. This system requires integrating multiple functional components, including patient information management, medical image processing, and remote diagnosis. These components are developed by separate development teams, each with its own source code repository, resource files (such as configuration files, patient data templates, and image processing algorithms), and a series of dependencies (including system and third-party libraries). To improve development efficiency and code maintainability, the company decided to integrate these components into the target system (the EMR) as dynamic libraries.

[0074] The development team decided to integrate the "medical image processing component" into the electronic medical record management system as a dynamic library. First, the developer or automated build tool will trigger a request to create a dynamic library. This request contains the source code path of the medical image processing component. Based on the obtained source code path, the server recursively traverses the source code directory and its subdirectories of the medical image processing component. During the traversal process, all source code files that need to be compiled are filtered out according to the preset file extensions (such as .cpp, .h, .hpp, etc.). According to the requirements of the target system, use an appropriate build tool (such as CMake) to create a compilation configuration file. For example, use CMake to create a CMakeLists.txt file. Add the filtered source code file path to this configuration file.

[0075] Traverse the directory of the medical imaging component, identify all related configuration files (such as header files and resource files), and add the paths to these files to the compilation configuration file. For example, the resource file path for the medical imaging component is / path / to / medical_imaging_component / source / resources, which contains dicom_config.json and logo.png. Add the paths to these files to the compilation configuration file.

[0076] In one embodiment, after creating the compilation configuration file of the target system, the method further includes:

[0077] Obtaining the output path and product name of the compiled configuration file, and using them as basic information of the compiled configuration file;

[0078] The basic information is stored in a configuration file related to the target component.

[0079] The compilation configuration file contains some basic information, such as output path, product name, etc. These basic information are very important in the compilation and building process and are used to guide the compiler and build tools on how to process the project.

[0080] Read basic information from the build configuration file and store it in the target system's configuration file. The target system's build configuration file is typically a project file, such as an Xcode project's .pbxproj file. The build configuration file contains various project configuration information, such as source file paths, build options, and output paths.

[0081] Write the basic information obtained from the compilation configuration file into the configuration run file of the target system to ensure that the target system can correctly reference this basic information during the build process.

[0082] In one embodiment, the filtering, from the configuration directory of the target component according to the file extension and file type of the second preset type, configuration operation files associated with the operation of the target component includes:

[0083] Use a preset script to traverse the configuration directory of the target component and its subdirectories, and list the paths of all files;

[0084] Filtering a first initial running file associated with the running of the target component from all listed files according to a file extension of a second preset type, the .h, .hpp, .hh, .hxx, .png, .jpg, .gif, .mp3, .wav, .json, .xml, .plist, .a, .lib, .so, .dyli b, .dll;

[0085] Filtering a second initial running file associated with the running of the target component from all listed files according to a second preset file type, wherein the file type includes a header file, a resource file, a library file, a compilation configuration file, a runtime configuration file, and a resource path file;

[0086] The paths of the first initial operation file and the second initial operation file are collected and stored to obtain the configuration operation file associated with the target component.

[0087] During dynamic library creation, the target component's configuration directory and its subdirectories contain various types of files. These files are essential for compiling and running the target component. To ensure that the compilation configuration file contains all necessary file paths, a pre-defined script is used to traverse these directories and list all file paths.

[0088] The pre-set script will start from the root directory of the target component and recursively visit each subdirectory to list all file paths. These paths will be stored in a temporary list for subsequent processing. After all file paths are listed, the next step is to filter the first initial run files associated with the target component run according to the second pre-set file extension type. These file extensions include but are not limited to:

[0089] Header files: .h, .hpp, .hh, .hxx. Resource files: .png, .jpg, .gif, .mp3, .wav. Configuration files: .json, .xml, .plist. Library files: .a, .lib, .so, .dylib, .dll.

[0090] The script checks the extension of each file and adds the file path to a new list if the file extension matches the preset extension list. For example, if the path of a file is target component directory / resources / image1.png, since its extension is .png, the path will be added to the list.

[0091] In addition to filtering based on file extensions, it is also necessary to further filter out the second initial running files associated with the target component based on file types. These file types include:

[0092] Header files: These typically contain class declarations, function prototypes, and more. Resource files: These include image files and audio files. Library files: These include static libraries and dynamic libraries. Compilation configuration files: These include Makefile and CMakeLists.txt. Runtime configuration files: These include .json, .xml, and .plist. Resource path files: These include .xib and .storyboard.

[0093] The script checks the content and purpose of each file and adds its path to another list if it matches one of the above file types. For example, if a file's path is target component directory / configuration / compile options.txt, it will be added to the list because its content is compile options.

[0094] The paths of the first initial run file and the second initial run file are collected and stored to obtain a compilation configuration file. The compilation configuration file will contain the paths of all the selected associated configuration run files. These paths will be added to the compilation configuration file to ensure that these files can be correctly referenced during the compilation and linking process.

[0095] In step S2, by automatically adding the first path of the source code file and the second path of the associated configuration run file to the compilation configuration file, developers do not need to manually configure these paths, reducing the tediousness and possibility of errors in manual operations, ensuring that the same configuration file is used for each compilation and build, and avoiding problems caused by inconsistent manual configuration.

[0096] S3. Obtain system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and use them as dependency relationships of the compilation configuration file; obtain compiler flags, operating architecture, SDK version, and search path of the target system, and use them as compilation options of the compilation configuration file; and configure the compilation configuration file according to the dependency relationships and the compilation options;

[0097] In this embodiment, it is necessary to obtain the system library dependencies and third-party library dependencies of the target system. These dependencies are usually defined in the configuration file of the target component, such as dependencies.txt. In addition, it may be necessary to add some preset types of dependencies based on the characteristics of the target system. Assume that the dependency file of the target component is stored in the target component directory / configuration / dependencies.txt, which lists all required system libraries and third-party libraries. Use a script to parse the file and extract the dependency information. Depending on the characteristics of the target system, it may be necessary to add some preset types of dependencies. These dependencies can be libraries or modules that the target system requires by default, such as certain system libraries or specific third-party libraries.

[0098] Obtain the target system's compiler flags, runtime architecture, SDK version, and search paths. This information is typically defined in the target component's configuration file, such as compileoptions.txt. Assume the target component's compileoptions file is located in the target component directory / configuration / compileoptions.txt. This file lists all required compiler flags, runtime architecture, SDK version, and search paths. Use a script to parse this file and extract the compile option information. Determine the runtime architecture based on the target system's characteristics. This can be done by examining the target system's hardware configuration or operating system version. For example, the target system might support x86 or ARM architectures. Determine the SDK version based on the target system's development environment. This can be done by examining the development tool version information or configuration files. For example, the target system might use a specific version of the iOS SDK or Android SDK. Determine the search paths for header files and library files based on the target system's configuration. These paths are typically defined in the compileoptions file, such as the header file search path and library file search path. Configure the obtained dependencies and compile options in the compile configuration file. This step ensures that the compile configuration file contains all necessary compilation and linking information. In the compile configuration file, add system library dependencies, third-party library dependencies, and predefined type dependencies. These dependencies will be referenced by the linker during the linking phase. In the build configuration file, add compiler flags, runtime architecture, SDK version, and search paths. These options instruct the compiler on how to compile source code files. Save the configured build configuration file to the target system's pre-defined location, such as / targetsystem / configuration / buildconfiguration.txt. This step ensures that the build configuration file can be correctly read and used by subsequent build commands.

[0099] Continuing with the above scenario in the field of financial technology, we will give an example to illustrate the whole article:

[0100] Consider a financial services platform that integrates three components: payment, lending, and wealth management products. Each component has its own source code repository, resource files (such as configuration files, certificates, and keys), and a series of dependencies (including system and third-party libraries). Our goal is to integrate the payment component into the target system as a dynamic library so that the target system can implement payment functions by calling this dynamic library.

[0101] When the development team decides to integrate the payment component into the target system, a request to create a dynamic library is triggered. This request includes the payment component's source code path. Based on the request, the system automatically traverses all files in the payment component path and selects all source code files that need to be compiled (for example, files with extensions such as .m, .mm, and .cpp).

[0102] Based on the target system's requirements, use an appropriate build tool (such as CMake or Xcode) to create a compilation configuration file. Add the source code file paths identified in the previous step to this configuration file. Traverse the payment component's directory to identify all relevant configuration files (such as header files and resource files). Add the paths to these files to the compilation configuration file to ensure the compiler correctly references these files during compilation and linking.

[0103] Get the required dependencies (such as system library dependencies, third-party library dependencies, etc.) and compilation options (such as compiler flags, running architecture, etc.) from the configuration directory of the payment component and add them to the compilation configuration file.

[0104] In one embodiment, configuring the compilation configuration file according to the dependency relationship and the compilation options includes:

[0105] Setting the linker flags in the compilation configuration file to ensure that the system library dependencies and third-party library dependencies are correctly referenced during the linking phase;

[0106] Setting the header file search path in the compilation configuration file so that the compiler in the compilation configuration file can find the required header files;

[0107] Setting the library file search path in the compilation configuration file so that the linker in the compilation configuration file can find the required library file;

[0108] Setting the compiler optimization level in the compilation configuration file to optimize the performance of the generated dynamic library;

[0109] Setting the runtime architecture in the compilation configuration file to ensure that the generated dynamic library is compatible with the architecture of the target system;

[0110] Set the SDK version in the compilation configuration file to ensure that the compilation process uses the correct software development kit.

[0111] In step S3, the compilation configuration file is configured based on the dependencies and compilation options. This allows the compiler and linker to correctly locate and reference these dependencies, ensuring a smooth compilation process. Automating the compilation configuration file through scripts reduces manual intervention and the risk of compilation failures caused by manual configuration errors. This process automatically identifies and handles complex dependencies and compilation options, improving the reliability and efficiency of the compilation process.

[0112] S4. Execute a preset compilation command on the configured compilation configuration file to generate a dynamic library, integrate the dynamic library into the target system, and use the target system to load the dynamic library to call the target component.

[0113] In this embodiment, after the compilation configuration file is configured, it is necessary to determine the preset compilation command based on the information in the configuration file. The compilation command is usually generated by a build system (such as Make, CMake, Xcode, etc.) to automate the compilation process. For example, if CMake is used as the build system, the generated compilation command may be similar to: cmake --build.

[0114] Executes the preset compilation command in the target system's build environment. This step compiles the source code and links dependencies according to the settings in the compilation configuration file, ultimately generating a dynamic library file. The generated dynamic library file typically has a specific extension, such as .so (on Linux and Android), .dylib (on macOS), or .dll (on Windows).

[0115] After the compilation process is complete, check the compilation output to ensure that the dynamic library file has been successfully generated. The dynamic library file is usually placed in a preset output path, such as the / target system / output / directory. Verify the generated dynamic library to ensure that it conforms to the expected format and content. This can be done by checking information such as the file extension, size, dependencies, etc. For example, you can use tools (such as the file command, nm command, etc.) to check the properties of the dynamic library. Determine the integration path of the dynamic library based on the configuration of the target system. This is usually a specific directory of the target system, such as / target system / lib / or / target system / frameworks / . Make sure that the target system can find and load the dynamic library under this path.

[0116] Copy the generated dynamic library file to the integration path of the target system. This can be done through file operation commands (such as the cp command). For example: cp / target system / output / libtargetcomponent.so / target system / lib /

[0117] On the target system, configure the relevant load paths and dependencies to ensure that the target system can correctly load the dynamic library. This involves modifying the target system's configuration files (such as the LD_LIBRARY_PATH environment variable and the Info.plist file) to include the path to the dynamic library. In the target system's runtime environment, load the dynamic library. This can be accomplished through programming interfaces (such as the dlopen function and the NSBundle class).

[0118] After loading the dynamic library, the target component's functionality is used by calling the interface defined in the dynamic library. This can be done by obtaining a function pointer (such as the dlsym function) or by directly calling a class method.

[0119] Continuing with the above scenario in the field of financial technology, we will give an example to illustrate the whole article:

[0120] Consider a financial services platform that integrates three components: payment, lending, and wealth management products. Each component has its own source code repository, resource files (such as configuration files, certificates, and keys), and a series of dependencies (including system and third-party libraries). Our goal is to integrate the payment component into the target system as a dynamic library so that the target system can implement payment functions by calling this dynamic library.

[0121] When the development team decides to integrate the payment component into the target system, a request to create a dynamic library is triggered. This request includes the payment component's source code path. Based on the request, the system automatically traverses all files in the payment component path and selects all source code files that need to be compiled (for example, files with extensions such as .m, .mm, and .cpp).

[0122] Based on the target system's requirements, use an appropriate build tool (such as CMake or Xcode) to create a compilation configuration file. Add the source code file paths identified in the previous step to this configuration file. Traverse the payment component's directory to identify all relevant configuration files (such as header files and resource files). Add the paths to these files to the compilation configuration file to ensure the compiler correctly references these files during compilation and linking.

[0123] Get the required dependencies (such as system library dependencies, third-party library dependencies, etc.) and compilation options (such as compiler flags, running architecture, etc.) from the configuration directory of the payment component and add them to the compilation configuration file.

[0124] Use the preset compilation command (such as cmake --build.) to execute the compilation process and generate the dynamic library according to the configuration in the compilation configuration file. After compilation is complete, the generated dynamic library file will be stored in the specified output path. Copy the generated dynamic library file and its associated header files to the preset path of the target system, and add the dynamic library path and dependencies to the target system configuration file. The target system can then call the payment component functions through the interface provided by the dynamic library.

[0125] The financial services platform can efficiently and accurately integrate payment components into the target system as dynamic libraries. This not only simplifies the component integration process, reduces the tediousness and error potential of manual operations, but also improves development efficiency and code quality.

[0126] In one embodiment, executing a preset compilation command on the configured compilation configuration file to generate a dynamic library includes:

[0127] Determining, according to the configuration information in the compilation configuration file, a preset compilation command adapted to the target system and the target component;

[0128] Executing the preset compilation command to compile the filtered source code file to generate a target object file;

[0129] According to the dependency relationship in the compilation configuration file, the system library dependency, the third-party library dependency and the dependency of the preset type are linked, and the target object file is integrated with the linked dependency to generate the dynamic library.

[0130] A compilation configuration file typically contains all the information required for the compilation process, including source code file paths, dependency paths, compiler flags, linker flags, and more. First, you need to parse this configuration file to extract all the necessary information. Based on this information, you generate the default compilation commands. These commands will guide the compiler and linker through the compilation and linking process.

[0131] Execute the preset compilation command in the target system's build environment. This step compiles the source code and links dependencies according to the settings in the compilation configuration file, ultimately generating the target object file. Based on the dependencies in the compilation configuration file, the system library dependencies, third-party library dependencies, and pre-set dependencies are linked. The target object file is then combined with the linked dependencies to generate a dynamic library.

[0132] While executing the compilation command, monitor the compilation process to ensure that no errors occur. The compiler and linker typically output log information that can help identify and resolve problems. For example, if an error occurs during compilation, the compiler will output an error message indicating the problem. After the compilation process is complete, verify that the dynamic library was successfully generated. The dynamic library file is typically placed in a pre-defined output directory, such as build / libtargetcomponent.so. You can verify the generation of the dynamic library by checking whether the file exists and whether the file attributes are correct.

[0133] In step S4, the dynamic library is successfully integrated into the target system. The target system can load and call the target components in the dynamic library, ensuring the correct use and functional implementation of the dynamic library. The target system can independently generate and publish compilation configuration files for each component, improving code reusability and maintainability. At the same time, due to the characteristics of dynamic libraries, the target system can selectively import and use dynamic libraries of different components as needed, flexibly adjusting the integration and use of components.

[0134] In steps S1-S4, the present invention receives a request for creating a dynamic library for the target system, obtains the source code path of the target component according to the request, traverses the source code directory, and filters out the source code files that need to be compiled according to the preset file extension and file type, which not only improves efficiency but also reduces omissions or errors caused by manual screening. The accuracy and consistency of the compilation configuration file are ensured. According to the directory structure of the target component, a compilation configuration file is created, and the source code file path is added to the compilation configuration file. According to the preset file extension and file type, the associated configuration run files are filtered out from the target component, and the paths of these files are added to the compilation configuration file. The system library dependency, third-party library dependency and preset type dependency of the target system, as well as the compiler flag, operating architecture, SDK version and search path are obtained, and this information is configured in the compilation configuration file, ensuring that the compilation configuration file contains all necessary information, thereby improving the reliability and efficiency of the compilation process. According to the configured compilation configuration file, the preset compilation command is executed to generate a dynamic library, the compilation process is automated, and it is also ensured that the generated dynamic library meets the requirements of the target system. Integrate the generated dynamic library into the target system and configure the target system to load it, thereby implementing the target component's functional calls. This ensures that the dynamic library can be correctly identified and used by the target system, thus implementing the target component's functional calls. By dynamically creating a dynamic library, you only need to import the generated dynamic library into the target system to call the component project's functions through the dynamic library, eliminating the need for manual operation and configuration of resource file references, simplifying the component project integration process.

[0135] like Figure 3 FIG. 1 is a schematic diagram of a module of a dynamic library creation device provided by an embodiment of the present invention.

[0136] The dynamic library creation device 100 described in the present invention can be installed in a device. Depending on the functionality implemented, the dynamic library creation device 100 may include a traversal module 110, a screening module 120, a configuration module 130, and an integration module 140. A module, also referred to as a unit, is a series of computer program segments that can be executed by a device processor and perform a fixed function, and is stored in the device's memory.

[0137] In this embodiment, the functions of each module / unit are as follows:

[0138] The traversal module 110 is configured to receive a request for creating a dynamic library for a target system, obtain a target component corresponding to the target system according to the request, traverse a source code directory of the target component, and filter source code files required for compiling the dynamic library from the source code directory based on a file extension and a file type of a first preset type;

[0139] a screening module 120, configured to create a compilation configuration file of the target system according to the directory structure of the target component, copy the first path of the source code file to the compilation configuration file, screen configuration and operation files associated with the operation of the target component from the configuration directory of the target component according to a file extension and file type of a second preset type, and add the second path of the configuration and operation file to the compilation configuration file;

[0140] Configuration module 130, configured to obtain system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and use them as dependencies of the compilation configuration file; obtain compiler flags, operating architecture, SDK version, and search path of the target system, and use them as compilation options of the compilation configuration file; and configure the compilation configuration file according to the dependencies and the compilation options;

[0141] The integration module 140 is configured to execute preset compilation commands on the configured compilation configuration file to generate a dynamic library, integrate the dynamic library into the target system, and use the target system to load the dynamic library to call the target component.

[0142] In one embodiment, the traversal module 110 is specifically configured to:

[0143] Using a preset script to traverse the source code directory and its subdirectories, listing all files and paths of all files;

[0144] Filtering a first initial source code file to be compiled from all listed files according to a file extension of a first preset type;

[0145] According to the file type of the first preset type, a second initial source code file to be compiled is screened out from all listed files;

[0146] The paths of the first initial source code file and the second initial source code file are collected and stored to obtain the source code file.

[0147] In one embodiment, the screening module 120 is specifically configured to:

[0148] Parsing the directory structure of the target component to determine the storage path of the source code file and the associated configuration and operation files of the target component;

[0149] Creating an initial configuration file at a preset location of the target system according to the storage path;

[0150] In the initial configuration file, the configuration structure of the compilation options and dependency relationships corresponding to the target component is initialized to obtain the compilation configuration file of the target system.

[0151] In one embodiment, the screening module 120 is specifically configured to:

[0152] Creating a compilation option subfile in the initial configuration file, writing the compiler flag, operating architecture, and SDK version into the compilation option subfile, and adjusting parameters of the compilation option subfile according to preset properties of the target system to obtain an adjusted compilation option subfile;

[0153] Creating a dependency sub-file in the initial configuration file, writing the system library dependency, third-party library dependency, and preset type dependency items into the dependency sub-file, configuring the version requirement and path information for each dependency item, and obtaining a configured dependency sub-file;

[0154] A compilation configuration file of the target system is obtained according to the adjusted compilation option sub-file and the configured dependency relationship sub-file.

[0155] In one embodiment, the screening module 120 is specifically configured to:

[0156] Obtaining the output path and product name of the compiled configuration file, and using them as basic information of the compiled configuration file;

[0157] The basic information is stored in a configuration file related to the target component.

[0158] In one embodiment, the configuration module 130 is specifically configured to:

[0159] Setting the linker flags in the compilation configuration file to ensure that the system library dependencies and third-party library dependencies are correctly referenced during the linking phase;

[0160] Setting the header file search path in the compilation configuration file so that the compiler in the compilation configuration file can find the required header files;

[0161] Setting the library file search path in the compilation configuration file so that the linker in the compilation configuration file can find the required library file;

[0162] Setting the compiler optimization level in the compilation configuration file to optimize the performance of the generated dynamic library;

[0163] Setting the runtime architecture in the compilation configuration file to ensure that the generated dynamic library is compatible with the architecture of the target system;

[0164] Set the SDK version in the compilation configuration file to ensure that the compilation process uses the correct software development kit.

[0165] In one embodiment, the integrated module 140 is specifically configured to:

[0166] Determining, according to the configuration information in the compilation configuration file, a preset compilation command adapted to the target system and the target component;

[0167] Executing the preset compilation command to compile the filtered source code file to generate a target object file;

[0168] According to the dependency relationship in the compilation configuration file, the system library dependency, the third-party library dependency and the dependency of the preset type are linked, and the target object file is integrated with the linked dependency to generate the dynamic library.

[0169] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a form filling method.

[0170] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the client side of a form filling method.

[0171] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0172] receiving a request for creating a dynamic library for a target system, obtaining a target component corresponding to the target system according to the request, traversing a source code directory of the target component, and screening source code files required for compiling to create the dynamic library from the source code directory based on a file extension and a file type of a first preset type;

[0173] Creating a compilation configuration file of the target system according to the directory structure of the target component, copying the first path of the source code file to the compilation configuration file, screening a configuration operation file associated with the operation of the target component from the configuration directory of the target component according to a file extension and a file type of a second preset type, and adding the second path of the configuration operation file to the compilation configuration file;

[0174] Obtaining the system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and using them as dependencies of the compilation configuration file; obtaining the compiler flags, operating architecture, SDK version, and search path of the target system, and using them as compilation options of the compilation configuration file; and configuring the compilation configuration file according to the dependencies and the compilation options;

[0175] A preset compilation command is executed on the configured compilation configuration file to generate a dynamic library, the dynamic library is integrated into the target system, and the dynamic library is loaded by the target system to call the target component.

[0176] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the relevant descriptions of the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0177] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0178] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0179] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. If any software tools or components other than those of the company appear in the application embodiments, they are merely used for illustration and do not represent actual use. Although the present invention has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above-mentioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for creating a dynamic library, characterized in that: The method comprises: receiving a request for creating a dynamic library for a target system, obtaining a target component corresponding to the target system according to the request, traversing a source code directory of the target component, and screening source code files required for compiling to create the dynamic library from the source code directory based on a file extension and a file type of a first preset type; Creating a compilation configuration file of the target system according to the directory structure of the target component, copying the first path of the source code file to the compilation configuration file, screening a configuration operation file associated with the operation of the target component from the configuration directory of the target component according to a file extension and a file type of a second preset type, and adding the second path of the configuration operation file to the compilation configuration file; Obtaining the system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and using them as dependencies of the compilation configuration file; obtaining the compiler flags, operating architecture, SDK version, and search path of the target system, and using them as compilation options of the compilation configuration file; and configuring the compilation configuration file according to the dependencies and the compilation options; A preset compilation command is executed on the configured compilation configuration file to generate a dynamic library, the dynamic library is integrated into the target system, and the dynamic library is loaded by the target system to call the target component.

2. The dynamic library creation method according to claim 1, wherein: The step of screening the source code files required for compiling and creating the dynamic library from the source code directory according to the file extension and file type of the first preset type includes: Using a preset script to traverse the source code directory and its subdirectories, listing all files and paths of all files; Filtering a first initial source code file to be compiled from all listed files according to a file extension of a first preset type; According to the file type of the first preset type, a second initial source code file to be compiled is screened out from all listed files; The paths of the first initial source code file and the second initial source code file are collected and stored to obtain the source code file.

3. The dynamic library creation method according to claim 1, wherein: The step of creating a compilation configuration file for the target system according to the directory structure of the target component includes: Parsing the directory structure of the target component to determine the storage path of the source code file and the associated configuration and operation files of the target component; Creating an initial configuration file at a preset location of the target system according to the storage path; In the initial configuration file, the configuration structure of the compilation options and dependency relationships corresponding to the target component is initialized to obtain the compilation configuration file of the target system.

4. The dynamic library creation method according to claim 1, wherein: After creating the compilation configuration file of the target system, the method further includes: Obtaining the output path and product name of the compiled configuration file, and using them as basic information of the compiled configuration file; The basic information is stored in a configuration file related to the target component.

5. The dynamic library creation method according to claim 3, wherein: Initializing the configuration structure of the compilation options and dependencies corresponding to the target component in the initial configuration file to obtain the compilation configuration file of the target system includes: Obtain a configuration file containing compilation options and dependencies from the configuration directory of the target component, and parse the configuration file to extract compiler flags, operating architecture, SDK version, system library dependencies, and third-party library dependencies; Creating a compilation option subfile in the initial configuration file, writing the compiler flag, operating architecture, and SDK version into the compilation option subfile, and adjusting parameters of the compilation option subfile according to preset properties of the target system to obtain an adjusted compilation option subfile; Creating a dependency sub-file in the initial configuration file, writing the system library dependency, third-party library dependency, and pre-set type dependency items into the dependency sub-file, configuring the version requirement and path information for each dependency item, and obtaining a configured dependency sub-file; A compilation configuration file of the target system is obtained according to the adjusted compilation option sub-file and the configured dependency relationship sub-file.

6. The dynamic library creation method according to claim 1, wherein: The configuring the compilation configuration file according to the dependency relationship and the compilation options includes: Setting the linker flags in the compilation configuration file to ensure that the system library dependencies and third-party library dependencies are correctly referenced during the linking phase; Setting the header file search path in the compilation configuration file so that the compiler in the compilation configuration file can find the required header files; Setting the library file search path in the compilation configuration file so that the linker in the compilation configuration file can find the required library file; Setting the compiler optimization level in the compilation configuration file to optimize the performance of the generated dynamic library; Setting the runtime architecture in the compilation configuration file to ensure that the generated dynamic library is compatible with the architecture of the target system; Set the SDK version in the compilation configuration file to ensure that the compilation process uses the correct software development kit.

7. The dynamic library creation method according to claim 1, wherein: The process of executing a preset compilation command on the configured compilation configuration file to generate a dynamic library includes: Determining, according to the configuration information in the compilation configuration file, a preset compilation command adapted to the target system and the target component; Executing the preset compilation command to compile the filtered source code file to generate a target object file; According to the dependency relationship in the compilation configuration file, the system library dependency, the third-party library dependency and the dependency of the preset type are linked, and the target object file is integrated with the linked dependency to generate the dynamic library.

8. A dynamic library creation device, characterized in that: The device comprises: a traversal module, configured to receive a request for creating a dynamic library for a target system, obtain a target component corresponding to the target system according to the request, traverse a source code directory of the target component, and filter, from the source code directory, source code files required to be compiled for creating the dynamic library based on file extensions and file types of a first preset type; a screening module, configured to create a compilation configuration file of the target system according to the directory structure of the target component, copy the first path of the source code file to the compilation configuration file, screen configuration and operation files associated with the operation of the target component from the configuration directory of the target component according to the file extension and file type of a second preset type, and add the second path of the configuration and operation file to the compilation configuration file; a configuration module, configured to obtain the system library dependencies, third-party library dependencies, and dependencies of preset types of the target system, and use them as dependencies of the compilation configuration file; obtain the compiler flags, operating architecture, SDK version, and search path of the target system, and use them as compilation options of the compilation configuration file; and configure the compilation configuration file according to the dependencies and the compilation options; The integration module is used to execute preset compilation commands on the configured compilation configuration file to generate a dynamic library, integrate the dynamic library into the target system, and use the target system to load the dynamic library to call the target component.

9. A device, characterized in that The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a dynamic library creation program that can be executed by the at least one processor. The dynamic library creation program is executed by the at least one processor to enable the at least one processor to execute the dynamic library creation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a dynamic library creation program, which can be executed by one or more processors to implement the dynamic library creation method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Numerical weather forecast software componentization and operation instance construction method and device

    CN121116254A