Data serialization processing method and device, electronic equipment and storage medium
By serializing the data from IoT terminals and using the location and message ID information of the target signal for splicing and conversion, efficient serialized binary data is generated, which solves the problems of low data encoding efficiency and large size of IoT terminals and reduces data transmission costs.
Patent Information
- Application Number
- CN202511845298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-02-10
AI Technical Summary
Existing IoT terminal data encoding methods are inefficient and produce large data volumes, leading to high-cost data transmission.
By splicing and converting data based on the target signal's location information and message ID information, efficient serialized binary data is generated, reducing data volume and ensuring transmission efficiency.
It achieves efficient encoding of IoT terminal data, reducing data backhaul costs.
Smart Images

Figure CN121508741A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, specifically to a data serialization processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, in the Internet of Things (IoT) field, such as connected vehicles, industrial IoT, smart sensors, drones, and robots, IoT terminals like smart cars, industrial robots, smart sensors, drones, and smart robots generate a large amount of data during operation. This data is crucial for the functional interaction and operational status monitoring of IoT terminals. Specific data processing methods need to be selected based on the characteristics of different application scenarios before the data is processed and sent to the cloud or server. The cloud then uses this data for real-time functional interaction, status monitoring, offline fault analysis, and various intelligent data applications. Currently, for scenarios involving real-time data uploads to the cloud, commonly used data serialization encoding methods such as protobuf and JSON suffer from low efficiency and large encoded data volumes. In IoT scenarios, due to the extremely high volume of data interaction between the edge and the cloud, this leads to high data transmission costs.
[0003] IoT terminals generate massive amounts of data during operation, some of which needs to be uploaded to the cloud in real time for functional interaction, status monitoring, and other purposes. This requires an efficient data serialization encoding method to encode the data before uploading. However, for scenarios involving real-time data uploads to the cloud, traditional data encoding methods typically use protobuf, JSON, etc. The efficiency of these encoding methods and the resulting data volume are prohibitively high in IoT scenarios due to the sheer volume of data, leading to significant costs.
[0004] To meet practical needs, a data serialization processing technology is proposed. Summary of the Invention
[0005] In view of the deficiencies in the existing technology, the purpose of this application is to provide a data serialization processing method, apparatus, electronic device and storage medium to overcome the shortcomings of the existing technology, to efficiently encode the data in the Internet of Things terminal, generate binary data that can be directly sent over the network, reduce the data volume while ensuring transmission efficiency, and help reduce the cost of data backhaul from the Internet of Things terminal.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows: In a first aspect, this application provides a data serialization processing method, the method comprising the following steps: Based on the location information of each target signal in the corresponding target message, the total byte length information of the serialized binary data is obtained; Each target signal is spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained; Based on the target message ID information and the location information of each target signal, the original binary data of each target signal is obtained; Based on the original binary data of each target signal, and combined with the corresponding concatenated position information, the concatenated binary data of the set of concatenated target signals corresponding to each target signal is obtained, and integrated to obtain serialized binary data; wherein, The location information includes start byte information, start bit information, and bit length information; The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
[0007] Based on the above technical solution, the total byte length information of the serialized binary data is obtained based on the position information of each target signal in the corresponding target message, including the following steps: Based on the position information of each target signal, the bit length information corresponding to each target signal is summed to obtain the total byte length information of the serialized binary data.
[0008] Based on the above technical solution, the target signals are spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained, including the following steps: According to the preset custom splicing order, the target signals are spliced together to obtain a spliced set of target signals; Based on the spliced target signal set and the custom splicing order, the position information of each target signal in the spliced target signal set is obtained and recorded as the spliced position information.
[0009] Based on the above technical solution, and using the original binary data of each target signal, combined with the corresponding spliced position information, the spliced binary data of the set of spliced target signals corresponding to each target signal is obtained, and integrated to obtain serialized binary data, including the following steps: Based on the total byte length information of the serialized binary data, generate initial binary data of the corresponding byte length; Based on the original binary data of each target signal, and combined with the corresponding spliced position information, a data conversion operation is performed on the initial binary data to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and then integrated to obtain serialized binary data.
[0010] Secondly, this application provides a data serialization processing apparatus, the apparatus comprising: The total byte information acquisition module is used to obtain the total byte length information of the serialized binary data based on the position information of each target signal in the corresponding target message; The target signal splicing module is used to splice each target signal to obtain a spliced target signal set, and to obtain the spliced position information of each target signal in the spliced target signal set; The raw data acquisition module is used to obtain the raw binary data of each target signal based on the target message ID information and the location information of each target signal; A serialization processing module is used to obtain the concatenated binary data of the concatenated target signal set corresponding to each target signal based on the original binary data of each target signal and the corresponding concatenated position information, and to integrate them to obtain serialized binary data; wherein, The location information includes start byte information, start bit information, and bit length information; The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
[0011] Based on the above technical solution, the total byte information acquisition module is also used to sum the bit length information corresponding to each target signal based on the position information of each target signal to obtain the total byte length information of the serialized binary data.
[0012] Based on the above technical solution, the target signal splicing module is also used to splice each target signal according to a preset custom splicing order to obtain a spliced target signal set; The target signal splicing module is also used to obtain the position information of each target signal in the spliced target signal set based on the spliced target signal set and the custom splicing order, and record it as the spliced position information.
[0013] Based on the above technical solution, the serialization processing module is also used to generate initial binary data of corresponding byte length based on the total byte length information of the serialized binary data; The serialization processing module is further configured to perform data conversion operations on the initial binary data based on the original binary data of each target signal and in combination with the corresponding spliced position information, to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and integrate them to obtain serialized binary data.
[0014] Thirdly, this application provides an electronic device, the electronic device comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the data serialization processing method as mentioned in the first aspect.
[0015] Fourthly, this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the data serialization processing method mentioned in the first aspect.
[0016] Compared with the prior art, the advantages of this application are: This application overcomes the shortcomings of the prior art by efficiently encoding the data in the IoT terminal to generate binary data that can be directly sent over the network. While ensuring transmission efficiency, it reduces the data volume, which helps to reduce the cost of data backhaul from the IoT terminal. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the steps of a data serialization processing method according to an embodiment of this application.
[0019] Figure 2 This is a schematic diagram illustrating the technical principle between the target signal and the target message in the data serialization processing method of this application embodiment.
[0020] Figure 3 This is a schematic diagram illustrating the target signal splicing principle of the data serialization processing method in this application embodiment.
[0021] Figure 4 This is a schematic diagram illustrating the principle of binary data conversion process in the data serialization processing method of this application embodiment.
[0022] Figure 5 This is a structural block diagram of a data serialization processing apparatus according to an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0025] This application provides a data serialization processing method, apparatus, electronic device, and storage medium, which overcomes the shortcomings of the prior art. It efficiently encodes data within IoT terminals to generate binary data that can be directly transmitted over the network. While ensuring transmission efficiency, it reduces data volume and helps to lower the cost of data backhaul from IoT terminals.
[0026] To achieve the aforementioned technical effects, the overall concept of this application is as follows: A data serialization processing method, the method comprising the following steps: S1. Based on the location information of each target signal in the corresponding target message, obtain the total byte length information of the serialized binary data; S2. The target signals are spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained. S3. Based on the target message ID information and location information of each target signal, obtain the original binary data of each target signal; S4. Based on the original binary data of each target signal, and combined with the corresponding concatenated position information, obtain the concatenated binary data of the set of concatenated target signals corresponding to each target signal, and integrate them to obtain serialized binary data; among which, The position information includes the starting byte information, the starting bit information, and the bit length information; The position information after splicing includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
[0027] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0028] Firstly, see [the following] Figures 1-4 As shown in the figure, this application provides a data serialization processing method, which includes the following steps: S1. Based on the location information of each target signal in the corresponding target message, obtain the total byte length information of the serialized binary data; S2. The target signals are spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained. S3. Based on the target message ID information and location information of each target signal, obtain the original binary data of each target signal; S4. Based on the original binary data of each target signal, and combined with the corresponding concatenated position information, obtain the concatenated binary data of the set of concatenated target signals corresponding to each target signal, and integrate them to obtain serialized binary data; among which, The position information includes the starting byte information, the starting bit information, and the bit length information; The position information after splicing includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
[0029] In this embodiment, the shortcomings of the prior art are overcome by efficiently encoding the data in the IoT terminal to generate binary data that can be directly sent over the network. While ensuring transmission efficiency, the data volume is reduced, which helps to reduce the cost of data backhaul from the IoT terminal.
[0030] Furthermore, based on the location information of each target signal in the corresponding target message, the total byte length information of the serialized binary data is obtained, including the following steps: Based on the position information of each target signal, the bit length information corresponding to each target signal is summed to obtain the total byte length information of the serialized binary data.
[0031] Furthermore, the target signals are spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained, including the following steps: According to the preset custom splicing order, the target signals are spliced together to obtain a spliced set of target signals; Based on the spliced target signal set and the custom splicing order, the position information of each target signal in the spliced target signal set is obtained and recorded as the spliced position information.
[0032] Furthermore, based on the original binary data of each target signal and combined with the corresponding spliced position information, the spliced binary data of each target signal corresponding to the spliced target signal set is obtained, and integrated to obtain serialized binary data, including the following steps: Based on the total byte length information of the serialized binary data, generate initial binary data of the corresponding byte length; Based on the original binary data of each target signal, and combined with the corresponding spliced position information, a data conversion operation is performed on the initial binary data to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and then integrated to obtain serialized binary data.
[0033] Based on the above core technologies, the embodiments of this application include two processes in specific implementation: a serialization configuration file generation process and a binary data conversion process.
[0034] Specifically, the serialization configuration file generation process includes the following steps: A1. Based on the target message corresponding to each target signal, obtain the key element information corresponding to each target signal. The key element information includes location information, which includes the start byte information, start bit information, and bit length information of the target signal in the target message. A2. Sum the bit length information corresponding to each target signal to obtain the total byte length information of the serialized binary data corresponding to the serialization configuration file; A3. According to the preset custom splicing order, splice the target signals to obtain the spliced target signal set; A4. Based on the spliced target signal set and the custom splicing order, obtain the position information of each target signal in the spliced target signal set, denoted as the spliced position information. The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set. A5. Based on the total byte length information of the serialized binary data, the target message ID information of each target signal, the location information, and the concatenated location information, generate a serialization configuration file.
[0035] It should be noted that the custom splicing order can be as follows: During splicing, the low bit of the low byte is used as the starting bit direction and the high bit of the high byte is used as the ending bit direction. Each target signal is spliced sequentially starting from the low bit.
[0036] Specifically, the binary data conversion process includes the following steps: B1. Based on the total byte length information of the serialized binary data in the serialization configuration file, generate initial binary data of the corresponding byte length; B2. Based on the target message ID information of each target signal, obtain the target message, and according to the location information, obtain the original binary data of each target signal; B3. Based on the original binary data of each target signal, and combined with the corresponding spliced position information, perform a data conversion operation on the initial binary data to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and integrate them to obtain serialized binary data.
[0037] Specifically, based on the technical solution of the embodiments of this application, the specific implementation is as follows: Part 1: Generating the serialization configuration file: 1. Confirm the original signal type and signal range that the IoT terminal needs to upload: 1.1 The amount of data generated by IoT terminals is enormous. Depending on the usage scenario, some data needs to be uploaded to the cloud in real time, while other data can be stored within the IoT terminal and uploaded only when needed. First, it is necessary to determine the signal range for real-time cloud uploads, i.e., select the target signal, and then determine the target message containing the target signal based on the target signal.
[0038] 2. Based on the encoding method of the target signal in the original message, extract the key metadata of the original signal definition to generate the serialization configuration file: 2.1 The encoding method of the target signal in the target message is fixed. The position information of the target signal in the target message is obtained according to the encoding method of the target message. This position information usually includes the starting byte information, the starting bit information, and the bit length information occupied by the target signal in the target message. This location information is a key element defining the target signal. Through this key element, the original binary information of the target signal can be accurately parsed from the target message.
[0039] 2.2 Some target signals exist within Ethernet packets, and their encoding method is fixed. Similarly, the target signal value is directly parsed and obtained according to the encoding method of the target signal in the Ethernet packet. Depending on the encapsulation method of the target Ethernet packet, the encoding method of the target signal may be the same as in point 2.1, in which case the same method is used to obtain the key element information defined by the target signal; the target signal may also be encoded in plaintext or a specific encoding form in the target packet, in which case the target signal value is directly parsed using the corresponding encoding method. In this case, since various state data within the IoT terminal usually have data boundaries, i.e., maximum and minimum values, the key element information of the target signal, namely the bit length, can be defined based on the boundary values of the target signal.
[0040] 2.3 Based on the key element information of the target signal obtained in points 2.1 and 2.2, generate a portion of the serialization configuration file information, which mainly includes the target message information where each target signal is located (the identity-related information of the target message corresponding to the target signal), the starting bit information (starting byte information) of the target signal in the target message, and the bit length information occupied by the target signal.
[0041] 3. Based on the key element information of all target signals, rearrange the key elements bit by bit to generate new key element information. Based on the key element information of the target signals and the newly generated key element information, generate a serialization configuration file: 3.1 Based on the key element information of all target signals obtained in Section 2, the key element information of each signal contains the bit length information occupied by the signal. Calculate the total bit length occupied by all signals. The total bit length is the bit length of the effective information in the final serialized binary data. Convert the bit length to byte length (8 bits equals 1 byte). Round up any bits less than one byte to generate one byte. The resulting byte length is the byte length of the final serialized binary data.
[0042] 3.2 Rearrange all target signals in order (either a preset order or a random order), and then concatenate them bit by bit. The total length of the binary data after concatenation is the same as the total length of the bits in point 3.1 above. The byte length of the binary data after concatenation is the same as the byte length in point 3.1 above. When concatenating, the low bit of the low byte is used as the starting bit direction, and the high bit of the high byte is used as the ending bit direction. Each signal is concatenated sequentially starting from the low bit.
[0043] 3.3 Based on the splicing order of each target signal in point 3.2 above, the key element information of each target signal in the newly generated binary data can be obtained. The new key element information includes the starting bit information of the target signal in the regenerated binary data and the bit length information occupied by the signal. The bit length information occupied is the same as the bit length information occupied by the original message. The starting bit information of each target signal is equal to the sum of the bit lengths of all target signals that have been spliced before.
[0044] The final serialization configuration file contains the total byte length of the serialized binary data, the original message ID of each target signal, the starting bit information of each target signal in the original message, the bit length of each target signal, the starting bit information of each target signal in the reassembled binary data (i.e., the serialized data), and other parameter information related to the parsing or calculation of the target signal.
[0045] The second part serializes the target data into binary data that can be directly transmitted over the network according to the serialization configuration file: 1. Data uploaded by IoT terminals to the cloud or server in real time is generally sampled periodically, and then the sampled data is encoded in a specific way before being sent. The serialization encoding method for target data described in this solution refers to the target data, i.e. the target signal, which usually refers to all target data acquired in each sampling period. In specific scenarios, all target data can also be acquired temporarily outside the sampling period, and then the serialization encoding method is applied to the acquired target data.
[0046] 2. Using the serialization configuration file generated in Part 1 above, the total byte length of the final serialized binary data can be obtained. An array or list of the same length is generated according to the total byte length. Each initial element of the array or list is 0xFF. This array or list serves as the initial binary data after reassembling each signal. After performing the operation in point 3 below on this initial binary data, new binary data is generated, which serves as the target binary data after the final serialization encoding of each signal.
[0047] 3. Perform the following encoding operations on each target signal in the serialization configuration file in sequence: 3.1 Based on the original message ID information of the target signal in the serialization configuration file, the original message of the target signal, i.e. the target message, is located.
[0048] 3.2 Based on the start bit information and bit length information of the target signal in the target packet from the serialization configuration file, the binary representation of the target signal is extracted from the target packet through bit operations. If the target signal uses plaintext or other encoding methods in the Ethernet packet, the original value of the target signal is obtained using the corresponding decoding method, and then converted into the corresponding binary representation based on the bit length information of the target signal.
[0049] 3.3. Based on the starting bit information of the target signal in the reassembled binary data (i.e., the serialized data) and the bit length information occupied by the target signal in the serialization configuration file, determine the precise bit position of the target signal in the reassembled binary data.
[0050] 3.4 Perform a logical AND operation between the binary representation of the signal extracted in point 3.2 and the precise bit position of the target signal in the initial binary data in point 2. Since the initial binary data consists of 0xFF, performing the logical AND operation is equivalent to filling the target bit position of the binary representation of the target signal into the target bit position of the initial binary data. The precise bit position of the target signal in the initial binary data is determined by the precise bit position of the target signal in the reassembled binary data in point 3.3.
[0051] 4. After performing the operation in point 3 above, the initial binary data generates a new binary data group. All the data in this array is directly converted into bytes and concatenated in order to obtain binary byte data, which is the final serialized binary byte data. This binary byte data can be directly used for network transmission or storage.
[0052] 5. After receiving the binary byte data in the cloud or on the server, use the same serialization configuration file to obtain the start bit information, bit length information, etc. of each target signal, and then use the start bit information, bit length information, etc. of each signal to parse the corresponding value of each target signal from the binary byte data.
[0053] Secondly, see Figure 5 As shown, this application embodiment provides a data serialization processing apparatus, the apparatus comprising: The total byte information acquisition module is used to obtain the total byte length information of the serialized binary data based on the position information of each target signal in the corresponding target message; The target signal splicing module is used to splice each target signal to obtain a spliced target signal set, and to obtain the spliced position information of each target signal in the spliced target signal set; The raw data acquisition module is used to obtain the raw binary data of each target signal based on the target message ID information and the location information of each target signal; A serialization processing module is used to obtain the concatenated binary data of the concatenated target signal set corresponding to each target signal based on the original binary data of each target signal and the corresponding concatenated position information, and to integrate them to obtain serialized binary data; wherein, The location information includes start byte information, start bit information, and bit length information; The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
[0054] In this embodiment, the shortcomings of the prior art are overcome by efficiently encoding the data in the IoT terminal to generate binary data that can be directly sent over the network. While ensuring transmission efficiency, the data volume is reduced, which helps to reduce the cost of data backhaul from the IoT terminal.
[0055] Furthermore, the total byte information acquisition module is also used to sum the bit length information corresponding to each target signal based on the position information of each target signal to obtain the total byte length information of the serialized binary data.
[0056] Furthermore, the target signal splicing module is also used to splice each target signal according to a preset custom splicing order to obtain a spliced target signal set; The target signal splicing module is also used to obtain the position information of each target signal in the spliced target signal set based on the spliced target signal set and the custom splicing order, and record it as the spliced position information.
[0057] Furthermore, the serialization processing module is also used to generate initial binary data of corresponding byte length based on the total byte length information of the serialized binary data; The serialization processing module is further configured to perform data conversion operations on the initial binary data based on the original binary data of each target signal and in combination with the corresponding spliced position information, to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and integrate them to obtain serialized binary data.
[0058] Similarly, based on the above core technologies, in specific implementation, the embodiments of this application can be integrated into two core processing modules: a serialization configuration file generation module and a binary data conversion module, which are used to execute the serialization configuration file generation process and the binary data conversion process, respectively.
[0059] Specifically, the serialization configuration file generation process executed by the serialization configuration file generation module includes the following steps: A1. Based on the target message corresponding to each target signal, obtain the key element information corresponding to each target signal. The key element information includes location information, which includes the start byte information, start bit information, and bit length information of the target signal in the target message. A2. Sum the bit length information corresponding to each target signal to obtain the total byte length information of the serialized binary data corresponding to the serialization configuration file; A3. According to the preset custom splicing order, splice the target signals to obtain the spliced target signal set; A4. Based on the spliced target signal set and the custom splicing order, obtain the position information of each target signal in the spliced target signal set, denoted as the spliced position information. The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set. A5. Based on the total byte length information of the serialized binary data, the target message ID information of each target signal, the location information, and the concatenated location information, generate a serialization configuration file.
[0060] It should be noted that the custom splicing order can be as follows: During splicing, the low bit of the low byte is used as the starting bit direction and the high bit of the high byte is used as the ending bit direction. Each target signal is spliced sequentially starting from the low bit.
[0061] Specifically, the binary data conversion process executed by the binary data conversion module includes the following steps: B1. Based on the total byte length information of the serialized binary data in the serialization configuration file, generate initial binary data of the corresponding byte length; B2. Based on the target message ID information of each target signal, obtain the target message, and according to the location information, obtain the original binary data of each target signal; B3. Based on the original binary data of each target signal, and combined with the corresponding spliced position information, perform a data conversion operation on the initial binary data to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and integrate them to obtain serialized binary data.
[0062] In summary, the data serialization processing apparatus provided in this application embodiment has the same technical principle as the data serialization processing method provided in the first aspect in terms of technical problems, technical solutions and technical effects, so it will not be described again here.
[0063] Thirdly, this application provides an electronic device, the electronic device comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the data serialization processing method as mentioned in the first aspect.
[0064] Fourthly, this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the data serialization processing method mentioned in the first aspect.
[0065] In the description of this application, it should be noted that the terms "upper," "lower," etc., indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the system or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two components. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.
[0066] It should be noted that in this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0067] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data serialization processing method, characterized in that, The method includes the following steps: Based on the location information of each target signal in the corresponding target message, the total byte length information of the serialized binary data is obtained; Each target signal is spliced together to obtain a spliced target signal set, and the spliced position information of each target signal in the spliced target signal set is obtained; Based on the target message ID information and the location information of each target signal, the original binary data of each target signal is obtained; Based on the original binary data of each target signal, and combined with the corresponding concatenated position information, the concatenated binary data of the set of concatenated target signals corresponding to each target signal is obtained, and integrated to obtain serialized binary data; wherein, The location information includes start byte information, start bit information, and bit length information; The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
2. The data serialization processing method as described in claim 1, characterized in that, Based on the location information of each target signal in the corresponding target message, the total byte length information of the serialized binary data is obtained, including the following steps: Based on the position information of each target signal, the bit length information corresponding to each target signal is summed to obtain the total byte length information of the serialized binary data.
3. The data serialization processing method as described in claim 1, characterized in that, The process involves splicing together the target signals to obtain a spliced target signal set, and then obtaining the spliced position information of each target signal within the spliced target signal set. This includes the following steps: According to the preset custom splicing order, the target signals are spliced together to obtain a spliced set of target signals; Based on the spliced target signal set and the custom splicing order, the position information of each target signal in the spliced target signal set is obtained and recorded as the spliced position information.
4. The data serialization processing method as described in claim 1, characterized in that, Based on the original binary data of each target signal, and combined with the corresponding spliced position information, the spliced binary data of the set of spliced target signals corresponding to each target signal is obtained, and integrated to obtain serialized binary data, including the following steps: Based on the total byte length information of the serialized binary data, generate initial binary data of the corresponding byte length; Based on the original binary data of each target signal, and combined with the corresponding spliced position information, a data conversion operation is performed on the initial binary data to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and then integrated to obtain serialized binary data.
5. A data serialization processing apparatus, characterized in that, The device includes: The total byte information acquisition module is used to obtain the total byte length information of the serialized binary data based on the position information of each target signal in the corresponding target message; The target signal splicing module is used to splice each target signal to obtain a spliced target signal set, and to obtain the spliced position information of each target signal in the spliced target signal set; The raw data acquisition module is used to obtain the raw binary data of each target signal based on the target message ID information and the location information of each target signal; A serialization processing module is used to obtain the concatenated binary data of the concatenated target signal set corresponding to each target signal based on the original binary data of each target signal and the corresponding concatenated position information, and to integrate them to obtain serialized binary data; wherein, The location information includes start byte information, start bit information, and bit length information; The spliced position information includes the starting byte information, starting bit information, and bit length information of the target signal in the spliced target signal set.
6. The data serialization processing apparatus as described in claim 5, characterized in that: The total byte information acquisition module is also used to sum the bit length information corresponding to each target signal based on the position information of each target signal to obtain the total byte length information of the serialized binary data.
7. The data serialization processing apparatus as described in claim 5, characterized in that: The target signal splicing module is also used to splice each target signal according to a preset custom splicing order to obtain a spliced target signal set; The target signal splicing module is also used to obtain the position information of each target signal in the spliced target signal set based on the spliced target signal set and the custom splicing order, and record it as the spliced position information.
8. The data serialization processing apparatus as described in claim 5, characterized in that: The serialization processing module is also used to generate initial binary data of a corresponding byte length based on the total byte length information of the serialized binary data; The serialization processing module is further configured to perform data conversion operations on the initial binary data based on the original binary data of each target signal and in combination with the corresponding spliced position information, to obtain the spliced binary data of the spliced target signal set corresponding to each target signal, and integrate them to obtain serialized binary data.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the data serialization processing method as described in any one of claims 1 to 4.
10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the data serialization processing method as described in any one of claims 1 to 4.