CN110636009A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN110636009A
CN110636009A CN201810652176.3A CN201810652176A CN110636009A CN 110636009 A CN110636009 A CN 110636009A CN 201810652176 A CN201810652176 A CN 201810652176A CN 110636009 A CN110636009 A CN 110636009A
Authority
CN
China
Prior art keywords
data packet
data
difference
packet
original
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
CN201810652176.3A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201810652176.3A priority Critical patent/CN110636009A/en
Priority to PCT/CN2019/089916 priority patent/WO2019242496A1/en
Publication of CN110636009A publication Critical patent/CN110636009A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data transmission method.A data sending end acquires a first original data packet to be sent, compares difference data of the first original data packet and a preset reference data packet, and determines the difference of the difference data; when the difference exceeds a preset threshold value, the first original data packet is sent; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet. A data receiving end receives a first receiving data packet sent by a data sending end; and when the first received data packet is determined to be the difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet. The invention also discloses a data transmission device and a storage medium.

Description

Data transmission method and device
Technical Field
The invention relates to the transmission technology of the Internet of things, in particular to a data transmission method and device.
Background
The requirements of the internet of things on the devices in the network mainly include the requirement of long standby time. For a data terminal, the most important work is uplink and downlink data transmission; the existing protocol of the internet of things has a series of methods in the aspect of prolonging the standby of a terminal, and the methods comprise the steps of carrying a data packet in a Non-Access Stratum (NAS) signaling for transmission, limiting bandwidth and flow, and enabling a device to enter a low-power shutdown mode within the time of no data transmission, and the like. However, there is no targeted and general optimization method for the Internet of things in the transmission mode and the transmission Protocol, especially the transmission Protocol above the Internet Protocol (IP).
Therefore, how to compress transmission data, reduce data transmission amount, reduce power consumption, and prolong standby is an urgent problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a data transmission method and apparatus, which can compress transmitted data, reduce data transmission amount, further reduce power consumption, and prolong standby time.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a data transmission method, which is applied to a data sending end and comprises the following steps:
acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining the difference of the difference data;
when the difference exceeds a preset threshold value, sending the first original data packet; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet.
In the above scheme, the method further comprises:
and taking a second original data packet which is completely transmitted before the first original data packet is transmitted as the reference data packet.
In the foregoing solution, the generating a difference data packet from the difference data according to a preset group package rule includes:
and combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet.
In the above scheme, the method further comprises:
and when the difference data packet recovery abnormal signal returned by the data receiving end is received, sending the first original data packet.
In the foregoing solution, the difference amount of the difference data includes:
a data amount of the difference data and/or a block number of the difference data.
The embodiment of the invention also provides a data transmission method, which is applied to a data receiving end and comprises the following steps:
receiving a first receiving data packet sent by a data sending end;
and when the first received data packet is a difference data packet, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet.
In the foregoing solution, the restoring, by using a data restoring rule, the first received data packet into a first original data packet includes:
and replacing the data at the corresponding position of the reference data packet with the difference data according to the difference data in the first received data packet and the position information of the difference data relative to the reference data packet to obtain a first original data packet.
In the foregoing solution, before restoring the differential data packet, the method further includes:
presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet.
In the above scheme, the method further comprises:
updating the reference data packet with the first received data packet when the first received data packet is not a difference data packet;
and when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet.
The embodiment of the present invention further provides a data transmission device, which is arranged at a data sending end, and the device includes: a sending detection module and a package sending module; wherein the content of the first and second substances,
the sending detection module is used for acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining difference quantity of the difference data;
the group packet sending module is used for sending the first original data packet when the difference exceeds a preset threshold value; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet.
In the foregoing solution, the sending detection module is further configured to:
and taking a second original data packet which is completely transmitted before the first original data packet is transmitted as the reference data packet.
In the foregoing solution, the group packet sending module is specifically configured to:
and combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet.
In the foregoing solution, the group packet sending module is further configured to:
and when the difference data packet recovery abnormal signal returned by the data receiving end is received, sending the first original data packet.
In the foregoing solution, the difference amount of the difference data includes:
a data amount of the difference data and/or a block number of the difference data.
The embodiment of the present invention further provides a data transmission device, which is arranged at a data receiving end, and the device includes: a receiving module and a recovery module; wherein
The receiving module is used for receiving a first receiving data packet sent by the data sending end;
and the recovery module is used for recovering the first received data packet into a first original data packet by adopting a data recovery rule according to a preset reference data packet and the first received data packet when the first received data packet is determined to be a difference data packet.
In the foregoing solution, the recovery module is specifically configured to:
and replacing the data at the corresponding position of the reference data packet with the difference data according to the difference data in the first received data packet and the position information of the difference data relative to the reference data packet to obtain a first original data packet.
In the foregoing solution, the recovery module is further configured to: and presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet before the difference data packet is restored.
In the foregoing solution, the recovery module is further configured to: updating the reference data packet with the first received data packet when the first received data packet is not a difference data packet;
and when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the above methods applied to a data sending end or an application domain data receiving end;
an embodiment of the present invention further provides a data transmission device, including: a processor and a memory for storing a computer program capable of running on the processor,
the processor is configured to execute the steps of any one of the methods applied to the data sending end or the data receiving end when the computer program is executed.
The data transmission method and device provided by the embodiment of the invention; acquiring a first original data packet to be sent at a data sending end, comparing difference data of the first original data packet relative to a preset reference data packet, and determining difference quantity of the difference data; when the difference exceeds a preset threshold value, sending the first original data packet; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet. At a data receiving end, receiving a first receiving data packet sent by a data sending end; and when the first received data packet is determined to be the difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet. Therefore, only partial data which are different from the reference data packet after comparison are transmitted, the transmission data are effectively compressed, the data transmission quantity is reduced, and the power consumption is reduced, and the standby state is prolonged.
Drawings
Fig. 1 is a schematic flow chart of a data transmission method implemented by a data transmitting end according to the present invention;
FIG. 2 is a flow chart of a data transmission method implemented by a data receiving end according to the present invention;
FIG. 3 is a diagram illustrating a terminal software architecture according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a packet format according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a terminal data transmission flow according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal data retransmission process according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal data receiving flow according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a data transmission apparatus at a data transmitting end according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a data transmission apparatus at a data receiving end according to an embodiment of the present invention.
Detailed Description
In the embodiment of the invention, a data sending end acquires a first original data packet to be sent, compares difference data of the first original data packet relative to a preset reference data packet, and determines the difference of the difference data; and when the difference of the difference data exceeds a preset threshold value, sending the first original data packet, otherwise, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet. A data receiving end receives a first receiving data packet sent by a data sending end; and when the first received data packet is determined to be the difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet.
The present invention will be described in further detail with reference to examples.
As shown in fig. 1, the data transmission method provided in the embodiment of the present invention is applied to a data transmitting end, and the method includes:
step 101: acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining the difference of the difference data;
here, the data sending end and the data receiving end corresponding to the data sending end may be a data receiving and sending end in a narrowband Internet of Things (NB-IoT) scenario, such as a terminal and a network side server in the NB-IoT; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server sends data, the network side service and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes; taking an internet of things scene as an example, the terminal can acquire a first original data packet uploaded to a network side server from an internet of things sensor or an application layer and the like;
the reference data packet is a reference for comparison with the first original data packet, and is used for extracting a difference part, namely difference data, of the first original data packet relative to the reference data packet; and determining a difference amount of the difference data.
Further, a second original data packet which is completely sent before the first original data packet is sent is used as the reference data packet;
due to the characteristics of the internet of things and other scenes, the difference between the two transmitted data packets is small, and a second original data packet which is sent before the first original data packet can be used as a reference data packet to subsequently compress the first original data packet;
the second original data packet may be a first data packet sent by the data sending end, or may be a data packet in the sending process; after the second original data packet is completely sent, the second original data packet may be buffered to a specific location, such as a designated buffer address, as a reference data packet. Here, the sending of the second original data packet is completed, that is, the receiving end has received the second original data packet, and the receiving end may use a method such as replying an acknowledgement signal to confirm that the second original data packet has been received;
here, the first original data packet may be a data packet that needs to be transmitted immediately after the second original data packet; the first original data packet and the second original data packet can be data packets acquired by the terminal from an internet of things sensor or an application layer and the like;
after the first original data packet is obtained, the first original data packet and the reference data packet may be compared to obtain difference data of the first original data packet with respect to the reference data packet.
Further, the difference amount of the difference data may be a data amount of the difference data, or a block number of the difference data; the data amount of the difference data may refer to a sum of data lengths of all difference data; the number of blocks of the difference data may refer to how many different positions of the first original data packet are relative to the reference data packet, and consecutive difference data may be regarded as one block of difference data.
Step 102: when the difference exceeds a preset threshold value, sending the first original data packet; when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet;
after the difference data is obtained, whether the first original data packet is directly transmitted or the first original data packet is compressed and then transmitted can be judged according to the difference of the difference data, namely the difference data packet is sent;
the preset difference threshold value can be set according to the difference of the difference data, the size of an original data packet and the like; if the difference amount is the number of blocks of the difference data, a preset difference threshold value may be set to 1 to 10, and if 3, that is, if 3 consecutive differences exist in the first original data packet compared to the reference data packet, the difference data packet of the difference data is sent. The purpose of the preset difference threshold is to subsequently limit the size of the difference data packet, and ensure that the size of the difference data packet can be smaller than the first original data packet;
the preset grouping rule may be composed of minimum information required to restore the difference data packet to the first original data packet, and may set difference data, a start position of the difference data with respect to a reference data packet, and the like in the difference data packet.
And selecting whether to perform difference data packet packaging or not through the preset difference threshold, wherein the difference data packet obtained by the difference data packet packaging is smaller than the data volume of the first original data packet, so that the compression conversion of the first original data packet is completed.
Further, combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet;
the format composition of the difference data packet may be specified, for example, the format of the difference data packet is specified as difference data plus position information of the difference data relative to the reference data packet; if a plurality of difference data exist, setting position information relative to the data benchmark report for each difference data;
after the differential data packet is established, the differential data packet may be sent to a data receiving end.
Further, setting identification bits for distinguishing the difference data packets from the original data packets in the difference data packets and the original data packets;
here, the original packet includes: a first original data packet and a second original data packet; here, an identification bit may be set in the difference packet and the original packet to distinguish the type of the received packet after the data receiving end receives the packet.
Further, after the first original data packet or the difference data packet is successfully sent, the reference data packet is updated by using the first original data packet;
here, the first original data packet is used as a reference data packet, and may be used to determine whether a subsequent data packet needs to be compressed or directly sent without being compressed; the subsequent data packet refers to a data packet subsequently transmitted in the first original data packet. By analogy, each original data packet may be used as a reference data packet of a data packet to be transmitted subsequently to the original data packet.
Further, when receiving the abnormal recovery signal of the differential data packet returned by the data receiving end, sending the first original data packet;
after the data sending end sends the first original data packet, the second original data packet or the difference data packet, subsequent operations can be performed according to information returned by the data receiving end. The data receiving end can return different corresponding indications of different conditions, such as that the receiving is normal by using Acknowledgement (ACK), the receiving is not normal by using Non-return information, the recovery of the difference data packet is abnormal by using Non-Acknowledgement (NAK), and the like;
if the ACK is received after the first original data packet, the second original data packet or the difference data packet is sent, the data receiving end is indicated to receive normally, namely, the data packet sending is completed, and the data sending end can perform subsequent sending work;
if no information is returned, the first original data packet, the second original data packet or the difference data packet can be retransmitted;
after the first original data packet is sent, if the data receiving end receives the difference data packet, the difference data packet cannot be restored into the first original data due to the condition that the reference data packet of the data receiving end is lost and the like, NAK is sent to the data sending end, and the data sending end can directly send the first original data packet without sending the difference data packet after receiving the NAK.
This is a fault tolerance measure, and if the differential data packet cannot be recovered at the data receiving end, the differential data packet is not retransmitted, but the original data packet is transmitted.
As shown in fig. 2, the data transmission method provided in the embodiment of the present invention is applied to a data receiving end, and the method includes:
step 201: receiving a first received data packet sent by a data sending end
Here, the data receiving end and the data sending end corresponding to the data receiving end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server and the like send data, the network side server and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes;
the data receiving side receives a first reception packet transmitted from the data transmitting side via a communication line such as wireless communication. Here, the first received packet may be an original packet or a differential packet obtained by compressing the original packet.
Step 202: when the first received data packet is determined to be a difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet;
here, the preset determination rule may be set according to formats of the difference data packet and the original data packet, or may be set according to sizes of the difference data packet and the original data packet, where the difference data is formed by compressing the original data packet, and the data size is usually small, and the difference data packet and the original data packet may be determined according to the size of the data packet;
the difference data packet is the difference between a first original data packet corresponding to the difference data packet and the reference data packet, and the first original data packet can be recovered through the difference data in the difference data packet and the reference data packet;
the reference data packet is a reference used for recovering the first original data packet, and the difference data packet is a data packet formed at a data sending end according to difference data of the original data packet and the reference data packet; the data receiving end receives the difference data packet and restores original data according to the reference data packet;
the preset data restoration rule may be set according to a packet rule adopted when the difference data packet is generated, and the first original data packet is restored through a reverse process to the packet.
Further, distinguishing the differential data packet from the original data packet according to identification bits set in the differential data packet and the original data packet;
the data sending end may set an identification bit in the difference data packet and the original data packet, so as to determine the type of the received data packet after the data receiving end receives the data packet. The flag bit may be set at the header positions of the differential data packet and the original data packet, so that the first received data packet may be distinguished as the differential data packet or the original data packet by the flag bit in the header of the first received data packet.
Further, presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet;
here, the method adopted in the embodiment of the present invention is to use a previous data packet of a current data packet as a reference data packet, and use the reference data packet as a reference, and compare to obtain a difference data packet; therefore, here, a second original packet corresponding to a second packet received before receiving the first received packet may be preset as a reference packet; the second received data packet may be an original data packet or a differential data packet; and when the second received data packet is the difference data packet, taking the second original data packet restored by the second received data packet as the reference data packet.
Further, according to difference data in the first received data packet and position information of the difference data relative to the reference data packet, replacing data at a position corresponding to the reference data packet with the difference data to obtain a first original data packet;
the data sending end generates a difference data packet, wherein the difference data packet is based on the reference data packet, the first received data packet is compared with the reference data packet, and the obtained difference data and the position information of the difference data in the reference data packet are obtained; therefore, the difference data can replace the data at the corresponding position of the reference data packet, so as to obtain the original data corresponding to the first received data.
Further, the data receiving end can inform the data sending end of the data receiving condition by returning response information to the data sending end; returning the abnormal reduction information of the difference data packet to a data sending end when the reduction of the difference data packet into the first original data packet corresponding to the difference data packet fails;
specifically, the ACK information may be sent to indicate that the data reception is successful, where the successful data reception may indicate that the data packet is received and restored successfully; sending NAK information to indicate that the data packet is failed to restore; when no data is received, it may appear that no response information is sent.
Further, when the first received data packet is not a difference data packet, updating the reference data packet with the first received data packet; when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet;
after the first received data packet is received, the first original data packet corresponding to the first received data packet can be used as a reference data packet, and the user can recover the subsequent data packet of the first received data packet; the subsequent data packet of the first received data packet is compressed and converted at the data sending end by taking the first original data packet corresponding to the first received data packet as a reference data packet, so that after the first received data packet is received, the data receiving end takes the first original data packet corresponding to the first received data packet as a new reference data packet.
The positive effects produced by the present invention will be described in further detail with reference to specific examples below;
here, the positive effects of the present invention will be described in detail by taking a terminal as an example, and the software modules in the terminal are shown in fig. 3. The terminal mainly comprises an uplink part and a downlink part:
and the uplink part, namely the process that the terminal needs to send data to the server and receives an acknowledgement message ACK from the server after the data is sent. When the upper computer has data to send to the server, the data packet first reaches the data sending detection module 31, the module mainly functions to compare the difference between the current data packet and the data packet sent last time, and if the difference is smaller than a certain threshold value, the original data packet is transmitted to the data compression module 32 to compress the data packet. In the comparison and compression process, the reference packet stored in the transmitted reference packet 33, that is, the content of the last transmitted packet, needs to be used; the compression process of the data compression module 32 is essentially a process of manufacturing a new differential data packet, i.e. the difference between the current original data packet and the reference data packet is extracted, a new data packet is formed by the differential data, and is transmitted to the wireless protocol stack module, and the wireless protocol stack is sent to the server on the network side through the air interface. After receiving the data packet, the server needs to send an ACK control packet to the terminal by an application program running on the server, wherein the ACK control packet needs to carry sequence number information of the data packet to be confirmed;
the downlink packet receiving process is similar to the uplink transmission process. On the remote server, there are also terminal-like internal software modules. The server is used as a sending end to perform the sending process of the end described above, the terminal is used as a receiving end, after receiving the data packet from the server, the received data detection module 37 in the terminal firstly detects the relevant identification bits of the received data, if the data is judged to be a compressed packet, namely, a differential data packet, the data is delivered to the data recovery module 36 to recover, the differential data packet is recovered into an original data packet, and the recovery process refers to the receiving reference data packet 38. Similarly, after receiving the data packet, the terminal needs to send an ACK control message to the server to indicate that the data packet is received;
here, the packet format in the example is not limited at all, that is, whatever service and whatever user data format, the scheme may be adopted to perform compression transmission processing. The packet format mentioned here, just temporary packets used during implementation and application of the schema, is completely transparent to the end user and to the author of the application. The original data sender, and the final data receiver, do not need to be changed or processed. The whole scheme improves the transmission efficiency and reduces the power consumption of the opposite end system due to the transparency.
Here, a unified packet format may be adopted for the original data packet and the differential data packet, and as shown in fig. 4, the data packet may include three parts:
packet type 41: different data packet types can be distinguished by numbers, such as difference data packets or original data packets;
packet serial number (MID, Message ID) 42: different data packets can be distinguished numerically;
data 43; when the packet is a difference packet, storing difference data of the data packet, wherein the difference data can be described in various ways, and only the difference data needs to be embodied, as an example, a description mode of the starting position/length/data content of the difference data relative to the packet head can be used for describing a piece of continuous difference information; when this packet is an original data packet, the original data is stored.
The data transmission process at the terminal side, that is, the uplink user data packet transmission process, as shown in fig. 5, includes:
step 501: the terminal needs to send a data packet with the serial number n, and the data packet is marked as [ MID: n ]. N here represents the first packet to be transmitted by the terminal, before which no packet has been transmitted;
step 502: and after the sending is finished, judging whether the ACK confirmation message sent back by the server can be received or not. If the data packet is received, the data packet is correctly received and analyzed by the data packet server; if not, there may be two cases, no response from the server is received, or a NAK control message is received back from the server. In both cases, the process proceeds to step 512. In the retransmission process, for the case of no response, the data packet is directly retransmitted, and for the case of receiving the NAK control message, it is checked whether the current transmission is a differential data packet, i.e. a compressed packet, and if so, the compressed packet is not retransmitted, but the original data packet is transmitted.
Under normal conditions, when a receiving end receives a compressed packet, the receiving end checks the MID of the compressed packet, and restores the compressed packet to the original packet by using the information of a receiving reference data packet cached by the receiving end, namely, the data packet of the MID-1 number. But it may happen that the server loses the packet of MID-1 number. Under the condition, if the client retransmits the compressed MID number data packet all the time, the receiving end can not recover even though receiving the compressed MID number data packet, the system can enter an abnormal state, in order to solve the problem, NAK control information is involved, when the receiving end can not recover the compressed data packet, NAK control information is sent to the sending end, after the sending end receives the information, the original MID number data packet is retransmitted, when the receiving end receives the NAK control information, ACK confirmation is normally replied, the NAK confirmation is cached as a receiving reference data packet, and the subsequent compressed and decompressed information at two ends is synchronized;
step 503: caching records of the n number of data packets as sending reference data packets;
step 504: when the next data packet, namely the n +1 packet, needs to be sent, the next data packet is compared with the sending reference data packet. Here, the difference threshold is set to 3, and this threshold may be modified as needed. This value embodies that only when the part of the difference is less than a certain degree, it is considered worth compressing and calculating the difference packet, and when it is greater than that degree, it is considered that the difference of the next data packet is larger than that of the last one, so that the original packet should be sent without compression;
step 505: according to the comparison result, if the similarity reaches the threshold, executing step 506 to calculate and generate a compressed packet, and after generating a new compressed packet, transmitting the packet without transmitting the original packet; if the similarity is small, step 510 is executed to directly send the n +1 number original data packet;
step 506: sending a compressed data packet, and waiting for receiving a response message returned by the server after the compressed data packet is sent;
step 507: this step is similar to step 502 and waits for a control type response message to be sent back by the server. If the ACK acknowledgement is received, it indicates that the n +1 data packet has been successfully received and analyzed by the server, at this time, step 508 is executed, the sending end replaces the n +1 data packet with a sending reference data packet, and when the n +1 data packet is sent subsequently, the sending end compares the n +1 data packet with the n +1 data packet and generates a compressed packet; if the ACK acknowledgement is not received, the data packet retransmission process of step 512 needs to be entered;
step 508: after the n +1 data packet is successfully transmitted, the transmitting end, namely the terminal side, updates and transmits the reference data packet;
step 509: the next data packet needs to be sent, and n needs to be increased by 1;
step 510: directly sending an n +1 number original data packet; step 511: judging whether a confirmation message is received or not; if no ACK acknowledgement is received, go to step 512, otherwise go to step 508;
step 512 is a process of retransmitting the data packet, and as shown in fig. 6, the process of retransmitting the data packet includes:
step 5121: after sending out data packet with sequence number m, if receiving NAK control message, the sending end directly resends m number original data packet, and does not resend compressed packet; if no response is received, step 5122 is executed to determine whether the sending reference data packet is cached locally, and then the reference data packet is continuously retransmitted;
step 5122: the sending end checks whether a sending reference data packet is stored in the sending end; if there is no reference data packet, execute step 5128 to directly send m number original data packet; otherwise, go to step 5123 to continue the flow of compressing packets;
step 5123: comparing the difference between the m number packet and the sending reference data packet, and judging whether the difference is within the threshold value, if so, executing a step 5124, otherwise, executing a step 5128 to send the original data packet;
step 5124: creating a compressed difference packet based on the m-number packet and the reference data packet, and sending the difference packet to the server;
step 5125: judging whether the confirmation message of the server is received, if so, executing step 5126 to update the sending reference data packet, if not, executing step 5127 to judge whether NAK is received;
step 5126: the step shows that the m number packet confirms that the server receives and analyzes successfully, and then the sending end needs to update the sending reference data packet into the m number packet;
step 5127: if NAK is received, step 5128 is executed to directly retransmit the m-number original data packet; if not, execute step 5122 to repeat the retransmission process of the compression mode;
step 5128: directly retransmitting the m number original data packets.
The process of receiving the data packet by the terminal, as shown in fig. 7, includes:
step 701: receiving a data packet sent by a server, wherein the serial number of the data packet is m;
step 702: according to the 'packet type indication' field in the data packet, whether the data packet is compressed or not is judged. If the packet is not a compressed packet, step 705 is executed to update the received reference packet to an m-number packet. It should be noted that, both in the terminal and the server, there are one transmission reference packet and one reception reference packet, and the two reference packets are independent of each other. When the terminal receives the downlink data packet m, the reception reference data packet is set as the content of the m number packet. If the packet is a compressed packet, executing step 703 to determine whether a receiving reference packet with the content of the number m-1 is stored, if so, executing step 704 to restore the packet to the number m packet in the original state according to the content of the reference packet and the content of the number m compressed packet;
step 703: checking whether a receiving reference data packet with the m-1 number packet as the content exists in the terminal; if yes, go to step 704, start the recovery process of the data packet; if not, step 707 sends NAK message to the sender;
step 704: recovering the m-number data packet in the original state according to the reference data packet, and executing step 705 after the completion;
step 705: after the m-number data packet is successfully received, the m-number data packet needs to be updated to be a received reference data packet to prepare for the decompression of the next data packet;
step 706: sending an ACK message to a sender of the data packet, here a server, indicating that the downlink data packet receiving process is completed;
step 707: when the terminal does not correctly receive the reference data packet, a NAK message needs to be sent to the sending end, and the sending end is informed to send the original m-number data packet when retransmitting the data packet.
As shown in fig. 8, the data transmission apparatus provided in the embodiment of the present invention may be disposed at a data sending end, and the apparatus includes: a transmission detection module 81 and a packet transmission module 82; wherein the content of the first and second substances,
the sending detection module 81 is configured to acquire a first original data packet to be sent, compare difference data between the first original data packet and a preset reference data packet, and determine a difference amount of the difference data;
here, the data sending end and the data receiving end corresponding to the data sending end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server sends data, the network side service and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes; taking an internet of things scene as an example, the terminal can acquire a first original data packet uploaded to a network side server from an internet of things sensor or an application layer and the like;
the reference data packet is a reference for comparison with the first original data packet, and is used for extracting a difference part, namely difference data, of the first original data packet relative to the reference data packet; and determining a difference amount of the difference data.
Further, a second original data packet which is completely sent before the first original data packet is sent is used as the reference data packet;
due to the characteristics of the internet of things and other scenes, the difference between the two transmitted data packets is small, and a second original data packet which is sent before the first original data packet can be used as a reference data packet to subsequently compress the first original data packet;
the second original data packet may be a first data packet sent by the data sending end, or may be a data packet in the sending process; after the second original data packet is completely sent, the second original data packet may be buffered to a specific location, such as a designated buffer address, as a reference data packet. Here, the sending of the second original data packet is completed, that is, the receiving end has received the second original data packet, and the receiving end may use a method such as replying an acknowledgement signal to confirm that the second original data packet has been received;
here, the first original data packet may be a data packet that needs to be transmitted immediately after the second original data packet; the first original data packet and the second original data packet can be data packets acquired by the terminal from an internet of things sensor or an application layer and the like;
after the first original data packet is obtained, the first original data packet and the reference data packet may be compared to obtain difference data of the first original data packet with respect to the reference data packet.
Further, the difference amount of the difference data may be a data amount of the difference data, or a block number of the difference data; the data amount of the difference data may refer to a sum of data lengths of all difference data; the number of blocks of the difference data may refer to how many different positions of the first original data packet are relative to the reference data packet, and consecutive difference data may be regarded as one block of difference data.
The group packet sending module 82 is configured to send the first original data packet when the difference exceeds a preset threshold; when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet;
after the difference data is obtained, whether the first original data packet is directly transmitted or the first original data packet is compressed and then transmitted can be judged according to the difference of the difference data, namely the difference data packet is sent;
the preset difference threshold value can be set according to the difference of the difference data, the size of an original data packet and the like; if the difference amount is the number of blocks of the difference data, a preset difference threshold value may be set to 1 to 10, and if 3, that is, if 3 consecutive differences exist in the first original data packet compared to the reference data packet, the difference data packet of the difference data is sent. The purpose of the preset difference threshold is to subsequently limit the size of the difference data packet, and ensure that the size of the difference data packet can be smaller than the first original data packet;
the preset grouping rule may be composed of minimum information required to restore the difference data packet to the first original data packet, and may set difference data, a start position of the difference data with respect to a reference data packet, and the like in the difference data packet.
And selecting whether to perform difference data packet packaging or not through the preset difference threshold, wherein the difference data packet obtained by the difference data packet packaging is smaller than the data volume of the first original data packet, so that the compression conversion of the first original data packet is completed.
Further, combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet;
the format composition of the difference data packet may be specified, for example, the format of the difference data packet is specified as difference data plus position information of the difference data relative to the reference data packet; if a plurality of difference data exist, setting position information relative to the data benchmark report for each difference data;
after the differential data packet is established, the differential data packet may be sent to a data receiving end.
Further, setting identification bits for distinguishing the difference data packets from the original data packets in the difference data packets and the original data packets;
here, the original packet includes: a first original data packet and a second original data packet; here, an identification bit may be set in the difference packet and the original packet to distinguish the type of the received packet after the data receiving end receives the packet.
Further, after the first original data packet or the difference data packet is successfully sent, the reference data packet is updated by using the first original data packet;
here, the first original data packet is used as a reference data packet, and may be used to determine whether a subsequent data packet needs to be compressed or directly sent without being compressed; the subsequent data packet refers to a data packet subsequently transmitted in the first original data packet. By analogy, each original data packet may be used as a reference data packet of a data packet to be transmitted subsequently to the original data packet.
Further, when receiving the abnormal recovery signal of the differential data packet returned by the data receiving end, sending the first original data packet;
after the data sending end sends the first original data packet, the second original data packet or the difference data packet, subsequent operations can be performed according to information returned by the data receiving end. The data receiving end can return different corresponding indications of different conditions, such as indicating normal receiving by using ACK, indicating no receiving by not returning information, indicating abnormal recovery of the differential data packet by using NAK, and the like;
if the ACK is received after the first original data packet, the second original data packet or the difference data packet is sent, the data receiving end is indicated to receive normally, namely, the data packet sending is completed, and the data sending end can perform subsequent sending work;
if no information is returned, the first original data packet, the second original data packet or the difference data packet can be retransmitted;
after the first original data packet is sent, if the data receiving end receives the difference data packet, the difference data packet cannot be restored into the first original data due to the condition that the reference data packet of the data receiving end is lost and the like, NAK is sent to the data sending end, and the data sending end can directly send the first original data packet without sending the difference data packet after receiving the NAK.
This is a fault tolerance measure, and if the differential data packet cannot be recovered at the data receiving end, the differential data packet is not retransmitted, but the original data packet is transmitted.
In practical applications, the sending detection module 81 and the group packet sending module 82 may be implemented by a CPU, a Microprocessor (MCU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like in a communication device such as a terminal and a server.
As shown in fig. 9, the data transmission apparatus provided in the embodiment of the present invention may be disposed at a data receiving end, and the apparatus includes: a receiving module 91 and a restoring module 92; wherein the content of the first and second substances,
the receiving module 91 is configured to receive a first received data packet sent by a data sending end
Here, the data receiving end and the data sending end corresponding to the data receiving end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server and the like send data, the network side server and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes;
the data receiving side receives a first reception packet transmitted from the data transmitting side via a communication line such as wireless communication. Here, the first received packet may be an original packet or a differential packet obtained by compressing the original packet.
The recovery module 92 is configured to, when it is determined that the first received data packet is a differential data packet according to a preset determination rule, recover the first received data packet into a first original data packet by using a data recovery rule according to a preset reference data packet and the first received data packet;
here, the preset determination rule may be set according to formats of the difference data packet and the original data packet, or may be set according to sizes of the difference data packet and the original data packet, where the difference data is formed by compressing the original data packet, and the data size is usually small, and the difference data packet and the original data packet may be determined according to the size of the data packet;
the difference data packet is the difference between a first original data packet corresponding to the difference data packet and the reference data packet, and the first original data packet can be recovered through the difference data in the difference data packet and the reference data packet;
the reference data packet is a reference used for recovering the first original data packet, and the difference data packet is a data packet formed at a data sending end according to difference data of the original data packet and the reference data packet; the data receiving end receives the difference data packet and restores original data according to the reference data packet;
the preset data restoration rule may be set according to a packet rule adopted when the difference data packet is generated, and the first original data packet is restored through a reverse process to the packet.
Further, distinguishing the differential data packet from the original data packet according to identification bits set in the differential data packet and the original data packet;
the data sending end may set an identification bit in the difference data packet and the original data packet, so as to determine the type of the received data packet after the data receiving end receives the data packet. The flag bit may be set at the header positions of the differential data packet and the original data packet, so that the first received data packet may be distinguished as the differential data packet or the original data packet by the flag bit in the header of the first received data packet.
Further, presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet;
here, the method adopted in the embodiment of the present invention is to use a previous data packet of a current data packet as a reference data packet, and use the reference data packet as a reference, and compare to obtain a difference data packet; therefore, here, a second original packet corresponding to a second packet received before receiving the first received packet may be preset as a reference packet; the second received data packet may be an original data packet or a differential data packet; and when the second received data packet is the difference data packet, taking the second original data packet restored by the second received data packet as the reference data packet.
Further, according to difference data in the first received data packet and position information of the difference data relative to the reference data packet, replacing data at a position corresponding to the reference data packet with the difference data to obtain a first original data packet;
the data sending end generates a difference data packet, wherein the difference data packet is based on the reference data packet, the first received data packet is compared with the reference data packet, and the obtained difference data and the position information of the difference data in the reference data packet are obtained; therefore, the difference data can replace the data at the corresponding position of the reference data packet, so as to obtain the original data corresponding to the first received data.
Further, the data receiving end can inform the data sending end of the data receiving condition by returning response information to the data sending end; returning the abnormal reduction information of the difference data packet to a data sending end when the reduction of the difference data packet into the first original data packet corresponding to the difference data packet fails;
specifically, the ACK information may be sent to indicate that the data reception is successful, where the successful data reception may indicate that the data packet is received and restored successfully; sending NAK information to indicate that the data packet is failed to restore; when no data is received, it may appear that no response information is sent.
Further, when the first received data packet is not a difference data packet, updating the reference data packet with the first received data packet; when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet;
after the first received data packet is received, the first original data packet corresponding to the first received data packet can be used as a reference data packet, and the user can recover the subsequent data packet of the first received data packet; the subsequent data packet of the first received data packet is compressed and converted at the data sending end by taking the first original data packet corresponding to the first received data packet as a reference data packet, so that after the first received data packet is received, the data receiving end takes the first original data packet corresponding to the first received data packet as a new reference data packet.
In practical applications, the receiving module 91 and the recovering module 92 may be implemented by a CPU, a Microprocessor (MCU), a Digital Signal Processor (DSP), or a Field Programmable Gate Array (FPGA) in a communication device such as a terminal and a server.
The storage medium provided in the embodiment of the present invention stores an executable program thereon, and when the executable program is executed by a processor, the method implements a data transmission method, and the method may be applied to a data transmitting end, as shown in fig. 1, and the method includes:
step 101: acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining the difference of the difference data;
here, the data sending end and the data receiving end corresponding to the data sending end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server sends data, the network side service and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes; taking an internet of things scene as an example, the terminal can acquire a first original data packet uploaded to a network side server from an internet of things sensor or an application layer and the like;
the reference data packet is a reference for comparison with the first original data packet, and is used for extracting a difference part, namely difference data, of the first original data packet relative to the reference data packet; and determining a difference amount of the difference data.
Further, a second original data packet which is completely sent before the first original data packet is sent is used as the reference data packet;
due to the characteristics of the internet of things and other scenes, the difference between the two transmitted data packets is small, and a second original data packet which is sent before the first original data packet can be used as a reference data packet to subsequently compress the first original data packet;
the second original data packet may be a first data packet sent by the data sending end, or may be a data packet in the sending process; after the second original data packet is completely sent, the second original data packet may be buffered to a specific location, such as a designated buffer address, as a reference data packet. Here, the sending of the second original data packet is completed, that is, the receiving end has received the second original data packet, and the receiving end may use a method such as replying an acknowledgement signal to confirm that the second original data packet has been received;
here, the first original data packet may be a data packet that needs to be transmitted immediately after the second original data packet; the first original data packet and the second original data packet can be data packets acquired by the terminal from an internet of things sensor or an application layer and the like;
after the first original data packet is obtained, the first original data packet and the reference data packet may be compared to obtain difference data of the first original data packet with respect to the reference data packet.
Further, the difference amount of the difference data may be a data amount of the difference data, or a block number of the difference data; the data amount of the difference data may refer to a sum of data lengths of all difference data; the number of blocks of the difference data may refer to how many different positions of the first original data packet are relative to the reference data packet, and consecutive difference data may be regarded as one block of difference data.
Step 102: when the difference exceeds a preset threshold value, sending the first original data packet; when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet;
after the difference data is obtained, whether the first original data packet is directly transmitted or the first original data packet is compressed and then transmitted can be judged according to the difference of the difference data, namely the difference data packet is sent;
the preset difference threshold value can be set according to the difference of the difference data, the size of an original data packet and the like; if the difference amount is the number of blocks of the difference data, a preset difference threshold value may be set to 1 to 10, and if 3, that is, if 3 consecutive differences exist in the first original data packet compared to the reference data packet, the difference data packet of the difference data is sent. The purpose of the preset difference threshold is to subsequently limit the size of the difference data packet, and ensure that the size of the difference data packet can be smaller than the first original data packet;
the preset grouping rule may be composed of minimum information required to restore the difference data packet to the first original data packet, and may set difference data, a start position of the difference data with respect to a reference data packet, and the like in the difference data packet.
And selecting whether to perform difference data packet packaging or not through the preset difference threshold, wherein the difference data packet obtained by the difference data packet packaging is smaller than the data volume of the first original data packet, so that the compression conversion of the first original data packet is completed.
Further, combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet;
the format composition of the difference data packet may be specified, for example, the format of the difference data packet is specified as difference data plus position information of the difference data relative to the reference data packet; if a plurality of difference data exist, setting position information relative to the data benchmark report for each difference data;
after the differential data packet is established, the differential data packet may be sent to a data receiving end.
Further, setting identification bits for distinguishing the difference data packets from the original data packets in the difference data packets and the original data packets;
here, the original packet includes: a first original data packet and a second original data packet; here, an identification bit may be set in the difference packet and the original packet to distinguish the type of the received packet after the data receiving end receives the packet.
Further, after the first original data packet or the difference data packet is successfully sent, the reference data packet is updated by using the first original data packet;
here, the first original data packet is used as a reference data packet, and may be used to determine whether a subsequent data packet needs to be compressed or directly sent without being compressed; the subsequent data packet refers to a data packet subsequently transmitted in the first original data packet. By analogy, each original data packet may be used as a reference data packet of a data packet to be transmitted subsequently to the original data packet.
Further, when receiving the abnormal recovery signal of the differential data packet returned by the data receiving end, sending the first original data packet;
after the data sending end sends the first original data packet, the second original data packet or the difference data packet, subsequent operations can be performed according to information returned by the data receiving end. The data receiving end can return different corresponding indications of different conditions, such as indicating normal receiving by using ACK, indicating no receiving by not returning information, indicating abnormal recovery of the differential data packet by using NAK, and the like;
if the ACK is received after the first original data packet, the second original data packet or the difference data packet is sent, the data receiving end is indicated to receive normally, namely, the data packet sending is completed, and the data sending end can perform subsequent sending work;
if no information is returned, the first original data packet, the second original data packet or the difference data packet can be retransmitted;
after the first original data packet is sent, if the data receiving end receives the difference data packet, the difference data packet cannot be restored into the first original data due to the condition that the reference data packet of the data receiving end is lost and the like, NAK is sent to the data sending end, and the data sending end can directly send the first original data packet without sending the difference data packet after receiving the NAK.
This is a fault tolerance measure, and if the differential data packet cannot be recovered at the data receiving end, the differential data packet is not retransmitted, but the original data packet is transmitted.
The storage medium may store an executable program, and the executable program when executed by the processor implements a data transmission method, and the method may be applied to a data receiving end, as shown in fig. 2, and the method includes: the method is applied to a data receiving end and comprises the following steps:
step 201: receiving a first received data packet sent by a data sending end
Here, the data receiving end and the data sending end corresponding to the data receiving end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server and the like send data, the network side server and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes;
the data receiving side receives a first reception packet transmitted from the data transmitting side via a communication line such as wireless communication. Here, the first received packet may be an original packet or a differential packet obtained by compressing the original packet.
Step 202: when the first received data packet is determined to be a difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet;
here, the preset determination rule may be set according to formats of the difference data packet and the original data packet, or may be set according to sizes of the difference data packet and the original data packet, where the difference data is formed by compressing the original data packet, and the data size is usually small, and the difference data packet and the original data packet may be determined according to the size of the data packet;
the difference data packet is the difference between a first original data packet corresponding to the difference data packet and the reference data packet, and the first original data packet can be recovered through the difference data in the difference data packet and the reference data packet;
the reference data packet is a reference used for recovering the first original data packet, and the difference data packet is a data packet formed at a data sending end according to difference data of the original data packet and the reference data packet; the data receiving end receives the difference data packet and restores original data according to the reference data packet;
the preset data restoration rule may be set according to a packet rule adopted when the difference data packet is generated, and the first original data packet is restored through a reverse process to the packet.
Further, distinguishing the differential data packet from the original data packet according to identification bits set in the differential data packet and the original data packet;
the data sending end may set an identification bit in the difference data packet and the original data packet, so as to determine the type of the received data packet after the data receiving end receives the data packet. The flag bit may be set at the header positions of the differential data packet and the original data packet, so that the first received data packet may be distinguished as the differential data packet or the original data packet by the flag bit in the header of the first received data packet.
Further, presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet;
here, the method adopted in the embodiment of the present invention is to use a previous data packet of a current data packet as a reference data packet, and use the reference data packet as a reference, and compare to obtain a difference data packet; therefore, here, a second original packet corresponding to a second packet received before receiving the first received packet may be preset as a reference packet; the second received data packet may be an original data packet or a differential data packet; and when the second received data packet is the difference data packet, taking the second original data packet restored by the second received data packet as the reference data packet.
Further, according to difference data in the first received data packet and position information of the difference data relative to the reference data packet, replacing data at a position corresponding to the reference data packet with the difference data to obtain a first original data packet;
the data sending end generates a difference data packet, wherein the difference data packet is based on the reference data packet, the first received data packet is compared with the reference data packet, and the obtained difference data and the position information of the difference data in the reference data packet are obtained; therefore, the difference data can replace the data at the corresponding position of the reference data packet, so as to obtain the original data corresponding to the first received data.
Further, the data receiving end can inform the data sending end of the data receiving condition by returning response information to the data sending end; returning the abnormal reduction information of the difference data packet to a data sending end when the reduction of the difference data packet into the first original data packet corresponding to the difference data packet fails;
specifically, the ACK information may be sent to indicate that the data reception is successful, where the successful data reception may indicate that the data packet is received and restored successfully; sending NAK information to indicate that the data packet is failed to restore; when no data is received, it may appear that no response information is sent.
Further, when the first received data packet is not a difference data packet, updating the reference data packet with the first received data packet; when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet;
after the first received data packet is received, the first original data packet corresponding to the first received data packet can be used as a reference data packet, and the user can recover the subsequent data packet of the first received data packet; the subsequent data packet of the first received data packet is compressed and converted at the data sending end by taking the first original data packet corresponding to the first received data packet as a reference data packet, so that after the first received data packet is received, the data receiving end takes the first original data packet corresponding to the first received data packet as a new reference data packet.
The data transmission device provided in the embodiment of the present invention includes a processor, a memory, and an executable program stored on the memory and capable of being run by the processor, and executes a method for implementing data transmission when the processor runs the executable program, where the method may be applied to a data sending end, as shown in fig. 1, and the method includes:
step 101: acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining the difference of the difference data;
here, the data sending end and the data receiving end corresponding to the data sending end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server sends data, the network side service and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes; taking an internet of things scene as an example, the terminal can acquire a first original data packet uploaded to a network side server from an internet of things sensor or an application layer and the like;
the reference data packet is a reference for comparison with the first original data packet, and is used for extracting a difference part, namely difference data, of the first original data packet relative to the reference data packet; and determining a difference amount of the difference data.
Further, a second original data packet which is completely sent before the first original data packet is sent is used as the reference data packet;
due to the characteristics of the internet of things and other scenes, the difference between the two transmitted data packets is small, and a second original data packet which is sent before the first original data packet can be used as a reference data packet to subsequently compress the first original data packet;
the second original data packet may be a first data packet sent by the data sending end, or may be a data packet in the sending process; after the second original data packet is completely sent, the second original data packet may be buffered to a specific location, such as a designated buffer address, as a reference data packet. Here, the sending of the second original data packet is completed, that is, the receiving end has received the second original data packet, and the receiving end may use a method such as replying an acknowledgement signal to confirm that the second original data packet has been received;
here, the first original data packet may be a data packet that needs to be transmitted immediately after the second original data packet; the first original data packet and the second original data packet can be data packets acquired by the terminal from an internet of things sensor or an application layer and the like;
after the first original data packet is obtained, the first original data packet and the reference data packet may be compared to obtain difference data of the first original data packet with respect to the reference data packet.
Further, the difference amount of the difference data may be a data amount of the difference data, or a block number of the difference data; the data amount of the difference data may refer to a sum of data lengths of all difference data; the number of blocks of the difference data may refer to how many different positions of the first original data packet are relative to the reference data packet, and consecutive difference data may be regarded as one block of difference data.
Step 102: when the difference exceeds a preset threshold value, sending the first original data packet; when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet;
after the difference data is obtained, whether the first original data packet is directly transmitted or the first original data packet is compressed and then transmitted can be judged according to the difference of the difference data, namely the difference data packet is sent;
the preset difference threshold value can be set according to the difference of the difference data, the size of an original data packet and the like; if the difference amount is the number of blocks of the difference data, a preset difference threshold value may be set to 1 to 10, and if 3, that is, if 3 consecutive differences exist in the first original data packet compared to the reference data packet, the difference data packet of the difference data is sent. The purpose of the preset difference threshold is to subsequently limit the size of the difference data packet, and ensure that the size of the difference data packet can be smaller than the first original data packet;
the preset grouping rule may be composed of minimum information required to restore the difference data packet to the first original data packet, and may set difference data, a start position of the difference data with respect to a reference data packet, and the like in the difference data packet.
And selecting whether to perform difference data packet packaging or not through the preset difference threshold, wherein the difference data packet obtained by the difference data packet packaging is smaller than the data volume of the first original data packet, so that the compression conversion of the first original data packet is completed.
Further, combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet;
the format composition of the difference data packet may be specified, for example, the format of the difference data packet is specified as difference data plus position information of the difference data relative to the reference data packet; if a plurality of difference data exist, setting position information relative to the data benchmark report for each difference data;
after the differential data packet is established, the differential data packet may be sent to a data receiving end.
Further, setting identification bits for distinguishing the difference data packets from the original data packets in the difference data packets and the original data packets;
here, the original packet includes: a first original data packet and a second original data packet; here, an identification bit may be set in the difference packet and the original packet to distinguish the type of the received packet after the data receiving end receives the packet.
Further, after the first original data packet or the difference data packet is successfully sent, the reference data packet is updated by using the first original data packet;
here, the first original data packet is used as a reference data packet, and may be used to determine whether a subsequent data packet needs to be compressed or directly sent without being compressed; the subsequent data packet refers to a data packet subsequently transmitted in the first original data packet. By analogy, each original data packet may be used as a reference data packet of a data packet to be transmitted subsequently to the original data packet.
Further, when receiving the abnormal recovery signal of the differential data packet returned by the data receiving end, sending the first original data packet;
after the data sending end sends the first original data packet, the second original data packet or the difference data packet, subsequent operations can be performed according to information returned by the data receiving end. The data receiving end can return different corresponding indications of different conditions, such as indicating normal receiving by using ACK, indicating no receiving by not returning information, indicating abnormal recovery of the differential data packet by using NAK, and the like;
if the ACK is received after the first original data packet, the second original data packet or the difference data packet is sent, the data receiving end is indicated to receive normally, namely, the data packet sending is completed, and the data sending end can perform subsequent sending work;
if no information is returned, the first original data packet, the second original data packet or the difference data packet can be retransmitted;
after the first original data packet is sent, if the data receiving end receives the difference data packet, the difference data packet cannot be restored into the first original data due to the condition that the reference data packet of the data receiving end is lost and the like, NAK is sent to the data sending end, and the data sending end can directly send the first original data packet without sending the difference data packet after receiving the NAK.
This is a fault tolerance measure, and if the differential data packet cannot be recovered at the data receiving end, the differential data packet is not retransmitted, but the original data packet is transmitted.
On the memory of the data transmission device or an executable program may be stored, which when executed by the processor implements a data transmission method, which may be applied to a data receiving end, as shown in fig. 2, the method comprising: the method is applied to a data receiving end and comprises the following steps:
step 201: receiving a first received data packet sent by a data sending end
Here, the data receiving end and the data sending end corresponding to the data receiving end may be a data receiving and sending end in an NB-IoT scenario, such as a terminal in an NB-IoT and a network side server; because the communication is mutual, when the terminal sends data, the terminal is a data sending end, and a network side server and the like are data receiving ends; when a network side server and the like send data, the network side server and the like are data sending ends, and a terminal is a data receiving end; the data sending end and the data receiving end can also be communication ends in other communication scenes;
the data receiving side receives a first reception packet transmitted from the data transmitting side via a communication line such as wireless communication. Here, the first received packet may be an original packet or a differential packet obtained by compressing the original packet.
Step 202: when the first received data packet is determined to be a difference data packet according to a preset judgment rule, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet;
here, the preset determination rule may be set according to formats of the difference data packet and the original data packet, or may be set according to sizes of the difference data packet and the original data packet, where the difference data is formed by compressing the original data packet, and the data size is usually small, and the difference data packet and the original data packet may be determined according to the size of the data packet;
the difference data packet is the difference between a first original data packet corresponding to the difference data packet and the reference data packet, and the first original data packet can be recovered through the difference data in the difference data packet and the reference data packet;
the reference data packet is a reference used for recovering the first original data packet, and the difference data packet is a data packet formed at a data sending end according to difference data of the original data packet and the reference data packet; the data receiving end receives the difference data packet and restores original data according to the reference data packet;
the preset data restoration rule may be set according to a packet rule adopted when the difference data packet is generated, and the first original data packet is restored through a reverse process to the packet.
Further, distinguishing the differential data packet from the original data packet according to identification bits set in the differential data packet and the original data packet;
the data sending end may set an identification bit in the difference data packet and the original data packet, so as to determine the type of the received data packet after the data receiving end receives the data packet. The flag bit may be set at the header positions of the differential data packet and the original data packet, so that the first received data packet may be distinguished as the differential data packet or the original data packet by the flag bit in the header of the first received data packet.
Further, presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet;
here, the method adopted in the embodiment of the present invention is to use a previous data packet of a current data packet as a reference data packet, and use the reference data packet as a reference, and compare to obtain a difference data packet; therefore, here, a second original packet corresponding to a second packet received before receiving the first received packet may be preset as a reference packet; the second received data packet may be an original data packet or a differential data packet; and when the second received data packet is the difference data packet, taking the second original data packet restored by the second received data packet as the reference data packet.
Further, according to difference data in the first received data packet and position information of the difference data relative to the reference data packet, replacing data at a position corresponding to the reference data packet with the difference data to obtain a first original data packet;
the data sending end generates a difference data packet, wherein the difference data packet is based on the reference data packet, the first received data packet is compared with the reference data packet, and the obtained difference data and the position information of the difference data in the reference data packet are obtained; therefore, the difference data can replace the data at the corresponding position of the reference data packet, so as to obtain the original data corresponding to the first received data.
Further, the data receiving end can inform the data sending end of the data receiving condition by returning response information to the data sending end; returning the abnormal reduction information of the difference data packet to a data sending end when the reduction of the difference data packet into the first original data packet corresponding to the difference data packet fails;
specifically, the ACK information may be sent to indicate that the data reception is successful, where the successful data reception may indicate that the data packet is received and restored successfully; sending NAK information to indicate that the data packet is failed to restore; when no data is received, it may appear that no response information is sent.
Further, when the first received data packet is not a difference data packet, updating the reference data packet with the first received data packet; when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet;
after the first received data packet is received, the first original data packet corresponding to the first received data packet can be used as a reference data packet, and the user can recover the subsequent data packet of the first received data packet; the subsequent data packet of the first received data packet is compressed and converted at the data sending end by taking the first original data packet corresponding to the first received data packet as a reference data packet, so that after the first received data packet is received, the data receiving end takes the first original data packet corresponding to the first received data packet as a new reference data packet
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the scope of the present invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A data transmission method is applied to a data sending end, and the method comprises the following steps:
acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining the difference of the difference data;
when the difference exceeds a preset threshold value, sending the first original data packet; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet.
2. The method of claim 1, further comprising:
and taking a second original data packet which is completely transmitted before the first original data packet is transmitted as the reference data packet.
3. The method according to claim 1, wherein the generating the difference data into the difference data packet according to the preset group packet rule comprises:
and combining the difference data and the position information of the difference data relative to the reference data packet to generate the difference data packet.
4. The method of claim 1, further comprising:
and when the difference data packet recovery abnormal signal returned by the data receiving end is received, sending the first original data packet.
5. The method of any of claims 1 to 4, wherein the amount of difference in the difference data comprises:
a data amount of the difference data and/or a block number of the difference data.
6. A data transmission method, applied to a data receiving end, the method comprising:
receiving a first receiving data packet sent by a data sending end;
and when the first received data packet is a difference data packet, restoring the first received data packet into a first original data packet by adopting a data restoration rule according to a preset reference data packet and the first received data packet.
7. The method of claim 6, wherein the applying the data reduction rule to reduce the first received data packet to the first original data packet comprises:
and replacing the data at the corresponding position of the reference data packet with the difference data according to the difference data in the first received data packet and the position information of the difference data relative to the reference data packet to obtain a first original data packet.
8. The method of claim 6, wherein prior to restoring the differential packet, the method further comprises:
presetting a second original data packet corresponding to a second data packet received before the first received data packet is received as a reference data packet.
9. The method according to any one of claims 6 to 8, further comprising:
updating the reference data packet with the first received data packet when the first received data packet is not a difference data packet;
and when the first received data packet is a difference data packet, after the first original data packet is restored, updating the reference data packet by using the first original data packet.
10. A data transmission apparatus, which is arranged at a data transmitting end, the apparatus comprising: a sending detection module and a package sending module; wherein the content of the first and second substances,
the sending detection module is used for acquiring a first original data packet to be sent, comparing difference data of the first original data packet with a preset reference data packet, and determining difference quantity of the difference data;
the group packet sending module is used for sending the first original data packet when the difference exceeds a preset threshold value; and when the difference does not exceed a preset threshold value, generating a difference data packet from the difference data according to a preset packet packing rule, and sending the difference data packet.
11. A data transmission apparatus, arranged at a data receiving end, the apparatus comprising: a receiving module and a recovery module; wherein
The receiving module is used for receiving a first receiving data packet sent by the data sending end;
and the recovery module is used for recovering the first received data packet into a first original data packet by adopting a data recovery rule according to a preset reference data packet and the first received data packet when the first received data packet is determined to be a difference data packet.
12. A data transmission apparatus, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the method of any one of claims 1 to 5 when running the computer program;
alternatively, the processor is adapted to perform the steps of the method of any one of claims 6 to 9 when running the computer program.
CN201810652176.3A 2018-06-22 2018-06-22 Data transmission method and device Pending CN110636009A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810652176.3A CN110636009A (en) 2018-06-22 2018-06-22 Data transmission method and device
PCT/CN2019/089916 WO2019242496A1 (en) 2018-06-22 2019-06-04 Method and device for data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810652176.3A CN110636009A (en) 2018-06-22 2018-06-22 Data transmission method and device

Publications (1)

Publication Number Publication Date
CN110636009A true CN110636009A (en) 2019-12-31

Family

ID=68967258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810652176.3A Pending CN110636009A (en) 2018-06-22 2018-06-22 Data transmission method and device

Country Status (2)

Country Link
CN (1) CN110636009A (en)
WO (1) WO2019242496A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时***工程有限公司 Data processing method and device
CN114338826A (en) * 2021-12-31 2022-04-12 海光信息技术股份有限公司 Data transmission method, device, system and related equipment
CN114665450A (en) * 2022-03-29 2022-06-24 国网信息通信产业集团有限公司 Data processing method and device for power distribution network differential protection service
CN114691626A (en) * 2020-12-31 2022-07-01 北京万集科技股份有限公司 Point cloud data compression method, point cloud data transmission method, point cloud data decompression method, point cloud data compression device, point cloud data transmission device and point cloud data decompression device
US20220271960A1 (en) * 2020-05-20 2022-08-25 Tencent Technology (Shenzhen) Company Limited Blockchain-based data processing method, apparatus, device, and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884881B (en) * 2022-05-12 2023-07-07 福建天晴在线互动科技有限公司 Data compression transmission method and terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013009A1 (en) * 2007-07-02 2009-01-08 Kiyotaka Nakayama Using differential file representing differences of second version of a file compared to first version of the file
CN103618787A (en) * 2013-11-26 2014-03-05 优视科技有限公司 System and method for displaying webpage
CN103685476A (en) * 2013-11-26 2014-03-26 优视科技有限公司 Method for displaying web pages by aid of web page templates and web page template server
CN105530272A (en) * 2014-09-29 2016-04-27 阿里巴巴集团控股有限公司 Method and device for application data synchronization
CN106325769A (en) * 2016-08-19 2017-01-11 华为技术有限公司 Data storage method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011234198A (en) * 2010-04-28 2011-11-17 Sony Corp Information providing method, content display terminal, mobile terminal, server device, information providing system, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013009A1 (en) * 2007-07-02 2009-01-08 Kiyotaka Nakayama Using differential file representing differences of second version of a file compared to first version of the file
CN103618787A (en) * 2013-11-26 2014-03-05 优视科技有限公司 System and method for displaying webpage
CN103685476A (en) * 2013-11-26 2014-03-26 优视科技有限公司 Method for displaying web pages by aid of web page templates and web page template server
CN105530272A (en) * 2014-09-29 2016-04-27 阿里巴巴集团控股有限公司 Method and device for application data synchronization
CN106325769A (en) * 2016-08-19 2017-01-11 华为技术有限公司 Data storage method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220271960A1 (en) * 2020-05-20 2022-08-25 Tencent Technology (Shenzhen) Company Limited Blockchain-based data processing method, apparatus, device, and readable storage medium
CN112202623A (en) * 2020-12-03 2021-01-08 北京和利时***工程有限公司 Data processing method and device
CN114691626A (en) * 2020-12-31 2022-07-01 北京万集科技股份有限公司 Point cloud data compression method, point cloud data transmission method, point cloud data decompression method, point cloud data compression device, point cloud data transmission device and point cloud data decompression device
CN114338826A (en) * 2021-12-31 2022-04-12 海光信息技术股份有限公司 Data transmission method, device, system and related equipment
CN114665450A (en) * 2022-03-29 2022-06-24 国网信息通信产业集团有限公司 Data processing method and device for power distribution network differential protection service

Also Published As

Publication number Publication date
WO2019242496A1 (en) 2019-12-26

Similar Documents

Publication Publication Date Title
CN110636009A (en) Data transmission method and device
CN102292940B (en) Communication method and apparatus for header compression adopting ARQ mechanism
CN104518853B (en) Method, receiving terminal and the system that a kind of data retransmit
KR101405927B1 (en) Method of coommunication in mobile communication system
CN102045132B (en) Retransmission mechanism-based method and device for transmitting header compression data packet
CN106330414B (en) Message transmission method and device
US8386901B2 (en) Method, device and software application for transmitting data packets in a communication system
JP3349926B2 (en) Receiving control device, communication control system, and communication control method
CN109714130B (en) Fountain code-based file transmission method
CA2466231A1 (en) Time-aware best-effort hole-filling retry method and system for network communications
CN102231658A (en) Safe communication method of internetwork isolation apparatus
CN103338090A (en) Service data transmission method, device and system
CN101964703A (en) Data retransmission method and system
WO2018014564A1 (en) Method and device for recovering incomplete transmission file
CN107809302A (en) File metadata redundant transmission, method of reseptance and system under a kind of unreliable link
EP3764576A1 (en) System and method for implementing a hybrid automatic repeat request process
CN103944690B (en) Bitmap compression method in RLC data retransmission system
CN111246428A (en) Network reliable communication method, system, device and storage medium
CN116132001A (en) Packet loss retransmission method
JPH1070523A (en) Method and equipment for packet transmission
CN113784389B (en) Data processing method and device
CN114337917B (en) Data transmission method based on forward error correction and short message sending method
CN117749789B (en) Transmission method based on UDP protocol
KR100926669B1 (en) System for transmitting data using erasure resilient code
Bansal et al. Analysis of Sliding Window Protocol for Connected Node

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20191231