CN114285529A - Data transmission method, device, equipment and medium - Google Patents

Data transmission method, device, equipment and medium Download PDF

Info

Publication number
CN114285529A
CN114285529A CN202111660321.0A CN202111660321A CN114285529A CN 114285529 A CN114285529 A CN 114285529A CN 202111660321 A CN202111660321 A CN 202111660321A CN 114285529 A CN114285529 A CN 114285529A
Authority
CN
China
Prior art keywords
data
receiving end
segment
packet
packets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111660321.0A
Other languages
Chinese (zh)
Inventor
宋强
方垒
官亚娟
刘奋民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hollysys Automation Co Ltd
Original Assignee
Hangzhou Hollysys Automation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hollysys Automation Co Ltd filed Critical Hangzhou Hollysys Automation Co Ltd
Priority to CN202111660321.0A priority Critical patent/CN114285529A/en
Publication of CN114285529A publication Critical patent/CN114285529A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The application discloses a data transmission method, a device, equipment and a medium, comprising the following steps: splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the plurality of data segments to a data receiving end, wherein each data segment comprises a plurality of data packets; after the current data segment is transmitted to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet; and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment. And the data is sent in a segmented mode and confirmed, so that the data transmission efficiency is improved.

Description

Data transmission method, device, equipment and medium
Technical Field
The present invention relates to the field of computer communications technologies, and in particular, to a data transmission method, apparatus, device, and medium.
Background
In a Distributed Control System (DCS), many communication processes between DCS nodes have periodicity and have a high requirement on timeliness, so that many communication processes between nodes are realized based on a User data packet Protocol (UDP), and then communication interfaces between nodes can be unified through encapsulation of a Remote Procedure Call (RPC) Protocol.
Currently, when communication is performed between nodes, a data sending end sends all data packets to a data receiving end, and then waits for the data receiving end to confirm each received data packet. In the process, the data receiving end is required to confirm each received data packet, so that when the data volume sent by the data sending end is large, the proportion of effective data in a protocol is reduced, a large load is brought to the switch and the network card, the data packet loss rate is high, the communication delay between nodes is high, and the data transmission efficiency is low.
In summary, how to efficiently transmit data and improve reliability and timeliness of data transmission is a problem to be solved at present.
Disclosure of Invention
In view of this, the present invention provides a data transmission method, apparatus, device and medium, which can perform efficient data transmission and improve reliability and timeliness of data transmission. The specific scheme is as follows:
in a first aspect, the present application discloses a data transmission method, which is applied to a data sending end in a distributed control system, and includes:
splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets;
after transmitting a current data segment to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet;
and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment.
Optionally, before transmitting the current data segment to the data receiving end, the method further includes:
and acquiring the number of data packets in the current data segment, and numbering the data packets in the current data segment based on the number of the data packets to obtain a packet number corresponding to each data packet.
Optionally, before acquiring the acknowledgement packet sent by the data receiving end within the preconfigured time limit, the method further includes:
confirming the received data packet in the current data segment according to a predefined confirmation rule through the data receiving end to obtain a confirmation packet; and the confirmation rule is used for confirming the number of the data packets, the maximum value of the data packet numbers and the packet numbers corresponding to the data packets which are not received.
Optionally, after determining whether the data receiving end receives all the data packets in the current data segment according to the acknowledgement packet, the method further includes:
and if the data receiving end judges that all the data packets in the current data segment are received, transmitting the next data segment to the data receiving end.
Optionally, if it is determined that the data receiving end does not receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, including:
and if the data receiving end is judged not to receive all the data packets in the current data segment, extracting packet number information used for representing the data packets which are not received in the current data segment from the confirmation packet, and screening out missing data packets corresponding to the packet number information from the current data segment.
Optionally, in the process of acquiring the acknowledgement packet sent by the data receiving end within the preconfigured time limit, the method further includes:
and if the confirmation packet sent by the data receiving end is not acquired within a preset time limit, re-executing the step of transmitting the current data segment to the data receiving end until the re-executed times exceed the retransmission times, and determining that the transmission of the current data segment fails.
Optionally, the retransmitting the missing data packet to the data receiving end based on the preconfigured number of retransmissions, so that after the data receiving end receives all data packets in the current data segment, the method further includes:
and transmitting the next data segment to the data receiving end so that the data receiving end replies a confirmation packet for representing the data packet information received by the data receiving end from all the data segments to the data transmitting end after receiving the data packets in all the data segments, and finishing the corresponding data processing request.
In a second aspect, the present application discloses a data transmission apparatus, which is applied to a data sending end in a distributed control system, and includes:
the data segmentation module is used for splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets;
the system comprises a confirmation packet acquisition module, a data receiving terminal and a data transmission module, wherein the confirmation packet acquisition module is used for acquiring a confirmation packet sent by the data receiving terminal within a preset time limit after transmitting a current data segment to the data receiving terminal, and judging whether the data receiving terminal receives all data packets in the current data segment according to the confirmation packet;
and the data retransmission module is used for screening out corresponding missing data packets from the current data segment and retransmitting the missing data packets to the data receiving end based on the preset retransmission times if the data receiving end is judged not to receive all the data packets in the current data segment, so that the data receiving end can receive all the data packets in the current data segment.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the data transmission method disclosed in the foregoing.
A fourth aspect, itself, discloses a computer-readable storage medium for storing a computer program; wherein the computer program realizes the steps of the data transmission method disclosed in the foregoing when being executed by a processor.
The method comprises the steps that data to be transmitted, which are created based on a user data packet protocol, are split into a plurality of data segments according to a preset data segmentation rule so that the data segments can be sequentially transmitted to a data receiving end, wherein each data segment comprises a plurality of data packets; after transmitting a current data segment to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet; and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment. Therefore, when the data is transmitted, the data to be transmitted is divided into a plurality of data segments and is sequentially transmitted to the data receiving end, so that the data receiving end only confirms the information of the data packets received in the current data segment, that is, the data transmitting end does not transmit all the data packets to the data receiving end at one time, so that the data receiving end confirms each data packet. Therefore, the technical scheme in the application can realize the efficient transmission of the data and improve the reliability and timeliness in the data transmission process.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a data transmission method disclosed herein;
FIG. 2 is a flow chart of a particular data transmission method disclosed herein;
FIG. 3 is a flow chart of a particular data transmission method disclosed herein;
fig. 4 is a data transmission flow between a client and a server according to the present disclosure;
FIG. 5 is a schematic diagram of a data transmission apparatus according to the present disclosure;
fig. 6 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, when communication is performed between nodes, a data sending end sends all data packets to a data receiving end, and then waits for the data receiving end to confirm each received data packet. In the process, the data receiving end is required to confirm each received data packet, so that when the data volume sent by the data sending end is large, the proportion of effective data in a protocol is reduced, a large load is brought to the switch and the network card, the data packet loss rate is high, the communication delay between nodes is high, and the data transmission efficiency is low. Therefore, the embodiment of the application discloses a data transmission method, a data transmission device, data transmission equipment and a data transmission medium, which can be used for efficiently transmitting data and improving the reliability and timeliness of data transmission.
Referring to fig. 1, an embodiment of the present application discloses a data transmission method, including:
step S11: the method comprises the steps of splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets.
In this embodiment, when the data sending end transmits data to the data receiving end, the data to be transmitted may be split into a plurality of data segments, each data segment is subdivided into a plurality of data packets, and the plurality of data segments are sequentially transmitted to the data receiving end. For example, according to 64K as one data segment, the data to be transmitted is split into a plurality of data segments with the size of 64K, and then, according to 1K as one data packet size, one data segment is split into 64 data packets.
Step S12: after the current data segment is transmitted to a data receiving end, a confirmation packet sent by the data receiving end is obtained within a preset time limit, and whether the data receiving end receives all data packets in the current data segment is judged according to the confirmation packet.
In this embodiment, a plurality of data packets in the current data segment are transmitted to the data receiving end, so that the data receiving end confirms the received current data segment to obtain a confirmation packet, and returns the confirmation packet to the data sending end within a time limit configured in advance, and the data sending end determines whether the data receiving end receives all the data packets in the current data segment from information carried in the confirmation packet. It should be noted that, a time limit needs to be configured for the time for acquiring the acknowledgement packet to control the timeliness of the communication, that is, the timeout time during the communication is configured, and the timeout time is related to the network delay.
Step S13: and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment.
In this embodiment, if the data sending end determines that the data receiving end does not receive all the data packets in the current data segment according to the information in the acknowledgement packet, the data sending end screens out corresponding missing data packets from the current data segment, and retransmits the missing data packets to the data receiving end based on the pre-configured retransmission times. It can be understood that, in the data transmission process, a data packet loss phenomenon may occur due to a failure of a physical line, network congestion, and the like, which may cause a data receiving end to fail to receive a complete data packet in a data segment. Therefore, the data sending end needs to retransmit only the data packets lost in the transmission process to the data receiving end according to the related information in the acknowledgement packet, so that the data receiving end receives all the data packets in the current data segment. It should be noted that the retransmission number also needs to be configured in advance to avoid the network from being congested due to the excessive retransmission number.
The method comprises the steps that data to be transmitted, which are created based on a user data packet protocol, are split into a plurality of data segments according to a preset data segmentation rule so that the data segments can be sequentially transmitted to a data receiving end, wherein each data segment comprises a plurality of data packets; after transmitting a current data segment to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet; and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment. Therefore, when the data is transmitted, the data to be transmitted is divided into a plurality of data segments and is sequentially transmitted to the data receiving end, so that the data receiving end only confirms the information of the data packets received in the current data segment, that is, the data transmitting end does not transmit all the data packets to the data receiving end at one time, so that the data receiving end confirms each data packet. Therefore, the technical scheme in the application can realize the efficient transmission of the data and improve the reliability and timeliness in the data transmission process.
Referring to fig. 2, the embodiment of the present application discloses a specific data transmission method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution. The method specifically comprises the following steps:
step S21: the method comprises the steps of splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets.
Step S22: and acquiring the number of data packets in the current data segment, and numbering the data packets in the current data segment based on the number of the data packets to obtain a packet number corresponding to each data packet.
In this embodiment, the number of the data packets in the current data segment needs to be obtained, and a plurality of data packets in the current data segment are numbered correspondingly, for example, the size of the current data segment is 64K, and if 1K is the size of one data packet, 64 data packets are obtained, and then the 64 data packets may be numbered sequentially according to the sequence of 0 to 63, so as to obtain the packet number corresponding to each data packet.
Step S23: after transmitting the current data segment to a data receiving end, confirming the received data packet in the current data segment through the data receiving end according to a predefined confirmation rule to obtain a confirmation packet; and the confirmation rule is used for confirming the number of the data packets, the maximum value of the data packet numbers and the packet numbers corresponding to the data packets which are not received.
In this embodiment, after the data receiving end acquires the current data segment, it is necessary to determine the number of data packets in the current data segment, the maximum value of packet numbers of the data packets, and packet numbers corresponding to the data packets that are not received. It can be understood that the data receiving end does not need to confirm each data packet in the current data segment, but confirms the above several pieces of information, and by this way of batch confirmation, the network utilization and the communication timeliness can be improved, and for the local area network with the packet loss rate of almost zero, the transmission efficiency of the above way will be higher.
In an embodiment, if the number of the data packets received by the data receiving end is consistent with the number of the data packets acquired in step S22, and the maximum value of the number of the received data packets is also consistent with the maximum value of the number, it indicates that the data receiving end has received all the data packets in the current data segment, and then an acknowledgement packet for indicating that the data receiving end has received all the data packet information in the current data segment is created.
In another specific embodiment, if the number of the data packets received by the data receiving end is not consistent with the number of the data packets acquired in step S22, it indicates that a data packet loss event occurs in the data transmission process, and determines packet number information corresponding to the data packet that is not received, and creates a confirmation packet for representing the packet number information.
Step S24: and acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet.
Step S25: if the data receiving end is judged not to receive all the data packets in the current data segment, extracting packet number information used for representing the data packets which are not received in the current data segment from the confirmation packet, screening missing data packets corresponding to the packet number information from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end receives all the data packets in the current data segment.
In this embodiment, if it is determined that the data receiving end does not receive all the data packets in the current data segment, missing data packets corresponding to the packet number information are screened from the current data segment based on the packet number information of the data packets that are not received and carried in the acknowledgement packet, and the missing data packets are retransmitted to the data receiving end based on the pre-configured retransmission times.
Step S26: and transmitting the next data segment to the data receiving end so that the data receiving end replies a confirmation packet for representing the data packet information received by the data receiving end from all the data segments to the data transmitting end after receiving the data packets in all the data segments, and finishing the corresponding data processing request.
In this embodiment, after the data receiving end receives all information in the current data segment, the next data segment is transmitted to the data receiving end, and when all data segments in the data to be transmitted are completely transmitted and the data receiving end also completes reception of data packets in all data segments, a confirmation packet for representing that the data receiving end receives data packet information in all data segments is replied to the data transmitting end, and a corresponding data processing request is completed, at this time, the data transmitting end can also determine that the data receiving end has already received all data packets.
For more specific processing procedures of the steps S21 and S24, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
It can be seen that, in the embodiment of the present application, before transmitting a current data segment to a data receiving end, the number of data packets in the current data segment needs to be acquired, and all data packets are numbered based on the number of data packets to obtain a packet number corresponding to each data packet, so that after the data receiving end acquires the current data segment, the number of the acquired data packets, the maximum value of the packet number of the data packet, and a packet number corresponding to a data packet that is not received are confirmed, if the data receiving end does not acquire all data packets in the current data segment, packet number information corresponding to the data packet that is not acquired is sent to a data sending end in the form of a confirmation packet, and the data sending end screens out a corresponding actual data packet based on the packet number information and then sends the actual data packet to the data receiving end again. Therefore, in the embodiment of the application, after the data receiving end acquires the current data segment, the data receiving end does not confirm each data packet in the current data segment, but confirms the data packets in the current data segment in batch according to the predefined confirmation rule, so that the network utilization rate and the communication timeliness are improved; the premise of the above-mentioned confirmation rule is that before sending the current data segment, the number of data packets in the current data segment needs to be acquired, and corresponding numbering is carried out to obtain the packet number of each data packet; when data needs to be retransmitted, all data packets in the current data segment are not retransmitted, but the packet number information of the data packets which are not received at present is sent to the data sending end through the data receiving end, so that the data sending end screens out corresponding missing data packets according to the packet number information for retransmission, thereby reducing network overhead and saving computer resources.
Referring to fig. 3, the embodiment of the present application discloses a specific data transmission method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution. The method specifically comprises the following steps:
step S31: the method comprises the steps of splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets.
Step S32: after the current data segment is transmitted to a data receiving end, a confirmation packet sent by the data receiving end is obtained within a preset time limit, and whether the data receiving end receives all data packets in the current data segment is judged according to the confirmation packet.
In this embodiment, in the process of acquiring the acknowledgment packet sent by the data receiving end within the preconfigured time limit, the method further includes: and if the confirmation packet sent by the data receiving end is not acquired within a preset time limit, re-executing the step of transmitting the current data segment to the data receiving end until the re-executed times exceed the retransmission times, and determining that the transmission of the current data segment fails. It can be understood that when a network is delayed or blocked, a data sending end may not obtain an acknowledgement packet sent by a data receiving end within a preconfigured time limit, and if the time limit is exceeded, the current data segment needs to be retransmitted to the data receiving end, so that the data receiving end obtains and acknowledges all data packets in the current data segment again. It should be noted that, if the physical line fails or other physical devices fail, the data receiving end cannot receive the data packet in the current data segment no matter how many times the data packet is retransmitted, and therefore, the retransmission times need to be configured, that is, when the number of times of retransmission exceeds the retransmission times, it is determined that the transmission of the current data segment fails.
Step S33: and if the data receiving end judges that all the data packets in the current data segment are received, transmitting the next data segment to the data receiving end.
In this embodiment, if the data sending end determines that the data receiving end has received all the data packets in the current data segment, that is, the data packet loss event does not occur in the current transmission, the data sending end transmits the next data segment, that is, transmits the next data segment to the data receiving end.
For more specific processing procedures of the steps S31, S32, and S33, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
It can be seen that, in the embodiment of the present application, when the data receiving end returns the acknowledgement packet, the data sending end may not obtain the acknowledgement packet sent by the data receiving end within the preconfigured time limit due to the network delay, network congestion, or failure of a physical line and failure of other physical devices, and at this time, the step of transmitting the current data segment to the data receiving end needs to be re-executed, and it is determined that the transmission of the current data segment fails until the number of re-execution times exceeds the preconfigured number of retransmissions. On the contrary, if the data sending end obtains the acknowledgement packet and determines that the data receiving end has received all the data packets in the current data segment, the data sending end transmits the next data segment, that is, transmits the next data segment to the data receiving end.
Fig. 4 is a diagram illustrating a data transmission process between a client and a server in detail, according to an embodiment of the present disclosure:
the client and the server communicate in a request and response mode, and the client has the following states in the sending and receiving periods: sending _ request, receiving _ ack, waiting _ reply, and receiving _ reply.
Firstly, a client initiates rpc a request (namely, a remote procedure call request), enters a sending _ request state, sends partial data to a server, namely, a current data segment, starts an ack packet (namely, an acknowledgement packet) timer, and enters a receiving _ ack state, wherein the timer is used for configuring a time limit for receiving the acknowledgement packet, the time limit is set to 100ms, namely, the client is ensured to receive at least one ack packet in every 100ms, and the ack packet comprises the number of data packets in the currently sent data which have been received by the server and the number of the data packets which need to be retransmitted.
For whether the client receives the acknowledgement packet sent by the server, there are the following situations:
(1) the client receives the confirmation packet sent by the server, judges that the server has received all the data packets in the current data segment according to the information in the confirmation packet, and transmits the next data segment;
(2) the client receives the confirmation packet sent by the server, judges that the server does not receive all the data packets in the current data segment according to the information in the confirmation packet, screens out corresponding missing data packets from the current data segment according to the number of the data packets needing to be retransmitted in the confirmation packet, and retransmits the missing data packets to the server;
(3) if the client does not receive the confirmation packet sent by the server and the sending is considered to be overtime, all data packets in the current data segment are retransmitted to the server;
(4) the client receives the confirmation packet sent by the server, if the error code is 10054 or 10061, the client indicates that the related data transmission service does not exist, and returns a notification message that the corresponding service does not exist;
(5) and the client receives the ack _ all packet sent by the server, namely the client receives all the data packets in all the data segments, the client enters a waiting _ reply state, and starts to send response data to the client after the server processes all the requests, and the client correspondingly enters a receiving _ reply state.
It should be noted that the process of sending the response data from the server to the client is similar to the process of sending the request from the client to the server, and details are not described here, and the specific process refers to fig. 4.
Referring to fig. 5, an embodiment of the present application discloses a data transmission apparatus, which is applied to a data sending end in a distributed control system, and the apparatus includes:
the data segmentation module 11 is configured to split data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule, so that the plurality of data segments are sequentially transmitted to a data receiving end, where each data segment includes a plurality of data packets;
a confirmation packet obtaining module 12, configured to obtain a confirmation packet sent by a data receiving end within a preset time limit after a current data segment is transmitted to the data receiving end, and determine whether the data receiving end receives all data packets in the current data segment according to the confirmation packet;
a data retransmission module 13, configured to, if it is determined that the data receiving end does not receive all the data packets in the current data segment, screen out corresponding missing data packets from the current data segment, and retransmit the missing data packets to the data receiving end based on a preconfigured retransmission number, so that the data receiving end receives all the data packets in the current data segment.
The method comprises the steps that data to be transmitted, which are created based on a user data packet protocol, are split into a plurality of data segments according to a preset data segmentation rule so that the data segments can be sequentially transmitted to a data receiving end, wherein each data segment comprises a plurality of data packets; after transmitting a current data segment to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet; and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment. Therefore, when the data is transmitted, the data to be transmitted is divided into a plurality of data segments and is sequentially transmitted to the data receiving end, so that the data receiving end only confirms the information of the data packets received in the current data segment, that is, the data transmitting end does not transmit all the data packets to the data receiving end at one time, so that the data receiving end confirms each data packet. Therefore, the technical scheme in the application can realize the efficient transmission of the data and improve the reliability and timeliness in the data transmission process.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The method specifically comprises the following steps: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the data transmission method executed by the computer device disclosed in any of the foregoing embodiments.
In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the computer device 20; the communication interface 24 can create a data transmission channel between the computer device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device and the computer program 222 on the computer device 20, so as to realize the operation and processing of the mass data 223 in the memory 22 by the processor 21, which may be Windows, Unix, Linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the data transmission method disclosed in any of the foregoing embodiments by the computer device 20. The data 223 may include data received by the computer device and transmitted from an external device, data collected by the input/output interface 25, and the like.
Further, an embodiment of the present application further discloses a storage medium, in which a computer program is stored, and when the computer program is loaded and executed by a processor, the method steps executed in the data transmission process disclosed in any of the foregoing embodiments are implemented.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The data transmission method, apparatus, device and storage medium provided by the present invention are described in detail above, and the principle and implementation of the present invention are explained herein by applying specific examples, and the description of the above examples is only used to help understanding the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data transmission method is applied to a data sending end in a distributed control system and comprises the following steps:
splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets;
after transmitting a current data segment to a data receiving end, acquiring a confirmation packet sent by the data receiving end within a preset time limit, and judging whether the data receiving end receives all data packets in the current data segment according to the confirmation packet;
and if the data receiving end is judged not to receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment, and retransmitting the missing data packets to the data receiving end based on the preset retransmission times so that the data receiving end can receive all the data packets in the current data segment.
2. The data transmission method according to claim 1, wherein before transmitting the current data segment to the data receiving end, further comprising:
and acquiring the number of data packets in the current data segment, and numbering the data packets in the current data segment based on the number of the data packets to obtain a packet number corresponding to each data packet.
3. The data transmission method according to claim 1, wherein before acquiring the acknowledgement packet sent by the data receiving end within a preconfigured time limit, the method further comprises:
confirming the received data packet in the current data segment according to a predefined confirmation rule through the data receiving end to obtain a confirmation packet; and the confirmation rule is used for confirming the number of the data packets, the maximum value of the data packet numbers and the packet numbers corresponding to the data packets which are not received.
4. The data transmission method according to claim 1, wherein after determining whether the data receiving end receives all the data packets in the current data segment according to the acknowledgement packet, the method further comprises:
and if the data receiving end judges that all the data packets in the current data segment are received, transmitting the next data segment to the data receiving end.
5. The data transmission method according to claim 3, wherein if it is determined that the data receiving end does not receive all the data packets in the current data segment, screening out corresponding missing data packets from the current data segment includes:
and if the data receiving end is judged not to receive all the data packets in the current data segment, extracting packet number information used for representing the data packets which are not received in the current data segment from the confirmation packet, and screening out missing data packets corresponding to the packet number information from the current data segment.
6. The data transmission method according to any one of claims 1 to 5, wherein the process of acquiring the acknowledgement packet sent by the data receiving end within a preconfigured time limit further comprises:
and if the confirmation packet sent by the data receiving end is not acquired within a preset time limit, re-executing the step of transmitting the current data segment to the data receiving end until the re-executed times exceed the retransmission times, and determining that the transmission of the current data segment fails.
7. The data transmission method according to claim 1, wherein the retransmitting the missing data packet to the data receiving end based on the preconfigured number of retransmissions, so that after the data receiving end receives all data packets in the current data segment, the method further comprises:
and transmitting the next data segment to the data receiving end so that the data receiving end replies a confirmation packet for representing the data packet information received by the data receiving end from all the data segments to the data transmitting end after receiving the data packets in all the data segments, and finishing the corresponding data processing request.
8. A data transmission device is applied to a data sending end in a distributed control system, and comprises:
the data segmentation module is used for splitting data to be transmitted, which is created based on a user data packet protocol, into a plurality of data segments according to a preset data segmentation rule so as to sequentially transmit the data segments to a data receiving end, wherein each data segment comprises a plurality of data packets;
the system comprises a confirmation packet acquisition module, a data receiving terminal and a data transmission module, wherein the confirmation packet acquisition module is used for acquiring a confirmation packet sent by the data receiving terminal within a preset time limit after transmitting a current data segment to the data receiving terminal, and judging whether the data receiving terminal receives all data packets in the current data segment according to the confirmation packet;
and the data retransmission module is used for screening out corresponding missing data packets from the current data segment and retransmitting the missing data packets to the data receiving end based on the preset retransmission times if the data receiving end is judged not to receive all the data packets in the current data segment, so that the data receiving end can receive all the data packets in the current data segment.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to carry out the steps of the data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program realizes the steps of the data transmission method according to any one of claims 1 to 7 when executed by a processor.
CN202111660321.0A 2021-12-30 2021-12-30 Data transmission method, device, equipment and medium Pending CN114285529A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111660321.0A CN114285529A (en) 2021-12-30 2021-12-30 Data transmission method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111660321.0A CN114285529A (en) 2021-12-30 2021-12-30 Data transmission method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114285529A true CN114285529A (en) 2022-04-05

Family

ID=80879032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111660321.0A Pending CN114285529A (en) 2021-12-30 2021-12-30 Data transmission method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114285529A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126562A1 (en) * 2004-12-22 2008-05-29 Reiner Ludwig Data Flow Control With Duplicate Acknowledgement
CN105791154A (en) * 2014-12-26 2016-07-20 浙江大华技术股份有限公司 Data transmission method and device based on UDP (User Datagram Protocol)
CN105940639A (en) * 2013-11-29 2016-09-14 桥联有限公司 Transferring data between a first network node and a second network node
CN109474642A (en) * 2019-01-08 2019-03-15 郑州云海信息技术有限公司 Based on Ethernet udp protocol data transmission method, apparatus, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126562A1 (en) * 2004-12-22 2008-05-29 Reiner Ludwig Data Flow Control With Duplicate Acknowledgement
CN105940639A (en) * 2013-11-29 2016-09-14 桥联有限公司 Transferring data between a first network node and a second network node
CN105791154A (en) * 2014-12-26 2016-07-20 浙江大华技术股份有限公司 Data transmission method and device based on UDP (User Datagram Protocol)
CN109474642A (en) * 2019-01-08 2019-03-15 郑州云海信息技术有限公司 Based on Ethernet udp protocol data transmission method, apparatus, equipment and medium

Similar Documents

Publication Publication Date Title
US7228330B2 (en) Method for the optimization of network traffic, and associated implementation device
CN111224999A (en) Transmission protocol switching method, device, equipment and storage medium
CN107567107B (en) Data transmission method and device
CN113259391B (en) Data transmission method and device applied to multi-level node network
CN103795632A (en) Data message transmission method, related equipment and system
CN106453356B (en) The bilateral acceleration transmission method of wireless network and system
CN113765976A (en) Communication method and system
EP3142442A1 (en) Method, device and system for controlling air interface resources
CN101977358A (en) Method, device and equipment for transmitting data short messages
EP3481028A1 (en) Network packet processing method, device, and network server
CN105407149B (en) Information push method and device
CN112152880A (en) Link health detection method and device
CN103973414A (en) Data transmission method and device
JP3827688B2 (en) Method for synchronizing Internet service of mobile communication terminal
CN113852445A (en) Method, system, equipment and storage medium for improving data transmission reliability
JP7328177B2 (en) Data transmission method and communication system
CN113412478B (en) Message transmitting/receiving method, communication device, and program
CN110266446B (en) Method and device for adjusting out-of-order time length based on SACK mode
CN109445806B (en) Ble-based multi-device upgrading method, device, system and terminal
CN107431965B (en) Method and device for realizing Transmission Control Protocol (TCP) transmission
CN114285529A (en) Data transmission method, device, equipment and medium
CN110913431A (en) Data wireless transmission method and device, computer equipment and storage medium
CN106130863A (en) The transfer approach of LAN protocol message, device and system
AU2021230848B2 (en) Communication apparatus, program, communication method, information processing method, information processing apparatus, and communication system
WO2022033083A1 (en) Decoding method, decoding system, electronic apparatus, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination