Data transmission method, device and system, storage medium and electronic device

By grouping and framing the packet number of sensor data in the field of intelligent driving cars, the problem of inefficient packet transmission of multi-data source data is solved, and efficient and accurate data transmission and framing effects are achieved.

CN119814674APending Publication Date: 2025-04-11CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510035135.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, in the field of intelligent driving vehicles, data packets sent by multiple data sources cannot be processed efficiently and accurately, resulting in insufficiency of framing.

Method used

By receiving the received frames transmitted by multiple data sources, the received frames are grouped according to the packet sequence number, multiple data groups are obtained, and these data groups are framed, multiple publish frames are generated, and these publish frames are finally transmitted to the frame data subscription end.

Benefits of technology

A new framing method is realized, which improves the universality of data transmission and framing efficiency, and can accurately align data packets from multiple data sources, solving the problem of data inability to be grouped due to data loss during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814674A_ABST
    Figure CN119814674A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method, device and system, a storage medium and an electronic device.The method comprises the steps that receiving frames transmitted by a plurality of data sources are received, the receiving frames comprise a plurality of data packets, and one data packet only carries one packet sequence number; grouping the receiving frames according to the packet serial numbers to obtain a plurality of data groups, the packet serial numbers of the data packets sent by the same data group in the same period being the same; respectively framing the plurality of data groups to obtain a plurality of publishing frames; and transmitting the plurality of publishing frames to a framing data subscription end. Through the embodiment of the invention, the technical problem that data packets sent by multiple data sources cannot be framed at the same time in the prior art is solved, and the universality and framing efficiency of data transmission are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data transmission method and device, a system, a storage medium, and an electronic device. Background Art

[0002] In the related technology, in the field of smart driving cars, in order to more accurately obtain various types of information about various things around the vehicle, multiple types of sensors will be installed around the vehicle, and even the same type of sensors will be installed in different positions of the vehicle, such as cameras, millimeter-wave radars, etc. The data generated by the sensors needs to be used in combination in the existing smart driving field to issue correct control instructions to the vehicle. Under the existing overall intelligent driving architecture, sensors send data to the domain controller through network transmission methods such as TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) / DDS (Data Distribution Service). In order to check whether the data is lost during the transmission process, in the existing data transmission process, a packet number (rolling counter) will be added to identify the order of transmission.

[0003] In the related art, only the data packets split by the same data sender due to network transmission are studied for framing, but no research is done on the framing of data from multiple senders. In the existing research, because there is only one data sending source, there is no operation process for aligning data during framing.

[0004] With respect to the above-mentioned problems existing in the related technologies, no efficient and accurate solutions have been found yet. Summary of the invention

[0005] The present invention provides a data transmission method and device, a system, a storage medium, and an electronic device to solve technical problems in related technologies.

[0006] According to one embodiment of the present invention, there is provided a data transmission method, comprising: receiving reception frames transmitted by several data sources, wherein the reception frames include multiple data packets, and one data packet carries only one packet sequence number; grouping the reception frames according to the packet sequence numbers to obtain multiple data groups, wherein data packets of the same data group sent in the same cycle have the same packet sequence number; framing the multiple data groups respectively to obtain multiple publishing frames; and transmitting the multiple publishing frames to a framing data subscriber.

[0007] Optionally, the received frame is grouped according to the packet sequence number to obtain multiple data groups, including: traversing each data packet in the received frame to determine the packet sequence number carried by each data packet in the same sending cycle; if the received frame carries multiple packet sequence numbers in the same sending cycle, initializing the received frame to the corresponding multiple data groups, and the data of the same group has the same packet sequence number in the same sending cycle; if the received frame carries one packet sequence number in the same sending cycle, initializing the received frame to a corresponding data group.

[0008] Optionally, the multiple data groups are framed separately to obtain multiple published frames, including: for each received frame, obtaining a packet number determination table and a current packet number carried by the data packet in the data group; reading a currently recorded reference packet number from the packet number determination table, wherein the packet number determination table is used to store a packet number offset value for each data group and a reference packet number currently to be framed; and framing the data packet according to the reference packet number and the current packet number.

[0009] Optionally, framing the data packet according to the reference packet sequence number and the current packet sequence number includes: performing frame loss check on the data packet based on the reference packet sequence number and the current packet sequence number; if the data packet is normal data, obtaining a list of frames to be combined for the published frame; and adding the data packet to the list to be combined to complete the framing operation.

[0010] Optionally, performing frame loss check on the data packet based on the reference packet sequence number and the current packet sequence number includes: searching for a packet sequence number offset value that matches the current data group in a framing determination table; correcting the current packet sequence number based on the offset value to obtain a target packet sequence number; comparing the reference packet sequence number with the target packet sequence number; if the reference packet sequence number is equal to the target packet sequence number, determining that the data packet is normal data.

[0011] Optionally, after comparing the reference packet sequence number with the target packet sequence number, the method further includes: if the target packet sequence number is smaller than the reference packet sequence number, discarding the data packet; if the target packet sequence number is larger than the reference packet sequence number, updating the reference packet sequence number and starting a new round of framing in the current data group.

[0012] Optionally, before searching the framing determination table for a packet sequence number offset value that matches the data group, the method further includes: receiving first data source data and second data source data from the plurality of data sources in two adjacent cycles; recording a first receiving time and a second receiving time of the first data source data and the second data source data, respectively; sorting the first receiving time and the second receiving time, and selecting the middle period after the sorting as the reference time; calculating in turn the designated packet sequence numbers of the data packets received closest to the reference time for each data group; and configuring the designated packet sequence numbers as the packet sequence number offset values ​​of the corresponding data group in the framing determination table.

[0013] Optionally, after obtaining the list of frames to be combined for publication, the method further includes: reading the framing time of the published frame in the current cycle; judging whether the framing time is greater than the framing timeout time, wherein the framing timeout time is less than the sending cycle length of the data group; if the framing time is greater than the framing timeout time, transmitting the framing data in the list to be combined to the framing data subscriber.

[0014] Optionally, transmitting the multiple publishing frames to the framing data subscription end includes: for each publishing frame, determining whether the corresponding data packet has been assembled; if the corresponding data packet has been assembled, transmitting the publishing frame to the framing data subscription end.

[0015] Optionally, receiving reception frames transmitted by several data sources includes at least one of the following: receiving reception frames transmitted by multiple types of sensors; receiving reception frames transmitted by multiple sensors of the same type; receiving reception frames transmitted by the same sensor.

[0016] According to another embodiment of the present invention, there is provided a data transmission device, comprising: a first receiving module, for receiving reception frames transmitted by several data sources, wherein the reception frames include multiple data packets, and one data packet carries only one packet sequence number; a grouping module, for grouping the reception frames according to the packet sequence numbers to obtain multiple data groups, wherein the packet sequence numbers of data packets sent by the same data group in the same cycle are the same; a framing module, for framing the multiple data groups respectively to obtain multiple publishing frames; and a transmission module, for transmitting the multiple publishing frames to a framing data subscriber.

[0017] Optionally, the grouping module includes: a determination unit, used to traverse each data packet in the received frame and determine the packet sequence number carried by each data packet in the same sending cycle; a processing unit, used to initialize the received frame to corresponding multiple data groups if the received frame carries multiple packet sequence numbers in the same sending cycle, and the packet sequence numbers of the same grouped data in the same sending cycle are the same; if the received frame carries one packet sequence number in the same sending cycle, initialize the received frame to a corresponding data group.

[0018] Optionally, the framing module includes: an acquisition unit, used to obtain, for each received frame, a packet number determination table and a current packet number carried by the data packet in the data group; a reading unit, used to read a currently recorded reference packet number from the packet number determination table, wherein the packet number determination table is used to store a packet number offset value for each data group and a reference packet number currently to be framed; and a framing unit, used to frame the data packet according to the reference packet number and the current packet number.

[0019] Optionally, the framing unit includes: a checking subunit, used to perform frame loss checking on the data packet based on the reference packet sequence number and the current packet sequence number; an acquiring subunit, used to acquire a list of frames to be combined for the published frame if the data packet is normal data; and a framing subunit, used to add the data packet to the list to be combined to complete the framing operation.

[0020] Optionally, the check subunit is also used to: search for a packet number offset value that matches the current data group in the framing determination table; correct the current packet number based on the offset value to obtain a target packet number; compare the reference packet number with the target packet number; if the reference packet number is equal to the target packet number, determine that the data packet is normal data.

[0021] Optionally, the check subunit is further used to: if the target packet sequence number is smaller than the reference packet sequence number, discard the data packet; if the target packet sequence number is larger than the reference packet sequence number, update the reference packet sequence number, and start a new round of framing in the current data group.

[0022] Optionally, the device also includes: a second receiving module, used to receive the first data source data and the second data source data of the multiple data sources in two adjacent cycles before the framing module searches the framing determination table for the packet sequence number offset value matching the data group; a recording module, used to record the first receiving time and the second receiving time of the first data source data and the second data source data, respectively; a selection module, used to sort the first receiving time and the second receiving time, and select the middle time period after sorting as the reference time; a calculation module, used to sequentially calculate the designated packet sequence number of the data packet received closest to the reference time for each data group; and a configuration module, used to configure the designated packet sequence number as the packet sequence number offset value of the corresponding data group in the framing determination table.

[0023] Optionally, the device also includes: a reading module, used to read the framing time of the published frame in the current period after the framing module obtains the list of published frames to be combined; a judgment module, used to judge whether the framing time is greater than the framing timeout time, wherein the framing timeout time is less than the sending cycle length of the data group; and a processing module, used to transmit the framing data in the list to be combined to the framing data subscription end if the framing time is greater than the framing timeout time.

[0024] Optionally, the transmission module includes: a judgment unit, used to judge whether the corresponding data packet has been assembled for each published frame; and a transmission unit, used to transmit the published frame to the frame data subscription terminal if the corresponding data packet has been assembled.

[0025] Optionally, the first receiving module includes at least one of the following: a first receiving unit, used to receive receiving frames transmitted by multiple types of sensors; a second receiving unit, used to receive receiving frames transmitted by multiple sensors of the same type; and a third receiving unit, used to receive receiving frames transmitted by the same sensor.

[0026] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.

[0027] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.

[0028] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.

[0029] Beneficial effects of the present invention:

[0030] 1. A new framing method is implemented to provide a solution for sensor data abstraction. There is no need to add additional fields to identify the same frame of data in the existing data transmission. Only the fields of the existing data transmission are used to complete the framing. This solves the technical problem that related technologies cannot simultaneously frame data packets sent by multiple data sources, and improves the versatility and framing efficiency of data transmission.

[0031] 2. The data to be framed can be managed in groups. The same sensor and different sensor data can be framed by groups carrying different rolling counters. The rolling counter verification algorithm is used to determine the continuity of the received data from different sensors and the historical received data. The rolling counter determination table is initialized to initialize the alignment of the same frame data. The timeout mechanism solves the problem of data loss during transmission that prevents data from being assembled and delivered to the receiver in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0033] Figure 1 is a hardware structure block diagram of a car according to an embodiment of the present invention;

[0034] Figure 2 is a flow chart of a data transmission method according to an embodiment of the present invention;

[0035] Figure 3 is a schematic diagram of grouping data packets in an embodiment of the present invention;

[0036] Figure 4 is a schematic diagram of framing according to a receiving end in an embodiment of the present invention;

[0037] Figure 5 It is a diagram of a sensor data grouping and framing framework based on a packet sequence number in an embodiment of the present invention;

[0038] Figure 6 is a flow chart of framing sensor data in an embodiment of the present invention;

[0039] Figure 7 It is a structural block diagram of a data transmission device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0042] Example 1

[0043] The method embodiment provided in the first embodiment of the present application can be executed in a car, a server, a processor, a controller or a similar processing device. Taking running on a car as an example, Figure 1 1 is a hardware structure diagram of a car according to an embodiment of the present invention. Figure 1 As shown, a car may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above-mentioned automobile may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above-mentioned automobile. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0044] The memory 104 can be used to store automobile programs, for example, software programs and modules of application software, such as automobile programs corresponding to a method for transmitting automobile data in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the automobile programs stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the automobile via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the car. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] In this embodiment, a data transmission method is provided. Figure 2 is a flow chart of a data transmission method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0047] Step S202, receiving a receiving frame transmitted by a plurality of data sources, wherein the receiving frame includes a plurality of data packets, and a data packet carries only a packet sequence number;

[0048] The data source of this embodiment can be any source device that sends data packets, such as sensors, terminal devices, Internet of Things devices, etc., such as multiple sensors on a car. The solution of this embodiment can be applied in various data packet transmission scenarios. In this embodiment, the data source is a sensor as an example for explanation.

[0049] Optionally, receiving reception frames transmitted from several data sources may include but is not limited to: receiving reception frames transmitted from sensors of multiple types; receiving reception frames transmitted from multiple sensors of the same type; and receiving reception frames transmitted from the same sensor.

[0050] There are multiple data packets in the received frame, and they may contain different packet sequence numbers.

[0051] Step S204, grouping the received frames according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of the data packets sent in the same data group in the same cycle are the same;

[0052] By grouping, it is possible to determine whether the current data packet to be framed in the data group is correct during subsequent framing.

[0053] Step S206, framing the multiple data groups respectively to obtain multiple publishing frames;

[0054] The publishing frame of this embodiment is defined by the downstream of data transmission (framing data subscription end), which defines which data packets transmitted by which data source, which data packets with which packet sequence numbers, etc. are specifically included in the data of each publishing frame.

[0055] Step S208: transmitting the multiple publishing frames to a frame data subscription terminal.

[0056] According to the subscription relationship, each published frame is transmitted to the matching framing data subscriber, thereby realizing the transmission of data packets from the data source to the receiving end.

[0057] Through the above steps, receiving frames transmitted by several data sources are received, wherein the receiving frames include multiple data packets, and one data packet carries only one packet sequence number; the receiving frames are grouped according to the packet sequence numbers to obtain multiple data groups, wherein the packet sequence numbers of data packets sent by the same data group in the same cycle are the same; the multiple data groups are framed respectively to obtain multiple publishing frames; the multiple publishing frames are transmitted to the framing data subscriber, and a framing scheme for data packets with different packet sequence numbers transmitted by multiple data sources is implemented by grouping the data packets, which solves the technical problem that the related technology cannot frame the data packets sent by multiple data sources at the same time, and improves the versatility and framing efficiency of data transmission.

[0058] In one implementation of the present embodiment, the received frame is grouped according to the packet sequence number to obtain multiple data groups, including: traversing each data packet in the received frame to determine the packet sequence number carried by each data packet in the same sending cycle; if the received frame carries multiple packet sequence numbers in the same sending cycle, initializing the received frame to the corresponding multiple data groups, and the packet sequence numbers of the same grouped data in the same sending cycle are the same; if the received frame carries one packet sequence number in the same sending cycle, initializing the received frame to a corresponding data group.

[0059] A data packet carries only one packet sequence number. By extracting the packet sequence number of each data packet in the received frame and grouping them according to the packet sequence number, in the same sending cycle, the packet sequence numbers of several data packets in each data group are the same.

[0060] In this embodiment, the multiple data groups are framed separately to obtain multiple published frames, including: for each received frame, obtaining a packet sequence number determination table and a current packet sequence number carried by a data packet in the data group; reading a reference packet sequence number of the current record from the packet sequence number determination table, wherein the packet sequence number determination table is used to store a packet sequence number offset value of each data group and a reference packet sequence number to be currently framed; and framing the data packet according to the reference packet sequence number and the current packet sequence number.

[0061] Figure 3is a schematic diagram of grouping data packets in an embodiment of the present invention, showing that three sensors send sensor data packets [1,2,3], [11,12,13], and [21,22,23] respectively according to the same and fixed period. When the program starts running, the grouping configuration of different sensor data is loaded. Different data of the same sensor may be grouped, including four data groups from group 1 to group 4. For example, for the data of sensor 1, data 1 and 2 are grouped into the same group, and data 3 is grouped into a separate data group. The rolling counter offsets of different data groups may be different or the same. The offsets of group 1 and group 2 from the same sensor are different, while the offsets of group 2 and group 4 from different sensors are the same.

[0062] Figure 4 It is a schematic diagram of framing according to a receiving end in an embodiment of the present invention. The receiving end includes fusion, data recording, diagnosis, and other four framing data subscribers. The data that each subscriber needs to frame comes from at least one data group. In the data initialization stage, the rolling counter offsets of each group of the rolling determination table (packet sequence number determination table) are initialized according to the sensor data initialization process, and the current rolling counter value to be determined is set for subsequent verification of the received sensor data.

[0063] In one embodiment, framing the data packet according to the reference packet sequence number and the current packet sequence number includes: performing frame loss check on the data packet based on the reference packet sequence number and the current packet sequence number; if the data packet is normal data, obtaining a list of frames to be combined for the published frame; and adding the data packet to the list of frames to be combined to complete the framing operation.

[0064] In one example, performing frame loss check on the data packet based on the reference packet sequence number and the current packet sequence number includes: searching for a packet sequence number offset value that matches the current data group in a framing determination table; correcting the current packet sequence number based on the offset value to obtain a target packet sequence number; comparing the reference packet sequence number with the target packet sequence number; if the reference packet sequence number is equal to the target packet sequence number, determining that the data packet is normal data.

[0065] In another aspect of the above implementation, after comparing the reference packet sequence number with the target packet sequence number, it also includes: if the target packet sequence number is smaller than the reference packet sequence number, discarding the data packet; if the target packet sequence number is larger than the reference packet sequence number, updating the reference packet sequence number and starting a new round of framing in the current data group.

[0066] In the above implementation, the packet number in the current data packet is taken, and the offset of the group to which it belongs is added to determine whether it is equal to the recorded current rolling counter value (reference packet number). If it is less than the current rolling counter, it means that the received data is the timeout data of the previous frame period, and the data packet is discarded in time. If it is equal to the reference packet number, it means that the received data packet is the normal data of the current framing period, and the normal framing operation is performed; if it is greater than the reference packet number, it means that the received data packet is the data of the next frame period. At this time, the framed release frame to be delivered is submitted to the framing data subscriber, and the reference packet number is updated (the packet number is increased by 1, and if it is already the maximum value, it is returned to the minimum value), and a new round of framing is restarted.

[0067] The above-mentioned grouping and framing mechanism of this embodiment means that when the framing module receives a data packet of a receiving frame transmitted by the network, based on the current packet sequence number and the packet sequence number offset value, a frame loss check is performed with reference to the packet sequence number. If the currently received data packet is normal data, that is, the currently received data packet and the data in the list to be combined are the same frame data, the data is parsed and added to the list to be combined. Each time the data is added to the list to be combined, it is necessary to determine whether the framing operation is completed. If it is completed, the combined data needs to be submitted to all framing data subscribers in a timely manner; if the framing is not completed, continue to wait for other data. When the data completes a framing operation, it is necessary to update the reference packet sequence number of the current framing in the determination table, that is, the rolling counter is logically added by 1 (which is equal to resetting the current rolling counter value to 0 when defining the max counter).

[0068] In this embodiment, before searching the framing determination table for the packet sequence number offset value that matches the data group, it also includes: receiving the first data source data and the second data source data of the plurality of data sources in two adjacent cycles; recording the first receiving time and the second receiving time of the first data source data and the second data source data respectively; sorting the first receiving time and the second receiving time, and selecting the middle time after the sorting as the reference time; calculating in turn the designated packet sequence number of the data packet received closest to the reference time for each data group; and configuring the designated packet sequence number as the packet sequence number offset value of the corresponding data group in the framing determination table.

[0069] When the rolling counter determination table is initialized, the sensor data within two cycles is first received during program initialization, and sorted according to the receiving time. The data in the middle period after sorting is selected as the reference time, and the rolling counters of other data to be combined are calculated in sequence when they are received closest to the reference time. Since the determination table stores the offset value of each group, it is necessary to determine whether the rolling counters of the group where the current data is located are equal to the ones that have been initialized. If they are not equal, the initialization fails. If they are equal, the next data is determined. If the rolling counter value of the group where the data is located does not exist in the current determination table, it is initialized to the determination table. After all data rolling counters are determined through the above steps, the received data can be framed normally; when the initialization determination table is not completed, the received data will not be processed temporarily.

[0070] In another aspect of this embodiment, after obtaining the list of published frames to be combined, it also includes: reading the framing time of the published frame in the current cycle; judging whether the framing time is greater than the framing timeout time, wherein the framing timeout time is less than the sending cycle length of the data group; if the framing time is greater than the framing timeout time, transmitting the framing data in the list to be combined to the framing data subscriber.

[0071] During the program running process, data may not be received due to network transmission or the time difference of receiving data may exceed the set threshold, which will affect the service function of all subscribed framing data. Therefore, it is necessary to set a timeout mechanism to handle abnormal data. Optionally, the framing timeout is set to 75% of the data transmission cycle length, that is, when there is data that is not received within 75% of the cycle length, the data in the list to be combined needs to be submitted to all subscribers, and the data that has not been received and should be combined is reset to abnormal data, and the rolling counter value of the current framing in the judgment table is updated.

[0072] In one implementation of this embodiment, transmitting the multiple publishing frames to the framing data subscription end includes: for each publishing frame, determining whether the corresponding data packet has been assembled; if the corresponding data packet has been assembled, transmitting the publishing frame to the framing data subscription end.

[0073] The example of the present application provides a sensor data grouping and framing solution based on packet sequence numbers (rolling counters), which can solve the deficiency of existing solutions that only frame a single data source. Figure 5It is a sensor data grouping and framing framework diagram based on packet sequence number in an embodiment of the present invention, including multiple data sources (sensor 1 to sensor 4), a framing module (for framing), a data publishing module (for transmitting the framed data to the receiving end), and a receiving end (fusion, data recording, diagnosis, and others). The framing module includes the following contents: rolling counter verification algorithm, rolling counter determination table initialization, group framing mechanism, and timeout mechanism. The data to be framed can be managed in groups, and the same sensor and different sensor data can be framed by groups carrying different rolling counters. The rolling counter verification algorithm completes the continuity judgment when different sensor data is received and the historical received data. The rolling counter determination table initialization realizes the alignment initialization of the same frame data, wherein the determination table stores the initial offset of the rolling counter of each group of data and the rolling counter value of the current data to be framed. The timeout mechanism solves the problem that the data cannot be assembled in time due to data loss during the transmission process.

[0074] Figure 6 This is a flowchart of sensor data framing in an embodiment of the present invention. After the rolling counter determination table is initialized, all sensor data is received normally, and the data is framed according to the above framing strategy, and the framed data is submitted to all applications that subscribe to the data. Figure 4 As shown in the figure, the fusion application subscribes to all data from sensor 1 and sensor 2, the data logging and diagnosis applications subscribe to all sensor data respectively, and other applications subscribe to data 3 of sensor 1 and all data of sensor 3. When receiving data 1 of sensor 1, it traverses which receiving ends have subscribed to the data. If no receiving end has subscribed to the data, the processing flow is jumped out, as shown in the example. Figure 4 As shown in the figure, there are three applications such as Fusion that have subscribed to the data, so it is necessary to traverse three group frame lists. Figure 3It can be seen that data 1 of sensor 1 is initialized to group 1, and the offset value of group 1 initialized in the rolling counter decision table is 3, and the current rolling counter value is 10. The rolling counter carried by the current data is parsed. If the rolling counter value of the currently received data is less than 7, since the current rolling counter plus the offset is less than the rolling counter value in the decision table, the timeout mechanism has been triggered when the data is received, and the data has been delivered to the subscriber, the data is directly discarded; if the currently received rolling counter value is equal to 7, it means that the current data belongs to the set to be framed, and the data is added to the frame set after parsing; if the currently received rolling counter value is greater than 7, it means that the currently received data is already the data set of the next frame, then all the current data waiting for the frame will be delivered to all subscribers, and the rolling counter decision table and timer will be updated, and the newly received data will be added to the new round of frame set.

[0075] Figure 6 The timer in is used to execute the framing timeout mechanism. A separate timer detects whether all sensor data are received within the specified cycle time. The sending cycle of all sensor data is set to 100 milliseconds. If the interval between sensor 1 data 1 and the last reception exceeds 75 milliseconds, the timeout framing publishing process is triggered, and all current framing sets waiting for sensor 1 data 1 are traversed, and the framed data is delivered to the corresponding subscriber. When the data is delivered, the timer trigger time is updated, and the current rolling counter judgment value in the rolling counter judgment table is updated.

[0076] In this embodiment, the data to be framed can be managed in groups, and the same sensor and different sensor data can be framed by groups carrying different rolling counters. The rolling counter verification algorithm completes the continuity judgment when different sensor data is received and the historical received data. The rolling counter judgment table is initialized to realize the alignment initialization of the same frame data, wherein the judgment table stores the initial offset of the rolling counter of each group of data and the rolling counter value of the current frame to be framed. The timeout mechanism solves the problem that the data cannot be assembled and delivered to the receiver in time due to data loss during transmission.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0078] Example 2

[0079] In the present embodiment, a data transmission device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0080] Figure 7 is a structural block diagram of a data transmission device according to an embodiment of the present invention. Figure 7 As shown, the device comprises:

[0081] A first receiving module 70, configured to receive a receiving frame transmitted by a plurality of data sources, wherein the receiving frame includes a plurality of data packets, and a data packet carries only one packet sequence number;

[0082] A grouping module 72, configured to group the received frames according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of the data packets sent in the same data group in the same cycle are the same;

[0083] A framing module 74, configured to frame the plurality of data groups respectively to obtain a plurality of publishing frames;

[0084] The transmission module 76 is used to transmit the multiple publishing frames to the frame data subscription end.

[0085] Optionally, the grouping module includes: a determination unit, used to traverse each data packet in the received frame and determine the packet sequence number carried by each data packet in the same sending cycle; a processing unit, used to initialize the received frame to corresponding multiple data groups if the received frame carries multiple packet sequence numbers in the same sending cycle, and the packet sequence numbers of the same grouped data in the same sending cycle are the same; if the received frame carries one packet sequence number in the same sending cycle, initialize the received frame to a corresponding data group.

[0086] Optionally, the framing module includes: an acquisition unit, used to obtain, for each received frame, a packet number determination table and a current packet number carried by the data packet in the data group; a reading unit, used to read a currently recorded reference packet number from the packet number determination table, wherein the packet number determination table is used to store a packet number offset value for each data group and a reference packet number currently to be framed; and a framing unit, used to frame the data packet according to the reference packet number and the current packet number.

[0087] Optionally, the framing unit includes: a checking subunit, used to perform frame loss checking on the data packet based on the reference packet sequence number and the current packet sequence number; an acquiring subunit, used to acquire a list of frames to be combined for the published frame if the data packet is normal data; and a framing subunit, used to add the data packet to the list to be combined to complete the framing operation.

[0088] Optionally, the check subunit is also used to: search for a packet number offset value that matches the current data group in the framing determination table; correct the current packet number based on the offset value to obtain a target packet number; compare the reference packet number with the target packet number; if the reference packet number is equal to the target packet number, determine that the data packet is normal data.

[0089] Optionally, the check subunit is further used to: if the target packet sequence number is smaller than the reference packet sequence number, discard the data packet; if the target packet sequence number is larger than the reference packet sequence number, update the reference packet sequence number, and start a new round of framing in the current data group.

[0090] Optionally, the device also includes: a second receiving module, used to receive the first data source data and the second data source data of the multiple data sources in two adjacent cycles before the framing module searches the framing determination table for the packet sequence number offset value matching the data group; a recording module, used to record the first receiving time and the second receiving time of the first data source data and the second data source data, respectively; a selection module, used to sort the first receiving time and the second receiving time, and select the middle time period after sorting as the reference time; a calculation module, used to sequentially calculate the designated packet sequence number of the data packet received closest to the reference time for each data group; and a configuration module, used to configure the designated packet sequence number as the packet sequence number offset value of the corresponding data group in the framing determination table.

[0091] Optionally, the device also includes: a reading module, used to read the framing time of the published frame in the current period after the framing module obtains the list of published frames to be combined; a judgment module, used to judge whether the framing time is greater than the framing timeout time, wherein the framing timeout time is less than the sending cycle length of the data group; and a processing module, used to transmit the framing data in the list to be combined to the framing data subscription end if the framing time is greater than the framing timeout time.

[0092] Optionally, the transmission module includes: a judgment unit, used to judge whether the corresponding data packet has been assembled for each published frame; and a transmission unit, used to transmit the published frame to the frame data subscription terminal if the corresponding data packet has been assembled.

[0093] Optionally, the first receiving module includes at least one of the following: a first receiving unit, used to receive receiving frames transmitted by multiple types of sensors; a second receiving unit, used to receive receiving frames transmitted by multiple sensors of the same type; and a third receiving unit, used to receive receiving frames transmitted by the same sensor.

[0094] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0095] Example 3

[0096] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0097] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0098] S1, receiving a receiving frame transmitted by several data sources, wherein the receiving frame includes multiple data packets, and one data packet carries only one packet sequence number;

[0099] S2, grouping the received frames according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of data packets sent in the same data group in the same cycle are the same;

[0100] S3, respectively framing the multiple data groups to obtain multiple publishing frames;

[0101] S4, transmitting the multiple publishing frames to the frame data subscription end.

[0102] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0103] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0104] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0105] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0106] S1, receiving a receiving frame transmitted by several data sources, wherein the receiving frame includes multiple data packets, and one data packet carries only one packet sequence number;

[0107] S2, grouping the received frames according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of data packets sent in the same data group in the same cycle are the same;

[0108] S3, respectively framing the multiple data groups to obtain multiple publishing frames;

[0109] S4, transmitting the multiple publishing frames to the frame data subscription end.

[0110] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0113] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0114] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be 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 the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A data transmission method, characterized in that: include: Receiving a receiving frame transmitted by a plurality of data sources, wherein the receiving frame includes a plurality of data packets, and a data packet carries only a packet sequence number; The received frames are grouped according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of data packets sent in the same data group in the same cycle are the same; Frame the multiple data groups respectively to obtain multiple publishing frames; The multiple publishing frames are transmitted to a framing data subscription terminal.

2. The method according to claim 1, characterized in that The received frames are grouped according to the packet sequence numbers to obtain multiple data groups, including: Traversing each data packet in the received frame, and determining a packet sequence number carried by each data packet in the same sending cycle; If the received frame carries multiple packet sequence numbers in the same sending cycle, the received frame is initialized to the corresponding multiple data groups, and the data of the same group has the same packet sequence number in the same sending cycle; if the received frame carries one packet sequence number in the same sending cycle, the received frame is initialized to a corresponding data group.

3. The method according to claim 1, characterized in that The multiple data groups are respectively framed to obtain multiple publishing frames, including: For each received frame, obtaining a packet sequence number determination table and a current packet sequence number carried by a data packet in the data group; Reading the reference packet number of the current record from the packet number determination table, wherein the packet number determination table is used to store the packet number offset value of each data group and the reference packet number of the current frame to be assembled; The data packet is framed according to the reference packet sequence number and the current packet sequence number.

4. The method according to claim 3, characterized in that Framing the data packet according to the reference packet sequence number and the current packet sequence number comprises: Performing frame loss check on the data packet based on the reference packet sequence number and the current packet sequence number; If the data packet is normal data, obtaining a list of the published frames to be combined; The data packet is added to the to-be-assembled list to complete the framing operation.

5. The method according to claim 4, characterized in that Performing frame loss checking on the data packet based on the reference packet sequence number and the current packet sequence number includes: Searching the framing determination table for a packet sequence number offset value that matches the current data group; Correct the current packet sequence number based on the offset value to obtain a target packet sequence number; Comparing the reference packet sequence number with the target packet sequence number; If the reference packet sequence number is equal to the target packet sequence number, it is determined that the data packet is normal data.

6. The method according to claim 5, characterized in that After comparing the reference packet sequence number with the target packet sequence number, the method further comprises: If the target packet sequence number is smaller than the reference packet sequence number, the data packet is discarded; if the target packet sequence number is larger than the reference packet sequence number, the reference packet sequence number is updated, and a new round of framing is started in the current data group.

7. The method according to claim 6, characterized in that Before searching the framing determination table for a packet sequence number offset value that matches the data group, the method further includes: Receiving first data source data and second data source data from the plurality of data sources in two adjacent periods; Recording a first receiving time and a second receiving time of the first data source data and the second data source data respectively; sorting the first receiving time and the second receiving time, and selecting the middle time period after the sorting as the reference time; Calculate in sequence the designated packet sequence number of the data packet received most recently from the reference time for each data group; The designated packet sequence number is configured as a packet sequence number offset value of a corresponding data group in the framing determination table.

8. The method according to claim 4, characterized in that After obtaining the list of published frames to be combined, the method further includes: Read the framing time of the published frame in the current cycle; Determine whether the framing time is greater than a framing timeout time, wherein the framing timeout time is less than a sending cycle length of the data group; If the framing time is greater than the framing timeout time, the framing data in the to-be-combined list is transmitted to the framing data subscription terminal.

9. The method according to claim 1, characterized in that: Transmitting the plurality of published frames to the frame data subscriber includes: For each published frame, determine whether the corresponding data packet has been assembled; If the corresponding data packets have been assembled, the publishing frame is transmitted to the frame data subscription end.

10. The method according to claim 1, characterized in that Receiving frames transmitted by multiple data sources includes at least one of the following: receiving a plurality of types of received frames transmitted by sensors; receiving frames transmitted by multiple sensors of the same type; Receives a receive frame transmitted by the same sensor.

11. A data transmission device, characterized in that: include: A first receiving module, configured to receive a receiving frame transmitted by a plurality of data sources, wherein the receiving frame includes a plurality of data packets, and a data packet carries only a packet sequence number; A grouping module, used for grouping the received frames according to the packet sequence numbers to obtain a plurality of data groups, wherein the packet sequence numbers of the data packets sent in the same data group in the same cycle are the same; A framing module, used for framing the multiple data groups respectively to obtain multiple publishing frames; The transmission module is used to transmit the multiple publishing frames to the frame data subscription end.

12. The device according to claim 11, characterized in that The framing module comprises: An acquisition unit, used for acquiring, for each received frame, a packet sequence number determination table and a current packet sequence number carried by a data packet in the data group; A reading unit, used for reading the reference packet number of the current record from the packet number determination table, wherein the packet number determination table is used for storing the packet number offset value of each data group and the reference packet number of the current frame to be formed; A framing unit is used to frame the data packet according to the reference packet sequence number and the current packet sequence number.

13. A data transmission system, characterized in that: It includes a data source, a processor, and a framing data subscription end, wherein the processor is connected between the data source and the framing data subscription end, wherein: The processor comprises the device according to claim 11 or 12.

14. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 10 when executed.

15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.