Form conversion description method between communication data packet and physical data packet
By converting complex data packets into a tree structure and defining node attributes and physical quantity conversion information, the problem in the existing technology that complex data packets are not conducive to rapid configuration is solved, and efficient mapping between communication data packets and physical data packets is achieved. Conversion improves the configuration and operation efficiency of test software.
Patent Information
- Application Number
- CN202410714109.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, complex communication data packets cannot be quickly configured and added, modified, and deleted, which affects the efficiency of data communication, especially when the data packet has a large number of bytes, a long length, and contains a large number of physical quantities.
By converting complex data packets into a tree structure, defining and describing the attributes and physical quantity conversion information of each node, and using XML format to save and read, the mapping and conversion between communication data packets and physical data packets is realized.
It realizes the fast mapping and conversion between complex communication data packets and actual physical quantities, supports the rapid configuration and addition, modification, deletion and query functions of test software, and improves the efficiency of data communication.
Smart Images

Figure CN118569210A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of measurement and control technology, and in particular to a form conversion description method for communication data packets and physical data packets. Background Art
[0002] During the operation of the test software, communication data packets consisting of byte arrays are received from each port of the product under test. The software needs to convert the data packets into physical data packets with practical significance according to the specified format (directly bound to the product under test). Similarly, when the test software needs to send data to the product under test, it needs to first convert the physical data packets into communication data packets consisting of byte arrays according to the specified format, and then send them to the product end by the hardware. The data analysis, processing, display, and storage operations of the test software are all based on these physical data packets. However, when the communication data packets have a large number of bytes, a long length, and contain a large number of physical quantities, it is impossible to achieve rapid configuration and data addition, modification, deletion, and query, which affects the efficiency of data communication. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0004] The present invention provides a method for describing the form conversion between a communication data packet and a physical data packet, the method comprising: according to the properties of the corresponding physical quantity, dividing the data of the same property in the complex data packet into a group as a node that can be further split downward, and so on, converting the complex data packet from a single-form one-dimensional array into a hierarchical structure with a tree structure as the center; defining and describing the attributes of the elements of each node of the tree structure; defining and describing the physical quantity conversion information of the entity nodes with actual physical meaning in the tree structure, including defining and describing the data variables and data conversion information; saving each description file in XML format and reading it into the test software.
[0005] Furthermore, the attributes of an element include: name, element code, location information and element list.
[0006] Furthermore, the element code is unique and its scope is only within this level.
[0007] Furthermore, the position information is used to reflect the relative position of the current element in the parent element.
[0008] Furthermore, the element list is used to reflect the contained subordinate elements.
[0009] Furthermore, the parameters of the data variable include data type, display format, save format, unit and value list.
[0010] Furthermore, the parameters of the data conversion information include the data type, the position of the byte array to be converted in the element position information, the big and small ends, the bit information and the conversion method.
[0011] Furthermore, the position of the byte array to be converted in the element position information includes the starting relative position and the ending relative position of the byte array to be converted in the element position information, and the byte array to be converted that needs to be calculated is determined according to the starting position and the ending position.
[0012] Furthermore, the bit information includes a relative position of the start bit in the conversion byte array and a relative position of the end bit in the conversion byte array.
[0013] By applying the technical solution of the present invention, a method for describing the form conversion between communication data packets and physical data packets is provided. By hierarchically decomposing a complex data packet, defining the attributes and physical quantity conversion information corresponding to the nodes of the tree structure obtained by the decomposition, and performing corresponding descriptions, a received communication data packet can be mapped to a physical data packet with actual physical meaning, or a data packet with physical meaning can be converted into a transmitted communication data packet. Based on this description method, the mapping and conversion between complex communication data packets and actual physical quantities can be realized. The configurable and extensible mapping relationship description method of the present invention can realize the functions of rapid configuration and addition, modification, deletion and query of test software. Compared with the prior art, the technical solution of the present invention can solve the technical problem in the prior art that complex data packets are not conducive to the use of test software. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The included drawings are used to provide a further understanding of the embodiments of the present invention, which constitute a part of the specification, are used to illustrate the embodiments of the present invention, and together with the text description, explain the principles of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1 A schematic flow chart of a method for converting a complex communication data packet into a physical data packet according to a specific embodiment of the present invention is shown;
[0016] Figure 2 It shows a schematic diagram of a hierarchical decomposition structure provided according to a specific embodiment of the present invention;
[0017] Figure 3 A typical XML file format schematic diagram provided according to a specific embodiment of the present invention is shown;
[0018] Figure 4An example diagram of location information in an XML file provided according to a specific embodiment of the present invention is shown;
[0019] Figure 5 An example diagram of data conversion information in an XML file provided according to a specific embodiment of the present invention is shown;
[0020] Figure 6 An example diagram of data variables in an XML file provided according to a specific embodiment of the present invention is shown. DETAILED DESCRIPTION
[0021] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0023] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the parts and steps set forth in these embodiments do not limit the scope of the present invention. Meanwhile, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to those of ordinary skill in the relevant art may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be considered as a part of the specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, and therefore, once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[0024] like Figure 1As shown, according to a specific embodiment of the present invention, a method for converting a communication data packet and a physical data packet is provided, the method comprising:
[0025] According to the properties of the corresponding physical quantities, the data with the same properties in the complex data packet are divided into a group, which is used as a node that can be further split down, and so on, so that the complex data packet is converted from a single one-dimensional array to a hierarchical structure with a tree structure as the center;
[0026] Define and describe the attributes of the elements of each node in the tree structure;
[0027] For entity nodes with actual physical meaning in the tree structure, physical quantity conversion information is defined and described, including definition and description of data variables and data conversion information;
[0028] Each description file is saved in XML format and read into the test software.
[0029] By applying this configuration method, a method for describing the formal conversion between communication data packets and physical data packets is provided. By hierarchically decomposing complex data packets, defining the attributes and physical quantity conversion information corresponding to the nodes of the tree structure obtained by decomposition, and performing corresponding descriptions, the received communication data packets can be mapped to physical data packets with actual physical meanings, or data packets with physical meanings can be converted to sent communication data packets. Based on this description method, the mapping and conversion between complex communication data packets and actual physical quantities can be realized. The configurable and extensible mapping relationship description method of the present invention can realize the functions of rapid configuration and addition, modification, deletion and query of test software.
[0030] First, in the present invention, data of the same nature in a complex data packet are divided into a group according to the properties of the corresponding physical quantities, and serve as a node that can be further split downward, and so on, thereby converting the complex data packet from a single one-dimensional array into a hierarchical structure centered on a tree structure.
[0031] After the division is performed in the above manner, the nodes are divided into two types: one is a newly added virtual node, which has no physical meaning and can be further divided downwards, and is located in the middle layer of the tree structure; the other is a physical node that represents actual physical meaning and is located at the bottom of the tree structure. The operation of each node will not affect the nodes at the same level or above, which is convenient for adding, modifying, deleting and checking operations.
[0032] Furthermore, in the present invention, the attributes of the elements of each node of the tree structure are defined and described.
[0033] After the hierarchical decomposition, the content of each element in the tree structure can be continuously expanded according to the actual application situation, but must meet the corresponding attribute definition. As a specific embodiment of the present invention, as shown in Table 1, an element attribute definition is provided, and the attributes of the element include: name, element code, location information and element list. Among them, the element code corresponds to the element of this level, is unique, and its scope is only in this layer. After the setting is completed, if this node belongs to the upper element, it can be encoded in the way of "upper node element code. This level element code". The location information reflects the relative information of the element in the upper element. Its content includes "start position" and "end position", both of which are integers and start from 0. If the element list is empty, it means that the current node is a bottom node; any node of the lower level first follows the definition of "element attribute", but can be expanded according to the node type; if "base" is used, it means that the lower node is a virtual node; if "physical quantity" is used, the lower node has actual physical meaning and cannot be split down.
[0034] Table 1 An example of element attribute definition
[0035]
[0036]
[0037] Furthermore, in the present invention, the physical quantity conversion information is defined and described for the entity nodes with actual physical meaning in the tree structure, including the definition and description of data variables and data conversion information.
[0038] As a specific embodiment of the present invention, as shown in Table 2, a parameter definition of a data variable is provided, including: data type, display format, storage format, unit and value list.
[0039] Table 2 Parameter example of a data variable
[0040]
[0041]
[0042] As a specific embodiment of the present invention, as shown in Table 3, a parameter definition of data conversion information is provided, including: data type, position of the byte array to be converted in the element position information, big and small ends, bit information and conversion mode. Among them, the position of the byte array to be converted in the element position information includes the relative position of the start and the relative position of the end of the byte array to be converted in the element position information. Through the starting position and the ending position, the byte array to be converted that needs to be calculated can be determined. The bit information includes the starting position (the relative position of the starting bit in the conversion byte array, starting from 0) and the ending position (the relative position of the ending bit in the conversion byte array, starting from 0). Through the starting position and the ending position, the number of bits that need to be calculated and the specific value can be determined.
[0043] Table 3 Parameter example of a data conversion information
[0044]
[0045]
[0046] Furthermore, in the present invention, the above-mentioned description files are saved in XML format and read into the test software.
[0047] Use XML files as the file storage format after formal description, and read the information into the test software through the XML reading operation.
[0048] The following takes a typical communication data packet (column name "byte") and its corresponding physical data packet (column name "name") as an example to explain the conversion relationship in detail. Figure 2 In the datagram, except for the frame header, data length, checksum and other bytes, the part from sequence number 3 to sequence number 69 is the actual part with substantial meaning.
[0049] From the perspective of communication data packets, sequence numbers 3 to 69 have a total of 122 bytes, which are arranged in sequence.
[0050] From the perspective of the physical data packet, the data includes seven physical quantities, including positioning mode and status, longitude, latitude, elevation, east speed, north speed and vertical speed, as well as physical quantity data of the internal status of 12 satellites, including five physical quantities, including satellite number, channel status, carrier-to-noise ratio, elevation angle and azimuth angle, and a total of 67 data quantities with different physical meanings. The byte data occupied by each physical quantity in the data packet is different. In actual use, the byte data needs to be converted into a value matching the "type" first, and then changed according to the proportional coefficient to obtain the final physical quantity value.
[0051] First, perform hierarchical decomposition.
[0052] When defining the model of the data packet, it is first necessary to decompose the physical quantities hierarchically according to their organizational structure. For example, the 60 physical quantities of the 12 satellites have obvious repetitive properties and can be replaced by a virtual "channel information", which together with the previous seven physical quantities form the first-level element of the data packet; at the same time, the internal elements of the channel information are at the second level, consisting of the channel information of the 12 satellites, that is, the next-level elements of the "channel information" contain 12 virtual channel information (1-12) reflecting each satellite channel; and the description of each channel information is placed at the third level, including five physical quantities such as satellite number, channel status, carrier-to-noise ratio, elevation angle and azimuth angle.
[0053] exist Figure 2 On the right side, the data packets on the left are divided into three levels. The italic fonts are virtual elements that have no actual physical meaning; the non-italic fonts represent physical quantities with actual meaning. In the hierarchical division, at this level, only the data volume defined within the layer needs to be managed.
[0054] Next, the attributes of the elements are defined and described, as shown in Table 1.
[0055] Then, the physical quantity conversion information is defined and described, as shown in Table 2 and Table 3.
[0056] Finally, each description file is saved in XML format and read into the test software.
[0057] Figure 3 It is a typical XML file format. In the specific implementation, serialization and deserialization methods are used to realize the reading operation of the file. In the XML file, the node numbered 0 and named "Inertial Navigation Telemetry Data" is the top node of the tree structure, which contains three bottom nodes of type "physical quantity" and two intermediate virtual nodes of type "foundation". Each intermediate virtual node contains 12 child nodes (numbered 1 to 12).
[0058] For the occupied bytes attribute of a node, use Figure 4 The XML format description is shown. The position reflects the relative information in the parent element. Its content includes two items, "start position" and "end position", both of which are integers and start from 0. For example, when the start position is 8 and the end position is 128, it means that data is selected from the position with sequence number 8 of the parent node and ends at sequence number 128, which contains a total of 121 bytes of data.
[0059] For data conversion information, use Figure 5The XML format description is shown. After the operation is completed according to the byte value or byte and bit matching method, the subsequent operation (such as multiplication by dimension) is realized through a specific conversion method. Taking the following figure as an example, the four bytes 0-3 are first converted to integer data, and then converted to floating point numbers according to the formula.
[0060] For data variables, use Figure 6 The XML format description is shown. The value list is a further explanation of what each value of the physical quantity represents.
[0061] XML files are used as the file storage format after the form conversion description, providing the overall structure of the data package and the description of each internal attribute.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for describing the form conversion between a communication data packet and a physical data packet, characterized in that: The method comprises: According to the properties of the corresponding physical quantities, the data with the same properties in the complex data packet are divided into a group, which is used as a node that can be further split down, and so on, so that the complex data packet is converted from a single one-dimensional array to a hierarchical structure with a tree structure as the center; Define and describe the attributes of the elements of each node in the tree structure; For entity nodes with actual physical meaning in the tree structure, physical quantity conversion information is defined and described, including definition and description of data variables and data conversion information; Each description file is saved in XML format and read into the test software.
2. The method for format conversion description between communication data packets and physical data packets according to claim 1, characterized in that: The attributes of an element include: name, element code, location information, and element list.
3. The method for format conversion description between communication data packets and physical data packets according to claim 2, characterized in that: The element code is unique and its scope is only within this level.
4. The method for format conversion description between communication data packets and physical data packets according to claim 2 or 3, characterized in that: The position information is used to reflect the relative position of the current element in the parent element.
5. The method for format conversion description between communication data packets and physical data packets according to claim 2, characterized in that: The element list is used to reflect the contained subordinate elements.
6. The method for format conversion description between communication data packets and physical data packets according to any one of claims 1 to 5, characterized in that: The parameters of data variables include data type, display format, storage format, unit, and value list.
7. The method for format conversion description between communication data packets and physical data packets according to claim 1, characterized in that: The parameters of the data conversion information include the data type, the position of the byte array to be converted in the position information of this element, the big and small ends, the bit information and the conversion method.
8. The method for format conversion description between communication data packets and physical data packets according to claim 7, characterized in that: The position of the byte array to be converted in the position information of this element includes the relative position of the start and the relative position of the end of the byte array to be converted in the position information of this element. The byte array to be converted that needs to be calculated is determined according to the start position and the end position.
9. The method for format conversion description between communication data packets and physical data packets according to claim 7, characterized in that: The bit information includes the relative position of the start bit in the conversion byte array and the relative position of the end bit in the conversion byte array.
