A method for quickly modifying a message data structure without compiling

By using ini configuration files and a visual interface, the system enables custom configuration and compilation-free modification of message data structures, solving the problem of frequent data structure changes during message interface debugging and improving the flexibility and convenience of message data processing.

CN118784756BActive Publication Date: 2026-04-21CHINA SHIP DEV & DESIGN CENT
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA SHIP DEV & DESIGN CENT
Filing Date
2024-06-27
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In the process of debugging the message interface, the frequent changes in the message data structure of existing technologies lead to high dependence on the compilation environment and code development, and place high demands on version control and testing personnel, making it difficult to achieve rapid custom configuration and compilation-free modification.

Method used

The message data structure can be designed through the ini configuration file, and the message fields can be customized and modified through a visual interface. The configuration file can be read and imported in batches, and the message data can be generated by concatenating the data without recompiling.

Benefits of technology

It enables rapid modification and custom configuration of message data structures, avoids the compilation process, improves ease of use and flexibility, and is suitable for scenarios with frequent changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784756B_ABST
    Figure CN118784756B_ABST
Patent Text Reader

Abstract

This invention discloses a method for rapid modification of message data structure without compilation, comprising: initializing the message name, data type, and values ​​of each field in the message by designing the format of the INI configuration file; automatically reading the INI configuration file to achieve batch import of message data; visually displaying the modifiable message data structure and content, and modifying the message data structure and content by adding and deleting, outputting message configuration information; obtaining the message configuration information, and sequentially concatenating the contents of each field of the message into a byte sequence to create the message data; and sending the message data, including one-time sending and periodic sending, achieving periodic sending of message data based on the independent configuration of the periodic changes in the values ​​of each field of the message. This invention enables rapid modification of the message data structure without recompilation, is independent of the development environment, and improves ease of use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of message data interface testing, and in particular to a method for rapidly modifying message data structures without compilation. Background Technology

[0002] Message communication is one of the basic methods of information exchange between different devices. During the design and joint testing phase of message interfaces, it is usually necessary to send message data to the device under test and check its response to conduct interface debugging or troubleshooting.

[0003] The commonly used method for generating message data is to treat the message data structure as a struct, with the message fields as members of the struct. Message types are created by creating objects from the struct, and then values ​​are assigned to each field to generate the message data. However, during interface debugging, there are often numerous requirements for changes to the message data structure. In such cases, the method of creating objects from the struct often requires recompiling the source code due to changes in the struct itself. Therefore, it has a high dependency on the compilation environment and code development, and places high demands on version control and testing personnel.

[0004] The technical problems to be solved by this invention include:

[0005] 1. How to implement custom configuration of message data structure?

[0006] The required functionalities include: the ability to quickly initialize and configure the data structure and values ​​of messages; support for customizing message data structures; and support for graphical modification of message field data types and values.

[0007] 2. How to modify the message data structure without compiling?

[0008] The required functionalities include: the ability to automatically create message data based on the message field types and values ​​configured in the interface, without the need for recompilation; and the ability to configure these functions individually. Summary of the Invention

[0009] The technical problem to be solved by the present invention is to provide a method for rapid modification of message data structure without compilation, which addresses the shortcomings of the prior art.

[0010] The technical solution adopted by this invention to solve its technical problem is:

[0011] This invention provides a method for quickly modifying message data structures without compilation, the method comprising the following steps:

[0012] By designing the format of the ini configuration file, the message name, data type, and values ​​of each field in the message can be initialized.

[0013] Automatically reads the ini configuration file to achieve batch import of message data;

[0014] The system displays the modifiable message data structure and content in a visual format, and allows users to modify the message data structure and content by adding and deleting data, outputting message configuration information.

[0015] Obtain message configuration information, and then concatenate the contents of each field of the message into a byte sequence by data concatenation, thereby creating message data;

[0016] The transmission of message data includes one-time transmission and periodic transmission. The periodic transmission of message data is achieved by independently configuring the periodic changes of the values ​​of each field in the message.

[0017] Furthermore, the method for designing the format content of the ini configuration file in this invention includes:

[0018] The contents of the ini configuration file include:

[0019] The [type] section indicates the data structure type; including: uint8_t, uint16_t, uint32_t, uint64_t, int, and double; users can add data types according to their needs;

[0020] In the [Msg] section, Msgn represents the name of the nth message, and the section content indicates the data type and value of each field in that message; the two are separated by "+", and if there is no "+", the default initial value is 0; that is:

[0021] Msgn = Data type of field n + Numeric value of field n.

[0022] Furthermore, the method for batch importing message data in the method of the present invention includes:

[0023] It automatically reads the ini configuration file to achieve batch import of message data. Users can select the corresponding message name in the drop-down menu of the visual operation interface to quickly load the message data content and display the loading result.

[0024] Furthermore, the method of the present invention includes a method for visually displaying the modifiable message data structure and content, comprising:

[0025] In the visual operation interface, the table header headings include: field number, type, value, minimum value, maximum value, and interval; add and delete message fields using the add and delete buttons; among them:

[0026] Configure the data type of the message fields using the drop-down list of "Type";

[0027] Configure the values ​​for message fields by entering the contents of the "Values" list.

[0028] Furthermore, the method of the present invention includes an independent configuration based on the periodic changes in the values ​​of each field of the message, comprising:

[0029] If a fixed one-time message is to be sent, the user can click the "Send Single" button on the visual operation interface to automatically obtain the data type and data value of each field and generate one-time message data for sending.

[0030] If periodic messages are to be sent to test the boundary conditions of message field values ​​of the device under test, first set the sending period in seconds on the visual operation interface; then configure the change requirements for each field data, including: minimum value, maximum value, and interval; click the loop button on the visual operation interface to generate message data for sending periodically.

[0031] Furthermore, the method for generating message data in the method of the present invention includes:

[0032] If a field value change requirement is configured, the value of that field will start from the minimum value and accumulate periodically at intervals. When the maximum value is reached, it will start from the minimum value again, and so on. The value of the currently generated message will be updated in real time in the value column.

[0033] Furthermore, the method for generating message data in the method of the present invention includes:

[0034] If no field value change requirements are configured, a message will be generated based on the content of the corresponding value column.

[0035] This invention provides a system for rapid modification of message data structures without compilation, comprising:

[0036] The ini configuration file module is used to design the format and content of the ini configuration file, and to initialize the message name, data type and value of each field in the message;

[0037] The message batch import module is used to automatically read the ini configuration file to achieve batch import of message data;

[0038] The message visualization modification module is used to display the modifiable message data structure and content in a visual form, and to modify the message data structure and content by adding and deleting, and output message configuration information;

[0039] The automatic message generation module is used to obtain message configuration information and concatenate the contents of each field of the message into a byte sequence by data splicing, thereby realizing the creation of message data;

[0040] The message periodic configuration module enables the sending of message data, including one-time sending and periodic sending. It is used to independently configure the periodic changes of the values ​​of each field in the message to achieve the periodic sending of messages.

[0041] The beneficial effects of this invention are:

[0042] 1. This invention designs a method for quickly modifying message data structure without compilation. The data type and data value of each field of the message can be modified through the interface, supporting user customization. The fields are then concatenated one by one, avoiding the process of creating objects using data structures. Therefore, without recompiling, the message data structure can be quickly changed. It is independent of the development environment and improves ease of use.

[0043] 2. This invention avoids the frequent compilation work caused by changes in message data structure, providing testers with a quick modification method that does not require compilation. Attached Figure Description

[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0045] Figure 1 This is a sample of the format content of the ini configuration file in an embodiment of the present invention;

[0046] Figure 2 This is a dropdown list for the message name in this embodiment of the invention;

[0047] Figure 3 This is the loading result of the message field structure and values ​​in this embodiment of the invention;

[0048] Figure 4 This is a visual modification of the message data structure and content in an embodiment of the present invention;

[0049] Figure 5 This is the creation message data in an embodiment of the present invention;

[0050] Figure 6 This is a configuration requirement for changes in field values ​​in this embodiment of the invention;

[0051] Figure 7 This is a business operation flowchart of an embodiment of the present invention;

[0052] Figure 8 This is the endianness conversion option in this embodiment of the invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0054] Example 1

[0055] The method for rapid modification of message data structure without compilation according to an embodiment of the present invention includes the following steps:

[0056] 1. Batch import of message data structures

[0057] This invention, through the design of the format of the ini configuration file, initializes the message name, data type, and values ​​of each field, enabling batch import of multiple messages. An example of the ini configuration file content is shown below. Figure 1 As shown.

[0058] in:

[0059] The [type] section indicates the data structure type, including: uint8_t, uint16_t, uint32_t, uint64_t, int, and double; users can also add data types as needed.

[0060] In the [Msg1] section, Msg1 represents the message name, and the section content represents the data type and value of each field in the message; the two are separated by "+", and if there is no "+", the default initial value is 0. The specific format is as follows:

[0061] [Message 1 Name]

[0062] 1 = Field 1 data structure + Field 1 value

[0063] 2 = Field 2 data structure + Field 2 value ......

[0065] n = data structure of field n + numerical value of field n

[0066] [Message 2 Name]

[0067] 1 = Field 1 data structure + Field 1 value

[0068] 2 = Field 2 data structure + Field 2 value ......

[0070] n = data structure of field n + numerical value of field n

[0071] After startup, it automatically reads the ini configuration file to achieve batch import of message data. Users can select this from the dropdown menu in the upper left corner of the interface. Figure 2 As shown, by selecting the corresponding message name, message data can be loaded quickly. The result of loading the message data is as follows. Figure 3 As shown.

[0072] 2. Visual modification of message data structure and content

[0073] In the tables of the software interface, the table headers include: field number, type, value, minimum value, maximum value, interval, etc.

[0074] You can add or delete message fields using the "Add" and "Delete" buttons on the right side of the interface.

[0075] The data type of the message field can be configured through the drop-down list of the "Type" option.

[0076] The values ​​of message fields can be configured by entering the contents of the "Values" list.

[0077] Operating status, such as Figure 4 As shown.

[0078] 3. Automatic generation of message data content

[0079] After the user completes the configuration of message field data types and values ​​on the interface, this embodiment of the invention will automatically obtain the message configuration information from the interface and concatenate the contents of each field of the message into a byte sequence through data concatenation, thereby realizing the creation of message data, such as... Figure 5 As shown.

[0080] Since this process does not require the creation of object data using a structure or recompilation, it is independent of the development environment and suitable for scenarios where message data structures change frequently. Users can customize message data to create and send test messages by combining ini configuration files and interface configuration.

[0081] 4. Independent configuration for periodic changes in the values ​​of each field in the message.

[0082] Message data transmission includes one-time transmission and periodic transmission. The business logic flowchart is as follows: Figure 7 As shown.

[0083] (1) Send a one-time message

[0084] If only a fixed one-time message needs to be sent, click the "Send Only" button. This embodiment of the invention will automatically obtain the data type and data value of each field and generate one-time message data for sending.

[0085] (2) Send periodic messages

[0086] If periodic messages need to be sent to test the boundary conditions of message field values ​​of the device under test, the sending period (in seconds) can be set first on the interface; then the change requirements for each field data can be configured, including: minimum value, maximum value, and interval, such as... Figure 6 As shown.

[0087] After clicking the [Loop] button, this embodiment of the invention will generate message data periodically for sending.

[0088] If a field value change requirement is configured, the field value will start from the minimum value and periodically accumulate at intervals. Once the maximum value is reached, it will start from the minimum value again, and so on. The value column will be updated in real time with the currently generated message value.

[0089] If no field value change requirements are configured, a message will be generated based on the content of the corresponding value column.

[0090] Example 2

[0091] The specific steps of this invention are as follows:

[0092] (1) In the root directory of the system folder, open the ini configuration file.

[0093] a) In the [type] section, add a key-value pair where the key is "type" and the value is the data type of the message field, separated by semicolons (;); e.g. Figure 1 As shown, it includes 6 data types: uint8_t, uint16_t, uint32_t, uint64_t, int, and double.

[0094] b) Add the data structure for the Msg1 message. In the [Msg1] section, add a key-value pair. The key is the field number, and the value is "data type + number". If no data value is needed, the value is "data type". The default value for initialization is 0.

[0095] (2) Run the system, and in the drop-down menu in the upper left corner, select the message name Msg1, such as... Figure 2 As shown;

[0096] (3) The table below automatically loads the data types and values ​​of each field in the configuration file to initialize the message data. For example... Figure 3 The system automatically loads six fields, with the "Type" column and "Number" category displaying the data type of each field.

[0097] (4) If you need to modify the data structure of the message, click the "Add" button at the top right to add one field at the bottom; for example... Figure 4In the initial message structure, three blank fields are added below for user customization.

[0098] (5) Click the [Delete] button on the right to delete the field in the corresponding row.

[0099] (6) If you need to modify the data type and value of the message fields, you can modify the contents of the "Type" drop-down box and the "Value" input box; for example Figure 4 As shown, the elements in the "Type" dropdown list are the data types set in the INI configuration file, which users can select.

[0100] (7) If sending a one-time message, click the [Single Send] button. The data type and value of each field will be obtained according to the "Type" column and "Value" column in the interface. The message data will be generated by concatenating them one by one and then sent.

[0101] (8) If sending periodic messages, the message sending period needs to be configured in the upper right corner of the interface, in seconds; for example... Figure 6 In the settings, the sending period is set to 1 second. Then, the periodic change requirements for each field are set, including minimum value, maximum value, and interval. Clicking the "Loop" button will generate and send message data according to the set period.

[0102] a) If the field has been configured to accept changes in its value, the value will start from the minimum value and accumulate periodically at intervals. Once the maximum value is reached, it will start again from the minimum value, and so on. The value of the currently created field will be updated in real time in the "Value" column.

[0103] For example Figure 6 In the first field, the minimum value is 0, the maximum value is 100, and the interval is 1. The value of this field starts from 0, increases by 1 every 1 second, and after it reaches 100, it starts from 0 again, and so on.

[0104] b) If no value change requirement is configured for this field, the value of this field, i.e. the content in the "Value" column, will not change.

[0105] For example Figure 6 In the context of the fifth field, if no changes are configured, the value of this field will always be 300.

[0106] (9) If you need to stop sending messages, click the [Stop] button.

[0107] (10) By checking whether to perform endianness conversion, such as Figure 8 As shown, you can configure whether to perform endianness conversion when creating a message to accommodate high and low address translation between the network and host sides.

[0108] (11) Note: Since this system uses field concatenation to concatenate byte by byte into a byte sequence, when receiving and processing, if the structure method is used for parsing, it needs to be set to 1-byte memory alignment.

[0109] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0110] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for rapid modification of message data structure without compilation, characterized in that, The method includes the following steps: By designing the format of the ini configuration file, the message name, data type, and values ​​of each field in the message can be initialized. Automatically reads the ini configuration file to achieve batch import of message data; The system displays the modifiable message data structure and content in a visual format, and allows users to modify the message data structure and content by adding and deleting data, outputting message configuration information. Obtain message configuration information, and then concatenate the contents of each field of the message into a byte sequence by data concatenation, thereby realizing the creation of message data; The transmission of message data includes one-time transmission and periodic transmission. The periodic transmission of message data is achieved by independently configuring the periodic changes of the values ​​of each field in the message. The methods for designing the format content of the ini configuration file include: The contents of the ini configuration file include: The [type] section indicates the data structure type; including: uint8_t, uint16_t, uint32_t, uint64_t, int, and double; users can add data types according to their needs; In the [Msg] section, Msgn represents the name of the nth message, and the section content indicates the data type and value of each field in that message; the two are separated by "+", and if there is no "+", the default initial value is 0; that is: Msgn = data type of field n + value of field n; The method for independent configuration based on the periodic changes in the values ​​of each field in the message includes: If a fixed one-time message is to be sent, the user can click the "Send Single" button on the visual operation interface to automatically obtain the data type and data value of each field and generate one-time message data for sending. If periodic messages are to be sent to test the boundary conditions of message field values ​​of the device under test, first set the sending period in seconds on the visual operation interface; then configure the change requirements for each field data, including: minimum value, maximum value, and interval; click the loop button on the visual operation interface to generate message data for sending periodically.

2. The method for rapid modification of message data structure without compilation according to claim 1, characterized in that, The methods for batch importing message data in this method include: It automatically reads the ini configuration file to achieve batch import of message data. Users can select the corresponding message name in the drop-down menu of the visual operation interface to quickly load the message data content and display the loading result.

3. The method for rapid modification of message data structure without compilation according to claim 1, characterized in that, The methods for visually displaying the modifiable message data structure and content include: In the visual operation interface, the table header headings include: field number, type, value, minimum value, maximum value, and interval; add and delete message fields using the add and delete buttons; among them: Configure the data type of the message fields using the drop-down list of "Type"; Configure the values ​​of message fields by entering the contents of the "Values" list.

4. The method for rapid modification of message data structure without compilation according to claim 1, characterized in that, The methods for generating message data in this method include: If a field value change requirement is configured, the value of that field will start from the minimum value and accumulate periodically at intervals. When the maximum value is reached, it will start from the minimum value again, and so on. The value of the currently generated message will be updated in real time in the value column.

5. The method for rapid modification of message data structure without compilation according to claim 4, characterized in that, The methods for generating message data in this method include: If no field value change requirements are configured, a message will be generated based on the content of the corresponding value column.

6. A system for rapid modification of message data structure without compilation, used to implement the method described in any one of claims 1-5, characterized in that, include: The ini configuration file module is used to design the format and content of the ini configuration file, and to initialize the message name, data type and value of each field in the message; The message batch import module is used to automatically read the ini configuration file to achieve batch import of message data; The message visualization modification module is used to display the modifiable message data structure and content in a visual form, and to modify the message data structure and content by adding and deleting, and output message configuration information; The automatic message generation module is used to obtain message configuration information and concatenate the contents of each field of the message into a byte sequence by data splicing, thereby realizing the creation of message data; The message periodic configuration module enables the sending of message data, including one-time sending and periodic sending. It is used to independently configure the periodic changes of the values ​​of each field in the message to achieve periodic sending of messages.

Citation Information

Patent Citations

  • Message generation method and device and nonvolatile storage medium

    CN116932399A