Low-code template automatic mining method, device and equipment for ROS nodes

Through automated methods, the project documents and open source code of open source ROS application software are used to identify and analyze ROS nodes and generate low-code templates, which solves the problems of difficulty in extracting low-code templates of ROS nodes in the existing technology and achieves efficient and accurate acquisition and customization of low-code templates.

CN119558296BActive Publication Date: 2025-04-18NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510111019.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-18
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

Existing ROS node low-code templates mainly rely on manual labeling and extraction, which makes template extraction difficult, low efficiency, and narrow functional scope, making it difficult to cope with complex and changeable business scenarios. At the same time, there are a large amount of duplicate code and design, and implicit low-code templates are difficult to obtain.

Method used

By obtaining the project documents and open source code of the open source ROS application software, preprocessing and data fusion, identifying ROS nodes, performing code similarity analysis, generating ROS node differences group, performing pattern mining and matching, building a set of ROS node parameterization options, and combining the relationship diagram between ROS nodes and interfaces, a ROS node low-code template is generated.

Benefits of technology

It realizes efficient, accurate and automated acquisition of low-code templates for ROS nodes, reduces development difficulty, improves development efficiency, and can flexibly deal with complex and changeable business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558296B_ABST
    Figure CN119558296B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and equipment for automatic mining of low-code templates for ROS nodes. A code data set is obtained through the project documents and open source codes of open source ROS application software. The nodes in the data set are identified to obtain the node data set, and code similarity analysis is performed to obtain a set of similar node categories. Then, for each similar node group, a node difference class set including multiple node difference class groups is generated according to the difference between the central node and other non-central nodes, and a corresponding node parameterization option set is constructed according to the node difference class set. According to the relationship diagram between the node and the interface, in the node parameterization option set, the node parameterization options corresponding to each similar node group are combined and merged with the interface data set to construct a node low-code template to realize automatic mining of low-code templates for ROS nodes. The present method can efficiently, accurately and automatically obtain and customize ROS node low-code templates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of program development technology, and in particular to a method, device and equipment for automatic mining of low-code templates for ROS nodes. Background Art

[0002] ROS (Robot Operating System) is a widely used robot development framework. ROS nodes are the basic units for implementing different functional modules. Each node is usually responsible for a specific task in the robot system (such as sensor data acquisition, motion control, path planning, etc.).

[0003] With the expansion of the ROS ecosystem, developers are faced with increasingly complex system architectures and node designs. In order to improve development efficiency and reduce duplication of work, the ROS low-code platform came into being. The ROS low-code platform simplifies the design and implementation of ROS application software by reusing, customizing and integrating ROS node low-code templates. Existing ROS node low-code templates are mainly obtained by construction technology based on manual annotation extraction. This technology not only faces the problems of difficulty and low efficiency in manual template extraction, but also has the problem that the extracted template has a narrow functional range and is difficult to flexibly respond to complex and changing business scenarios. In addition, there are a large number of repeated codes and designs in existing ROS application software, indicating that ROS software has implicit low-code templates, such as programming frameworks, interface call modes, etc. These implicit low-code templates are often not available using existing technologies. Summary of the invention

[0004] Based on this, it is necessary to provide a low-code template automatic mining method, device and equipment for ROS nodes that can solve at least one of the above technical problems.

[0005] A low-code template automatic mining method for ROS nodes, the method comprising:

[0006] Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set;

[0007] Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0008] Performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0009] For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0010] According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

[0011] In one embodiment, preprocessing the open source code includes performing data cleaning on the open source code to remove redundant and uninteresting data.

[0012] In one embodiment, when identifying the ROS nodes in the ROS code data set, corresponding static code analysis tools are called for parsing the different programming languages ​​in the ROS code data set to achieve identification of the ROS nodes;

[0013] The ROS node data set includes multiple ROS nodes and raw data related to each ROS node, and extracts configuration information of the ROS node based on the raw data, including node name, node type and life cycle.

[0014] In one embodiment, when generating a corresponding ROS interface data set according to the project document:

[0015] The project document is used to perform corresponding analysis on each of the ROS nodes to obtain input / output interface information of each of the ROS nodes, generate the ROS interface data set according to the input / output interface information of all ROS nodes, and generate the relationship diagram between each of the ROS nodes and each interface.

[0016] In one embodiment, code similarity analysis is performed based on the ROS node data set to obtain a set of similar ROS node categories including:

[0017] Using a clone detection method at a function granularity, similar ROS node functions are identified in the ROS node data set, similar ROS node functions are grouped together, and a similar ROS node function set including multiple groups of ROS node functions is constructed;

[0018] According to the attribution relationship between the similar ROS node function set and the ROS node data set, similar node functions are associated and classified with ROS node codes to obtain the similar ROS node category set;

[0019] In each of the similar ROS node groups in the similar ROS node category set, the central ROS node is determined according to the similarity, and other ROS nodes in the similar ROS node group except the central ROS node are non-central ROS nodes.

[0020] In one embodiment, generating a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes includes:

[0021] In each of the similar ROS node groups, a code analysis tool based on Tree-sitter is used to parse the ROS node code into a French tree form;

[0022] A difference detection algorithm based on tree edit distance is used to calculate the edit differences between the syntax tree of the central ROS node code and the syntax trees of other non-central ROS node codes;

[0023] The ROS node difference group is generated according to the obtained multiple edit differences.

[0024] In one embodiment, constructing a corresponding ROS node parameterization option set according to the ROS node difference class set includes:

[0025] The PrefixSpan algorithm is used to mine the sequence pattern of the ROS node difference class set, and the edit difference position in the mined pattern is parameterized to obtain the ROS node parameterized pattern set;

[0026] Matching the patterns in the ROS node parameterization pattern set with the groups of central ROS nodes in the similar ROS node category set, and parameterizing the corresponding positions in the central ROS node code according to the successfully matched patterns;

[0027] And the corresponding code values ​​of other non-central ROS nodes are matched as candidates and added to the corresponding central ROS node to form the ROS node parameterization option set.

[0028] The present application also provides a low-code template automatic mining device for ROS nodes, the device comprising:

[0029] The ROS code data set acquisition module is used to acquire the project documents and open source codes of the open source ROS application software, and pre-process the open source codes and then fuse the data with the project documents to obtain the ROS code data set;

[0030] A ROS node identification module, used to identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0031] A similarity analysis module, configured to perform code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes of similar category;

[0032] A ROS node parameterization option set generation module is used to generate a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes for each of the similar ROS node groups, and correspondingly generate a ROS node difference class set including a plurality of ROS node difference class groups, and then perform pattern mining and matching according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0033] The low-code template generation module is used to combine and merge the ROS node parameterization options corresponding to each similar ROS node group with the ROS interface data set in the ROS node parameterization option set according to the relationship diagram between ROS nodes and interfaces, and construct a ROS node low-code template corresponding to each similar ROS node group to realize automatic mining of low-code templates of ROS nodes.

[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0035] Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set;

[0036] Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0037] Performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0038] For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0039] According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

[0040] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0041] Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set;

[0042] Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0043] Performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0044] For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0045] According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

[0046] The above-mentioned method, device and equipment for automatic mining of low-code templates for ROS nodes obtain a code data set through the project documents and open source codes of open source ROS application software, identify the nodes in the data set to obtain a node data set, perform code similarity analysis on it, obtain a similar node category set, and then for each similar node group, generate a node difference class set including multiple node difference class groups based on the difference between the central node and other non-central nodes, and construct a corresponding node parameterization option set based on the node difference class set. According to the relationship diagram between nodes and interfaces, in the node parameterization option set, the node parameterization options corresponding to each similar node group are combined and merged with the interface data set to construct a ROS node low-code template to realize automatic mining of low-code templates for ROS nodes. This method can efficiently, accurately and automatically obtain and customize ROS node low-code templates. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a method for automatically mining low-code templates for ROS nodes in one embodiment;

[0048] Figure 2 It is a structural block diagram of a low-code template automatic mining device for ROS nodes in one embodiment;

[0049] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] In view of the problem that the implicit low-code template of ROS software cannot be obtained in the prior art, in this application, Figure 1 As shown, a low-code template automatic mining method for ROS nodes is provided, which specifically includes the following steps:

[0052] Step S100, obtaining the project documents and open source codes of the open source ROS application software, preprocessing the open source codes and then fusing the data with the project documents to obtain a ROS code data set.

[0053] Step S110 , identifying ROS nodes in the ROS code data set, constructing a ROS node data set including multiple ROS nodes, and generating a corresponding ROS interface data set according to the project document.

[0054] Step S120 , performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes of similar category.

[0055] Step S130, for each similar ROS node group, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including multiple ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set.

[0056] Step S140, according to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group and the ROS interface data set are combined and merged to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

[0057] In this application, a method for automatically mining ROS node low-code templates is proposed. This method obtains repeated ROS codes and designs by performing similarity analysis on a large number of ROS application software codes in the open source community, and automatically extracts ROS node low-code templates from these codes and designs using difference analysis and pattern mining techniques.

[0058] In step S100, the Selenium tool is used to collect project documents and Github code repository addresses of open source ROS application software from ROS Wiki, and the Scrapy framework is run to batch crawl the ROS software open source code under the Github code repository address.

[0059] In this embodiment, the open source code is preprocessed to clean the open source code to remove redundant and uninteresting data, i.e., irrelevant data. When performing data cleaning, data screening is performed in a targeted manner based on preset rules. The processing process includes code formatting and normalization, removing comments and document strings, removing test code and debugging information, and extracting core functional code modules.

[0060] Furthermore, the project documents and the processed ROS software open source code are integrated to form a unified ROS code dataset.

[0061] In step S110, when identifying the ROS nodes in the ROS code data set, the corresponding static code analysis tools are called for different programming languages ​​in the ROS code data set to perform analysis to achieve the identification of the ROS nodes. For example, the Python language can be analyzed by pylint or bandit, the C++ language can be analyzed by cppcheck and clang-static-analyzer, and other languages, that is, the Lisp language which is less used in ROS, can be analyzed by the compiler checking function of SBCL (Steel Bank Common Lisp) and tools such as cl-linter.

[0062] Specifically, the ROS node data set includes multiple ROS nodes and raw data related to each ROS node, and extracts configuration information of the ROS node based on the raw data, including node name, node type, and life cycle.

[0063] In this embodiment, when generating the corresponding ROS interface data set according to the project document: the project document is used to perform corresponding analysis on each ROS node, and the input / output interface information of each ROS node is obtained, and the ROS interface data set is generated according to the input / output interface information of all ROS nodes, and according to the relationship diagram between each ROS node and each interface. Among them, the obtained interface information includes title, service port, message type, etc., and the relationship diagram can ensure that the input and output interfaces of each ROS node can be correctly associated in the subsequent steps.

[0064] Specifically, when using the project document to analyze each ROS node, the launch file in the project document is analyzed by template matching technology, and the input / output interface information of each ROS node is located and extracted by regular expressions. Among them, the launch file is usually in XML format, which is used to define the startup parameters, topic mapping, and service interface information of each ROS node. By analyzing its file structure, it can be found that the startup information of the ROS node is generally obtained through <node>Tag definition, which contains attributes such as name (node ​​name) and type (executable file path). Topic mapping is done through <remap>Tags specify the original and mapped names of topics, e.g. <remap from=" / input_topic" to=" / output_topic" / > The relevant parameters of the service interface may be passed <param> Tags clearly specify key information such as service name, message type, etc. Using regular expressions, these key contents can be quickly extracted from the launch file.

[0065] For example, you can use the pattern Extract the node name and its executable file path; through Extract the input and output of topic mapping; through Get service-related parameters and their values. Combined with Python's re module, ROS node interface information can be extracted efficiently.

[0066] In this embodiment, the construction of the relationship graph is based on the ROS node and its corresponding interface, and the relationship is represented by the edge between the node and the interface, and the direction of the edge is used to distinguish between input and output. In this relationship graph, each ROS node and interface is used as a vertex in the graph, and the edge between the node and the interface is defined according to the interaction direction: when a ROS node generates an output (such as publishing a topic or providing a service), the edge points from the node to the corresponding interface; when a ROS node receives an input (such as subscribing to a topic or calling a service), the edge points from the interface to the node.

[0067] In the specific construction process, each node and interface is first mapped to a vertex in the graph, where the vertex attributes of the ROS node include the node name, type, etc., and the vertex attributes of the interface include the interface name, type (such as topic or service) and message type, etc. Then, add edges based on the input and output relationships. For example, if a node publishes a topic " / camera / image", an edge is added from the node to the vertex representing the topic in the graph; if a node subscribes to the topic, an edge is added from the vertex representing the topic to the node.

[0068] In step S120, code similarity analysis is performed based on the ROS node data set to obtain a set of similar ROS node categories, including: using a clone detection method at a function granularity to identify similar ROS node functions in the ROS node data set, where the existing open source clone detection tool NiCad is used to identify similar ROS node functions, group similar ROS node functions together, and construct a set of similar ROS node functions including multiple groups of ROS node functions to optimize the importance and maintainability of the code.

[0069] Furthermore, according to the attribution relationship between the similar ROS node function set and the ROS node data set, similar node functions are associated and classified with ROS node codes to obtain a similar ROS node category set. In each similar ROS node group in the similar ROS node category set, the central ROS node is determined according to the similarity, and the other ROS nodes in the similar ROS node group except the central ROS node are non-central ROS nodes.

[0070] Specifically, when determining the central ROS node based on similarity, the grammatical similarity is mainly used as the similarity measurement standard. Syntactic similarity measures the similarity between two functions based on the grammatical structure of the code. By parsing the abstract syntax tree (AST) of the function, the node structure and the relationship between the nodes of the two functions are compared. Functions with high similarity scores have similar grammatical structures. Even if the variable names are different or the loop order changes, as long as the structure of the syntax tree is similar, they are still considered similar functions. The tree edit distance is used here to measure, that is, the minimum number of edit steps to compare the two ASTs.

[0071] In step S130, generating a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes includes: in each similar ROS node group, using a Tree-sitter-based code analysis tool to parse the ROS node code into a French tree form, using a tree edit distance-based difference detection algorithm to calculate the edit difference between the syntax tree of the central ROS node code and the syntax trees of other non-central ROS node codes, and generating a ROS node difference group according to the obtained multiple edit differences.

[0072] Furthermore, constructing a corresponding ROS node parameterization option set according to the ROS node difference class set includes: using the PrefixSpan algorithm to mine the sequence pattern of the ROS node difference class set, and parameterizing the edit difference positions in the mined patterns to obtain a ROS node parameterization pattern set, matching the patterns in the ROS node parameterization pattern set with each group of central ROS nodes in the similar ROS node category set, and parameterizing the corresponding positions in the central ROS node code according to the successfully matched patterns, and appending the corresponding code values ​​of other non-central ROS nodes as candidates to the corresponding central ROS nodes to form a ROS node parameterization option set.

[0073] In this embodiment, when the PrefixSpan algorithm is used to mine the sequence pattern of the ROS node difference class set, it is first necessary to convert the difference information in the ROS node difference class set into a sequence form to ensure that it is suitable for sequence pattern mining. Specifically, the difference feature of each ROS node is taken as an item and arranged in the order of its appearance in the node execution process to form an ordered event sequence. Subsequently, the PrefixSpan algorithm discovers the potential commonalities and differences between ROS nodes by mining the frequent sequence patterns in these sequence data. It first extracts frequent prefix subsequences from the input sequence, and then recursively expands these prefixes until a frequent subsequence that meets the minimum support is found. In this process, the algorithm gradually builds a prefix tree and identifies the difference class sequence patterns that frequently appear between multiple ROS nodes. In this way, PrefixSpan can extract representative sequence patterns from a large number of ROS node differences, which reflect the common functional characteristics and differences between different ROS nodes.

[0074] In this embodiment, the matching process first involves comparing each pattern in the ROS node parameterization pattern set with the code of the central ROS node. The central ROS node is the representative node of the group of similar ROS nodes, and its code structure and functional characteristics are typical expressions of the nodes in the group. When matching, the system locates the corresponding code position in the central ROS node according to the edit difference position in the pattern. Specifically, each parameterized position in the pattern is mapped to the relevant code fragment of the central ROS node. In this way, the system can find the code position that matches the parameterized pattern in the central ROS node and perform parameterization processing. Once successfully matched, the system modifies the corresponding position in the central ROS node according to the parameterized pattern, replacing the originally fixed value with a configurable parameter. These parameters can be dynamically generated values ​​adjusted based on demand, allowing users to customize the behavior of the ROS node according to actual conditions.

[0075] In addition, for non-central ROS nodes, the system will find the code snippet corresponding to the parameterization position of the central node code based on similarity matching, and attach it to the central ROS node as a candidate. This process involves extracting the parts of other non-central nodes that are similar to the central node to form candidates. These candidates provide customized references for the parameterization options in the central node.

[0076] Through this matching process, the system can successfully apply the parameterization pattern to the central ROS node based on the differentiated characteristics of ROS nodes, and generate relevant candidate parameter options in other non-central nodes, thereby building a complete set of ROS node parameterization options.

[0077] In order to make customized modifications more flexible in the future when using the ROS node low-code template, the parameterized option set includes a variety of fixed relationship modes. The main purpose of this fixed relationship mode is to provide a certain constraint mechanism in the parameterized option selection process to ensure the rationality and consistency between the various parameterized options. When the value of a parameterized option is determined, the values ​​of other related parameterized options will be subject to certain constraints to avoid configurations that do not conform to logic or system requirements. This constraint relationship helps to ensure that the system can always maintain functional correctness and stability when making customized modifications.

[0078] Specifically, fixed relationship patterns refer to specific sequence patterns obtained from the set of ROS node difference classes through the PrefixSpan algorithm during the sequence pattern mining process. These sequence patterns represent common code snippets or execution steps with similar functions and behaviors in ROS nodes, and are usually repeated in multiple ROS nodes. It reflects the interdependence between different parameterization options. For example, in terms of the input and output interfaces, message types, or service calls of ROS nodes, the values ​​of certain parameters may directly affect the optional values ​​of other parameters. For example, when the input parameters of a ROS node are set to a specific type or format, the output results or message types associated with the input parameters may also be affected, so the selection of these related parameters will be constrained. This constraint relationship ensures that when the nodes are customized, there will be no incompatible configurations or functional failures.

[0079] The introduction of this constraint mechanism not only improves the accuracy and efficiency of customization, but also reduces the risk of errors when developers adjust parameters. Through the constraints of fixed relationship patterns, developers only need to focus on the reasonable configuration of each parameter without worrying about conflicts or incompatibilities between different parameters. Ultimately, the entire system can strike a balance between flexibility and configurability while ensuring the correctness and scalability of system functions.

[0080] In step S140, according to the relationship diagram between ROS nodes and interfaces, the ROS node parameterization option set and the ROS interface data set are combined and merged to construct a ROS node low-code template set to support ROS low-code development.

[0081] In this embodiment, when combining and merging the ROS node parameterization option set and the ROS interface data set, the input and output interface information of each node is combined with the parameterization option set. The interface information is responsible for describing the interaction between the node and the external system, while the parameterization options control the internal behavior of the node. The system combines a fixed relationship model to ensure that the mutual constraints between the parameterization options are followed and that the selection of each option does not cause conflicts or unreasonable configurations. For example, if a parameterization option determines that a node uses a specific message format, then the related interface configuration will also be automatically adjusted to ensure that data exchange meets the requirements of the new option.

[0082] Furthermore, after the combination is completed, a merging operation is performed to integrate the interface information and parameterized options (including fixed relationship patterns) into a complete ROS node low-code template. The merging process ensures that each node template contains complete input and output interface definitions and flexible parameterized function configuration options. At this stage, the fixed relationship pattern ensures that the parameterized option set of each node follows the predetermined constraints during the template generation process, thereby avoiding invalid or inconsistent configurations. At the same time, the system optimizes the option selection according to the fixed relationship pattern to ensure the operability and effectiveness of the template.

[0083] The system also verifies each generated node template to ensure that the combination of interface information and parameterized options can work correctly and meet the constraints. The verification process checks whether the fixed relationship mode is correctly applied to ensure that the selection of parameterized options conforms to the predetermined rules. For example, if a parameterized option depends on the selection of another option, the system will automatically check and prompt the developer to adjust the unreasonable configuration. In addition, the system will optimize the template to reduce unnecessary complexity, making the template more concise and efficient, and enhancing the user experience of the low-code development platform.

[0084] Finally, the combined, merged, verified and optimized ROS node low-code template set will be delivered to developers. Developers can select and adjust the parameterized options in these templates through the low-code development platform to flexibly customize the functional configuration of the node. In this process, the fixed relationship model ensures that the selection of each parameterized option is consistent and reasonable, thereby reducing the risk of configuration errors and improving development efficiency.

[0085] In this embodiment, the resulting ROS node low-code template is a structured and flexible customizable template designed to simplify the development process of ROS nodes. The core part of this template set includes the following main structural elements:

[0086] First, the node interface information section contains the input and output interface information of the ROS node. These interface information define the communication method between the node and the external system, covering the node's subscription and publishing topics, service ports, message types, etc. The interface information is displayed in a standardized format in the template to ensure that the node can smoothly exchange data with the external system. In the low-code platform, developers can directly operate these interfaces to configure the interaction rules between the node and the external system.

[0087] Secondly, the parameterized options section includes flexible and adjustable node internal function configuration options. Parameterized options may involve the customization of node behavior, such as message processing logic, scheduling frequency, or other internal function settings. Each option has several candidate values, which can be referenced and modified according to the needs of developers. These options provide developers with the ability to customize the configuration, allowing the execution mode of the node to be customized according to different application scenarios.

[0088] In addition, the fixed relationship patterns partially define the interdependencies between parameterized options through sequential pattern mining methods. Fixed relationship patterns are used to ensure that the selection of each parameterized option is reasonable and consistent. For example, the values ​​of some options may limit the optional range of other options to ensure that the overall configuration of the system does not produce inconsistencies or conflicts. These fixed relationship patterns provide developers with a clear constraint mechanism in the template, thereby avoiding incorrect configuration.

[0089] The code template part contains the basic code framework of the ROS node, covering node initialization, operation logic, message subscription and publishing, service call, etc. These template codes have been automatically configured for most common application scenarios. Developers only need to adjust the parameterized options according to actual needs to generate applicable node codes. Developers adjust options through the graphical interface of the low-code platform to automatically generate node functions that meet their needs.

[0090] Finally, the Documentation and Instructions section provides detailed documentation to help developers understand the specific meaning, usage, and configuration options of each parameterization option and interface information. Through these documents, developers can quickly get started and make configuration choices that suit project requirements to avoid configuration errors.

[0091] In the above-mentioned automatic mining method for low-code templates for ROS nodes, in order to solve the problem of obtaining a large number of high-quality low-code templates for ROS nodes, clone detection, difference analysis and pattern mining technologies are effectively combined to collect and clean a large number of ROS open source codes through automated tools, accurately extract node and interface information, identify similar node functions and perform difference analysis, and finally generate high-quality low-code templates for ROS nodes through sequence pattern mining and parameterization processing. This method can efficiently, accurately and automatically obtain and customize low-code templates for ROS nodes, reduce development difficulty, improve development efficiency, and promote rapid innovation and popularization of ROS low-code development.

[0092] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0093] In one embodiment, Figure 2 As shown, a low-code template automatic mining device for ROS nodes is provided, including: a ROS code data set acquisition module 200, a ROS node identification module 210, a similarity analysis module 220, a ROS node parameterization option set generation module 230 and a low-code template generation module 240, wherein:

[0094] The ROS code data set acquisition module 200 is used to acquire the project documents and open source codes of the open source ROS application software, and pre-process the open source codes and then perform data fusion with the project documents to obtain the ROS code data set;

[0095] A ROS node identification module 210, for identifying ROS nodes in the ROS code data set, constructing a ROS node data set including a plurality of ROS nodes, and generating a corresponding ROS interface data set according to the project document;

[0096] A similarity analysis module 220 is used to perform code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0097] The ROS node parameterization option set generation module 230 is used to generate a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes for each of the similar ROS node groups, and correspondingly generate a ROS node difference class set including a plurality of ROS node difference class groups, and then perform pattern mining and matching according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0098] The low-code template generation module 240 is used to combine and merge the ROS node parameterization options corresponding to each similar ROS node group with the ROS interface data set in the ROS node parameterization option set according to the relationship diagram between ROS nodes and interfaces, and construct a ROS node low-code template corresponding to each similar ROS node group to realize automatic mining of low-code templates of ROS nodes.

[0099] For the specific limitations of the low-code template automatic mining device for ROS nodes, please refer to the limitations of the low-code template automatic mining method for ROS nodes mentioned above, which will not be repeated here. Each module in the above-mentioned low-code template automatic mining device for ROS nodes can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0100] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a low-code template automatic mining method for ROS nodes is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0101] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0102] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0103] Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set;

[0104] Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0105] Performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0106] For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0107] According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

[0108] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0109] Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set;

[0110] Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document;

[0111] Performing code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including a plurality of similar ROS node groups, each similar ROS node group including a plurality of ROS nodes with similar categories;

[0112] For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set;

[0113] According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

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

[0115] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.< / remap> < / node>

Claims

1. A low-code template automatic mining method for ROS nodes, characterized in that: The method comprises: Obtain project documents and open source codes of open source ROS application software, preprocess the open source codes and then fuse them with the project documents to obtain a ROS code data set; Identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document. Specifically, use the project document to perform corresponding analysis on each of the ROS nodes to obtain input / output interface information of each of the ROS nodes, generate the ROS interface data set according to the input / output interface information of all ROS nodes, and generate a relationship diagram according to each of the ROS nodes and each interface; Based on the ROS node data set, code similarity analysis is performed to obtain a similar ROS node category set including multiple similar ROS node groups, each similar ROS node group includes multiple ROS nodes with similar categories. Specifically, a clone detection method at function granularity is used to identify similar ROS node functions in the ROS node data set, group similar ROS node functions into one group, and construct a similar ROS node function set including multiple groups of ROS node functions. According to the attribution relationship between the similar ROS node function set and the ROS node data set, similar node functions are associated and classified with ROS node codes to obtain the similar ROS node category set. In each of the similar ROS node groups in the similar ROS node category set, a central ROS node is determined according to the similarity, and the other ROS nodes in the similar ROS node group except the central ROS node are non-central ROS nodes. For each of the similar ROS node groups, a corresponding ROS node difference group is generated according to the difference between the central ROS node and other non-central ROS nodes, and a ROS node difference class set including a plurality of ROS node difference class groups is correspondingly generated, and then pattern mining and matching are performed according to the ROS node difference class set to construct a corresponding ROS node parameterization option set; According to the relationship diagram between ROS nodes and interfaces, in the ROS node parameterization option set, the ROS node parameterization options corresponding to each similar ROS node group are combined and merged with the ROS interface data set to construct a ROS node low-code template corresponding to each similar ROS node group, so as to realize automatic mining of low-code templates of ROS nodes.

2. The low-code template automatic mining method according to claim 1 is characterized in that: The preprocessing of the open source code is to perform data cleaning on the open source code to remove redundant and uninteresting data.

3. The low-code template automatic mining method according to claim 2 is characterized in that: When identifying the ROS nodes in the ROS code data set, calling corresponding static code analysis tools for parsing the different programming languages ​​in the ROS code data set to achieve ROS node identification; The ROS node data set includes multiple ROS nodes and raw data related to each ROS node, and extracts configuration information of the ROS node based on the raw data, including node name, node type and life cycle.

4. The low-code template automatic mining method according to claim 3 is characterized in that: The generating a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes comprises: In each of the similar ROS node groups, a code analysis tool based on Tree-sitter is used to parse the ROS node code into a French tree form; A difference detection algorithm based on tree edit distance is used to calculate the edit differences between the syntax tree of the central ROS node code and the syntax trees of other non-central ROS node codes; The ROS node difference group is generated according to the obtained multiple edit differences.

5. The low-code template automatic mining method according to claim 4 is characterized in that: The constructing a corresponding ROS node parameterization option set according to the ROS node difference class set comprises: The PrefixSpan algorithm is used to mine the sequence pattern of the ROS node difference class set, and the edit difference position in the mined pattern is parameterized to obtain the ROS node parameterized pattern set; Matching the patterns in the ROS node parameterization pattern set with the groups of central ROS nodes in the similar ROS node category set, and parameterizing the corresponding positions in the central ROS node code according to the successfully matched patterns; And the corresponding code values ​​of other non-central ROS nodes are matched as candidates and added to the corresponding central ROS node to form the ROS node parameterization option set.

6. A low-code template automatic mining device for ROS nodes, characterized in that: The device comprises: The ROS code data set acquisition module is used to acquire the project documents and open source codes of the open source ROS application software, and pre-process the open source codes and then fuse the data with the project documents to obtain the ROS code data set; A ROS node identification module is used to identify the ROS nodes in the ROS code data set, construct a ROS node data set including multiple ROS nodes, and generate a corresponding ROS interface data set according to the project document. Specifically, the project document is used to perform a corresponding analysis on each of the ROS nodes to obtain input / output interface information of each of the ROS nodes, generate the ROS interface data set according to the input / output interface information of all ROS nodes, and generate a relationship diagram according to each of the ROS nodes and each interface; A similarity analysis module is used to perform code similarity analysis based on the ROS node data set to obtain a similar ROS node category set including multiple similar ROS node groups, each similar ROS node group including multiple ROS nodes of similar categories. Specifically, a clone detection method at function granularity is used to identify similar ROS node functions in the ROS node data set, group similar ROS node functions together, and construct a similar ROS node function set including multiple groups of ROS node functions. According to the attribution relationship between the similar ROS node function set and the ROS node data set, similar node functions are associated and classified with ROS node codes to obtain the similar ROS node category set. In each of the similar ROS node groups in the similar ROS node category set, a central ROS node is determined according to similarity, and other ROS nodes in the similar ROS node group except the central ROS node are non-central ROS nodes. A ROS node parameterization option set generation module is used to generate a corresponding ROS node difference group according to the difference between the central ROS node and other non-central ROS nodes for each of the similar ROS node groups, and correspondingly generate a ROS node difference class set including a plurality of ROS node difference class groups, and then perform pattern mining and matching according to the ROS node difference class set to construct a corresponding ROS node parameterization option set; The low-code template generation module is used to combine and merge the ROS node parameterization options corresponding to each similar ROS node group with the ROS interface data set in the ROS node parameterization option set according to the relationship diagram between ROS nodes and interfaces, and construct a ROS node low-code template corresponding to each similar ROS node group to realize automatic mining of low-code templates of ROS nodes.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Low-code development system based on data process analysis

    CN117055859A

  • Dynamic code generation method and system based on interface document

    CN118860356A