Method and system for automatic modular construction of real-time systems based on dependency graph

Through the real-time system modular automatic construction method based on dependency graph, maintenance difficulties and management inefficiency caused by manual configuration in embedded real-time system development are solved, flexible expansion and tailoring of system functions are achieved, and development efficiency and cross-platform adaptability are improved.

CN120335860BActive Publication Date: 2025-09-02BEIJING LINX SOFTWARE CORP
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing embedded real-time system development, the system construction method relies on manual configuration, resulting in difficulty in maintaining, incompatible versions, inefficient management, and unclear mapping relationship between hardware resources and software configuration parameters, making it difficult to flexibly manage system function expansion and cropping.

Method used

The real-time system modular automatic construction method based on dependency graph is adopted, and configuration files are constructed through a unified file format, initial dependency graphs are generated and version incompatible modules are filtered, and minimized dependency graphs are generated according to the target hardware and functional requirements. System image files are generated in a cross-platform format to realize the automated construction and flexible expansion of the system.

Benefits of technology

It improves the efficiency of system construction, realizes flexible expansion and tailoring of system functions, supports the development needs of multiple BSP platforms, and ensures that the system runs under different hardware and operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335860B_ABST
    Figure CN120335860B_ABST
Patent Text Reader

Abstract

The present application discloses a method and system for automatically building modularized real-time systems based on a dependency graph. The method includes: constructing a configuration file using a unified file format; generating an initial dependency graph based on the dependency relationships between software modules in the configuration file; performing version matching on hardware parameters and module function description information, filtering out software modules that are incompatible with the hardware parameter version, and obtaining a reference dependency graph; receiving 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 based on the target hardware information, functional requirement information, and the reference dependency graph; filtering out configuration information corresponding to multiple necessary software modules included in the minimized dependency graph from the configuration file to generate a target configuration file; constructing a system script based on the minimized dependency graph and the target configuration file, compiling the system script, and generating a system image file. This method can improve system construction efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and system for automatically constructing modularized real-time systems based on dependency graphs. Background Art

[0002] With the rapid development of embedded real-time systems and applications, microcontroller unit (MCU)-based embedded devices are widely used in industrial control, smart home and other fields. These embedded devices often require real-time system customization based on application scenarios and requirements. System vendors must support multiple board support packages (BSPs) simultaneously, and complex dependencies and resource sharing requirements exist between system modules.

[0003] Existing system construction methods rely on developers to preconfigure system parameters and create corresponding build scripts. This leads to maintenance difficulties when dealing with complex dependencies, making it difficult to flexibly manage system functionality expansion and tailoring. In current embedded real-time system development, dependencies between software modules are described using static configuration files, with configuration parameters scattered across different files and lacking a unified management mechanism.

[0004] Existing manual system construction methods increase developer workloads, easily leading to version incompatibilities and inefficient management. Furthermore, the mapping between hardware resources and software configuration parameters is unclear. Development across multiple BSP platforms requires significant time to maintain and adjust the build system and related configuration files, impacting development efficiency. Summary of the Invention

[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a method and system for automatically building modular real-time systems based on dependency graphs, which can achieve flexible expansion and tailoring of system functions on the basis of improving system construction efficiency.

[0006] According to one aspect of the present invention, a method for automatically constructing modularized real-time systems based on a dependency graph is provided, the method comprising:

[0007] A configuration file is constructed using a unified file format. The configuration file includes configuration information of multiple software modules. The configuration information of each software module includes module function description information, hardware parameters adapted by the software module, and dependencies between the software module and other software modules.

[0008] Generate an initial dependency graph corresponding to multiple software modules based on the dependency relationships between the software modules in the configuration file; perform version matching on the hardware parameters and module function description information, filter out software modules incompatible with the hardware parameter versions in the initial dependency graph, and obtain a reference dependency graph;

[0009] Receive target hardware information and functional requirement information input by a user, and determine a minimized dependency graph that matches the target hardware information and functional requirement information based on the target hardware information, functional requirement information, and a reference dependency graph; the minimized dependency graph includes multiple necessary software modules that are compatible with the target hardware information and functional requirement information;

[0010] The configuration information corresponding to multiple necessary software modules is filtered out from the configuration file to generate a target configuration file; a system script is constructed according to the minimized dependency graph and the target configuration file, the system script is compiled, and a system image file is generated.

[0011] Optionally, in the method of the present invention, a minimized dependency graph that matches the target hardware information and the functional requirement information is determined based on the target hardware information, the functional requirement information and the reference dependency graph, including: starting from the root node included in the reference dependency graph, traversing the software modules in the reference dependency graph in reverse order, determining the software modules whose hardware parameters match the target hardware information, whose module functional description information matches the functional requirement information, and which have a dependency relationship, and marking them as necessary software modules; deleting the software modules other than the necessary software modules in the reference dependency graph to obtain the minimized dependency graph corresponding to the target hardware information and the functional requirement information.

[0012] 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 comprises: topologically sorting the multiple software modules in the reference dependency graph based on the structure of the reference dependency graph.

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

[0014] 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 transmission rules and linking rules of the configuration information of each necessary software module.

[0015] Optionally, in the method of the present invention, the system script is compiled to generate a system image file, including: 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 a system image file.

[0016] 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 based on changes in the source code or dependency relationships of each necessary software module; and reusing the compilation results of the necessary software modules that have been compiled and have not changed.

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

[0018] 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 hardware platform.

[0019] According to another aspect of the present invention, a computer system is provided. The computer system includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the method according to the first aspect is implemented.

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

[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0022] The method and system for modular automatic construction of a real-time system based on a dependency graph provided by the embodiment of the present application, compared with the existing manual system construction scheme, can first perform information configuration and dependency graph generation for a large number of software modules, so that when the target hardware information and functional requirement information of the system to be built by the user are received, they can be directly matched with the pre-built configuration file and the reference dependency graph, from which the minimized dependency graph and the target configuration file corresponding to the system to be built by the user are cut out. 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 realize the flexibility, expansion and tailoring of the system functions on the basis of improving the efficiency of system construction. In addition, the configuration file is constructed in a unified file format, and the system script is generated in a cross-platform format, which can realize the unified management of the configuration information of multiple software modules, improve the efficiency of software module management, and meet the development requirements of different hardware platforms at the same time, ensuring that the system can run in different operating systems and hardware environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0024] Figure 1 One of the architectural diagrams of the real-time system modular automatic construction system based on the dependency graph provided in an embodiment of the present application;

[0025] Figure 2 The second flowchart of the method for automatically building modularized real-time systems based on dependency graphs provided in an embodiment of the present application;

[0026] Figure 3 The third flowchart of the method for automatically building modularized real-time systems based on dependency graphs provided in an embodiment of the present application;

[0027] Figure 4 Flowchart 4 of the method for automatically building modularized real-time systems based on dependency graphs provided in an embodiment of the present application;

[0028] Figure 5 Flowchart 5 of the method for automatically building modularized real-time systems based on dependency graphs provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram summarizing the process of automatically constructing a modularized real-time system based on a dependency graph according to an embodiment of the present application;

[0030] Figure 7 A schematic diagram of the system construction process for a specific application scenario provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the dependency graph management system architecture provided in an embodiment of the present application;

[0032] Figure 9 A schematic diagram of the structure of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

[0034] It should be noted that, in the absence of conflict, the embodiments in this 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 accompanying drawings and in combination with the embodiments. In addition, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first" and "second" in the description and claims of the embodiments of this application are used to distinguish different objects, rather than to describe a specific order of objects.

[0035] With the rapid development of embedded real-time systems and applications, MCU-based embedded devices are widely used in industrial control, smart home, and other fields. These embedded devices often require real-time system customization based on application scenarios and requirements. System vendors need to support multiple BSPs simultaneously, and complex dependencies and resource sharing requirements exist between system modules.

[0036] Existing system construction methods rely on developers to preconfigure system parameters and create corresponding build scripts. This leads to maintenance difficulties when dealing with complex dependencies, making it difficult to flexibly manage system functionality expansion and tailoring. In current embedded real-time system development, dependencies between software modules are described using static configuration files, with configuration parameters scattered across different files and lacking a unified management mechanism.

[0037] Existing manual system construction methods increase developer workloads, easily leading to version incompatibilities and inefficient management. Furthermore, the mapping between hardware resources and software configuration parameters is unclear. Development across multiple BSP platforms requires significant time to maintain and adjust the build system and related configuration files, impacting development efficiency.

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

[0039] It should be noted that although the operations of the present method are described in a particular order in the drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve desirable results.

[0040] According to one aspect of the present invention, a method for automatically building modular real-time systems based on dependency graphs is provided. Exemplarily, Figure 1 This is one of the flow diagrams of the method for automatically building a modularized real-time system based on a dependency graph provided in an embodiment of the present application. The method specifically includes the following steps:

[0041] Step S11: construct a configuration file using a unified file format.

[0042] Optionally, a unified file format is used to describe the configuration information of multiple software modules, and configuration files corresponding to the multiple software modules are constructed, thereby achieving unified management of the configuration information of the software modules and improving the management efficiency of the configuration information.

[0043] This configuration file uses a structured format. The configuration information for each software module includes a description of the module's functionality, the hardware parameters it supports, and the dependencies between the module and other modules. The module's functionality description includes the module's specific functions and interfaces, facilitating dependency resolution and matching when building the dependency graph. Hardware parameters supported by the software module include key parameters such as processor architecture, peripheral types, and memory requirements.

[0044] Step S12, generating an initial dependency graph corresponding to multiple software modules based on the dependency relationships between the software modules in the configuration file; performing version matching on the hardware parameters and module function description information, filtering out software modules incompatible with the hardware parameter versions in the initial dependency graph, and obtaining a reference dependency graph.

[0045] Optionally, each software module is treated as a node in a dependency graph. The dependency relationships between the software modules in the configuration file are then parsed, and edges in the dependency graph are formed between any two software modules with a dependency relationship. The direction of the edge is determined based on the specific dependency relationship, thereby forming an initial dependency graph corresponding to the multiple software modules.

[0046] Furthermore, considering that version mismatches between software modules and hardware parameters can easily affect the actual operation of the subsequently constructed system, 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 identify any software modules that are incompatible with the hardware parameter versions. The nodes corresponding to the incompatible software modules in the initial dependency graph, as well as the edges connected to these nodes, are deleted to obtain a reference dependency graph.

[0047] Optionally, when constructing the initial dependency graph, a directed acyclic graph structure can be used to avoid circular dependencies during system construction. 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, the multiple software modules in the reference dependency graph can also be topologically sorted based on the structure of the reference dependency graph to optimize the construction order of the multiple software modules included in the reference dependency graph and improve system construction efficiency.

[0048] Optionally, after completing the configuration of multiple software modules, a module resource library can be established to store the multiple software modules in a standardized manner. This allows the configuration information of the software modules related to the system to be built to be directly obtained from the software resource library during subsequent system construction, thus avoiding repeated configuration of software modules and improving system construction efficiency.

[0049] The module resource library construction process includes: establishing associations between each software module, its configuration information, and its source code; and constructing the module resource library based on these associations and a reference dependency graph. Specifically, for each software module, its configuration file and source code are associated. The associated software modules, configuration information, and source code are then stored, along with the reference dependency graph corresponding to the multiple software modules constructed above, completing the module resource library construction.

[0050] Optionally, the module resource library adopts a module classification management mode and a module version management mode. Software modules of the same type are uniformly marked and managed so that when the system is subsequently built, the associated information (configuration information and source code) can be quickly found and obtained according to the type information of the required software module. Software modules with the same version or the same version compatibility information are uniformly marked and managed so that when the system is subsequently built, software modules with compatible versions can be found 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 classification according to hardware platform. That is, for multiple software modules, classification management can be carried out according to function or according to the corresponding hardware platform.

[0051] Step S13: receiving the target hardware information and functional requirement information input by the user, and determining a minimized dependency graph matching the target hardware information and functional requirement information according to the target hardware information, functional requirement information and the reference dependency graph.

[0052] The minimized dependency graph includes multiple necessary software modules that are adapted to the target hardware information and functional requirement information.

[0053] It is understandable that the above configuration files and reference dependency graphs are constructed based on 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 some of them.

[0054] Optionally, the system first receives target hardware information and functional requirement information input by the user, then sequentially matches the target hardware information and functional requirement information with the hardware parameters, functional description information, and dependency relationships corresponding to each of the multiple software modules included in the reference dependency graph. Software modules that match the target hardware information and functional requirement information and have dependency relationships are marked as essential software modules. Nodes corresponding to the essential software modules and edges connecting the nodes are extracted from the reference dependency graph to obtain a minimized dependency graph corresponding to the user's system to be built.

[0055] Step S14: Filter configuration information corresponding to multiple necessary software modules from the configuration file to generate a target configuration file; construct a system script based on the minimized dependency graph and the target configuration file, compile the system script, and generate a system image file.

[0056] Optionally, after trimming the reference dependency graph to obtain a minimized dependency graph, the configuration information in the configuration file must be filtered to identify the configuration information corresponding to the necessary software modules, thereby obtaining the target configuration file corresponding to the system to be built. The minimized dependency graph and target configuration file are converted into a system script. After compiling the system script, the system image file is obtained, completing the automated system build.

[0057] Optionally, the system script uses a cross-platform format to ensure that it can run on different operating systems and hardware environments. Specifically, the system script includes the compilation order of multiple necessary software modules, as well as the configuration information transfer and linking rules for each necessary software module. This ensures that the system is accurately compiled and linked according to the specified compilation order, configuration information transfer, and linking rules, thereby ensuring system reliability.

[0058] Optionally, after the system is built, the system image file can be automatically tested according to a variety of pre-set test schemes to obtain test results. For example, the functional integrity and hardware compatibility of the system can be verified. The test results of the system image file can be fed back to the system automated construction scheme in this application to optimize the subsequent system construction process.

[0059] Compared with the existing manual system construction scheme, the present invention can first perform information configuration and dependency graph generation for a large number of software modules, so that when the target hardware information and functional requirement information of the system that the user needs to build is received, it can be directly matched with the pre-built configuration file and reference dependency graph, from which the minimized dependency graph and target configuration file corresponding to the system that the user needs to build are cut out. 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 realize the flexibility, expansion and tailoring of the system functions on the basis of improving the efficiency of system construction. In addition, the use of a unified file format to construct the configuration file and the use of a cross-platform format to generate the system script can realize the unified management of the configuration information of multiple software modules, improve the efficiency of software module management, and meet the development requirements of different hardware platforms at the same time, ensuring that the system can run under different operating systems and hardware environments.

[0060] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. For example, Figure 2 This is a second flow chart of a method for automatically constructing a real-time system module based on a dependency graph provided in an embodiment of the present application. The method specifically includes the following steps:

[0061] Step S21, starting from the root node included in the reference dependency graph, reversely traverse each software module in the reference dependency graph, determine the software modules whose hardware parameters match the target hardware information, whose module function description information matches the function requirement information, and have dependency relationships, and mark them as necessary software modules.

[0062] Optionally, when the target hardware information and functional requirement information are sequentially matched with the configuration information of multiple software modules, each node in the reference dependency graph may be traversed in reverse order starting from the root node in the reference dependency graph. That is, starting from the application module among the multiple software modules included in the reference dependency graph, each software module included in the reference dependency graph may be traversed in reverse order.

[0063] For each software module traversed, the target hardware information is matched with the module's hardware parameters, and the functional requirements are matched with the module's functional description information. After traversing all software modules, the software modules whose hardware parameters match the user-entered target hardware information, whose module functional description information matches the user-entered functional requirements, and whose dependencies are marked as necessary for building the system are marked as necessary for building the system.

[0064] Step S22: Delete the software modules other than the necessary software modules in the reference dependency graph to obtain a minimized dependency graph corresponding to the target hardware information and the functional requirement information.

[0065] Optionally, after determining the necessary software modules required to build the system, delete the software modules other than the necessary software modules in the reference dependency graph, as well as the dependency relationships of the software modules other than the necessary software modules, to obtain a minimized dependency graph corresponding to the target hardware information and functional requirement information.

[0066] In the method according to the present invention, reverse traversal based on the root node can reversely decouple the complex dependencies between multiple software modules, accurately traversing all software modules and ensuring the comprehensiveness and accuracy of information matching. Trimming software modules and dependencies other than essential software modules in the reference dependency graph can remove redundant software modules and optimize resource utilization efficiency.

[0067] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. For example, Figure 3 This is a flow chart of the third method for automatically constructing a real-time system module based on a dependency graph provided in an embodiment of the present application. The method specifically includes the following steps:

[0068] Step S31 : A unified parameter mapping mechanism is used to establish a mapping relationship between each software module and hardware parameters in the hardware abstraction layer.

[0069] As you can understand, the hardware abstraction layer and platform adaptation layer are indispensable components of the system. The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuitry, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, providing the operating system with a virtual hardware platform, 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. Its primary function is to handle differences between the operating system and the hardware, ensuring that the operating system can run properly on different hardware platforms.

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

[0071] Step S32: creating a platform adaptation layer of the system according to the mapping relationship.

[0072] Optionally, automated code generation can be used to convert the mapping between software modules and hardware parameters in the hardware abstraction layer into executable code files for the platform adaptation layer. This platform adaptation layer provides a unified interface that shields underlying hardware differences and decouples business logic from hardware.

[0073] In the method according to the present invention, the hardware abstraction layer and platform adaptation layer necessary for system construction can be generated. Moreover, the mapping relationship between each software module and hardware parameters in the hardware abstraction layer established by the present invention using a unified parameter mapping mechanism can support complex one-to-many and many-to-one scenarios 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 decoupling between business logic and hardware.

[0074] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. For example, Figure 4 This is a fourth flow chart of a method for automatically constructing a real-time system module based on a dependency graph provided in an embodiment of the present application. The method specifically includes the following steps:

[0075] 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 transfer rule.

[0076] Optionally, when compiling the system script, each essential software module is compiled sequentially according to the compilation order in the system script. During the compilation process, compilation options such as conditional compilation, optimization level, debugging information, and target platform can be dynamically adjusted according to the transmission rules of the configuration information of each essential software module, thereby improving the flexibility and cross-platform capabilities of the system.

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

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

[0079] Optionally, symbol reference integrity can be checked during the link process, for example, by recording and handling unresolved symbols to ensure that all external references are correctly resolved.

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

[0081] According to another aspect of the present invention, another method for automatically constructing real-time system modules based on a dependency graph is provided. For example, Figure 5 This is a fifth flow chart of a method for automatically constructing a real-time system module based on a dependency graph provided in an embodiment of the present application. The method specifically includes the following steps:

[0082] Step S51 : determining the necessary software modules that have been compiled and have not been changed based on the changes in the source codes or dependency relationships of the necessary software modules.

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

[0084] Optionally, during the system script compilation process, for the compiled essential software modules, changes to the source code or dependencies of each essential software module can be determined using hash values ​​or timestamps. If the source code or dependencies of the essential software module have not changed, it indicates that the essential software module has not changed, i.e., the essential software module is a compiled and unchanged essential software module.

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

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

[0087] like Figure 6 As shown, the solution of the present invention is summarized and explained, which mainly includes the following three stages:

[0088] Phase 1: Dependency description and relationship analysis

[0089] S101: Create a module dependency description configuration file based on the hardware feature description (hardware parameters), module function identifier (function description information), and inter-module dependency relationships.

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

[0091] S103: Analyze the dependency relationships between modules and construct an initial dependency graph corresponding to multiple software modules.

[0092] Phase 2: Hardware Adaptation and Parameter Binding

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

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

[0095] Phase 3: Build Execution

[0096] S4: Generate a system script, compile the system script, obtain a system image file, and complete the parameterized build process.

[0097] like Figure 7 As shown in the figure, a system construction process is provided for a specific application scenario:

[0098] 1. Requirements input: The user specifies the target hardware platform and functional requirement parameters (i.e., inputs the target hardware information and functional requirement information).

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

[0100] 3. Dependency parsing: Analyze the dependencies of multiple software modules and build an initial dependency graph. Incompatible software modules can be further filtered out to obtain a reference dependency graph.

[0101] 4. Component graph optimization: The reference dependency graph is trimmed based on the target hardware information input by the user to generate a minimized build plan (necessary software modules in the reference dependency graph and the remaining software modules are deleted to obtain a minimized dependency graph).

[0102] 5. Parameter binding, compilation and linking to generate system image: Establish the mapping relationship between each software module and hardware parameters in the hardware abstraction layer, and create the system platform adaptation layer based on 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 the specific hardware platform.

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

[0104] The module description layer is used to maintain standardized configuration files and define hardware characteristics (hardware parameters) and function identifiers (function description information).

[0105] Dependency resolution engine, used to build and optimize module dependency graphs and resolve relationships between modules (i.e., build initial dependency graphs and reference dependency graphs).

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

[0107] 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 a mapping relationship between each software module in the hardware abstraction layer and the hardware parameters; and create the system's platform adaptation layer based on the mapping relationship).

[0108] Reference below Figure 9 , which shows a structural diagram of a computer system 600 suitable for implementing a terminal device or server of an embodiment of the present application.

[0109] like Figure 9 As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of system 600 are also stored in RAM 603. 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 bus 604.

[0110] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, mouse, and the like; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 608 including devices such as a hard disk; and a communication section 609 including a network interface card such as a LAN card or a modem. 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. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that computer programs read from the removable media can be installed in the storage section 608 as needed.

[0111] In particular, according to the embodiments of the present disclosure, the above reference Figure 1The described processes may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising instructions for executing Figure 1 In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 609 and / or installed from the removable medium 611 .

[0112] It should be noted that the computer-readable medium described herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, or any suitable combination thereof.

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

[0114] The units or modules involved in the embodiments described in this application may be implemented in software or hardware. The units or modules described may also be provided in a processor. The names of these units or modules do not, in certain circumstances, constitute limitations on the units or modules themselves.

[0115] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently without being assembled into the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application. For example, it can be executed Figures 1 to 5 The steps of any of the methods shown.

[0116] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the embodiment of the present application is executed. For example, you can execute Figures 1 to 5 The steps of any of the methods shown.

[0117] 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 above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. 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), magnetic 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 take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0118] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in this application.

Claims

1. A method for automatically building modular real-time systems based on dependency graphs, characterized in that: The method comprises: A configuration file is constructed using a unified file format, wherein the configuration file includes configuration information of multiple software modules, wherein the configuration information of each software module includes module function description information, hardware parameters adapted by the software module, and dependencies between the software module and other software modules; generating an initial dependency graph corresponding to the plurality of software modules according to the dependency relationships between the software modules in the configuration file; performing version matching on the hardware parameters and the module function description information, filtering out software modules incompatible with the hardware parameter versions in the initial dependency graph, and obtaining a reference dependency graph; Receive target hardware information and functional requirement information input by a user, and determine a minimized dependency graph that matches the target hardware information and functional requirement information based on the target hardware information, the functional requirement information, and the reference dependency graph, including: starting from a root node included in the reference dependency graph, traversing each software module in the reference dependency graph in reverse order, determining software modules whose hardware parameters match the target hardware information, whose module functional description information matches the functional requirement information, and which have a dependency relationship, and marking them as necessary software modules; deleting software modules other than the necessary software modules in the reference dependency graph to obtain a minimized dependency graph corresponding to the target hardware information and functional requirement information; wherein the minimized dependency graph includes multiple necessary software modules that are compatible with the target hardware information and functional requirement information; Filtering configuration information corresponding to the multiple necessary software modules from the configuration file to generate a target configuration file; constructing a system script based on the minimized dependency graph and the target configuration file, compiling the system script to generate a system image file, including: the system script adopts a cross-platform format, the compilation order of the multiple necessary software modules, and the transfer rules and linking rules of the configuration information of each necessary software module; compiling each of the necessary software modules in sequence according to the compilation order, and adjusting the compilation options of each of the necessary software modules according to the transfer rules; linking the compiled necessary software modules according to the linking rules to generate the system image file; The method further comprises: using a unified parameter mapping mechanism to establish a mapping relationship between each software module and hardware parameters in the hardware abstraction layer; and creating a platform adaptation layer of the system according to the mapping relationship.

2. The method according to claim 1, characterized in that The structure of the reference dependency graph is a directed acyclic graph structure, and the method further includes: A plurality of software modules in the reference dependency graph are topologically sorted based on the structure of the reference dependency graph.

3. The method according to claim 1, characterized in that The method further comprises: Determining the necessary software modules that have been compiled and have not been changed based on changes in the source code or dependency relationships of the necessary software modules; Reuse the compilation results of the necessary software modules that have been compiled and unchanged.

4. The method according to claim 1, wherein The method further comprises: For each of the software modules, establishing an association relationship between the software module and the configuration information and source code; A module resource library is constructed 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.

5. The method according to claim 4, characterized in that The module classification management mode includes classification according to module function description information or classification according to hardware platform.

6. A computer system comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 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