Real-time system modularization automatic construction method and system based on dependency graph

Through unified file format and dependency graph generation method, an embedded real-time system is automatically built, which solves the problems of inefficiency and version incompatibility in embedded real-time system development in the existing technology, and realizes flexible expansion and cutting of system functions, improving development efficiency and cross-platform adaptability.

CN120335860AActive Publication Date: 2025-07-18BEIJING LINX SOFTWARE CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510813654.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-07-18
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

In the development of existing embedded real-time systems, the dependencies between software modules are described through static configuration files, and the lack of a unified management mechanism has led to an increase in the work burden of developers, incompatible versions, inefficient management, and difficult to flexibly manage system function expansion and tailoring. A lot of time is required to maintain and adjust the construction system and related configuration files when developing across multiple BSP platforms.

Method used

The configuration file is built using a unified file format, the initial dependency graph is generated and version matching is performed, the target hardware information and functional requirements input by the user is received, the minimization dependency graph is generated, and the system image file is automatically built through the dependency graph to achieve flexible expansion and cropping of system functions. The system script is generated in a cross-platform format to support different hardware platforms.

Benefits of technology

It improves the efficiency of system construction, realizes flexible expansion and tailoring of system functions, meets the development needs of different hardware platforms, ensures the system's operation in different operating systems and hardware environments, and improves the efficiency of software module management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335860A_ABST
    Figure CN120335860A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time system modularization automatic construction method and system based on a dependency graph. The method comprises the following steps: constructing a configuration file by adopting a uniform file format; generating an initial dependency graph according to the dependency relationship among the software modules in the configuration file; performing version matching on the hardware parameters and the module function description information, and filtering out software modules incompatible with hardware parameter versions to obtain a reference dependency graph; receiving target hardware information and function demand information input by a user, and determining a minimum dependency graph matched with the target hardware information and the function demand information according to the target hardware information, the function demand information and the reference dependency graph; screening out configuration information corresponding to a plurality of necessary software modules included in the minimum dependency graph from the configuration file, and generating a target configuration file; and constructing a system script according to the minimum dependency graph and the target configuration file, compiling the system script, and generating a system mirror image file. By adopting the method, the system construction efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a method and system for modular automatic construction of a real-time system based on a dependency graph. Background Art

[0002] With the rapid development of embedded real-time systems and applications, embedded devices based on microcontroller units (MCUs) are widely used in fields such as industrial control and smart home. These embedded devices often need to customize the real-time system according to application scenarios and requirements. System manufacturers need to support multiple board support packages (BSPs) simultaneously, and there are complex dependency relationships and resource sharing requirements among system modules.

[0003] Existing system construction methods rely on developers' pre-configuration of system parameters and corresponding system construction scripts, and there are problems of difficult maintenance when dealing with complex dependency relationships, making it difficult to flexibly manage system function extension and system function trimming. In current embedded real-time system development, the dependency relationships between software modules are described through static configuration files, and configuration parameters are scattered in different files, lacking a unified management mechanism.

[0004] Existing manual-based system construction methods increase the workload of developers, are prone to version incompatibility and low management efficiency. At the same time, the mapping relationship between hardware resources and software configuration parameters is not clear enough, and a large amount of time is required to maintain and adjust the construction system and related configuration files when developing across multiple BSP platforms, affecting development efficiency. Summary of the Invention

[0005] In view of the above defects or deficiencies in the prior art, it is desirable to provide a method and system for modular automatic construction of a real-time system based on a dependency graph. On the basis of improving system construction efficiency, this method can achieve flexible extension and trimming of system functions.

[0006] According to one aspect of the present invention, there is provided a method for modular automatic construction of a real-time system based on a dependency graph, the method including: Constructing a configuration file in a unified file format, the configuration file including configuration information of multiple software modules, and the configuration information of each software module including module function description information, hardware parameters adapted by the software module, and dependency relationships between the software module and other software modules; Generating initial dependency graphs corresponding to multiple software modules according to the dependency relationships between the software modules in the configuration file; performing version matching on the hardware parameters and module function description information, and filtering out software modules in the initial dependency graphs that are incompatible with the hardware parameter versions to obtain a reference dependency graph; Receive the target hardware information and functional requirement information input by the user, and determine the minimized dependency graph that matches the target hardware information and functional requirement information according to the target hardware information, functional requirement information, and reference dependency graph; the minimized dependency graph includes multiple necessary software modules adapted to the target hardware information and functional requirement information; Screen out the configuration information corresponding to multiple necessary software modules from the configuration file to generate a target configuration file; construct a system script according to the minimized dependency graph and the target configuration file, and compile the system script to generate a system image file.

[0007] Optionally, in the method of the present invention, determining the minimized dependency graph that matches the target hardware information and functional requirement information according to the target hardware information, functional requirement information, and reference dependency graph includes: traversing each software module in the reference dependency graph in reverse starting from the root node included in the reference dependency graph, determining software modules whose hardware parameters match the target hardware information, module function description information matches the functional requirement information, and have a dependency relationship, and marking them as necessary software modules; deleting the software modules in the reference dependency graph except the necessary software modules to obtain the minimized dependency graph corresponding to the target hardware information and functional requirement information.

[0008] Optionally, in the method of the present invention, the structure of the reference dependency graph is a directed acyclic graph structure, and the method further includes: performing a topological sort on multiple software modules in the reference dependency graph based on the structure of the reference dependency graph.

[0009] Optionally, in the method of the present invention, the method further includes: establishing a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters by adopting a unified parameter mapping mechanism; creating a platform adaptation layer of the system according to the mapping relationship.

[0010] Optionally, in the method of the present invention, the system script adopts a cross-platform format, including the compilation order of multiple necessary software modules and the transfer rules and linking rules of the configuration information of each necessary software module.

[0011] Optionally, in the method of the present invention, compiling the system script to generate a system image file includes: sequentially compiling each necessary software module according to the compilation order, and adjusting the compilation options of each necessary software module according to the transfer rules; linking the compiled necessary software modules according to the linking rules to generate a system image file.

[0012] Optionally, in the method of the present invention, the method further includes: determining the necessary software modules that have been compiled and have not changed according to the change situation of the source code or dependency relationship of each necessary software module; reusing the compilation results of the necessary software modules that have been compiled and have not changed.

[0013] Optionally, in the method of the present invention, the method further includes: for each software module, constructing an association relationship between the software module, configuration information, and source code; constructing a module resource library according to the association relationship and the reference dependency graph; the module resource library adopts a module classification management mode and a module version management mode.

[0014] Optionally, in the method of the present invention, the module classification management mode includes classification according to module function description information or classification according to the hardware platform.

[0015] According to another aspect of the present invention, there is provided a computer system, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0016] According to still another aspect of the present invention, there is provided a readable storage medium storing program instructions. When the program instructions are read and executed by an embedded device, the embedded device is caused to execute the method described in the first aspect.

[0017] According to still another aspect of the present invention, there is provided a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0018] The method and system for modular automatic construction of a real-time system based on a dependency graph provided in the embodiments of the present application, compared with the existing manual-based system construction solutions, can first perform information configuration and dependency graph generation for a large number of software modules. Thus, when receiving the target hardware information and functional requirement information of the system to be constructed by the user, it can directly match with the pre-constructed configuration file and reference dependency graph, and cut out the minimized dependency graph and the target configuration file corresponding to the system to be constructed by the user. Finally, the automatic construction of the system is realized according to the minimized dependency graph and the target configuration file. The automatic construction method of the system based on the dependency graph can, on the basis of improving the system construction efficiency, realize the flexible expansion and trimming of the system functions. In addition, by constructing the configuration file in a unified file format and using system scripts generated in a cross-platform format, the unified management of the configuration information of multiple software modules can be realized, the software module management efficiency can be improved, and the development requirements of different hardware platforms can be met, ensuring that the system can run in different operating systems and hardware environments. Description of the Drawings

[0019] By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, objects, and advantages of the present application will become more apparent: Figure 1 It is one of the schematic diagrams of the architecture of the system for modular automatic construction of a real-time system based on a dependency graph provided in the embodiments of the present application; Figure 2 It is the second flowchart diagram of the method for automatically constructing a modular real-time system based on a dependency graph provided by an embodiment of the present application; Figure 3 It is the third flowchart diagram of the method for automatically constructing a modular real-time system based on a dependency graph provided by an embodiment of the present application; Figure 4 It is the fourth flowchart diagram of the method for automatically constructing a modular real-time system based on a dependency graph provided by an embodiment of the present application; Figure 5 It is the fifth flowchart diagram of the method for automatically constructing a modular real-time system based on a dependency graph provided by an embodiment of the present application; Figure 6 It is the summary flowchart diagram of the method for automatically constructing a modular real-time system based on a dependency graph provided by an embodiment of the present application; Figure 7 It is the flowchart diagram of system construction in a specific application scenario provided by an embodiment of the present application; Figure 8 It is the schematic diagram of the architecture of the dependency graph management system provided by an embodiment of the present application; Figure 9 The schematic diagram of the structure of the computer system provided by an embodiment of the present application. Detailed implementation manners

[0020] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the sake of description, only the parts related to the invention are shown in the drawings.

[0021] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments. Additionally, the term "and / or" in this document only describes the associated relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects.

[0022] With the rapid development of embedded real-time systems and applications, embedded devices based on MCUs are widely used in fields such as industrial control and smart home. These embedded devices often need to customize the real-time system according to the application scenario and requirements. System manufacturers need to support multiple BSPs simultaneously, and there are complex dependency relationships and resource sharing requirements among system modules.

[0023] Existing system construction methods rely on developers' pre-configuration of system parameters and corresponding system construction scripts, which have difficulties in maintenance when dealing with complex dependencies and are difficult to flexibly manage system function expansion and system function trimming. In the current development of embedded real-time systems, the dependencies between software modules are described through static configuration files, and the configuration parameters are scattered in different files, lacking a unified management mechanism.

[0024] The existing manual-based system construction method increases the workload of developers and is prone to version incompatibility and low management efficiency. At the same time, the mapping relationship between hardware resources and software configuration parameters is not clear enough. When developing across multiple BSP platforms, a large amount of time is required to maintain and adjust the construction system and related configuration files, which affects the development efficiency.

[0025] In view of the above problems, to improve the development efficiency and maintainability of embedded real-time systems, the embodiments of the present application provide a dependency graph-based modular automatic construction method and system for real-time systems that overcome the above problems or at least partially solve the above problems. This method can automatically manage module dependencies, optimize the construction process, and flexibly bind hardware resources and configuration parameters; it can support on-demand construction and flexible trimming of modules, and provide a unified BSP adaptation mechanism to meet the development needs of different hardware platforms. To solve the problems of low efficiency and poor flexibility in system development and management in the prior art.

[0026] It should be noted that although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result.

[0027] According to one aspect of the present invention, there is provided a dependency graph-based modular automatic construction method for a real-time system. Exemplarily, Figure 1 is one of the flow schematic diagrams of the dependency graph-based modular automatic construction method for a real-time system provided by the embodiments of the present application. The method specifically includes the following steps: Step S11, constructing a configuration file in a unified file format.

[0028] Optionally, describe the configuration information of multiple software modules in a unified file format and construct configuration files corresponding to multiple software modules. This realizes the unified management of the configuration information of software modules and improves the management efficiency of the configuration information.

[0029] The configuration file adopts a structured format. The configuration information of each software module includes the module function description information, the hardware parameters adapted by the software module, and the dependency relationship between the software module and other software modules. Among them, the module function description information includes the specific functions and interfaces of the software module, which is convenient for dependency parsing and matching when constructing a dependency graph. The hardware parameters adapted by the software module include key parameters such as the processor architecture, peripheral type, and memory requirements.

[0030] Step S12: Generate initial dependency graphs corresponding to multiple software modules according to the dependency relationships between the software modules in the configuration file; perform version matching on the hardware parameters and module function description information, and filter out the software modules in the initial dependency graph that are incompatible with the hardware parameter version to obtain a reference dependency graph.

[0031] Optionally, each software module is used as a node in the dependency graph. Then, parse the dependency relationships between the software modules in the configuration file, form edges in the dependency graph between any two software modules with a dependency relationship, and determine the direction of the edges according to the specific dependency relationship, thereby forming initial dependency graphs corresponding to multiple software modules.

[0032] Furthermore, considering that there is a problem of version mismatch between the software module and the hardware parameters, which is likely to affect the actual operation of the subsequent constructed system. Therefore, after the initial dependency graph is constructed, it is necessary to perform version matching on the hardware parameters and module function description information of each software module to determine the software modules that are incompatible with the hardware parameter version. Delete the nodes corresponding to the software modules with incompatible versions in the initial dependency graph, as well as the edges connected to this node, to obtain a reference dependency graph.

[0033] Optionally, when constructing the initial dependency graph, a directed acyclic graph structure can be adopted to avoid the problem of circular dependencies during the system construction process. Furthermore, the structure of the reference dependency graph obtained after filtering the initial dependency graph is a directed acyclic graph structure. Based on the structure of the directed acyclic graph, topological sorting can also be performed on the multiple software modules in the reference dependency graph to optimize the construction order of the multiple software modules included in the reference dependency graph and improve the system construction efficiency.

[0034] Optionally, after the information configuration of multiple software modules is completed, a module resource library can be established to standardize and store the multiple software modules. So that when constructing the system subsequently, the configuration information of the software modules related to the system to be constructed can be directly obtained from this software resource library, avoiding repeated information configuration of the software modules and improving the system construction efficiency.

[0035] The construction process of the module resource library includes: for each software module, establishing the association relationship between the software module, configuration information, and source code; constructing the module resource library according to the association relationship and the reference dependency graph. Specifically, for each software module, associate its configuration file and source code. Then, store the associated software modules, configuration information, and source code, and at the same time, store the reference dependency graph corresponding to the multiple software modules constructed above to complete the establishment of the module resource library.

[0036] Optionally, the module resource library adopts a module classification management mode and a module version management mode. Uniform type marking and management are carried out for software modules of the same type, so that when constructing the system subsequently, the associated information (configuration information and source code) can be quickly searched and obtained according to the type information of the required software modules. Software modules with the same version or consistent version compatibility information are uniformly version-marked and managed, so that when constructing the system subsequently, software modules with compatible versions can be searched and selected, and their associated information can be quickly obtained. Among them, the module classification management mode includes classification according to module function description information or according to the hardware platform. That is, for multiple software modules, they can be classified and managed according to function or according to the corresponding hardware platform.

[0037] Step S13, receive the target hardware information and functional requirement information input by the user, and determine the minimized dependency graph that matches the target hardware information and functional requirement information according to the target hardware information, functional requirement information, and reference dependency graph.

[0038] Among them, the minimized dependency graph includes multiple necessary software modules adapted to the target hardware information and functional requirement information.

[0039] It can be understood that the above configuration file and reference dependency graph are constructed based on the relevant information of a large number of software modules, and the automated construction of the system required by the user can be completed by screening or intercepting a part of them.

[0040] Optionally, first receive the target hardware information and functional requirement information input by the user, match the target hardware information and functional requirement information with the hardware parameters, function description information, and dependency relationships corresponding to each software module in the multiple software modules included in the reference dependency graph in turn, and mark the software modules that match the target hardware information and functional requirement information and have a dependency relationship as necessary software modules. Intercept the nodes corresponding to the necessary software modules and the edges connecting the nodes from the reference dependency graph to obtain the minimized dependency graph corresponding to the system to be constructed by the user.

[0041] Step S14, screen out the configuration information corresponding to multiple necessary software modules from the configuration file to generate a target configuration file; construct a system script according to the minimized dependency graph and the target configuration file, and compile the system script to generate a system image file.

[0042] Optionally, after cropping the reference dependency graph to obtain the minimized dependency graph, it is also necessary to screen the configuration information in the configuration file, screen out the configuration information corresponding to the necessary software modules, and obtain the target configuration file corresponding to the system to be built. After converting the minimized dependency graph and the target configuration file into a system script and compiling the system script, a system image file can be obtained, and the automated construction of the system is completed.

[0043] Optionally, the system script adopts a cross-platform format to ensure that the system script can run in different operating systems and hardware environments. Specifically, the system script includes the compilation order of multiple necessary software modules and the transfer rules and linking rules of the configuration information of each necessary software module. To ensure that the system can be accurately compiled and linked according to the set compilation order, configuration information transfer, and linking rules during system compilation, and to ensure the reliability of the system.

[0044] Optionally, after the system construction is completed, the system image file can also be automatically tested according to multiple preset test scenarios to obtain test results. For example, the functional integrity and hardware compatibility of the system can be verified. Among them, the test results of the system image file can be fed back to the system automated construction solution in this application to optimize the subsequent system construction process.

[0045] Compared with the existing manual-based system construction solutions, the present invention can first perform information configuration and dependency graph generation for a large number of software modules. Thus, when receiving the target hardware information and functional requirement information of the system to be built by the user, it can directly match with the pre-built configuration file and reference dependency graph, and crop out the minimized dependency graph and the target configuration file corresponding to the system to be built by the user. Finally, the automated construction of the system is realized based on the minimized dependency graph and the target configuration file. The automated system construction method based on the dependency graph can achieve flexible expansion and cropping of the system functions while improving the system construction efficiency. In addition, using a unified file format to build the configuration file and a cross-platform format to generate the system script can realize the unified management of the configuration information of multiple software modules, improve the software module management efficiency, and meet the development needs of different hardware platforms to ensure that the system can run in different operating systems and hardware environments.

[0046] According to another aspect of the present invention, another automated construction method for real-time system modules based on a dependency graph is provided. Exemplarily, Figure 2 is the second flowchart of the automated construction method for real-time system modules based on a dependency graph provided by an embodiment of the present application. The method specifically includes the following steps: Step S21: Starting from the root node included in the reference dependency graph, traverse each software module in the reference dependency graph in reverse, determine the software modules whose hardware parameters match the target hardware information, whose module function description information matches the functional requirement information, and which have dependency relationships, and mark them as necessary software modules.

[0047] Optionally, when the target hardware information and the functional requirement information are sequentially matched with the configuration information of multiple software modules, it is possible to start from the root node in the reference dependency graph and traverse each node in the reference dependency graph in reverse. That is, starting from the application module among the multiple software modules included in the reference dependency graph, traverse each software module included in the reference dependency graph in reverse.

[0048] For each software module traversed, match the target hardware information with the hardware parameters of the software module, and match the functional requirement information with the functional description information of the software module. After completing the traversal of all software modules, mark the software modules whose hardware parameters match the target hardware information input by the user, whose module function description information matches the functional requirement information input by the user, and which have dependency relationships as the necessary software modules for building the system.

[0049] Step S22: Delete the software modules in the reference dependency graph except for the necessary software modules to obtain the minimized dependency graph corresponding to the target hardware information and the functional requirement information.

[0050] Optionally, after determining the necessary software modules required for building the system, delete the software modules in the reference dependency graph except for the necessary software modules, and the dependency relationships of the software modules except for the necessary software modules, to obtain the minimized dependency graph corresponding to the target hardware information and the functional requirement information.

[0051] In the method according to the present invention, the reverse traversal based on the root node can decouple the complex dependency relationships between multiple software modules in reverse, accurately traverse all software modules, and ensure the comprehensiveness and accuracy of information matching. Trimming the software modules and dependency relationships in the reference dependency graph except for the necessary software modules can remove redundant software modules and optimize the resource utilization efficiency.

[0052] According to another aspect of the present invention, another method for automatically building real-time system modules based on a dependency graph is provided. Exemplarily, Figure 3 is the third flowchart of the method for automatically building real-time system modules based on a dependency graph provided by an embodiment of the present application. The method specifically includes the following steps: Step S31: Establish a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters by using a unified parameter mapping mechanism.

[0053] It can be understood that the hardware abstraction layer and the platform adaptation layer are indispensable parts of the system. The hardware abstraction layer is an interface layer located between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, provides a virtual hardware platform for the operating system, making it hardware-independent and portable across multiple platforms; the platform adaptation layer is a software layer located between the hardware abstraction layer and the operating system, and its main role is to handle the differences between the operating system and the hardware to ensure that the operating system can run properly on different hardware platforms.

[0054] Optionally, the present invention defines a unified parameter mapping mechanism and uses the unified parameter mapping mechanism to map hardware parameters such as GPIO pins, interrupt numbers, and communication interfaces to the configuration information of software modules, decoupling the specific parameters of the underlying hardware from the logical configuration of the upper-layer modules, and establishing a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters. This mapping relationship can support complex scenarios of one-to-many and many-to-one (that is, it can support the adaptation of the same logical function to multiple types of hardware parameters, and the convergence of multiple hardware parameters into the same logical function), and can also handle the differences between different hardware platforms to adapt to multiple hardware platforms.

[0055] Step S32, create the platform adaptation layer of the system according to the mapping relationship.

[0056] Optionally, through automated code generation technology, the mapping relationship between each software module in the hardware abstraction layer and the hardware parameters can be converted into an executable code file of the platform adaptation layer. The platform adaptation layer provides a unified interface, which can shield the underlying hardware differences and achieve the decoupling between the business logic and the hardware.

[0057] In the method according to the present invention, the hardware abstraction layer and the platform adaptation layer necessary for system construction can be generated. Moreover, the mapping relationship between each software module in the hardware abstraction layer established by the present invention using the unified parameter mapping mechanism can support complex scenarios of one-to-many and many-to-one, and can also adapt to multiple hardware platforms. The platform adaptation layer created based on the above mapping relationship can also shield the underlying hardware differences and achieve the decoupling between the business logic and the hardware.

[0058] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. Exemplarily, Figure 4 is the fourth flowchart of the method for automatically constructing real-time system modules based on a dependency graph provided by an embodiment of the present application. The method specifically includes the following steps: Step S41, compile each necessary software module in sequence according to the compilation order, and adjust the compilation options of each necessary software module according to the passing rules.

[0059] Optionally, when compiling the system script, each necessary software module is compiled in sequence according to the compilation order in the system script. During the compilation process, the compilation options can be dynamically adjusted according to the transmission rules of the configuration information of each necessary software module, such as conditional compilation, optimization level, debug information, target platform, etc., to improve the flexibility and cross-platform ability of the system.

[0060] Step S42: Link the compiled necessary software modules according to the linking rules to generate a system image file.

[0061] Optionally, after each necessary software module is compiled, the compiled necessary software modules are linked according to the linking rules to ensure that the dependency relationships reflected in the reference dependency graph are satisfied. For example, if software module A uses a function in software module B, then during linking, module B must be processed before module A. After linking in the correct order, a system image file is generated.

[0062] Optionally, the integrity of symbol references can be checked during the linking process. For example, un-resolved symbols are recorded and processed to ensure that all external references can be correctly resolved.

[0063] In the method according to the present invention, each necessary software module is compiled in the compilation order to ensure the compilation accuracy; the compilation options of each necessary software module can be adjusted according to the transmission rules to improve the flexibility and cross-platform ability of the system; the compiled necessary software modules can be linked according to the linking rules to ensure the accuracy of the dependency relationships between the necessary software modules and ensure the reliability of the system image file.

[0064] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. Exemplarily, Figure 5 is the fifth flowchart of the method for automatically constructing real-time system modules based on a dependency graph provided by an embodiment of the present application. The method specifically includes the following steps: Step S51: Determine the necessary software modules that have been compiled and have not changed according to the changes in the source code or dependency relationships of each necessary software module.

[0065] Step S52: Reuse the compilation results of the necessary software modules that have been compiled and have not changed.

[0066] Optionally, during the compilation of the system script, for the necessary software modules that have been compiled, the changes in the source code or dependency relationships of each necessary software module can be judged by the hash value or timestamp. If the source code or dependency relationship of the necessary software module has not changed, it means that the necessary software module has not changed, that is, the necessary software module is a necessary software module that has been compiled and has not changed.

[0067] In the compilation process of subsequent necessary software modules, the compilation results of the already compiled and unchanged necessary software modules can be reused, avoiding repeated compilation and improving the system construction efficiency.

[0068] In the method according to the present invention, during the compilation process of multiple necessary software modules, the compilation results of the already compiled and unchanged necessary software modules can be reused, avoiding repeated compilation and improving the system construction efficiency.

[0069] As Figure 6 shown, the solution of the present invention is summarized and described, mainly including the following three stages: Stage 1: Dependency description and relationship parsing stage S101: Create a module dependency description configuration file based on the hardware characteristic description (hardware parameters), module function identifier (function description information), and inter-module dependency relationship.

[0070] S102: Collect the dependency description configuration files of the above-mentioned multiple software modules, store them in a standardized manner, and establish a module resource library.

[0071] S103: Parse the inter-module dependency relationship and construct an initial dependency graph corresponding to the multiple software modules.

[0072] Stage 2: Hardware adaptation and parameter binding S2: Match the necessary software modules in the multiple software modules according to the target hardware configuration information input by the user, and trim the reference dependency graph (obtained after filtering the version compatibility of the initial dependency graph) based on the necessary software modules to obtain a minimized construction graph (i.e., a minimized dependency graph).

[0073] S3: Establish a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters, and create a platform adaptation layer of the system according to the mapping relationship to bind the hardware resources and configuration parameters.

[0074] Stage 3: Construction execution S4: Generate a system script, compile the system script to obtain a system image file, and complete the parameterized construction process.

[0075] As Figure 7 shown, a system construction process in a specific application scenario is provided: 1. Requirement input: The user specifies the target hardware platform and functional requirement parameters (i.e., input the target hardware information and functional requirement information).

[0076] 2. Module selection: Select components that meet the requirements from the module resource library (select the matching necessary software modules).

[0077] 3. Dependency Resolution: Analyze the dependencies among multiple software modules to construct an initial dependency graph. Further, incompatible software modules can be filtered out to obtain a reference dependency graph.

[0078] 4. Component Diagram Optimization: Trim the reference dependency graph according to the target hardware information input by the user to generate a minimized construction plan (delete the unnecessary software modules in the reference dependency graph to obtain a minimized dependency graph).

[0079] 5. Parameter Binding, Compilation and Linking to Generate a System Image: Establish the mapping relationship between each software module in the hardware abstraction layer and the hardware parameters, and create a platform adaptation layer for the system according to the mapping relationship; convert the minimized dependency graph into a system script, compile the system script, and finally generate a system image file adapted to a specific hardware platform.

[0080] As Figure 8 shown, the present invention provides a dependency graph management system, which includes four core components: a module description layer, a dependency resolution engine, a construction optimizer, and a platform adaptation layer.

[0081] The module description layer is used to maintain a standardized configuration file and define the hardware characteristics (hardware parameters) and function identifiers (function description information).

[0082] The dependency resolution engine is used to construct and optimize the module dependency graph and parse the relationships between modules (i.e., construct an initial dependency graph and a reference dependency graph).

[0083] The construction optimizer is used to generate a minimized construction graph according to the target hardware and perform topological sorting to optimize the construction order (i.e., generate a minimized dependency graph corresponding to the system and perform topological sorting on multiple necessary software modules included).

[0084] The platform adaptation layer is used to implement the binding of hardware resources and configuration parameters and generate platform-related adaptation code (i.e., establish the mapping relationship between each software module in the hardware abstraction layer and the hardware parameters; create a platform adaptation layer for the system according to the mapping relationship).

[0085] Next, refer to Figure 9 , which shows a schematic structural diagram of a computer system 600 of a terminal device or a server suitable for implementing the embodiments of the present application.

[0086] As Figure 9As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in the read-only memory (ROM) 602 or a program loaded from the storage section 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0087] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.

[0088] In particular, according to an embodiment of the present disclosure, the process described above with reference to Figure 1 can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing Figure 1 the method. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611.

[0089] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0091] The units or modules involved in the embodiments of the present application can be implemented in software or in hardware. The described units or modules can also be provided in a processor. Among them, the names of these units or modules do not, in some cases, limit the units or modules themselves.

[0092] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the computer device described in the above embodiments, or may exist separately without being assembled into the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are executed by one or more processors, the methods described in the present application are performed. For example, it can execute Figures 1 to 5 each step of any of the illustrated methods.

[0093] The embodiments of the present application provide a computer program product, which includes instructions that, when run, cause the methods described in the embodiments of the present application to be executed. For example, it can execute Figures 1 to 5 each step of any of the illustrated methods.

[0094] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing 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 methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0095] The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with (but not limited to) technical features with similar functions disclosed in the present application.

Claims

1. A modular automatic construction method for real-time systems based on a dependency graph, characterized in that The method includes: Constructing a configuration file in a unified file format, where the configuration file includes configuration information of multiple software modules, and the configuration information of each software module includes module function description information, hardware parameters adapted by the software module, and the dependency relationship between the software module and other software modules; Generating an initial dependency graph corresponding to the multiple software modules according to the dependency relationship between the software modules in the configuration file; performing version matching on the hardware parameters and the module function description information, and filtering out the software modules in the initial dependency graph that are incompatible with the hardware parameter version to obtain a reference dependency graph; Receiving the target hardware information and functional requirement information input by the user, and determining a minimized dependency graph that matches the target hardware information and functional requirement information according to the target hardware information, the functional requirement information, and the reference dependency graph; the minimized dependency graph includes multiple necessary software modules adapted to the target hardware information and functional requirement information; Screening out the configuration information corresponding to the multiple necessary software modules from the configuration file to generate a target configuration file; constructing a system script according to the minimized dependency graph and the target configuration file, and compiling the system script to generate a system image file.

2. The method according to claim 1, characterized in that, The determining the minimized dependency graph that matches the target hardware information and functional requirement information according to the target hardware information, the functional requirement information, and the reference dependency graph includes: Traversing each software module in the reference dependency graph in reverse order starting from the root node included in the reference dependency graph, determining the software modules whose hardware parameters match the target hardware information, module function description information matches the functional requirement information, and have a dependency relationship, and marking them as necessary software modules; Deleting the software modules in the reference dependency graph except the necessary software modules to obtain the minimized dependency graph corresponding to the target hardware information and functional requirement information.

3. The method according to claim 1, wherein The structure of the reference dependency graph is a directed acyclic graph structure, and the method further includes: Performing a topological sort on the multiple software modules in the reference dependency graph based on the structure of the reference dependency graph.

4. The method according to claim 1, characterized in that, The method further includes: Establishing a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters by using a unified parameter mapping mechanism; Creating a platform adaptation layer of the system according to the mapping relationship.

5. The method according to claim 1, wherein The system script adopts a cross-platform format and includes the compilation order of the multiple necessary software modules and the transfer rules and linking rules for the configuration information of each necessary software module.

6. The method according to claim 5, wherein The compiling the system script to generate a system image file includes: Compiling each necessary software module in sequence according to the compilation order, and adjusting the compilation options of each necessary software module according to the transfer rules; Linking the compiled necessary software modules according to the linking rules to generate the system image file.

7. The method according to claim 5, wherein The method further includes: Determining the necessary software modules that have been compiled and have not changed according to the change situations of the source codes or dependency relationships of each necessary software module; Reusing the compilation results of the necessary software modules that have been compiled and have not changed.

8. The method according to claim 1, wherein The method further includes: For each of the software modules, establish the association relationships between the software module, the configuration information, and the source code; Construct a module resource library according to the association relationships and the reference dependency graph; the module resource library adopts a module classification management mode and a module version management mode.

9. The method according to claim 8, wherein The module classification management mode includes classification according to module function description information or classification according to the hardware platform.

10. A computer system, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Distributed software development compiling method based on cloud computing and software development platform

    CN112394942A

  • Compiling integration method and device

    CN112835587A

  • Method and device for automatically converting functional modules between compiling construction systems

    CN116679936A

  • Mirror image file generation method and device of operating system, computer equipment and medium

    CN117453223A

  • Incremental build system using an inferred dependency graph collected with a system monitor

    US11144438B1