CN109905205B - Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system - Google Patents

Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system Download PDF

Info

Publication number
CN109905205B
CN109905205B CN201910267219.0A CN201910267219A CN109905205B CN 109905205 B CN109905205 B CN 109905205B CN 201910267219 A CN201910267219 A CN 201910267219A CN 109905205 B CN109905205 B CN 109905205B
Authority
CN
China
Prior art keywords
data
packet
header
index
long
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.)
Active
Application number
CN201910267219.0A
Other languages
Chinese (zh)
Other versions
CN109905205A (en
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.)
Suzhou Gold Mantis Culture Development Co Ltd
Original Assignee
Suzhou Gold Mantis Culture Development 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 Suzhou Gold Mantis Culture Development Co Ltd filed Critical Suzhou Gold Mantis Culture Development Co Ltd
Priority to CN201910267219.0A priority Critical patent/CN109905205B/en
Publication of CN109905205A publication Critical patent/CN109905205A/en
Application granted granted Critical
Publication of CN109905205B publication Critical patent/CN109905205B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Detection And Prevention Of Errors In Transmission (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a method and a device for sending and receiving data, a method and a system for transmitting data, relating to the communication technology, and dividing long data to be sent into a plurality of data packets; adding a packet header to each data packet, wherein the packet header comprises a header, a data length, a packet number and a packet index; when data is sent, data packets are sequentially sent according to the normal sequence of the packet indexes; when a new header and an initial packet index appear in data receiving and the previous long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data; when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by a receiving end, and sending a next data packet according to the packet index sequence of the current long data initial; the whole data sending process is more optimized, and the information loss of data splitting sending caused by packet loss and packet missing is avoided.

Description

Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system
Technical Field
The present invention relates to communication technologies, and in particular, to a method and an apparatus for transmitting and receiving data, and a method and a system for transmitting data.
Background
In activities or places such as exhibition, museum, concert, often need cooperate the occasion scene to build visual effect, auditory effect and the on-the-spot atmosphere that is fit for harmony, play the effect that brings out the best in each other, and audio-visual equipment such as a large amount of lights, stereo set are adopted usually to current scheme, connect and build the LAN, constitute a complete set of audio-visual system.
The realization of the Udp communication mode is an ideal technical means for realizing the local area network communication. However, for a large data packet, data transmission cannot be completed at one time, and the data packet needs to be divided into a plurality of data packets for transmission.
At present, chinese patent application No. 201110070410.X discloses a data transmission method and system, which includes: the first terminal splits data information needing to be sent to the second terminal and packages the data information into data packets, wherein the data packets comprise: a bag head and a bag body; the first terminal sends a data packet to the second terminal and waits for a receiving response fed back by the second terminal; if the first terminal receives a receiving response fed back by the second terminal within a preset time limit, sending a next data packet to the second terminal until all data packets are sent to the second terminal; and if the first terminal does not receive the receiving response fed back by the second terminal or receives the retransmission request fed back by the second terminal within the preset time limit, retransmitting the data packet which is transmitted last time to the second terminal until the retransmission times exceeds the preset threshold value.
Although the data transmission method and the data transmission system provided by the invention can quickly and effectively correct errors and remedy errors in the serial communication process, in the field of exhibition and display, due to the complexity of the communication environment and the various interference factors, the conditions of data packet loss and packet leakage often occur, and the data transmission is incomplete, so that an optimized data transmission method is needed.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and equipment for sending and receiving data, a method and a system for transmitting data.
In order to achieve the purpose, the invention provides the following technical scheme:
in a first aspect, a data transmission method based on coding technique is provided, which includes
Splitting long data to be sent into a plurality of data packets;
adding a packet header to each data packet, wherein the packet header comprises a header, a data length, a packet number and a packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is wrapped, the number of the packets is used for representing the total number of the split data packets, and the packet index is the sequence number of the data packet;
when data is sent, data packets are sequentially sent according to the normal sequence of the packet indexes;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by a receiving end, and sending a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the last long data is not completely received, responding to a third return command fed back by a receiving end, and retransmitting a next data packet according to the correct packet index sequence of the last long data;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index;
and when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, responding to a fifth return command fed back by the receiving end, and retransmitting the next data packet according to the next packet index sequence of the previous data packet.
By adopting the technical scheme, long data is split into single data packets to be sent one by one, the long data is sent, and a packet header is added to each data packet for normatively and completely sending report data. In case one, when data is transmitted, other commands are not received and are sequentially transmitted according to the packet index sequence, so that transmission disorder is avoided. And in the second situation, when the receiving end receives a new header and the initial packet index, and simultaneously the previous long data is received and the new long data is sent, responding to a first return command fed back by the receiving end at the moment, and sending the next data packet according to the packet index sequence of the currently and newly sent long data, thereby realizing the uninterrupted sending of the previous and next long data. And in case III, a new header and a non-initial packet index are received at the receiving end, and when the previous long data is received, the initial data packet of the long data is lost or omitted, and at the moment, a second return command fed back by the receiving end is responded, and the next data packet is sent according to the initial packet index sequence of the current new long data, so that the problem of data packet loss corresponding to the initial packet index is solved. And in the fourth case, when a new header appears during data reception but the previous long data is not received, that is, the packet loss and packet leakage of the previous long data occur, and the data packet condition of the next long data to be transmitted is directly received, at this time, the next data packet is retransmitted according to the packet index sequence of the previous long data which should be correctly transmitted in response to the third return command fed back by the receiving end, so that the problems of packet loss and packet leakage of the previous long data are solved. And in case five, when the data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, the normal and correct packet sequence transmission state is realized. And in case of the sixth situation, when the header of the received data is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, packet loss and packet omission occur in the same long data, and at this time, in response to a fifth return command fed back by the receiving end, the next data packet is retransmitted according to the next packet index sequence of the previous data packet, that is, the correct data packet is retransmitted, so that the data loss is avoided. The whole data sending process is more optimized, and the information loss of data splitting sending caused by packet loss and packet missing is avoided.
And further, encoding an error check code for each data packet, and retransmitting the error data packet in response to a sixth return command fed back by the receiving end when the error check is not passed during data reception.
By adopting the technical scheme, the error check code is utilized to further carry out error check on the data transmission, and the integrity and accuracy of the data transmission are further enhanced aiming at the error data retransmission.
In a second aspect, a data sending device is provided, which includes a first processor and a first memory, where the first memory stores an instruction set for the first processor to call to implement the following functions:
splitting long data to be sent into a plurality of data packets;
adding a packet header to each data packet, wherein the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is packaged, the number of the packets is used for representing the total number of the split data packets, and the packet index is the sequence number of the data packet;
when data is sent, data packets are sequentially sent according to the normal sequence of the packet indexes;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by a receiving end, and sending a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the last long data is not completely received, responding to a third return command fed back by a receiving end, and retransmitting a next data packet according to the correct packet index sequence of the last long data;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index;
and when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, responding to a fifth return command fed back by the receiving end, and retransmitting the next data packet according to the next packet index sequence of the previous data packet.
Further, the instruction set is also called by the first processor to realize the following functions:
and coding an error check code for each data packet, and retransmitting the error data packet in response to a sixth return command fed back by the receiving end when the error check is not passed during data receiving.
In a third aspect, a data receiving method is provided, comprising
Sequentially receiving a plurality of data packets split from long data; the data packet is additionally coded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is wrapped, the packet number is used for representing the total number of the split data packets, and the packet index is the sequence number of the data packet and is the sequence basis for data transmission;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, generating a first return command requesting to send a next data packet according to the normal packet index sequence of the current long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, generating a second return command requesting to send a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the previous long data is not completely received, generating a third return command requesting to resend the next data packet according to the correct packet index sequence of the previous long data;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, generating a fourth return command requesting to send the next data packet according to the normal sequence of the packet index;
and when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, generating a fifth return command requesting to resend the next data packet according to the next packet index sequence of the previous data packet.
And further, generating a sixth return command for retransmitting the error data packet when the error check code coded in each data packet received by the data fails to check the error.
In a fourth aspect, a data receiving device is provided, which includes a second processor and a second memory, where the second memory stores an instruction set for the second processor to call to implement the following functions:
sequentially receiving a plurality of data packets split from long data; the data packet is additionally coded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is packaged, the packet number is used for representing the total number of the split data packets, and the packet index is a sequence number of the data packet and is a sequence basis for data transmission;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, generating a first return command requesting to send a next data packet according to the normal packet index sequence of the current long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, generating a second return command requesting to send a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the previous long data is not completely received, generating a third return command requesting to resend the next data packet according to the correct packet index sequence of the previous long data;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, generating a fourth return command requesting to send the next data packet according to the normal sequence of the packet index;
and when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, generating a fifth return command requesting to resend the next data packet according to the next packet index sequence of the previous data packet.
Further, the instruction set is also called by the second processor to implement the following functions:
and when the error check code added in each data packet received by the data fails to check the error, generating a sixth return command for retransmitting the error data packet.
In a fifth aspect, a data transmission method is provided, which comprises the data transmission method as described above, and the data reception method as described above.
A sixth aspect provides a data transmission system comprising a data transmission device as described above, and a data reception device as described above.
The technical effects obtained by the second to sixth aspects of the present invention are similar to the technical effects obtained by the technical solutions of the first aspect, and are not described again.
In conclusion, the invention has the following beneficial effects:
1. the whole data sending process is more optimized, and the information loss of data splitting sending caused by packet loss and packet missing is avoided;
2. and the error check code is utilized to further carry out error check on the data transmission, and the data transmission is retransmitted aiming at the error data, so that the completeness and accuracy of the data transmission are further enhanced.
Drawings
FIG. 1 is a flow chart of a data transmission method according to the present invention;
FIG. 2 is a schematic diagram of a data transmission apparatus according to the present invention;
FIG. 3 is a flow chart of a data receiving method according to the present invention;
FIG. 4 is a schematic diagram of a data receiving device according to the present invention;
fig. 5 is a schematic diagram of a data transmission system according to the present invention.
In the figure: 1. a first processor; 2. a first memory; 3. a second processor; 4. a second memory.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and examples.
The present embodiment is only for explaining the present invention, and it is not limited to the present invention, and those skilled in the art can make modifications of the present embodiment without inventive contribution as needed after reading the present specification, but all of them are protected by patent law within the scope of the claims of the present invention.
Example 1
A data transmission method, referring to fig. 1, includes steps S101 to S103.
Step S101: and splitting long data to be transmitted into a plurality of data packets.
The long data splitting mode is splitting according to a fixed size, and when other requirements exist, splitting can be performed according to a specific size according to the requirements. The specific size of the split data packet and the number of the split data packets are set according to the needs, and are not limited.
Step S102: and adding a packet header to each data packet, wherein the packet header comprises a header, data length, packet number and packet index.
The header is a task number for distinguishing long data to which the data packet belongs, the splitting and sending process of one long data should be one task, and different headers represent different long data to be sent.
The data length is used for defining the length of the data content after the packet header, so that the data is convenient to check, and the completeness and accuracy of the data are ensured.
The number of the packets is used for representing the total number of the split data packets and verifying whether the long data is received completely or not by combining the packet indexes.
The packet index is the serial number of the data packet, and is used for numbering the data packet, so that the data packet can be conveniently sent according to the sequence and the requirement, and the packet number is combined to verify whether the long data is completely received or not
Take long data AA 0001020300010000000000 as an example, where:
AA 00010203000100 is a braided packet header;
00000000 is the data content to be transmitted;
AA is a header;
00010203 is the data length of the data content in the current data packet;
0001 is the number of packets into which the long data is split;
00 is the packet index of the current packet;
00000000 is the data content of the current data packet.
Step S103: receiving a return command of a feedback end, and sending the next data packet in the corresponding sequence according to the type of the return command:
the first situation is as follows: when data begins to be sent, other commands are not received, and the data is sent in sequence according to the packet index sequence, so that sending disorder is avoided.
Case two: and when the receiving end receives the new header and the initial packet index and simultaneously receives the previous long data, and sends the new long data, the receiving end responds to a first return command fed back by the receiving end and sends the next data packet according to the packet index sequence of the current newly sent long data, so that the continuous sending of the previous long data and the next long data is realized.
Case three: and when the receiving end receives a new header and a non-initial packet index and the last long data is received at the same time, the condition that the initial data packet of the long data is lost or omitted occurs, and at the moment, a second return command fed back by the receiving end is responded, and the next data packet is sent according to the initial packet index sequence of the current new long data, so that the problem that the data packet corresponding to the initial packet index is lost is solved.
Case four: when a new header appears in data reception but the previous long data is not received completely, that is, the previous long data packet loss and packet leakage occur, and the data packet condition of the next long data to be transmitted is directly received, at this time, the next data packet is retransmitted according to the packet index sequence of the previous long data which should be correctly transmitted in response to a third return command fed back by the receiving end, so that the problems of packet loss and packet leakage of the previous long data are solved.
Case five: and when the data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index. This is the normal and correct packet sequence transmission state.
Case six: when the header of the received data is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, packet loss and packet missing in the same long data occur, and at this time, the fifth return command fed back by the receiving end is responded, the next data packet is retransmitted according to the next packet index sequence of the previous data packet, namely, the correct data packet is retransmitted, so that the data loss is avoided.
Further, the method also comprises the step of adding an error check code to each data packet, and when the error check is not passed in the data receiving process, responding to a sixth return command fed back by the receiving end, and retransmitting the error data packet.
And the error check code is utilized to further carry out error check on the data transmission, and the data transmission is retransmitted aiming at the error data, so that the completeness and accuracy of the data transmission are further enhanced. The error checking code may be a CRC16 checking code or a CRC32 checking code or the like.
Example 2
A data transmission device, referring to fig. 2, includes a first processor 1 and a first memory 2, where the first memory 2 stores an instruction set for the first processor 1 to call to implement the following functions:
and splitting long data to be transmitted into a plurality of data packets.
Adding a packet header to each data packet, wherein the packet header comprises a header, a data length, a packet number and a packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is wrapped, the number of the packets is used for representing the total number of the split data packets, and the packet index is the sequence number of the data packet.
When data is transmitted, data packets are sequentially transmitted according to the normal sequence of the packet indexes.
And when a new header and an initial packet index appear in data receiving and the previous long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data.
And when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by the receiving end, and sending the next data packet according to the packet index sequence of the current long data initial.
And when a new header appears in data reception and the last long data is not completely received, responding to a third return command fed back by the receiving end, and retransmitting the next data packet according to the correct packet index sequence of the last long data.
And when the data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index.
And when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, responding to a fifth return command fed back by the receiving end, and retransmitting the next data packet according to the next packet index sequence of the previous data packet.
And coding an error check code for each data packet, and retransmitting the error data packet in response to a sixth return command fed back by the receiving end when the error check is not passed during data receiving.
Example 3
A data receiving method, referring to fig. 3, includes step S201 and step S202.
Step S201: and sequentially receiving a plurality of data packets formed by splitting the long data.
The data packet is additionally coded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is wrapped, the number of the packets is used for representing the total number of the split data packets, and the packet index is the sequence number of the data packet and is the sequence basis for data transmission.
Step S202: according to the header information of the received data packet, judging the receiving condition of the data and feeding back a corresponding return command to a receiving end to promote the data to be completely sent, specifically:
the first situation is as follows: when a new header and an initial packet index appear in data reception and the previous long data is completely received, the state is that the previous long data is completely transmitted, and the next long data is transmitted, at the moment, a new data receiving task is established in response to the new header and the initial packet index, a data buffer area is emptied for caching the new long data, and meanwhile, a first return command requesting to transmit the next data packet according to the normal packet index sequence of the current long data is generated.
Case two: when the receiving end receives a new header and a non-initial packet index and the last long data is received at the same time, the condition that the initial data packet of the long data is lost or omitted occurs, and at the moment, a second return command fed back by the receiving end is responded, and the next data packet is sent according to the initial packet index sequence of the current new long data, so that the problem that the data packet corresponding to the initial packet index is lost is solved.
Case three: when a new header appears in data reception but the previous long data is not received completely, packet loss and packet leakage of the previous long data occur, and the data packet condition of the next long data to be transmitted is directly received.
Case four: and when the data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index. This is the normal and correct packet sequence transmission state.
Case five: when the header of the received data is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, packet loss and packet missing in the same long data occur, and at this time, the fifth return command fed back by the receiving end is responded, the next data packet is retransmitted according to the next packet index sequence of the previous data packet, namely, the correct data packet is retransmitted, so that the data loss is avoided.
Further, the method includes generating a sixth return command to resend the corrupted data packet when the data received the error checking code encoded in each data packet fails the error checking.
And the error check code is utilized to further carry out error check on the data transmission, and the data transmission is retransmitted aiming at the error data, so that the completeness and accuracy of the data transmission are further enhanced. The error checking code may be a CRC16 check code or a CRC32 check code or the like.
Example 4
A data receiving device, referring to fig. 4, includes a second processor 3 and a second memory 4, where the second memory 4 stores an instruction set for the second processor 3 to call to implement the following functions:
sequentially receiving a plurality of data packets split from long data; the data packet is additionally coded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the data length is used for defining the length of data content after the header is packaged, the packet number is used for representing the total number of the split data packets, and the packet index is a sequence number of the data packet and is a sequence basis for data transmission.
When a new header and a starting packet index appear in data receiving and the previous long data is completely received, a first return command requesting to send the next data packet according to the normal packet index sequence of the current long data is generated.
When a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, generating a second return command requesting to send a next data packet according to the packet index sequence of the current long data initial;
and when a new header appears during data reception and the last long data is not completely received, generating a third return command requesting to resend the next data packet according to the correct packet index sequence of the last long data.
And when the data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, generating a fourth return command requesting to send the next data packet according to the normal sequence of the packet index.
And when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, generating a fifth return command requesting to resend the next data packet according to the next packet index sequence of the previous data packet.
And when the error check code added in each data packet received by the data fails to check the error, generating a sixth return command for retransmitting the error data packet.
Example 5
A data transmission method comprising the data transmission method provided in embodiment 1, and the data reception method as provided in embodiment 3.
Example 6
A data transmission system, referring to fig. 5, includes the data transmission apparatus as provided in embodiment 2, and the data reception apparatus as provided in embodiment 4.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.

Claims (6)

1. A data transmission method is based on coding technology and is characterized in that: comprises that
Splitting long data to be sent into a plurality of data packets;
adding a packet header to each data packet, wherein the packet header comprises a header, a data length, a packet number and a packet index; the header is a task number for distinguishing long data to which the data packet belongs, the splitting and sending process of one long data is one task, and different headers represent different long data to be sent; the data length is used for defining the length of the data content after the packet header; the number of the packets is used for representing the total number of the split data packets; the packet index is the serial number of the data packet, is used for numbering the data packet, facilitate the data packet to send according to the order and need, combine the quantity of the packet in addition, can be used for verifying whether the long data is received completely, the verification principle is, under the task of receiving the same long data, the total amount of the data packet received sequentially according to the sequence of the packet index is equal to the quantity of the packet;
receiving a return command of a feedback end, and sending a next data packet in a corresponding sequence according to the type of the return command, specifically comprising:
when data begins to be sent, data packets are sequentially sent according to the normal sequence of the packet indexes;
when a new header and an initial packet index appear in data receiving and the last long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data, thereby realizing the continuous sending of the front and back long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by a receiving end, and sending a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the last long data is not completely received, a third return command fed back by a receiving end is responded, and the next data packet is retransmitted according to the correct packet index sequence of the last long data, so that the problems of packet loss and packet leakage of the last long data are solved;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index;
when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, the fifth return command fed back by the receiving end is responded, and the next data packet is retransmitted according to the next packet index sequence of the previous data packet so as to avoid the data loss;
and encoding an error check code for each data packet, and retransmitting the error data packet in response to a sixth return command fed back by the receiving end when the error check is not passed during data reception.
2. A data transmission apparatus characterized by: the system comprises a first processor (1) and a first memory (2), wherein the first memory (2) stores an instruction set for the first processor (1) to call so as to realize the following functions:
splitting long data to be sent into a plurality of data packets;
adding a packet header to each data packet, wherein the packet header comprises a header, a data length, a packet number and a packet index; the header is a task number for distinguishing long data to which the data packet belongs, the splitting and sending process of one long data is one task, and different headers represent different long data to be sent; the data length is used for defining the length of the data content after the packet header; the number of the packets is used for representing the total number of the split data packets; the packet index is the serial number of the data packet, is used for numbering the data packet, facilitate the data packet to send according to the order and need, combine the quantity of the packet in addition, can be used for verifying whether the long data is received completely, the verification principle is, under the task of receiving the same long data, the total amount of the data packet received sequentially according to the sequence of the packet index is equal to the quantity of the packet;
receiving a return command of a feedback end, and sending a next data packet in a corresponding sequence according to the type of the return command, specifically comprising:
when data begins to be sent, data packets are sequentially sent according to the normal sequence of the packet indexes;
when a new header and an initial packet index appear in data receiving and the last long data is completely received, responding to a first return command fed back by a receiving end, and sending a next data packet according to the normal packet index sequence of the current long data, thereby realizing the continuous sending of the front and back long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, responding to a second return command fed back by a receiving end, and sending a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the last long data is not completely received, a third return command fed back by a receiving end is responded, and the next data packet is retransmitted according to the correct packet index sequence of the last long data, so that the problems of packet loss and packet leakage of the last long data are solved;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, responding to a fourth return command fed back by the receiving end, and sending the next data packet according to the normal sequence of the packet index;
when the data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, the fifth return command fed back by the receiving end is responded, and the next data packet is retransmitted according to the next packet index sequence of the previous data packet so as to avoid the data loss;
the set of instructions is also called by the first processor (1) to implement the following functions:
and coding an error check code for each data packet, and retransmitting the error data packet in response to a sixth return command fed back by the receiving end when the error check is not passed during data receiving.
3. A data receiving method, characterized by: comprises that
Sequentially receiving a plurality of data packets split from long data; the data packet is additionally coded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the splitting and sending process of one long data is one task, and different headers represent different long data to be sent; the data length is used for defining the length of the data content after the packet header; the number of the packets is used for representing the total number of the split data packets; the packet index is the serial number of the data packet, is the data sending sequence basis, is used for numbering the data packet, facilitate the data packet to send according to the order and need, combine the quantity of the packet in addition, can be used for verifying whether the long data is received completely, the verification principle is, under the receiving task of the same long data, whether the total amount of the data packet received sequentially according to the sequence of the packet index is equal to the quantity of the packet;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, generating a first return command requesting to send a next data packet according to the normal packet index sequence of the current long data, thereby realizing the uninterrupted sending of the previous and next long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, generating a second return command requesting to send a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the previous long data is not completely received, a third return command requesting to resend the next data packet according to the correct packet index sequence of the previous long data is generated, so that the problems of packet loss and packet leakage of the previous long data are solved;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, generating a fourth return command requesting to send the next data packet according to the normal sequence of the packet index;
when data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, generating a fifth return command requesting to resend the next data packet according to the next packet index sequence of the previous data packet so as to avoid data loss;
and generating a sixth return command for retransmitting the error data packet when the error check code added to each data packet received by the data fails to check the error.
4. A data receiving apparatus characterized by: the system comprises a second processor (3) and a second memory (4), wherein the second memory (4) stores an instruction set for the second processor (3) to call so as to realize the following functions:
sequentially receiving a plurality of data packets split from long data; the data packet is encoded with a packet header, and the packet header comprises a header, data length, packet number and packet index; the header is a task number for distinguishing long data to which the data packet belongs, the splitting and sending process of one long data is one task, and different headers represent different long data to be sent; the data length is used for defining the length of the data content after the packet header; the number of the packets is used for representing the total number of the split data packets; the packet index is the serial number of the data packet, is the data sending sequence basis, is used for numbering the data packet, facilitate the data packet to send according to the order and need, combine the quantity of the packet in addition, can be used for verifying whether the long data is received completely, the verification principle is, under the receiving task of the same long data, whether the total amount of the data packet received sequentially according to the sequence of the packet index is equal to the quantity of the packet;
when a new header and an initial packet index appear in data receiving and the previous long data is completely received, generating a first return command requesting to send the next data packet according to the normal packet index sequence of the current long data, thereby realizing the uninterrupted sending of the previous and next long data;
when a new header and a non-initial packet index appear in data receiving and the previous long data is completely received, generating a second return command requesting to send a next data packet according to the packet index sequence of the current long data initial;
when a new header appears in data reception and the previous long data is not completely received, a third return command requesting to resend the next data packet according to the correct packet index sequence of the previous long data is generated, so that the problems of packet loss and packet leakage of the previous long data are solved;
when data reception is consistent with the header of the previous data packet and the packet index is continuous with the packet index of the previous data packet, generating a fourth return command requesting to send the next data packet according to the normal sequence of the packet index;
when data reception is consistent with the header of the previous data packet and the packet index is not continuous with the packet index of the previous data packet, generating a fifth return command requesting to resend the next data packet according to the next packet index sequence of the previous data packet so as to avoid data loss;
the instruction set is also called by the second processor (3) to implement the following functions:
and when the error check code added in each data packet received by the data fails to check the error, generating a sixth return command for retransmitting the error data packet.
5. A method of data transmission, characterized by: comprising a data transmission method as claimed in claim 1 and a data reception method as claimed in claim 3.
6. A data transmission system, characterized by: comprising a data transmitting device as claimed in claim 2 and a data receiving device as claimed in claim 4.
CN201910267219.0A 2019-04-03 2019-04-03 Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system Active CN109905205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910267219.0A CN109905205B (en) 2019-04-03 2019-04-03 Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910267219.0A CN109905205B (en) 2019-04-03 2019-04-03 Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system

Publications (2)

Publication Number Publication Date
CN109905205A CN109905205A (en) 2019-06-18
CN109905205B true CN109905205B (en) 2022-06-24

Family

ID=66955177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910267219.0A Active CN109905205B (en) 2019-04-03 2019-04-03 Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system

Country Status (1)

Country Link
CN (1) CN109905205B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110311721A (en) * 2019-06-19 2019-10-08 海丰通航科技有限公司 Data transmission method, transmitting terminal, receiving end and data transmission system
CN112769708A (en) * 2019-11-05 2021-05-07 北京华为数字技术有限公司 Data transmission method and device and computer readable storage medium
CN111246428A (en) * 2019-11-20 2020-06-05 广东纬德信息科技股份有限公司 Network reliable communication method, system, device and storage medium
CN111917531B (en) * 2020-07-28 2023-04-18 厦门亿联网络技术股份有限公司 Single-wire bidirectional communication system and communication method thereof
WO2022087925A1 (en) 2020-10-28 2022-05-05 京东方科技集团股份有限公司 Data transmission method and apparatus, terminal, and system
CN113360435A (en) * 2021-06-03 2021-09-07 三川智慧科技股份有限公司 Serial port communication optimization method, device, equipment and medium for intelligent water meter

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102273176A (en) * 2009-01-14 2011-12-07 熵敏通讯股份有限公司 System and method for retransmission and fragmentation in a communication network
CN105245317A (en) * 2015-10-20 2016-01-13 北京小鸟听听科技有限公司 Data transmission method, transmitting end, receiving end and data transmission system
CN106453233A (en) * 2016-08-10 2017-02-22 深圳市中兴物联科技股份有限公司 Data transmission method and apparatus based on UDP
CN108848197A (en) * 2018-09-19 2018-11-20 江苏瑞中数据股份有限公司 A kind of method and system of file transmission

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193312B (en) * 2006-11-22 2011-01-05 中兴通讯股份有限公司 Self-adapted error recovery device, video communication system and method based on feedback
US20100165992A1 (en) * 2008-12-29 2010-07-01 Moxa Inc. Transmission system, device and method that prevent data loss

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102273176A (en) * 2009-01-14 2011-12-07 熵敏通讯股份有限公司 System and method for retransmission and fragmentation in a communication network
CN105245317A (en) * 2015-10-20 2016-01-13 北京小鸟听听科技有限公司 Data transmission method, transmitting end, receiving end and data transmission system
CN106453233A (en) * 2016-08-10 2017-02-22 深圳市中兴物联科技股份有限公司 Data transmission method and apparatus based on UDP
CN108848197A (en) * 2018-09-19 2018-11-20 江苏瑞中数据股份有限公司 A kind of method and system of file transmission

Also Published As

Publication number Publication date
CN109905205A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
CN109905205B (en) Data sending method, data receiving method, data sending equipment, data receiving equipment, data transmission method and data transmission system
CN109996097B (en) Screen projection method, system and storage device
CN107257270B (en) Data transmission method and system based on hybrid automatic repeat request
CN106209915A (en) A kind of real time flow medium radio transmitting method and system thereof
CN101753586A (en) Method for transmitting data, process method for receiving data and device
WO2018018627A1 (en) Data transmission method and system, and receiving device
RU2011108113A (en) DEVICE AND METHOD FOR FORMING MAS DATA PROTOCOL MODULE IN WIRELESS COMMUNICATION SYSTEM
CN107104677A (en) The apparatus and method of transmission/reception forward error correction relevant information in multimedia system
CN106452688A (en) Beidou data lost message retransmission method and system
CN106162374B (en) A kind of the intracoded frame robust transmission method and system of low complex degree
CN109327286A (en) Communication means and system based on optical fiber
CN103095439A (en) Method and device of two-way cooperation relay transmission data based on network coding
CN106656424A (en) Verification method of data transmission
CN103607264A (en) 3G network-based in-band data transmission method
CN105635802A (en) Transmission method of digital media data and device
CN102739650A (en) File transmission system combining broadcast and television net and internet
CN101453479A (en) Fast document transmission system
US10200154B2 (en) System and method for early packet header verification
CN112804028B (en) Data packet transmission method, equipment and storage medium
CN107257265B (en) Real-time transmission data stream forward error correction, system, device and storage medium
CN109391605A (en) Data transmission method, apparatus and system
US9762353B2 (en) Data packet for bidirectional transmission of data packets during data transmission between a first and a second communication appliance, and method for transmitting such a data packet
CN111246428A (en) Network reliable communication method, system, device and storage medium
CN104796735B (en) A kind of method of transmitting video data and device
US20220407635A1 (en) Method and device for transmitting hybrid automatic repeat request acknowledgement information

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
GR01 Patent grant
GR01 Patent grant