A data communication method

By prioritizing the transmission of changing data during data transmission and cyclically supplementing unchanged data, the problem of high-frequency and low-frequency data packet conflict is solved, and efficient transmission of data blocks is achieved, which is suitable for a variety of transmission media.

CN116566996BActive Publication Date: 2025-07-25CANNY ELEVATOR
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310402759.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2025-07-25
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

In the existing data transmission technology, the transmission time conflicts of high-frequency and low-frequency data packets or line occupation lead to data transmission delays, especially in application scenarios such as industrial fieldbus, which are difficult to meet real-time requirements.

Method used

During each transmission cycle, the data sender extracts data from the data blocks according to the rules of changing data priority and unchanged data cycle complementation, and packages and sends them in the form of index + data, and the receiver processes the data according to the index.

Benefits of technology

It realizes the real-time transmission requirements of high-frequency data, while taking into account the periodic transmission requirements of low-frequency data. It is suitable for a variety of data transmission methods such as fieldbus communication and wireless communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116566996B_ABST
    Figure CN116566996B_ABST
Patent Text Reader

Abstract

The present invention discloses a data communication method, belonging to the technical field of data transmission, which includes the following steps: Initialization step S10: Generate indexes for each data in the data block, and calculate the number M of data per frame 帧 ; Periodic step S20: S201: Count the data that has changed within the data block in the current transmission period, and the number m of the changed data; S202: Extract m changed data, and save them in buffer 1 in the form of m groups of index + data; S203: Traverse the data block, and sequentially extract M 帧 -m supplementary data from the data block corresponding to the transmission period from the data that has not changed within the data block and has not been sent before the traversal ends; and save them in buffer 2 in the form of M 帧 -m groups of index + data; S204: Merge buffer 1 and buffer 2 to obtain M 帧 groups of index + data, and pack and send a frame containing the corresponding M frames of index + data; S205: Delay for a duration of the transmission period t, and return to execute the periodic step S20.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data transmission, and specifically relates to a data communication method. Background Art

[0002] In the existing data transmission technology, when a large amount of data needs to be transmitted, the data is generally packed separately according to the data change frequency, and then the high-frequency data packets are given a high priority and a short sending period, and the low-frequency data packets are given a low priority and a long sending period, and they are transmitted separately according to the given priority and sending period. However, when there is a conflict in the sending time of high-frequency data packets and low-frequency data packets, the low-frequency data packets are missed due to the low priority. Another situation is that when the low-frequency data packet is in the process of being sent, the high-frequency data packet is missed because the line is occupied. The above two situations both cause delays in data transmission, which need to be avoided in application scenarios with high real-time requirements such as industrial field buses. Summary of the Invention

[0003] In order to solve the problems existing in the above solutions, the present invention provides a data communication method to solve the problem of transmitting data blocks with large amounts of data and different data change frequencies.

[0004] The object of the present invention can be achieved by the following technical solutions:

[0005] A data communication method, in each sending period, the data sender extracts a number of data from the data block to be sent according to the rule of giving priority to changed data and circularly supplementing unchanged and unsent data, and packs and sends them in the form of "index + data"; the data receiver saves and processes the data according to the index. Specifically, it includes the following steps:

[0006] Initialization step S10:

[0007] Generate indexes for each data in the data block, and calculate the number of data per frame M 帧 ;

[0008] Periodic step S20:

[0009] S201: Count the changed data in the data block in this sending period, and the number of changed data m;

[0010] S202: Extract m changed data, and save them to buffer 1 in the form of m groups of index + data;

[0011] S203: Traverse the data block, determine the supplementary data from the data block corresponding to the sending period; and save it to buffer 2 in the form of M 帧 -m groups of index + data;

[0012] S204: Combine buffer 1 and buffer 2 to obtain M帧 Group index + data, and pack and send a frame containing the corresponding M-frame group index + data;

[0013] S205: Delay for a duration of the transmission period t, and return to execute the periodic step S20.

[0014] Furthermore, the number of data per frame M 帧 is calculated as follows:

[0015] Count the number of data N and the maximum data change period T in the data block; set the transmission period t, and t is not greater than the minimum data change period; count the maximum number of changed data M in the data block per transmission period 变 ; Input the obtained N, T, t, and M 变 into the M 帧 calculation formula for calculation to obtain the corresponding number of data per frame M 帧 .

[0016] Furthermore, the M 帧 calculation formula is: M 帧 = M 变 +(N - M 变 ) / (T / t).

[0017] Furthermore, when the value of M 帧 calculated by the calculation formula is not an integer, M 帧 is rounded up. 帧

[0018] Furthermore, the method for confirming the supplementary data includes:

[0019] Extract M 帧 - m data in sequence from the data that has not changed in the data block and has not been sent before the traversal ends as the supplementary data.

[0020] Furthermore, when the number of the supplementary data is less than M 帧 - m when the traversal reaches the end of the data block, extract the data that has not changed in this transmission period from the head of the data block as a supplement.

[0021] Furthermore, the data communication method does not limit the physical transmission medium.

[0022] Compared with the prior art, the beneficial effects of the present invention are:

[0023] The data transmission method of the present invention can realize the transmission of a data block containing a large amount of data with a shorter data frame, while meeting the real-time transmission requirements of high-frequency data and taking into account the periodic transmission requirements of low-frequency data. In addition, since the data communication method does not limit the physical transmission medium, it is applicable to various data transmission methods such as fieldbus communication and wireless communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 is the flowchart of the method of the present invention;

[0026] Figure 2 is the schematic diagram of the example of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0027] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0028] As Figures 1 to 2 shown, a data communication method includes an initialization step S10 and a periodic step S20;

[0029] The initialization step S10 sequentially executes the following sub-steps:

[0030] S101: Generate indexes for each data in the data block;

[0031] S102: Count the number of data N and the maximum data change period T in the data block;

[0032] S103: Set the transmission period t, and t is not greater than the minimum data change period;

[0033] S104: Count the maximum number M of changed data in the data block per transmission period 变 ;

[0034] S105: Calculate the number of data M per frame 帧 : M 帧 = M 变 +(N - M 变 ) / (T / t).

[0035] That is, the number of data M per frame 帧 is determined by the number of data N, the maximum data change period T, the transmission period t, and the maximum number M of changed data in the data block 变 and is rounded up when the calculation result is not an integer.

[0036] The periodic step S20, which sequentially executes the following sub-steps:

[0037] S201: Count the data that has changed within the data block in the current transmission cycle and the number m of the changed data;

[0038] S202: Extract m changed data and save them in buffer 1 in the form of m groups of index + data; The form of index + data can be represented by a preset mode;

[0039] The number m of the changed data can be different in each transmission cycle.

[0040] S203: Traverse the data block, and sequentially extract M 帧 - m complementary data from the data that has not changed within the corresponding data block in the current transmission cycle and has not been sent before the end of the traversal, and save them in buffer 2 in the form of M 帧 - m groups of index + data;

[0041] Wherein, if the number of the complementary data is less than M 帧 - m when traversing to the end of the data block, extract the data that has not changed in the current transmission cycle from the head of the data block as a supplement.

[0042] S204: Merge buffer 1 and buffer 2 to obtain M 帧 groups of index + data, and pack and send a frame containing the corresponding M frames of index + data;

[0043] S205: Delay for a duration of the transmission cycle t, and then return to execute the periodic step.

[0044] In each transmission cycle, the data sender extracts a number of data from the data block according to the rule of giving priority to the changed data and circularly supplementing the unchanged and unsent data, and packs and sends them in the form of "index + data"; The data receiver saves and processes the data according to the index. The rule of giving priority to the changed data and circularly supplementing the unchanged and unsent data can be marked as a preset circular supplementation rule.

[0045] The data communication method does not limit the physical transmission medium, so it is applicable to various data transmission methods such as fieldbus communication and wireless communication.

[0046] The data transmission method of the present invention realizes the transmission of a data block containing a large amount of data with a shorter data frame, while meeting the real-time transmission requirements of high-frequency data and taking into account the periodic transmission requirements of low-frequency data. In addition, since the data communication method does not limit the physical transmission medium, it is applicable to various data transmission methods such as fieldbus communication and wireless communication.

[0047] Such as Figure 2As shown, the present invention gives an example. Assuming that the number of data in the data block N is 20, the maximum data change period T is 500 ms, the transmission period t is 50 ms, and the maximum number of changed data M in the data block per transmission period becomes 6, then according to the formula M 帧 = M 变 +(N - M 变 ) / (T / t), the number of data per frame M is rounded up to 8 after rounding up.

[0048] In transmission period 1, assuming that the number of changed data m is 5, and the changed data indexes are 1, 3, 5, 8, and 17 respectively, then the number of supplementary data is 3. Three supplementary data are sequentially extracted from the unchanged data in the data block in this transmission period and not sent before the traversal ends, and the supplementary data indexes are 2, 4, and 6 respectively.

[0049] In transmission period 2, assuming that the number of changed data m is 4, and the changed data indexes are 3, 7, 12, and 18 respectively, then the number of supplementary data is 4. Four supplementary data are sequentially extracted from the unchanged data in the data block in this transmission period and not sent before the traversal ends, and the supplementary data indexes are 9, 10, 11, and 13 respectively.

[0050] In transmission period 3, assuming that the number of changed data m is 6, and the changed data indexes are 1, 6, 9, 10, and 16 respectively, then the number of supplementary data is 2. Two supplementary data are sequentially extracted from the unchanged data in the data block in this transmission period and not sent before the traversal ends, and the supplementary data indexes are 14 and 15 respectively.

[0051] In transmission period 4, assuming that the number of changed data m is 5, and the changed data indexes are 1, 2, 5, 10, and 17 respectively, then the number of supplementary data is 3. Two supplementary data are sequentially extracted from the unchanged data in the data block in this transmission period and not sent before the traversal ends, and the supplementary data indexes are 19 and 20 respectively; then the unchanged data in this transmission period is extracted from the head of the data block as a supplement, and its data index is 3.

[0052] In each of the above transmission periods, the changed data indexes and changed data are saved to buffer 1, and the supplementary data indexes and changed data are saved to buffer 2, and are sent after being packed.

[0053] After the above four transmission periods of the embodiment, each data in the data block given by the embodiment has been sent at least once, and the actual total time taken is 200 ms (50 ms × 4), which is less than the maximum data change period of 500 ms, meeting the periodic transmission requirements of low-frequency data, and the changed data is transmitted in real time.

[0054] The above formulas are all calculated by removing the dimension and taking their numerical values. The formula is a formula that is obtained by collecting a large amount of data and performing software simulation to get the one closest to the actual situation. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.

[0055] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical method of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A data communication method, characterized in that, It includes the following steps: Initialization step S10: Generate indexes for each data in the data block and calculate the number of data M per frame 帧 , the number of data M per frame 帧 The calculation method includes: Count the number of data N and the maximum data change period T within the statistical data block; set the transmission period t, and t is not greater than the minimum data change period; count the maximum number M of changed data within the data block in each transmission period 变 ; The obtained N, T, t, and M 变 are input into M 帧 for calculation in the calculation formula to obtain the corresponding number of data per frame M 帧; M 帧 The calculation formula is: M 帧 = M 变 +(N - M 变 ) / (T / t); Periodic step S20: S201: Count the data that has changed within the data block in the current transmission period, and the number m of the changed data; S202: Extract m pieces of changed data and save them in buffer 1 in the form of m groups of index + data; S203: Traverse the data block to determine the supplementary data from the data block corresponding to the transmission period; The method for confirming the supplementary data includes: Extract M - m data in sequence from the data that has not changed within the data block and has not been sent before the traversal ends as padding data; 帧 - m data are padding data; During the supplementary data confirmation process, when the number of the supplementary data is less than M when traversing to the end of the data block 帧 -m, extract the data that has not changed in the current transmission cycle from the head of the data block as a supplement; And save it to cache 2 in the form of M 帧 - m group indexes + data; S204: Combine Cache 1 and Cache 2 to obtain M 帧 Group index + data, and pack and send a frame containing the group index + data of the corresponding M frames; S205: Delay for a duration of the transmission period t, and return to execute the periodic step S20.

2. The data communication method according to claim 1, wherein When M 帧 calculated by the calculation formula of M 帧 is not an integer, M 帧 is rounded up.

3. A data communication method according to claim 1, characterized in that, The data communication includes fieldbus communication or wireless communication.

Citation Information

Patent Citations

  • Data synchronization method and system, client and server

    CN111125258A

  • Method of adaptively adjusting transmission period of wireless terminal and wireless network system for the same

    KR1020210014853A