Data communication method and related device

By adding serial numbers to the data sending nodes and receiving nodes in industrial Ethernet communication and using the serial number table to judge redundant data, the problem of inaccurate redundant data identification in the prior art is solved, and the accuracy and efficiency of data filtering are improved.

CN120034498APending Publication Date: 2025-05-23SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510262605.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In industrial Ethernet communication, it is difficult for the prior art to effectively identify and filter redundant data, especially without changing the logic of the software program, resulting in increased computing load and logic errors.

Method used

By adding serial numbers to the communication data in the data sending node by incrementing the preset difference according to the sequence number, and using the real-time serial number, the maximum serial number of the entire network history and the temporary serial number table to be collected in the data receiving node to determine the redundant data, the accurate identification and filtering of redundant data is achieved.

Benefits of technology

It improves the accuracy of redundant data filtering, can identify first-come and then arrive, thereby accurately identifying and deleting redundant data, reducing calculation load and logical errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034498A_ABST
    Figure CN120034498A_ABST
Patent Text Reader

Abstract

The invention discloses a data communication method and a related device, and relates to the technical field of industrial Ethernet communication. When a real-time serial number of a data receiving node is greater than a whole-network historical maximum serial number and an absolute value of a difference value between the real-time serial number and the whole-network historical maximum serial number is greater than a preset difference value, the data receiving node receives data from the whole-network historical maximum serial number; and storing a serial number between the real-time serial number and the historical maximum serial number of the whole network into a temporary to-be-received serial number table, and updating the historical maximum serial number of the whole network as the real-time serial number. When the real-time serial number is not larger than the historical maximum serial number of the whole network, whether the real-time serial number exists in a temporary to-be-received serial number table or not is searched, and if yes, the real-time serial number is deleted from the temporary to-be-received serial number table; and if not, judging that the real-time communication data is redundant data, and deleting the real-time communication data. Therefore, according to the method, the serial numbers are added in the communication data according to the sending time sequence to distinguish the communication data, the data receiving node judges the redundant data through the real-time serial numbers, the whole-network historical maximum serial number and the temporary to-be-received serial number table, and the judgment accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial Ethernet communication technology, and in particular to a data communication method and related devices. Background Art

[0002] Industrial communication has high requirements for the real-time and integrity of data, and usually uses redundant networks for data transmission. For software that does not support redundant communication from the protocol, it is necessary to change the program logic of the software to achieve the purpose of supporting redundant networks. Alternatively, without changing the program logic of the software, software that does not support redundant communication can be used in a redundant network through Tap / Tun technology. Specifically, the software communicates with the virtual network card, intercepts the communication data in the driver of the virtual network card, and then sends the communication data through multiple real network cards. It can be seen that Tap / Tun technology solves the link problem of redundant communication. In order to alleviate the technical problems of increased computing load and logical errors caused by processing multiple copies of the same communication data, it is necessary to distinguish multiple copies of communication data and filter redundant data. Summary of the invention

[0003] In view of the above problems, the present application provides a data communication method and related devices to improve the accuracy of redundant data filtering. The specific scheme is as follows:

[0004] A first aspect of the present application provides a data communication method, which is applied to a data sending node. The data communication method includes:

[0005] Receive communication data, add sequence numbers to the communication data in a manner of increasing the sequence numbers by a preset difference, and then send the communication data to a data receiving node through multiple networks, so that after the data receiving node receives the real-time communication data through any network among the multiple networks, it extracts the sequence number from the real-time communication data as the real-time sequence number, and when the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, store the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network in a temporary to-be-received sequence number table, and update the largest sequence number in the history of the entire network to the real-time sequence number; when the real-time sequence number is not greater than the largest sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary to-be-received sequence number table, and if so, delete the real-time sequence number from the temporary to-be-received sequence number table; if not, determine that the real-time communication data is redundant data, and delete the real-time communication data.

[0006] In a possible implementation, adding a sequence number to the communication data includes: adding a sequence number at the end of the communication data.

[0007] A first aspect of the present application provides a data communication method, which is applied to a data receiving node. The data communication method includes:

[0008] After receiving the real-time communication data through the target network, extracting the sequence number from the real-time communication data as the real-time sequence number, the target network is any network among the preset multiple networks, and the real-time communication data is sent to the data receiving node through the multiple networks after adding the sequence number to the communication data in a manner of increasing the sequence number by a preset difference;

[0009] When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network is stored in a temporary waiting sequence number table, and the largest sequence number in the history of the entire network is updated to the real-time sequence number;

[0010] When the real-time sequence number is not greater than the maximum sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary sequence number table. If so, delete the real-time sequence number from the temporary sequence number table; if not, determine that the real-time communication data is redundant data and delete the real-time communication data.

[0011] In a possible implementation, the data communication method further includes:

[0012] When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the real-time communication data is determined to be non-redundant data, the real-time sequence number in the real-time communication data is deleted, and the real-time communication data is sent up.

[0013] In a possible implementation, after searching whether the real-time sequence number exists in the temporary sequence number table, the data communication method further includes:

[0014] If so, the real-time communication data is determined to be non-redundant data, and the real-time sequence number in the real-time communication data is deleted before the real-time communication data is sent.

[0015] In a possible implementation, the data communication method further includes:

[0016] The data receiving node determines that the real-time communication data is non-redundant data when the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is equal to the preset difference, deletes the real-time sequence number in the real-time communication data, and then sends the real-time communication data;

[0017] Update the historical maximum sequence number for the entire network to the real-time sequence number.

[0018] The second aspect of the present application provides a data communication system, including a data sending node and a data receiving node;

[0019] The data sending node is configured to: receive communication data, add a sequence number to the communication data in a manner of incrementing a preset difference in sequence numbers, and then send the communication data to the data receiving node through multiple networks;

[0020] The data receiving node is configured to: after receiving real-time communication data through a target network, extract the sequence number from the real-time communication data as the real-time sequence number, where the target network is any one of the multiple networks;

[0021] In the case where the real-time sequence number is greater than the historical maximum sequence number for the entire network, and the absolute value of the difference between the real-time sequence number and the historical maximum sequence number for the entire network is greater than the preset difference, store the sequence numbers between the real-time sequence number and the historical maximum sequence number for the entire network in a temporary table of sequence numbers to be received, and update the historical maximum sequence number for the entire network to the real-time sequence number;

[0022] In the case where the real-time sequence number is not greater than the historical maximum sequence number for the entire network, check whether the real-time sequence number exists in the temporary table of sequence numbers to be received. If it exists, delete the real-time sequence number from the temporary table of sequence numbers to be received; if it does not exist, determine that the real-time communication data is redundant data and delete the real-time communication data.

[0023] The third aspect of the present application provides a computer program product, including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement the data communication method in the first aspect or any implementation manner of the first aspect above.

[0024] The fourth aspect of the present application provides an electronic device, including at least one processor and a memory connected to the processor, where:

[0025] The memory is used to store a computer program;

[0026] The processor is used to execute the computer program so that the electronic device can implement the data communication method in the first aspect or any implementation manner of the first aspect above.

[0027] The fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the data communication method in the first aspect or any implementation manner of the first aspect above.

[0028] By means of the above technical scheme, the present application provides a data communication method and related devices, wherein a data sending node receives communication data, adds a sequence number to the communication data in a manner of increasing the sequence number by a preset difference, and then sends the communication data to a data receiving node through multiple networks; after the data receiving node receives the real-time communication data through the target network, it extracts the sequence number from the real-time communication data as the real-time sequence number, and the target network is any network among the multiple networks; when the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network is stored in a temporary waiting sequence number table, so as to realize the recording of the sequence number of the communication data that is sent first and arrives later, and the largest sequence number in the history of the entire network is updated to the real-time sequence number, so as to realize the recording of the largest sequence number of the communication data that is sent later and arrives first. When the real-time sequence number is not greater than the largest sequence number in the history of the entire network, it is checked whether there is a real-time sequence number in the temporary waiting sequence number table, and if so, the real-time sequence number is deleted from the temporary waiting sequence number table; if not, the real-time communication data is determined to be redundant data, and the real-time communication data is deleted. In order to realize the determination of redundant data for communication data that is sent first and arrives last, the accuracy of determining redundant data is improved. It can be seen that the method distinguishes the communication data by adding sequence numbers to the communication data according to the sending sequence by the data sending node, and the data receiving node determines the redundant data through the real-time sequence number, the largest sequence number in the history of the entire network, and the temporary sequence number table to be received. The determination has high accuracy and can identify the situation of sending first and arriving last, thereby identifying redundant data. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0030] Figure 1 A flow chart of a data communication method provided in an embodiment of the present application;

[0031] Figure 2 A specific structural diagram of a data communication system provided in an embodiment of the present application;

[0032] Figure 3 A specific implementation flow chart of a data communication method provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of the structure of a data communication system provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0036] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0037] 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 need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0038] The present application can be applied to the field of industrial Ethernet technology, and specifically can be applied to application scenarios based on Tap / Tun technology, in which redundant communication data generated is processed when communicating with software through a virtual network card in a redundant network. Specifically, after the driver of the virtual network card intercepts the communication data, it sends the communication data to the receiving end through multiple real network cards respectively, and the receiving end will receive multiple copies of the same communication data. Therefore, after receiving each communication data, the receiving end needs to perform a redundant judgment on the communication data before executing the data processing logic. However, due to different network states, the time when the receiving end receives the communication data will be different. The existing redundant judgment cannot handle the problem of communication data being sent first and then arriving later, and there is a problem of data loss due to low validity of redundant data judgment. It should be noted that TAP and TUN are both virtual network interfaces, which can be used to implement functions such as virtual LANs or tunnels.

[0039] Based on this, the embodiment of the present application provides a data communication method, the purpose of which is to improve the effectiveness of redundant data processing and avoid data loss. The present application can be applied to a data communication system, which includes at least two network nodes in a subnet in industrial communication, and each network node can be used as a data receiving end or a data sending end. Each network node includes a data buffer, a virtual network card driver, a virtual network card, and at least two physical network cards, wherein a data preprocessing center is configured in the virtual network card driver.

[0040] Figure 1 A flow chart of a data communication method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method includes:

[0041] S101, a data sending node receives communication data, adds a sequence number to the communication data in a manner of increasing the sequence number by a preset difference, and then sends the communication data to a data receiving node through multiple networks.

[0042] In this embodiment, after the data sending node receives the communication data through the data buffer, the data preprocessing center adds a sequence number to the communication data in a manner that increments the sequence number by a preset difference, and the virtual network card sends the communication data to the data receiving node through multiple physical network cards, where one physical network card is used to send communication data in a network.

[0043] In a possible implementation, a sequence number is added to the end of the communication data in a manner that the sequence number is incremented by a preset difference.

[0044] S102: After receiving the real-time communication data through the target network, the data receiving node extracts a sequence number from the real-time communication data as a real-time sequence number.

[0045] In this embodiment, the target network is any network among the multiple networks.

[0046] In this embodiment, the data pre-processing center receives communication data from each network in real time through each physical network card.

[0047] S103. When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than a preset difference, the data receiving node stores the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network into a temporary waiting-to-receive sequence number table, and updates the largest sequence number in the history of the entire network to the real-time sequence number.

[0048] The maximum historical sequence number of the entire network is the maximum sequence number of the communication data sent by the data sending node and received by the data receiving node before the real-time communication data.

[0049] S104, when the real-time sequence number is not greater than the largest sequence number in the history of the entire network, the data receiving node searches the temporary waiting sequence number table for the real-time sequence number, and if so, deletes the real-time sequence number from the temporary waiting sequence number table. If not, the real-time communication data is determined to be redundant data, and the real-time communication data is deleted.

[0050] It can be seen from the above technical solution that a data communication method provided in an embodiment of the present application distinguishes communication data by adding sequence numbers to the communication data according to the sending sequence by the data sending node, and the data receiving node judges the redundant data through the real-time sequence number, the maximum sequence number in the history of the entire network, and the temporary sequence number table to be received. The judgment has high accuracy and can identify the situation of first send and last arrive, thereby identifying redundant data.

[0051] It should be noted that this solution also includes: when the real-time sequence number is greater than the maximum sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the maximum sequence number in the history of the entire network is greater than a preset difference, or when the real-time sequence number is not greater than the maximum sequence number in the history of the entire network and the real-time sequence number is found in the temporary waiting sequence number table, the real-time communication data is determined to be non-redundant data. When the real-time sequence number is greater than the maximum sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the maximum sequence number in the history of the entire network is equal to the preset difference, the data receiving node determines that the real-time communication data is non-redundant data and updates the maximum sequence number in the history of the entire network to the real-time sequence number. Further, this solution also includes: after deleting the real-time sequence number in the real-time communication data, the real-time communication data is sent up. Specifically, Figure 2 A specific structure of a data communication system provided in an embodiment of the present application, the data communication system includes a data sending node and a data receiving node, the data sending node and the data receiving node both include a data buffer, a data preprocessing center configured in a virtual network card driver, a virtual network card, a physical network card of network A, and a physical network card of network B.

[0052] like Figure 2 As shown, at the sending node:

[0053] The application software sends the application software data to be sent to the data buffer of the virtual network card. After the data preprocessing center extracts the data in the data buffer, it adds the target sequence number IndexM to the data to generate the communication data data_IndexM. The virtual network card sends data_IndexM based on network A through the physical network card of network A, and sends data_IndexM based on network B through the physical network card of network B.

[0054] In this embodiment, the method for the data preprocessing center to add the target sequence number Index after data to generate the communication data data_Index includes: receiving data, taking out the sequence numbers from the pre-constructed self-increment sequence corresponding to the receiving end node in sequence from front to back according to the sequence position as the target sequence number, and using the target sequence number as the suffix of data to generate the communication data. Further, the current value of the target sequence number is updated. Among them, the self-increment sequence includes sequence numbers arranged in arithmetic from small to large, and the difference between adjacent sequence numbers is a preset difference. For example, the self-increment sequence includes 64-bit sequence numbers arranged in arithmetic from small to large, and the difference between adjacent sequence numbers is 1.

[0055] At the data receiving node: the virtual network card receives the communication data data_IndexA transmitted by network A through the physical network card of network A, and receives the communication data data_IndexB transmitted by network A through the physical network card of network B. Since the network states of network A and network B are different, there is a phenomenon of asynchronous network transmission and reception for the two networks, and a phenomenon of first send and last arrive for one network, resulting in inconsistency between data_IndexA and data_IndexB received by the virtual network card. Therefore, the data preprocessing center makes a redundancy judgment on the received communication data based on IndexA and IndexB. If data_IndexA and / or data_IndexB are non-redundant data, the sequence number is removed, and the data is sent to the data buffer, and then sent to the upper-layer application.

[0056] In this embodiment, Figure 3 The specific implementation process of a redundant data determination method provided in the embodiment of the present application is specifically applied to a data preprocessing center, such as Figure 3 As shown, this method specifically includes:

[0057] S301: Update the first network and the second network based on the historical maximum sequence number of the A network and the historical maximum sequence number of the B network.

[0058] In this embodiment, the network with a larger historical maximum sequence number is the first network, and the network with a smaller historical maximum sequence number is the second network.

[0059] In this embodiment, the historical maximum sequence number of network A is the maximum value of the historical sequence numbers extracted from the communication data received from network A, recorded as IndexA0. The historical maximum sequence number of network B is the maximum value of the historical sequence numbers extracted from the communication data received from network B, recorded as IndexB0. It can be understood that the historical maximum sequence number of the first network is the historical maximum sequence number of the entire network.

[0060] In this embodiment, the historical maximum sequence number IndexA0 of network A and the historical maximum sequence number IndexB0 of network B are compared. If IndexA0≥IndexB0, the first network is network A and the second network is network B. Otherwise, if IndexA0<IndexB0, the first network is network B and the second network is network A.

[0061] S302: In response to receiving real-time communication data from the first network, extract a sequence number of the real-time communication data as a real-time sequence number.

[0062] In this embodiment, the real-time serial number is extracted from the suffix part of the real-time communication data. The first network is network A or network B. Taking the first network as network A as an example, after receiving the communication data data_IndexA1 transmitted by network A, the real-time serial number IndexA1 is extracted.

[0063] S303: If the real-time sequence number meets a preset first condition, determine that the real-time communication data is non-redundant data.

[0064] In this embodiment, the first condition includes being greater than the largest historical sequence number of the first network, and the absolute value of the difference between the largest historical sequence number of the first network and the first network is a preset difference.

[0065] Continuing with the above example, the preset difference is n, where n is a positive natural number. If indexA1-indexA0=n, the real-time sequence number satisfies the first condition, and data_IndexA1 is determined to be non-redundant data.

[0066] S304: If the real-time sequence number meets the preset second condition, the real-time communication data is determined to be non-redundant data, and the to-be-received sequence number is stored in a temporary to-be-received sequence number table.

[0067] In this embodiment, the second condition includes being greater than the largest historical sequence number of the first network, and the absolute value of the difference with the largest historical sequence number of the first network is greater than a preset difference. The sequence number to be received includes all sequence numbers greater than the real-time sequence number and the largest historical sequence number of the first network.

[0068] Continuing with the previous example, if indexA1-indexA0=N×n, data_IndexA1 is determined to be non-redundant data, and the sequence numbers between indexA0 and indexA1 are obtained as the sequence numbers to be received, which are indexA0+n~indexA0+(N-1)×n respectively.

[0069] S305 , after determining that the real-time communication data is non-redundant data, update the historical maximum sequence number of the first network to the real-time sequence number, and return to S301 .

[0070] Continuing with the above example, after determining that the real-time communication data data_indexA1 is non-redundant data, the historical maximum sequence number of the first network is updated from indexA0 to IndexA1.

[0071] It should be noted that if the real-time sequence number meets the second condition, it means that it does not meet expectations, and there may be data loss or first-sent-last-arrived. At this time, the real-time communication data is non-redundant data, but it is necessary to record the sequence number of the communication data (recorded as communication data to be received) that has been sent by the data sender but not received by the data receiver, and record it as the sequence number to be received.

[0072] For example, in the scenario where the historical maximum sequence number of network A is IndexA0 and the historical maximum sequence number of network B is IndexB0, IndexA0 ≥ IndexB0, that is, the first network is network A and the preset difference is 1, the real-time sequence number of 1 real-time communication data received from network A is a sequence number indexA1 greater than indexA0, and as expected, indexA1=indexA0+1. If it meets expectations, the real-time communication data is determined to be non-redundant data, and the historical maximum sequence number of network A is updated to indexA1. If it does not meet expectations and indexA1=indexA0+N, it means that the sequence numbers between indexA1 and indexA0 are skipped, and data may be lost, or it may be sent first and arrive later. Therefore, the sequence numbers between indexA0 and indexA1 are stored as waiting-to-receive sequence numbers in the temporary waiting-to-receive sequence number table, and then the historical maximum sequence number of network A is updated to indexA1, and finally the real-time communication data is determined to be non-redundant data.

[0073] S306: If the real-time sequence number meets the preset third condition, check whether the real-time sequence number exists in the temporary waiting sequence number table.

[0074] In this embodiment, the third condition includes being smaller than the maximum historical sequence number of the first network.

[0075] S307: If not, determine that the real-time communication data is redundant data, keep the historical maximum sequence number of the first network, and return to S301.

[0076] S308: If it exists, determine that the real-time communication data is non-redundant data, delete the real-time sequence number from the temporary waiting sequence number table, keep the historical maximum sequence number of the first network, and return to S301.

[0077] For example, in the scenario where the historical maximum sequence number of network A is IndexA0 and the historical maximum sequence number of network B is IndexB0, IndexA0 ≥ IndexB0, that is, the first network is network A and the preset difference is 1, the real-time sequence number of 1 real-time communication data received from network A is indexA1 which is less than indexA0, and it is determined that there is a first-send-last-arrival situation. Therefore, indexA1 is searched in the temporary waiting sequence number table. If it does not exist, the real-time communication data is determined to be redundant data and then discarded. If it exists, the real-time communication data is determined to be non-redundant data, and indexA1 is deleted from the temporary waiting sequence number table.

[0078] S309: In response to receiving the real-time communication data from the second network, extract the sequence number of the real-time communication data as the real-time sequence number.

[0079] In this embodiment, the real-time serial number is extracted from the suffix part of the real-time communication data. The second network is network A or network B. Taking the second network as network B as an example, after receiving the communication data data_IndexB1 transmitted by network B, the real-time serial number IndexB1 is extracted.

[0080] S310: If the real-time sequence number satisfies the first condition, determine that the real-time communication data is non-redundant data.

[0081] S311. If the real-time sequence number satisfies the second condition, the real-time communication data is determined to be non-redundant data, and the to-be-received sequence number is stored in a temporary to-be-received sequence number table.

[0082] S312: After determining that the real-time communication data is non-redundant data, update the historical maximum sequence number of the second network to the real-time sequence number, and return to S301.

[0083] For example, in the scenario where the historical maximum sequence number of network A is IndexA0 and the historical maximum sequence number of network B is IndexB0, IndexA0 ≥ IndexB0, that is, the first network is network A and the preset difference is 1, the real-time sequence number of 1 real-time communication data received from network B is indexB1 which is greater than indexA0, indicating that the speed of network B exceeds that of network A, because the communication data sent by network A and network B at the same time are the same, so the expectation is indexB1=indexA0+1. If it meets the expectation, the real-time communication data is determined to be non-redundant data, and the historical maximum sequence number of network B is updated from IndexB0 to indexB1. If it does not meet the expectation and indexB1=indexA0+N, the real-time communication data is determined to be non-redundant data, and the sequence numbers between indexA0 and indexB1 are stored in the temporary waiting sequence number table, and the historical maximum sequence number of network B is updated from IndexB0 to indexB1.

[0084] S313: If the real-time sequence number satisfies the third condition, check whether the real-time sequence number exists in the temporary waiting sequence number table.

[0085] S314: If not, determine that the real-time communication data is redundant data, delete the redundant data, keep the historical maximum sequence number of the first network and the historical maximum sequence number of the second network, and return to S301.

[0086] S315, if it exists, determine that the real-time communication data is non-redundant data, delete the target sequence number to be received from the temporary sequence number table to be received, keep the historical maximum sequence number of the first network and the historical maximum sequence number of the second network, and return to S301.

[0087] For example, in the scenario where the historical maximum sequence number of network A is IndexA0 and the historical maximum sequence number of network B is IndexB0, IndexA0 ≥ IndexB0, that is, the first network is network A and the preset difference is 1, the real-time sequence number of 1 real-time communication data received from network B is indexB1 which is less than indexA0, and indexB1 is searched in the temporary sequence number table to be received. If it does not exist, the real-time communication data is determined to be redundant data and then discarded, and the historical maximum sequence number of network B is maintained. If it exists, it means that indexB1 is the sequence number that was skipped before, which may be caused by data loss or first-come-first-served in network A, so the real-time communication data is determined to be non-redundant data, and indexB1 is deleted from the temporary sequence number table to be received, and the historical maximum sequence number of network B is maintained.

[0088] It can be seen from the above technical solution that in a data communication method provided by an embodiment of the present application, a data sending end adds a sequence number at the end of the communication data according to the sending timing to distinguish the communication data, with high accuracy in packet assembly and without affecting the protocol of the upper-layer application. The data receiving end judges the redundant data based on the relationship between the sequence number and the sending timing, through the real-time sequence number, the historical maximum sequence number, and the temporary sequence number table to be received. The judgment has high accuracy and can identify the situation of first send and last arrive, thereby identifying redundant data.

[0089] It should be noted that the above is only a specific implementation of a data communication method provided in an embodiment of the present application. For example, in a data communication system in which a data communication method provided in an embodiment of the present application is applied, it is not limited to two networks, that is, it is not limited to two physical network cards, and it may include more than two physical network cards. For another example, the sequence number added by the sending node to the communication data is a self-incrementing sequence. The present application does not limit the specific data of the preset difference value, which may be 1 or other natural numbers greater than 1.

[0090] Figure 4 A schematic diagram of a data communication system provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the data communication system includes: a data sending node and a data receiving node;

[0091] The data sending node is used to: receive communication data, add sequence numbers to the communication data in a manner of increasing the sequence numbers by a preset difference, and then send the communication data to the data receiving node through multiple networks;

[0092] The data receiving node is used to: extract a sequence number from the real-time communication data as a real-time sequence number after receiving the real-time communication data through a target network, and the target network is any network among a plurality of networks;

[0093] When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network is stored in a temporary waiting sequence number table, and the largest sequence number in the history of the entire network is updated to the real-time sequence number;

[0094] When the real-time sequence number is not greater than the maximum sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary sequence number table. If so, delete the real-time sequence number from the temporary sequence number table; if not, determine that the real-time communication data is redundant data and delete the real-time communication data.

[0095] It should be noted that the specific structure and functions of the data communication system can refer to the above embodiments.

[0096] The present application also provides an electronic device in an embodiment. Figure 5 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0097] like Figure 5 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 to a random access memory (RAM) 503. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0098] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a memory card, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0099] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any data communication method provided in the embodiment of the present application.

[0100] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any data communication method provided in the embodiment of the present application.

[0101] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0102] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0103] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0104] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are wholly or partly generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from a website, a computer, a training device, or a data center to another website, a computer, a training device, or a data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

Claims

1. A data communication method, characterized in that: Applied to a data sending node, the data communication method comprises: Receive communication data, add sequence numbers to the communication data in a manner of increasing the sequence numbers by a preset difference, and then send the communication data to a data receiving node through multiple networks, so that after the data receiving node receives the real-time communication data through any network among the multiple networks, it extracts the sequence number from the real-time communication data as the real-time sequence number, and when the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, store the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network in a temporary to-be-received sequence number table, and update the largest sequence number in the history of the entire network to the real-time sequence number; when the real-time sequence number is not greater than the largest sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary to-be-received sequence number table, and if so, delete the real-time sequence number from the temporary to-be-received sequence number table; if not, determine that the real-time communication data is redundant data, and delete the real-time communication data.

2. The data communication method according to claim 1, characterized in that: The adding a sequence number to the communication data includes: adding a sequence number at the end of the communication data.

3. A data communication method, characterized in that: Applied to a data receiving node, the data communication method comprises: After receiving the real-time communication data through the target network, extracting the sequence number from the real-time communication data as the real-time sequence number, the target network is any network among the preset multiple networks, and the real-time communication data is sent to the data receiving node through the multiple networks after adding the sequence number to the communication data in a manner of increasing the sequence number by a preset difference; When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network is stored in a temporary waiting sequence number table, and the largest sequence number in the history of the entire network is updated to the real-time sequence number; When the real-time sequence number is not greater than the maximum sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary sequence number table. If so, delete the real-time sequence number from the temporary sequence number table; if not, determine that the real-time communication data is redundant data and delete the real-time communication data.

4. The data communication method according to claim 3, characterized in that: The data communication method further comprises: When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the real-time communication data is determined to be non-redundant data, the real-time sequence number in the real-time communication data is deleted, and the real-time communication data is sent up.

5. The data communication method according to claim 3, characterized in that: After searching in the temporary waiting sequence number table whether the real-time sequence number exists, the data communication method further comprises: If so, the real-time communication data is determined to be non-redundant data, and the real-time sequence number in the real-time communication data is deleted before the real-time communication data is sent.

6. The data communication method according to claim 3, characterized in that: The data communication method further comprises: The data receiving node determines that the real-time communication data is non-redundant data when the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is equal to the preset difference, deletes the real-time sequence number in the real-time communication data, and then sends the real-time communication data; Update the maximum serial number in the history of the entire network to the real-time serial number.

7. A data communication system, characterized in that: It includes a data sending node and a data receiving node; The data sending node is used to: receive communication data, add sequence numbers to the communication data in a manner of increasing the sequence numbers by a preset difference, and then send the communication data to the data receiving node through multiple networks; The data receiving node is used to: extract a sequence number from the real-time communication data as a real-time sequence number after receiving the real-time communication data through a target network, and the target network is any network among a plurality of networks; When the real-time sequence number is greater than the largest sequence number in the history of the entire network, and the absolute value of the difference between the real-time sequence number and the largest sequence number in the history of the entire network is greater than the preset difference, the sequence number between the real-time sequence number and the largest sequence number in the history of the entire network is stored in a temporary waiting sequence number table, and the largest sequence number in the history of the entire network is updated to the real-time sequence number; When the real-time sequence number is not greater than the maximum sequence number in the history of the entire network, check whether the real-time sequence number exists in the temporary sequence number table. If so, delete the real-time sequence number from the temporary sequence number table; if not, determine that the real-time communication data is redundant data and delete the real-time communication data.

8. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the data communication method as claimed in any one of claims 1 to 2, or the data communication method as claimed in any one of claims 3 to 6.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the data communication method as described in any one of claims 1 to 2, or the data communication method as described in any one of claims 3 to 6.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the data communication method as described in any one of claims 1 to 2, or the data communication method as described in any one of claims 3 to 6.