A custom message synchronization method and device

By determining and converting the text file of the custom message structure on the development terminal in the Intelligent Robot Operating System (IROS) and sending it to a specified topic, the problem of custom message synchronization across terminals is solved, and efficient message analysis is achieved and synchronize.

CN115766377BActive Publication Date: 2025-02-14SHANDONG NEW GENERATION INFORMATION IND TECH RES INST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211418539.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2025-02-14
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

When users use the custom message structure of the Intelligent Robot Operating System (IROS) to communicate with other networked terminals, it is difficult to achieve custom message synchronization across terminals.

Method used

By determining the custom message structure of the message to be transmitted on the development terminal and obtaining its corresponding text file, opening the preset custom message structure synchronous sending node, converting the text file into a message to be sent, and sending it through the IROS message sending interface Go to the specified topic so that the terminal to be synchronized can parse and synchronize messages.

Benefits of technology

It realizes custom message synchronization across terminals, solves the problem that there is no custom message structure on other terminals, and improves the efficiency of message synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766377B_ABST
    Figure CN115766377B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification disclose a method and device for synchronizing custom messages, the method comprising: a development terminal determines a custom message structure of a message to be transmitted, and obtains a text file corresponding to the custom message structure; a preset custom message structure synchronization sending node is opened to read the text file, and the text file is converted into a message to be sent based on a preset message synchronization rule; the message to be sent is sent to a designated topic through an IROS message sending interface; the terminal to be synchronized parses and converts the message based on the preset message synchronization rule to obtain the text file transmitted by the development terminal; a preset processing tool is called to perform format conversion on the text file to obtain a program file corresponding to the text file; the program file is written into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal to achieve synchronization of the message to be transmitted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent robot technology, and in particular to a method and device for synchronizing custom messages. Background Art

[0002] Intelligent Robot Operating System (IROS) is a secondary operating system that runs on the Linux system and provides standardized development interfaces and data processing flows including hardware abstract description, inter-program message communication, and package management.

[0003] Currently, IROS supports cross-terminal message communication and user-defined message structures. However, user-defined message structures are generally only defined on development terminals or specific terminals. When users use IROS's customized message structure to communicate with other networked terminals, since the message structure does not exist on other terminals, messages based on the customized message structure cannot be parsed, making it difficult to synchronize customized messages across terminals. Summary of the invention

[0004] One or more embodiments of the present specification provide a method and device for synchronizing custom messages, which are used to solve the following technical problem: currently, when users use the custom message structure of IROS to communicate messages with other networked terminals, it is difficult to achieve cross-terminal custom message synchronization.

[0005] One or more embodiments of this specification adopt the following technical solutions:

[0006] One or more embodiments of this specification provide a method for synchronizing a custom message, which is applied to a development terminal, and the method includes:

[0007] Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure;

[0008] Opening a preset custom message structure synchronous sending node to read the text file and convert the text file into a message to be sent based on a preset message synchronization rule;

[0009] The message to be sent is sent to a designated topic through an IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the designated topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure.

[0010] Optionally, in one or more embodiments of the present specification, determining the custom message structure of the message to be transmitted and acquiring the text file corresponding to the custom message structure specifically includes:

[0011] Obtaining the custom message structure information of the message to be transmitted; wherein the custom message structure information includes any one or more of the following: message type, name, and annotation information;

[0012] The custom message structure information is stored based on a preset file format to obtain a text file corresponding to the custom message structure; wherein the preset file format is a msg file format.

[0013] Optionally, in one or more embodiments of the present specification, before converting the text file into a message to be sent based on a preset message synchronization rule, the method further includes:

[0014] Determine a preset data conversion rule between the text file and the message to be sent, so as to use the preset data conversion rule as a preset message synchronization rule; wherein, determining the preset data conversion rule between the text file and the message to be sent specifically includes the following steps:

[0015] Obtaining the file sequence number, file name and data portion length information of the text file, and constructing a header data structure of the text file by respectively converting the file sequence number, the file name and the data portion length into corresponding preset bytes;

[0016] Adding the header data structure to the header of the text file with a preset byte length to construct a text file including the header structure;

[0017] The text file containing the header structure is converted into a message to be sent based on a preset format conversion function, so that the terminal to be synchronized parses the header structure in the message to be sent to obtain information of the text file.

[0018] Optionally, in one or more embodiments of the present specification, before sending the message to be sent to a specified topic through the IROS message sending interface, the method further includes:

[0019] Acquire a development terminal and a plurality of terminals to be synchronized, so as to establish an IROS communication network based on roles of the development terminal and the plurality of terminals to be synchronized;

[0020] A designated topic operating environment is deployed for each terminal device in the IROS communication network so that each terminal device in the IROS communication network communicates based on the designated topic; wherein the designated topic is an IROS topic.

[0021] Optionally, in one or more embodiments of the present specification, the preset custom message structure synchronous sending node is a CustomMessageSend node.

[0022] One or more embodiments of the present specification provide a method for synchronizing a custom message, which is applied to a terminal to be synchronized, and the method includes:

[0023] Enable the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface;

[0024] Parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted;

[0025] Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program;

[0026] The program file is written into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted.

[0027] Optionally, in one or more embodiments of the present specification, parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal specifically includes:

[0028] Based on the preset message synchronization rule, determine the byte length of the header structure of the message, extract the header structure of the message for parsing, and obtain text file information in the header structure; wherein the text file information includes: file name and data part length;

[0029] A file in a preset data format is created based on the file name, and the length of the data portion is written into the file to obtain the text file.

[0030] Optionally, in one or more embodiments of the present specification, the preset custom message structure synchronization receiving node is a CustomMessageRecive node.

[0031] One or more embodiments of the present specification provide a custom message synchronization device, which is applied to a development terminal, and the device includes:

[0032] at least one processor; and,

[0033] a memory communicatively connected to the at least one processor; wherein,

[0034] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0035] Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure;

[0036] Opening a preset custom message structure synchronous sending node to read the text file and convert the text file into a message to be sent based on a preset message synchronization rule;

[0037] The message to be sent is sent to a designated topic through an IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the designated topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure.

[0038] In one or more embodiments of the present specification, a custom message synchronization device is provided, which is applied to a terminal to be synchronized, and the device includes:

[0039] at least one processor; and,

[0040] a memory communicatively connected to the at least one processor; wherein,

[0041] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0042] Enable the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface;

[0043] Parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted;

[0044] Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program;

[0045] The program file is written into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted.

[0046] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:

[0047] The development terminal converts the custom message structure through the custom message structure synchronization sending node to obtain the message to be sent, and sends the message to be sent to the specified topic through the IROS message sending interface, so that the terminal to be synchronized can obtain the message to be sent based on the specified topic, and then obtain the custom message structure based on the message to be sent, so as to achieve synchronization of the custom message of the development terminal. It solves the problem that when the user uses the custom message structure of the development terminal to communicate with other networked terminals, the message parsing cannot be customized because the message structure does not exist on other terminals, and realizes the synchronization of custom messages across terminals. The text file containing the custom message structure is stored in the format of a program file in the terminal to be synchronized, so that the terminal to be synchronized can parse the message by calling the program, thereby improving the efficiency of message synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0049] Figure 1 A schematic diagram of a method flow for synchronizing custom messages applied to a development terminal provided in an embodiment of this specification;

[0050] Figure 2 A schematic diagram of a custom message synchronization interface in an application scenario provided by an embodiment of this specification;

[0051] Figure 3 A schematic diagram of the structure of a preset message synchronization rule provided in an embodiment of this specification.

[0052] Figure 4 A schematic flow chart of a method for synchronizing a custom message applied to a terminal to be synchronized provided in an embodiment of this specification;

[0053] Figure 5 A schematic diagram of a method flow for customizing message synchronization in an application scenario provided by an embodiment of this specification;

[0054] Figure 6 A schematic diagram of the internal structure of a device for developing custom message synchronization of a terminal provided in an embodiment of this specification;

[0055] Figure 7 A schematic diagram of the internal structure of a device for custom message synchronization of a terminal to be synchronized provided in an embodiment of the present specification. DETAILED DESCRIPTION

[0056] The embodiments of this specification provide a method and device for synchronizing a custom message.

[0057] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0058] like Figure 1 As shown, in one or more embodiments of the present specification, a method flow chart for custom message synchronization applied to a development terminal is provided. Figure 1 It can be seen that in one or more embodiments of this specification, a custom message synchronization method is applied to a development terminal, and the method includes the following steps:

[0059] S101: Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure.

[0060] The current IROS supports cross-terminal message communication, but when the user-defined message structure communicates with other networked terminals, since the customized message structure is defined on the development terminal, the message structure does not exist on other terminals, resulting in other terminals being unable to parse the customized message. Therefore, in one or more embodiments of this specification, in order to enable cross-terminal customized messages to be transmitted synchronously, the customized message structure of the message to be transmitted is first determined, and the text file corresponding to the customized message structure is obtained.

[0061] Specifically, in one or more embodiments of the present specification, determining a custom message structure of a message to be transmitted and obtaining a text file corresponding to the custom message structure specifically includes the following steps:

[0062] Obtain the custom message structure information of the message to be transmitted, and then store the custom message structure information according to the preset file format, so as to obtain the text file corresponding to the custom message structure. It should be noted that the preset file format is the msg file format. In other words, all custom message structures are saved in a text file with the suffix msg. It should be noted that the custom message structure information includes any one or more of the following: message type, name, comment information, etc.

[0063] S102: Open a preset custom message structure synchronous sending node to read the text file, and convert the text file into a message to be sent based on a preset message synchronization rule.

[0064] In order to enable the text file to be read and the message to be transmitted, in one or more embodiments of the present specification, a preset custom message structure synchronization sending node is started. It should be noted that the preset custom message structure synchronization sending node is a CustomMessageSend node. By starting the node, the custom message structure synchronization sending node reads the text file containing the custom message structure, thereby converting the text file into a message to be sent based on the preset message synchronization rules. It should also be noted that, if Figure 2 As shown, the preset custom message structure synchronization sending node provides a visual operation interface. After selecting the text file to be synchronized, the text file can be read and then converted into the format of the message to be sent according to the preset message synchronization rules.

[0065] Further, in order to convert the text file into the format of the message to be sent, the information of the text file can be sent to the topic based on the IROS sending interface for subsequent message synchronization. In one or more embodiments of the present specification, before converting the text file into the message to be sent based on the preset message synchronization rule, the method also includes the following process:

[0066] Determine the preset data conversion rules between the text file and the message to be sent, so as to use the preset data conversion rules as the preset message synchronization rules to achieve data conversion between the text file and the message to be sent. It should be noted that determining the preset data conversion rules between the text file and the message to be sent specifically includes the following steps:

[0067] Get the file number, file name and data length information of the text file, and then construct the header data structure of the text file by using the file number, file name and data length in corresponding preset bytes. Figure 3As shown, it is a structural diagram of a preset message synchronization rule provided by an embodiment of this specification. Among them, the sequence number is 4 bytes, the mag data length is 16 bytes, and the header structure occupies a total of 1024 bytes. The header data structure is added to the header of the text file with a preset byte length to construct a text file containing the header structure. The text file containing the header structure is converted into a message to be sent through a preset format conversion function, so that the terminal to be synchronized parses the header structure in the message to be sent and obtains the information in the text file. Specifically, in one embodiment of this specification, the msg file is used as the text file and the char* data is used as the message to be sent, then the preset data conversion rule defines a method for converting the msg file into char* data, and a method for converting the char* data into the msg file. After the msg file is read successfully, a 1024-byte header structure needs to be added to the header of the data file, and the header data structure includes the sequence number of the msg file, the msg file name containing the complete path, and the length information of the data part, and then the preset format conversion function memcpy function is used to convert the text file containing the header information into char* data. When the synchronization terminal receives the char* data, it first parses the 1024-byte header structure, obtains the name of the text file and the length of the data part, then creates a text file according to the name and writes the data part into the file.

[0068] S103: Send the message to be sent to a designated topic through the IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the designated topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure.

[0069] In order to ensure that different terminal devices can communicate messages through a designated topic, in one or more embodiments of the present specification, before sending the message to be sent to the designated topic through the IROS message sending interface, the method further includes the following process:

[0070] First, the development terminal and multiple terminals to be synchronized are obtained, so as to establish an IROS communication network according to the roles of the development terminal and the multiple terminals to be synchronized. That is, an IROS communication network including multiple terminal devices is established. Then, a designated topic operating environment is deployed for each terminal device in the IROS communication network, so that each terminal device in the IROS communication network can communicate based on the designated topic. It should be noted that in one or more embodiments of this specification, the designated topic is the custommessage_synchronizationg topic in the IROS topic.

[0071] like Figure 4As shown, in one or more embodiments of the present specification, a method flow chart for synchronizing a custom message applied to a terminal to be synchronized is provided. Figure 4 It can be seen that the embodiment of this specification provides a method for synchronizing a custom message, which is applied to a terminal to be synchronized, and the method includes the following steps:

[0072] S401: Open the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface.

[0073] S402: Parse and convert the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted.

[0074] S403: Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program.

[0075] S404: writing the program file into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted.

[0076] In order to enable the terminal to be synchronized to obtain the custom message of the development terminal, in the embodiment of this specification, the terminal to be synchronized starts the preset custom message structure synchronization receiving node, so that the custom message structure synchronization receiving node can receive the custom message in the specified topic through the IROS message receiving interface. It should be noted that the preset custom message structure synchronization receiving node is the CustomMessageRecive node. Then the custom message is parsed and converted according to the preset message synchronization rule, so as to obtain the text file sent by the development terminal. It should be noted that, according to the method of the above-mentioned development terminal, the custom message structure of the message to be transmitted is stored in the text file. In order to enable the file to be called by the program, the terminal to be synchronized in the embodiment of this specification converts the format of the text file by calling the preset processing tool to obtain the program file corresponding to the text file. It can be understood that the data structure in the program file can be called by the program. Then, by writing the obtained program file into the development program of the terminal to be synchronized, the terminal to be synchronized can obtain the custom message structure of the message to be transmitted when parsing the message to be transmitted sent by the development terminal, so as to obtain the message to achieve the synchronization of the message to be transmitted across terminals.

[0077] In addition, it is also necessary to explain that the method for message synchronization of the terminal to be synchronized is a synchronization process performed after the development terminal uploads the message to the designated topic. Therefore, the method for executing the terminal to be synchronized is based on the same technical foundation as that in the above-mentioned development terminals S101-S104. For example, it is necessary to establish an IROS communication network including multiple terminal devices, deploy an IROS topic operating environment on each terminal device, so that different terminal devices can communicate messages through topics, and establish preset message synchronization rules, etc. The technical foundation of the supporting method that is the same as that of the development terminal will not be repeated here, and the same and similar parts between the various embodiments can be referred to each other.

[0078] Further, in one or more embodiments of the present specification, parsing and converting the message according to the preset message synchronization rule to obtain the text file transmitted by the development terminal specifically includes the following process:

[0079] Depend on Figure 3 It can be seen that the preset message synchronization rule adds a 1024-byte header structure to the text file. Therefore, when the terminal to be synchronized obtains the text file, it first determines the byte length of the header structure of the message according to the preset message synchronization rule, thereby extracting the header structure of the message for parsing and obtaining the text file information in the header structure; it should be noted that the text file information includes: file name, data part length, file path and other information. Then, according to the file name of the obtained text file, a preset data format file with the same format as the text file is created, and the length of the data part is written into the file to obtain the text file. It should be noted that the preset data format file is a msg file.

[0080] like Figure 5 As shown, in one or more embodiments of this specification, a flowchart of a method for customizing message synchronization in an application scenario is provided. In one embodiment of this specification, in order to ensure that the synchronization method can be implemented, it is first necessary to establish an IROS communication network including multiple terminal devices, and each terminal device is deployed with an IROS topic operating environment so that different terminal devices can communicate messages through topics. Figure 5It can be seen that in one or more embodiments of the present specification, the user is first required to create a new custom data structure file on a terminal device. The custom data structure file contains the message type, name, and some annotation information, and supports mutual references to custom data structures. After the custom data structure file is established, the custom message structure synchronization sending node CustomMessageSend is started. Through the visual operation interface provided by the CustomMessageSend node, select the msg file to be synchronized, read the msg file content, and then convert the msg file into char* format according to the custom message synchronization rules. After completing the msg file conversion, call the IROS message sending interface and send the message to the custommessage_synchronizationg topic to complete the sending of the custom message, that is, the publishing of the message. Start the custom message structure synchronization receiving node CustomMessageRecive on the terminal to be synchronized where custom message synchronization is required. Through this node, the latest message published by the development terminal is obtained from the specified topic, and the message in char* format is converted into a msg file according to the custom message synchronization protocol. Then, the msg file processing tool in IROS is called to convert the msg file into a data structure that can be called by the program and saved in a .h file. The development program includes the .h file, and the custom message structure can be used to synchronize the custom messages published by the development terminal, thereby realizing custom message synchronization across terminals.

[0081] like Figure 6 As shown, the embodiment of this specification provides a schematic diagram of the internal structure of a device for developing custom message synchronization of a terminal. Figure 6 It can be seen that the embodiment of this specification provides a custom message synchronization device, which is applied to a development terminal, and the device includes:

[0082] at least one processor; and,

[0083] a memory communicatively connected to the at least one processor; wherein,

[0084] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0085] Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure;

[0086] Opening a preset custom message structure synchronous sending node to read the text file and convert the text file into a message to be sent based on a preset message synchronization rule;

[0087] The message to be sent is sent to a designated topic through an IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the designated topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure.

[0088] like Figure 7 As shown, the embodiment of this specification provides a schematic diagram of the internal structure of a device for custom message synchronization of a terminal to be synchronized. Figure 7 It can be seen that the embodiment of this specification provides a custom message synchronization device, which is applied to a terminal to be synchronized, and the device includes:

[0089] at least one processor; and,

[0090] a memory communicatively connected to the at least one processor; wherein,

[0091] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0092] Enable the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface;

[0093] Parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted;

[0094] Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program;

[0095] The program file is written into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted.

[0096] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0097] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0098] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A custom message synchronization method, applied to a development terminal, characterized in that: The method comprises: Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure; Opening a preset custom message structure synchronous sending node to read the text file and convert the text file into a message to be sent based on a preset message synchronization rule; Send the message to be sent to a specified topic through the IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the specified topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure; Before converting the text file into a message to be sent based on a preset message synchronization rule, the method further includes: Determine a preset data conversion rule between the text file and the message to be sent, so as to use the preset data conversion rule as a preset message synchronization rule; wherein, determining the preset data conversion rule between the text file and the message to be sent specifically includes the following steps: Obtaining the file sequence number, file name and data portion length information of the text file, and constructing a header data structure of the text file by respectively converting the file sequence number, the file name and the data portion length into corresponding preset bytes; Adding the header data structure to the header of the text file with a preset byte length to construct a text file including the header structure; The text file containing the header structure is converted into a message to be sent based on a preset format conversion function, so that the terminal to be synchronized parses the header structure in the message to be sent to obtain information of the text file.

2. A method for synchronizing a custom message according to claim 1, characterized in that: The step of determining the custom message structure of the message to be transmitted and obtaining the text file corresponding to the custom message structure specifically includes: Obtaining the custom message structure information of the message to be transmitted; wherein the custom message structure information includes any one or more of the following: message type, name, and annotation information; The custom message structure information is stored based on a preset file format to obtain a text file corresponding to the custom message structure; wherein the preset file format is a msg file format.

3. A method for synchronizing a custom message according to claim 1, characterized in that: Before sending the message to be sent to the designated topic through the IROS message sending interface, the method further includes: Acquire a development terminal and a plurality of terminals to be synchronized, so as to establish an IROS communication network based on roles of the development terminal and the plurality of terminals to be synchronized; A designated topic operating environment is deployed for each terminal device in the IROS communication network so that each terminal device in the IROS communication network communicates based on the designated topic; wherein the designated topic is an IROS topic.

4. A method for synchronizing a custom message according to claim 1, characterized in that: The preset custom message structure synchronous sending node is a CustomMessageSend node.

5. A method for synchronizing a custom message, applied to a terminal to be synchronized, characterized in that: The method comprises: Enable the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface; Parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted; Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program; Writing the program file into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted; The parsing and converting of the message based on the preset message synchronization rule to obtain the text file transmitted by the development terminal specifically includes: Based on the preset message synchronization rule, determine the byte length of the header structure of the message, extract the header structure of the message for parsing, and obtain text file information in the header structure; wherein the text file information includes: file name and data part length; A file in a preset data format is created based on the file name, and the length of the data portion is written into the file to obtain the text file.

6. A method for synchronizing a custom message according to claim 5, characterized in that: The preset custom message structure synchronous receiving node is a CustomMessageRecive node.

7. A custom message synchronization device, applied to a development terminal, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Determine a custom message structure of a message to be transmitted, and obtain a text file corresponding to the custom message structure; wherein the text file stores the custom message structure; Opening a preset custom message structure synchronous sending node to read the text file and convert the text file into a message to be sent based on a preset message synchronization rule; Send the message to be sent to a specified topic through the IROS message sending interface, so that the terminal to be synchronized obtains the custom message structure based on the specified topic, and implements parsing synchronization of the message to be transmitted based on the custom message structure; Before converting the text file into a message to be sent based on a preset message synchronization rule, the method further includes: Determine a preset data conversion rule between the text file and the message to be sent, so as to use the preset data conversion rule as a preset message synchronization rule; wherein, determining the preset data conversion rule between the text file and the message to be sent specifically includes the following steps: Obtaining the file sequence number, file name and data portion length information of the text file, and constructing a header data structure of the text file by respectively converting the file sequence number, the file name and the data portion length into corresponding preset bytes; Adding the header data structure to the header of the text file with a preset byte length to construct a text file including the header structure; The text file containing the header structure is converted into a message to be sent based on a preset format conversion function, so that the terminal to be synchronized parses the header structure in the message to be sent to obtain information of the text file.

8. A custom message synchronization device, applied to a terminal to be synchronized, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Enable the preset custom message structure synchronous receiving node to receive messages in the specified topic through the IROS message receiving interface; Parsing and converting the message based on a preset message synchronization rule to obtain a text file transmitted by the development terminal; wherein the text file stores a custom message structure of the message to be transmitted; Calling a preset processing tool to convert the format of the text file to obtain a program file corresponding to the text file; wherein the data structure in the program file can be called by a program; Writing the program file into the development program of the terminal to be synchronized, so that the terminal to be synchronized parses the message to be transmitted sent by the development terminal, and realizes synchronization of the message to be transmitted; The parsing and converting of the message based on the preset message synchronization rule to obtain the text file transmitted by the development terminal specifically includes: Based on the preset message synchronization rule, determine the byte length of the header structure of the message, extract the header structure of the message for parsing, and obtain text file information in the header structure; wherein the text file information includes: file name and data part length; A file in a preset data format is created based on the file name, and the length of the data portion is written into the file to obtain the text file.

Citation Information

Patent Citations

  • Message format analyzer and analysis method

    CN113687817A