A method and apparatus for generating components of a target software module, and an electronic device

By constructing graphs and generating data models, the problem of time-consuming and labor-intensive adaptation of framework code files in software module development has been solved, achieving efficient generation of adaptation code files and reducing development costs.

CN116009830BActive Publication Date: 2026-07-31GUOKE FOUNDATION STONE (CHONGQING) SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUOKE FOUNDATION STONE (CHONGQING) SOFTWARE CO LTD
Filing Date
2022-12-16
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

When developing software modules based on a framework, developers need to spend a lot of time and effort learning and adapting the framework code files, resulting in excessive time and manpower costs.

Method used

The target software module's graph is constructed through mapping operations, a data model is generated, and code files for the adapted framework are efficiently generated based on this model.

Benefits of technology

It reduces the time and effort required to develop code files for the adaptation framework and improves the efficiency of software module development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116009830B_ABST
    Figure CN116009830B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, electronic device, and storage medium for generating components of a target software module. The method for generating components of a target software module includes: in response to a graph-building operation, acquiring information about the target software module and constructing a first graph of the target software module; the first graph includes a first node, at least one second node, and edges, where the first node corresponds to the target software module, the second node represents component content information of the target software module, and the edges represent the association information between the first node and the second node; the target software module is developed based on a first software framework; a first data model is generated based on the first graph; wherein the first data model uses a preset format corresponding to the first software framework; the first data model is used to represent the component content information of the target software module and the association information between the target software module and the component content information; and components of the target software module are generated based on the first data model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of software development, and more particularly to a method, apparatus, electronic device, and storage medium for generating components of a target software module. Background Technology

[0002] Currently, software module development relies on various frameworks, such as ROS1, ROS2, Cyber ​​RT, and vendor-developed frameworks. In the process of developing software modules based on these frameworks, developers need to develop not only the software module's own source code (including C / C++ header files and C / C++ source files), but also code files adapted to the framework.

[0003] Typically, software module developers are familiar with the implementation or algorithms of their own software module's source code, but not with the code files for adapting to various frameworks. Developing based on a specific framework often involves a large number of code files related to framework adaptation, requiring developers to invest a lot of energy and time in learning them. Furthermore, the workload of developing code files for framework adaptation is substantial, resulting in excessively high time and manpower costs for framework adaptation during the software module development process.

[0004] Therefore, in the process of developing software modules based on a framework, how to efficiently generate code files that adapt to the framework is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, electronic device, and storage medium for generating components of a target software module.

[0006] According to a first aspect of the present disclosure, a method for generating components of a target software module is provided, comprising: in response to a graph-building operation, acquiring information of the target software module and constructing a first graph of the target software module; wherein the first graph includes a first node, at least one second node, and edges, the first node corresponding to the target software module, the second node representing component content information of the target software module, and the edges representing association information between the first node and the second node; the target software module is developed based on a first software framework; generating a first data model based on the first graph; wherein the first data model uses a preset format corresponding to the first software framework; the first data model is used to represent the component content information of the target software module and the association information between the target software module and the component content information; and generating components of the target software module based on the first data model.

[0007] In some embodiments, the mapping operation includes: inputting a string in the editing interface of the second graphical component representing the second node; obtaining information about the target software module includes: receiving the string; and obtaining component content information of the target software module represented by the second node based on the string.

[0008] In some embodiments, the mapping operation includes: inputting the name of the component content information of the target software module in the editing interface of the second graphical component representing the second node; obtaining the information of the target software module includes: receiving the name of the component content information; and obtaining the stored component content information represented by the second node based on the name of the component content information.

[0009] In some embodiments, the mapping operation includes: connecting a first graphic component representing the first node and a second graphic component representing the second node using connecting lines carrying annotation information; obtaining information about the target software module includes: obtaining the annotation information carried by the connecting lines; and obtaining the association information between the first node and the second node based on the annotation information.

[0010] In some embodiments, the components of the target software module include a first component, which is a code file; generating the components of the target software module according to the first data model includes: obtaining component content information of the first component from the first data model; and writing the component content information into the first component.

[0011] In some embodiments, the components of the target software module include a second component, which is source code; generating the components of the target software module according to the first data model includes: obtaining first component content information of the second component from the first data model; wherein the first component content information includes at least one of header file information contained in the second component and class information in the first software framework corresponding to the second component; and writing the first component content information into the second component.

[0012] In some embodiments, the method further includes: obtaining second component content information of the second component from the first data model; wherein the second component content information is the content information of the first function in the second component; and writing the second component content information into the second component.

[0013] According to a second aspect of the present disclosure, an apparatus for generating components of a target software module is provided, comprising a construction module configured to, in response to a graph-building operation, acquire information of the target software module and construct a first graph of the target software module; wherein the first graph includes a first node, at least one second node, and edges, the first node corresponding to the target software module, the second node representing component content information of the target software module, and the edges representing association information between the first node and the second node; the target software module is developed based on a first software framework; a first generation module configured to generate a first data model based on the first graph; wherein the first data model uses a preset format corresponding to the first software framework; the first data model is used to represent the component content information of the target software module and the association information between the target software module and the component content information; and a second generation module configured to generate components of the target software module based on the first data model.

[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement a method for generating components of a target software module provided in the first aspect of the present disclosure.

[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the steps of the method for generating components of a target software module provided in the first aspect of the present disclosure.

[0016] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: In the embodiments provided by this disclosure, in response to the mapping operation, information of the target software module is obtained, and a first map of the target software module is constructed; based on the first map, a first data model is generated; based on the first data model, components of the target software module are generated. This allows for the efficient generation of code files adapted to the framework during the development of software modules based on the framework.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0019] Figure 1 This is a flowchart illustrating a method for generating components of a target software module according to an exemplary embodiment.

[0020] Figure 2 This is a flowchart illustrating a method for obtaining information about a target software module according to an exemplary embodiment.

[0021] Figure 3 This is a flowchart illustrating a method for obtaining information about a target software module according to yet another exemplary embodiment.

[0022] Figure 4 This is a flowchart illustrating a method for obtaining information about a target software module according to another exemplary embodiment.

[0023] Figure 5 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to an exemplary embodiment.

[0024] Figure 6 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to yet another exemplary embodiment.

[0025] Figure 7 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to another exemplary embodiment.

[0026] Figure 8 This is a schematic diagram of a first map according to an exemplary embodiment.

[0027] Figure 9 This is a schematic diagram of the first map according to yet another exemplary embodiment.

[0028] Figure 10A This is a schematic diagram of a first data model according to an exemplary embodiment.

[0029] Figure 10B This is a schematic diagram of a second component according to an exemplary embodiment.

[0030] Figure 11 This is a schematic diagram of a second component according to yet another exemplary embodiment.

[0031] Figure 12 This is a block diagram illustrating an apparatus for generating components of a target software module according to an exemplary embodiment.

[0032] Figure 13 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0033] The exemplary embodiments will now be described in detail with reference to the accompanying drawings.

[0034] It should be noted that the relevant embodiments and accompanying drawings are only for describing and illustrating exemplary embodiments provided by this disclosure, and not all embodiments of this disclosure, nor should this disclosure be understood to be limited to the relevant exemplary embodiments.

[0035] It should be noted that the terms "first," "second," etc., used in this disclosure are only used to distinguish different steps, devices, or modules. These terms do not represent any specific technical meaning, nor do they indicate any order or interdependence between them.

[0036] It should be noted that the terms “a,” “a plurality of,” and “at least one” used in this disclosure are illustrative rather than restrictive. Unless otherwise expressly indicated in the context, they should be understood as “one or more.”

[0037] It should be noted that the term "and / or" used in this disclosure is used to describe the relationship between related objects, and generally indicates that there are at least three relationships. For example, A and / or B can at least indicate: the existence of A alone, the existence of both A and B, and the existence of B alone.

[0038] It should be noted that the various steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Unless otherwise specified, the scope of this disclosure is not limited by the order in which the steps are described in the relevant embodiments.

[0039] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.

[0040] Exemplary methods

[0041] Figure 1 This is a flowchart illustrating a method for generating components of a target software module according to an exemplary embodiment.

[0042] Reference Figure 1 As shown, the method for generating components of a target software module provided in this embodiment includes the following steps: S110, S120, and S130. This method can be implemented using web-based cloud-native tools or desktop-based applications.

[0043] In step S110, in response to the mapping operation, information about the target software module is obtained, and the first map of the target software module is constructed.

[0044] In practice, users can perform drawing operations in various ways. For example, users can draw graphics on the screen using a mouse, touchscreen, or other similar devices.

[0045] In some embodiments, users can build a knowledge graph by dragging and dropping nodes to construct the first knowledge graph of the target software module. A knowledge graph is a graph-based data structure composed of nodes and edges. Each node represents an "entity," and each edge represents a "relationship" between entities. Essentially, a knowledge graph is a semantic network.

[0046] The first graph includes a first node, at least one second node, and edges. The first node corresponds to the target software module, the second node represents the component content information of the target software module, and the edges represent the association information between the first node and the second node.

[0047] The target software module is a software module developed based on the first software framework. The target software module may include, but is not limited to: autonomous driving algorithm modules (e.g., perception modules, localization modules, etc.), vehicle sensor driver modules (e.g., camera driver modules, radar driver modules, etc.), vehicle-side toolchain modules (e.g., data flow visualization modules, data flow monitoring modules, etc.), etc.

[0048] The first software framework includes various open-source frameworks (e.g., ROS1, ROS2, Cyber ​​RT, etc.) as well as various frameworks developed by vendors themselves.

[0049] The information about the target software module may include, but is not limited to, the name of the target software module and its component content information. In specific implementations, this information can be obtained in various ways. For example, the name of the target software module can be obtained from the string input by the user into the graphic area corresponding to the first node during the drawing operation. See [link to example for details on obtaining target software module information] Figure 2 , Figure 3 and Figure 4 The contents of that article will not be repeated here.

[0050] The components of the target software module may include, but are not limited to: source code, code files, etc.

[0051] The source code is used to implement the functionality of the target software module, such as location and navigation functions. The source code can be implemented using various programming languages, such as C and C++.

[0052] The code files include various files adapted to the first software framework. For example, the first software framework is the Cyber ​​RT framework, and the code files may include: BUILD files for compiling and building C / C++ header and source files; DAG files for representing the data streams subscribed to and published to the target software module; and launch files for starting the target software module, etc.

[0053] The component content information of the target software module may include the content required to implement each component of the target software module, such as various functions in the source code (initialization functions, data stream processing functions, etc.), as well as information on input data streams and output data streams (e.g., topics in ROS, channels in Cyber ​​RT, etc.).

[0054] The relationship information between the first node and the second node may include, but is not limited to: the input and output relationship between the target software module and the component content information, such as the subscription and publication relationship between the target software module and the data stream; the specific implementation relationship between the target software module and the component content information, such as the component content information of component A being the initialization function of the target software module, and the component content information of component B being the data stream processing function of the target software module.

[0055] As an example, users can obtain knowledge graph nodes by dragging and dropping them on the web page. Figure 8 The first graph shown includes a first node corresponding to the data flow monitoring module and five second nodes (only five are shown for ease of description, but there may be many in actual applications). From this first graph, the component content information required for developing the data flow monitoring module can be obtained, such as the initialization function in the source code, and the input data flow information and output data flow information included in the code file.

[0056] In step S120, a first data model is generated based on the first map.

[0057] The first data model is used to represent the component content information of the target software module, as well as the relationship information between the target software module and the component content information.

[0058] In practice, the first data model can be implemented using a programming language compatible with the first software framework. The first data model uses a preset format corresponding to the first software framework. For example, if the first software framework is Cyber ​​RT, the first data model can be a JSON or XML data model.

[0059] As an example only, according to Figure 8 The first map shown can generate a map like this. Figure 10A The first data model shown includes content information of source code components (e.g., initialization function name, initialization function code, etc.), content information of code file components (e.g., BUILD file) (e.g., input data stream 1 type, data stream 1 name, etc.), and association information between target software modules and component content information (e.g., initialization, subscription data, etc.).

[0060] In practical implementation, a first data model can be generated based on the first graph in various ways. As an example only, the processing device can respond to the clicking of a control (e.g., a button) displayed on the web and generate a JSON or XML data model based on the content of the first graph, which will serve as the first data model.

[0061] In step S130, components of the target software module are generated based on the first data model.

[0062] In the specific implementation process, the relevant component content information can be obtained from the first data model (for example, it can be obtained using a batch program implemented with a scripting language) according to the content that the components of the target software module need to implement, and the component content information can be written into the corresponding component.

[0063] As an example only, implementation Figure 10B The "cc_binary" structure in the BUILD file template shown requires the name of the library (lib) to be specified. This can be found in [the documentation / source]. Figure 10A In the first data model shown, obtain the "Data Flow Monitoring Module" and write the field "name = lib_Data Flow Monitoring Module.so" into the BUILD file.

[0064] For several embodiments regarding the generation of components of the target software module based on the first data model, see [link to relevant documentation]. Figure 5 , Figure 6 , Figure 7 The contents of that article will not be repeated here.

[0065] In the embodiments provided in this disclosure, in response to the mapping operation, information of the target software module is obtained, and a first map of the target software module is constructed. This allows the acquisition of information about the target software module provided by the user during the mapping operation and provides developers with a clear view of the relationship between the target software module and its component content information. Based on the first map, a first data model is generated. Based on the first data model, components of the target software module are generated. This eliminates the need for developers to spend a lot of time and effort developing various files for adapting to the framework, effectively reducing the development cost of adapting the target software module to various frameworks.

[0066] Figure 2 This is a flowchart illustrating a method for obtaining information about a target software module according to an exemplary embodiment.

[0067] like Figure 2 As shown, the method includes the following steps:

[0068] In step S210, a string is received.

[0069] In this embodiment, the mapping operation includes: entering a string in the editing interface of the second graphical component representing the second node.

[0070] The second graphic component can include, but is not limited to: circles, squares, rectangles, triangles, etc. For example, in... Figure 8 In the first graphic shown, the second graphic component is a circle.

[0071] In practice, the string can be retrieved from the storage area (e.g., the keyboard buffer) of the processing device used to store the string input by the user.

[0072] In step S220, the component content information of the target software module represented by the second node is obtained based on the string.

[0073] As an example only, when a user enters the name (e.g., "Messages") and type (e.g., "geometry_msgs / Point") of data stream 1 represented by a string in the editing interface of the second graphical component A corresponding to the second node A, the content information of the component represented by the second node can be obtained from the string: "Messages" and "geometry_msgs / Point".

[0074] In the embodiments provided in this disclosure, a string input in the editing interface of a second graphical component representing a second node is received; based on the string, component content information of the target software module represented by the second node is obtained. Thus, component content information of the target software module provided by the developer can be received through the editing interface of the graphical component.

[0075] Figure 3 This is a flowchart illustrating a method for obtaining information about a target software module according to yet another exemplary embodiment.

[0076] like Figure 3 As shown, the method includes the following steps:

[0077] In step S310, the name of the component content information is received.

[0078] In this embodiment, the mapping operation includes: entering the name of the component content information of the target software module in the editing interface of the second graphical component representing the second node. For a detailed description of the second graphical component, see [link to documentation]. Figure 2 The relevant content will not be repeated here.

[0079] For common component content information, such as various information about data streams (e.g., the type of data stream) such as topics in ROS and channels in Cyber ​​RT, it can be obtained by the name of the component content information.

[0080] In practice, the name of the component content information can be obtained from the storage area (e.g., the keyboard buffer) of the processing device used to store the string that the user inputs to represent the name of the component content information.

[0081] In step S320, the component content information represented by the stored second node is obtained according to the name of the component content information.

[0082] In the specific implementation process, common component content information can be obtained and stored in advance. After obtaining the name of the component content information in step S310, the corresponding component content information can be obtained from the database or from other storage media according to the name.

[0083] In some embodiments, the component content information in the first knowledge graph can be stored after each construction of the first knowledge graph.

[0084] In the embodiments provided in this disclosure, the name of the component content information is received; based on the name of the component content information, the component content information represented by the stored second node is obtained. Developers only need to input the name of the component content information required for the target software module into the corresponding graphical component, without needing to provide more component content information. This saves developers time in understanding the component content information and makes it easier for them to create graphs.

[0085] Figure 4 This is a flowchart illustrating a method for obtaining information about a target software module according to another exemplary embodiment.

[0086] like Figure 4 As shown, the method includes the following steps:

[0087] In step S410, the annotation information carried by the connecting line is obtained.

[0088] In this embodiment, the mapping operation includes: connecting a first graphic component representing a first node and a second graphic component representing a second node using connecting lines carrying annotation information.

[0089] The annotation information is used to indicate the relationship between the first node and the second node. For example... Figure 8 As shown, the labeling information of the connection line connecting the first node (corresponding to the data flow monitoring module) and the second node (corresponding to input data flow 1) is "subscribed data".

[0090] In practice, connection lines carrying annotation information can be obtained in various ways. For example, users can input annotation information in the editing area corresponding to the connection line. Alternatively, the processing device can provide multiple connection lines with annotation information on the display interface used for mapping, allowing the user to select from them.

[0091] In step S420, the association information between the first node and the second node is obtained based on the annotation information.

[0092] In practice, the content represented by the annotation information can be used as the association between the first node and the second node. For example, such as Figure 8 As shown, the relationship between the first and second nodes, connected by a line labeled "Published Data", is: Published Data.

[0093] In the embodiments provided in this disclosure, the annotation information carried by the connecting line is obtained; based on the annotation information, the association information between the first node and the second node is obtained. This not only makes it convenient to obtain the association information between the first node and the second node, but also provides developers with a clear view showing the association between the target development module and the component content information.

[0094] Figure 5 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to an exemplary embodiment.

[0095] like Figure 5 As shown, the method includes the following steps:

[0096] In step S510, the component content information of the first component is obtained from the first data model.

[0097] In this embodiment, the target software module includes a first component, which is a code file. For example, the first component can be a BUILD file. Alternatively, the first component can be a launch file.

[0098] As an example only, the first component is as follows: Figure 10B The BUILD file shown requires the following component content information for the first component: fields such as "name", "srcs", and "hdrs" in the cc_library structure; and fields such as "name" and "deps" in the cc_binary structure. This information can be obtained from... Figure 10A The corresponding component content information is obtained from the first data model shown: name = "Data Flow Monitoring Module_lib", srcs = {"Data Flow Monitoring Module.cc"}, hdrs = {"Data Flow Monitoring Module_lib"}, etc.

[0099] In step S520, the component content information is written into the first component.

[0100] In the specific implementation process, the component content information can be written into the first component in a variety of ways. For example, the component content information in the above example can be written into the BUILD file using a batch processing tool.

[0101] In the publicly provided embodiments, component content information of the first component is obtained from the first data model; the component content information is then written into the first component. This allows for the automatic generation of code files based on the first data model, eliminating the need for developers to spend time and effort developing code files adapted to the first software framework, effectively saving development costs.

[0102] Figure 6 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to yet another exemplary embodiment.

[0103] like Figure 6 As shown, the method includes the following steps:

[0104] In step S610, the content information of the first component of the second component is obtained from the first data model.

[0105] In this embodiment, the target software module includes a second component, which is source code.

[0106] The content information of the first component includes at least one of the following: header file information contained in the second component, and class information in the first software framework corresponding to the second component. This is merely an example. Figure 11 The source code shown requires component information including: header file information (#include "xxx"), class information in the first software framework (bool xxx class), etc., which can be obtained from... Figure 10A The corresponding component content information is obtained from the first data model shown: #include "Data Flow Monitoring Module.h", bool Data Flow Monitoring Module Class, etc.

[0107] In step S620, the content information of the first component is written into the second component.

[0108] In the specific implementation process, the component content information can be written into the first component in a variety of ways. For example, the component content information in the above example can be written into the BUILD file using a batch processing tool.

[0109] In the embodiments provided in this disclosure, the content information of the first component, which is the source code of the second component, is obtained from the first data model. The content information of the first component includes at least one of the header file information contained in the second component and the class information in the first software framework corresponding to the second component. The content information of the first component is then written into the second component. This allows developers to focus on writing functions in the source code without needing to understand the header file information, class information, etc., that need to be included in the source code to adapt to the first software framework, effectively saving development costs.

[0110] Figure 7 This is a flowchart illustrating a method for generating components of a target software module based on a first data model, according to another exemplary embodiment.

[0111] like Figure 7 As shown, the method includes the following steps:

[0112] In step S710, the content information of the first component of the second component is obtained from the first data model.

[0113] In this embodiment, the target software module includes a second component, which is source code.

[0114] For a detailed description of this step, please refer to step S610, which will not be repeated here.

[0115] In step S720, the content information of the first component is written into the second component.

[0116] For a detailed description of this step, please refer to step S710, which will not be repeated here.

[0117] In step S730, the content information of the second component of the second component is obtained from the first data model.

[0118] The content information of the second component is the content information of the first function within the second component. The first function is a function in the source code, such as an initialization function or a data processing function. This is just an example. Figure 9 The first diagram shown includes an edit box for inputting code. Developers can write the content of the first function into the edit box, and the processing device can obtain the content information of the second component, i.e., the content of the first function, through the content in the edit box.

[0119] In step S740, the content information of the second component is written into the second component.

[0120] In practical implementation, the content of the first function obtained in step S730 can be written into the second component through copying or automated insertion via script. For example, if the first function is an initialization function, its content can be filled into a second component. Figure 11 The source code shown is in the init(){xxx} function.

[0121] In the embodiments provided in this disclosure, the content information of the second component is obtained from the first data model; wherein, the content information of the second component is the content information of the first function in the second component; the content information of the second component is written into the second component. This allows developers to view a complete target software module and generate source code based on this view.

[0122] Exemplary device

[0123] Figure 12 This is a block diagram illustrating an apparatus for generating components of a target software module according to an exemplary embodiment. (Refer to...) Figure 12 The device 1200 includes a construction module 1210, a first generation module 1220, and a second generation module 1230.

[0124] The construction module 1210 is used to respond to the graph construction operation, obtain information about the target software module, and construct a first graph of the target software module. The first graph includes a first node, at least one second node, and edges. The first node corresponds to the target software module, the second node represents component content information of the target software module, and the edges represent the association information between the first node and the second node. The target software module is developed based on a first software framework. For details on the specific processing of this module and its technical effects, please refer to the relevant description in step S110, which will not be repeated here.

[0125] The first generation module 1220 is used to generate a first data model based on the first map; wherein the first data model uses a preset format corresponding to the first software framework; the first data model is used to represent the component content information of the target software module, and the association information between the target software module and the component content information. For details on the specific processing of this module and its resulting technical effects, please refer to the relevant description in step S120, which will not be repeated here.

[0126] The second generation module 1230 is used to generate components of the target software module based on the first data model. For details on the specific processing of this module and its resulting technical effects, please refer to the relevant description in step S130, which will not be repeated here.

[0127] In some embodiments, the mapping operation includes: inputting a string in the editing interface of the second graphical component representing the second node; obtaining information about the target software module includes: receiving the string; and obtaining component content information of the target software module represented by the second node based on the string.

[0128] In some embodiments, the mapping operation includes: inputting the name of the component content information of the target software module in the editing interface of the second graphical component representing the second node; obtaining the information of the target software module includes: receiving the name of the component content information; and obtaining the stored component content information represented by the second node based on the name of the component content information.

[0129] In some embodiments, the mapping operation includes: connecting a first graphic component representing the first node and a second graphic component representing the second node using connecting lines carrying annotation information; obtaining information about the target software module includes: obtaining the annotation information carried by the connecting lines; and obtaining the association information between the first node and the second node based on the annotation information.

[0130] In some embodiments, the components of the target software module include a first component, which is a code file; generating the components of the target software module according to the first data model includes: obtaining component content information of the first component from the first data model; and writing the component content information into the first component.

[0131] In some embodiments, the components of the target software module include a second component, which is source code; generating the components of the target software module according to the first data model includes: obtaining first component content information of the second component from the first data model; wherein the first component content information includes at least one of header file information contained in the second component and class information in the first software framework corresponding to the second component; and writing the first component content information into the second component.

[0132] In some embodiments, the method further includes: obtaining second component content information of the second component from the first data model; wherein the second component content information is the content information of the first function in the second component; and writing the second component content information into the second component.

[0133] Exemplary electronic devices

[0134] Figure 13 This is a block diagram illustrating an electronic device 1300 according to an exemplary embodiment. The electronic device 1300 may be a vehicle controller, an in-vehicle terminal, an in-vehicle computer, or other types of electronic devices.

[0135] Reference Figure 13The electronic device 1300 may include at least one processor 1310 and a memory 1320. The processor 1310 can execute instructions stored in the memory 1320. The processor 1310 is communicatively connected to the memory 1320 via a data bus. In addition to the memory 1320, the processor 1310 may also be communicatively connected to an input device 1330, an output device 1340, and a communication device 1350 via the data bus.

[0136] Processor 1310 can be any conventional processor, such as a commercially available CPU. The processor may also include, for example, a Graphics Processing Unit (GPU), a Field Programmable Gate Array (FPGA), a System on Chip (SOC), an Application Specific Integrated Circuit (ASIC), or a combination thereof.

[0137] The memory 1320 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0138] In this embodiment of the present disclosure, the memory 1320 stores executable instructions, and the processor 1310 can read the executable instructions from the memory 1320 and execute the instructions to implement all or part of the steps of the method for generating components of the target software module in any of the exemplary embodiments described above.

[0139] Exemplary computer-readable storage media

[0140] In addition to the methods and apparatus described above, exemplary embodiments of this disclosure may also be a computer program product or a computer-readable storage medium storing the computer program product. The computer product includes computer program instructions that can be executed by a processor to perform all or part of the steps described in any of the methods in the exemplary embodiments described above.

[0141] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages, and scripting languages ​​(e.g., Python). The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0142] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media include: static random access memory (SRAM) having one or more electrically connected wires, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk, or any suitable combination thereof.

[0143] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0144] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method of generating components of a target software module, characterized by, include: In response to the graph building operation, information of the target software module is obtained, and a first graph of the target software module is constructed; wherein, the first graph includes a first node, at least one second node, and edges, the first node corresponds to the target software module, the second node represents the component content information of the target software module, and the edges represent the association information between the first node and the second node; the target software module is developed based on a first software framework; Based on the first map, a first data model is generated; wherein, the first data model uses a preset format corresponding to the first software framework; the first data model is used to represent the component content information of the target software module, and the association information between the target software module and the component content information; Based on the first data model, generate the components of the target software module; The step of generating the components of the target software module according to the first data model includes: obtaining component content information of the components of the target software module from the first data model, and writing the component content information into the components.

2. The method of claim 1, wherein, The mapping operation includes: entering a string in the editing interface of the second graphical component representing the second node; The process of obtaining information about the target software module includes: Receive the string; Based on the string, the component content information of the target software module represented by the second node is obtained.

3. The method for generating components of the target software module according to claim 1, characterized in that, The mapping operation includes: entering the name of the component content information of the target software module in the editing interface of the second graphical component representing the second node; The process of obtaining information about the target software module includes: The name of the component content information received; Based on the name of the component content information, the stored component content information represented by the second node is obtained.

4. The method for generating components of the target software module according to claim 1, characterized in that, The mapping operation includes: connecting a first graphic component representing the first node and a second graphic component representing the second node using connecting lines carrying annotation information; The acquisition of information about the target software module includes: Obtain the annotation information carried by the connecting line; Based on the annotation information, the association information between the first node and the second node is obtained.

5. The method for generating components of the target software module according to claim 1, characterized in that, The target software module includes a first component, which is a code file; The components for generating the target software module based on the first data model include: Obtain the component content information of the first component from the first data model; Write the component content information into the first component.

6. The method for generating components of the target software module according to claim 5, characterized in that, The target software module includes a second component, which is source code; The components for generating the target software module based on the first data model include: Obtain the first component content information of the second component from the first data model; wherein, the first component content information includes at least one of the header file information contained in the second component and the class information in the first software framework corresponding to the second component; Write the content information of the first component into the second component.

7. The method for generating components of the target software module according to claim 6, characterized in that, The method further includes: Obtain the second component content information of the second component from the first data model; wherein, the second component content information is the content information of the first function in the second component; Write the content information of the second component into the second component.

8. An apparatus for generating components of a target software module, characterized in that, The device includes: A construction module is used to respond to a graph construction operation, obtain information about the target software module, and construct a first graph of the target software module; wherein the first graph includes a first node, at least one second node, and edges, the first node corresponds to the target software module, the second node represents the component content information of the target software module, and the edges represent the association information between the first node and the second node; the target software module is developed based on a first software framework; A first generation module is configured to generate a first data model based on the first map; wherein the first data model uses a preset format corresponding to the first software framework; the first data model is configured to represent the component content information of the target software module, and the association information between the target software module and the component content information; The second generation module is used to generate components of the target software module based on the first data model; The second generation module is further configured to: obtain component content information of the components of the target software module from the first data model, and write the component content information into the component.

9. The apparatus for generating components of a target software module according to claim 8, characterized in that, The mapping operation includes: entering a string in the editing interface of the second graphical component representing the second node; The process of obtaining information about the target software module includes: Receive the string; Based on the string, the component content information of the target software module represented by the second node is obtained.

10. The apparatus for generating components of a target software module according to claim 8, characterized in that, The mapping operation includes: entering the name of the component content information of the target software module in the editing interface of the second graphical component representing the second node; The process of obtaining information about the target software module includes: The name of the component content information received; Based on the name of the component content information, the stored component content information represented by the second node is obtained.

11. The apparatus for generating components of a target software module according to claim 8, characterized in that, The mapping operation includes: connecting a first graphic component representing the first node and a second graphic component representing the second node using connecting lines carrying annotation information; The acquisition of information about the target software module includes: Obtain the annotation information carried by the connecting line; Based on the annotation information, the association information between the first node and the second node is obtained.

12. The apparatus for generating components of a target software module according to claim 8, characterized in that, The target software module includes a first component, which is a code file; The components for generating the target software module based on the first data model include: Obtain the component content information of the first component from the first data model; Write the component content information into the first component.

13. The apparatus for generating components of a target software module according to claim 12, characterized in that, The target software module includes a second component, which is source code; The components for generating the target software module based on the first data model include: Obtain the first component content information of the second component from the first data model; wherein, the first component content information includes at least one of the header file information contained in the second component and the class information in the first software framework corresponding to the second component; Write the content information of the first component into the second component.

14. The apparatus for generating components of a target software module according to claim 13, characterized in that, The component for generating the target software module based on the first data model further includes: Obtain the second component content information of the second component from the first data model; wherein, the second component content information is the content information of the first function in the second component; Write the content information of the second component into the second component.

15. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method for generating components of the target software module according to any one of claims 1-7.

16. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the steps of the method for generating components of the target software module according to any one of claims 1-7.