Internet of Things information transmission method and device, related equipment, product and storage medium
By using algorithms and interaction protocols for serial number calibration and confirmation in IoT systems, the problem of data loss in low-speed wireless networks is solved, and the reliable transmission and integrity of data is achieved.
Patent Information
- Application Number
- CN202411130498.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-12
AI Technical Summary
Under low-speed and unstable wireless networks, large-capacity data is easily discarded during network transmission, resulting in incomplete data received by the platform, especially when the Internet of Things passes through low bandwidth or the network is not in good condition, critical data will be lost. There is currently no effective solution to the problem.
By establishing an algorithm and interactive protocol for serial number calibration and serial number confirmation between the sending end and the receiving end, the sending end sends data packets with serial numbers to the receiving end within the preset period, and the receiving end sorts the lost data according to the serial number, and sends The lost data packet is resend to ensure reliable data transmission.
It realizes reliable data transmission under low-speed and unstable network conditions, ensures the data integrity received by the platform, avoids the loss of key data, and improves the reliability of IoT information transmission.
Smart Images

Figure CN118945123A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an Internet of Things information transmission method, device, related equipment, product and storage medium. Background Art
[0002] In low-speed and unstable wireless networks, large amounts of data are easily discarded during network transmission, resulting in incomplete data received by the platform. For example, when the Internet of Things transmits large amounts of data through low bandwidth or poor network conditions, critical data such as emergency alarms may be lost. There is currently no effective solution to this problem. Summary of the invention
[0003] To solve related technical problems, the embodiments of the present application provide an Internet of Things information transmission method, device, related equipment, product and storage medium.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The embodiment of the present application provides an Internet of Things information transmission method, which is applied to a sending end and includes:
[0006] Sending a plurality of first information to a receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located at a header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; determining a second sequence number of a lost second data message based on the sorting result;
[0007] receiving second information sent by the receiving end; the second information includes the second sequence number;
[0008] Acquire a second data message corresponding to the second sequence number in a local first database; cache the first data message to be sent and the corresponding first sequence number in the first database;
[0009] Determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information;
[0010] Resending the retransmission message to the receiving end.
[0011] In the above solution, before sending a plurality of first information to the receiving end within a preset period, the method further includes:
[0012] Sending third information to the receiving end; the third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; the third information is used by the receiving end to confirm the starting sequence number, the preset period and the retransmission window parameter;
[0013] When the receiving end has confirmed the starting sequence number, the preset period, and the retransmission window parameter, receiving fourth information sent by the receiving end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0014] The starting sequence number, the preset period and the retransmission window parameter are stored.
[0015] In the above scheme, the method further includes:
[0016] If the fourth information sent by the receiving end is not received, resending the third information to the receiving end;
[0017] If the fourth information sent by the receiving end is not received for multiple times, an alarm message is reported to the receiving end; the alarm message is used by the receiving end to find out the reason why the sending end did not receive the fourth information, so as to take measures to solve the reason.
[0018] In the above scheme, the preset period includes the time for sending N data messages, N is an integer greater than or equal to 2, and the method further includes:
[0019] The first sequence number and the first data message are determined according to the starting sequence number and the length of the sequence number added to each data message in the N data messages.
[0020] In the above solution, when the first sequence number is the end sequence number, the end sequence number is determined by the start sequence number and N; the method further includes:
[0021] Determine whether the end sequence number is greater than a preset threshold;
[0022] In the case that the end sequence number is greater than the preset threshold, the first sequence number and the first data message are re-determined according to the start sequence number and the length of the sequence number added to each data message in the N data messages.
[0023] In the above solution, when there are multiple second sequence numbers, the multiple second sequence numbers form a sequence number list; the second information also includes the start sequence number, the end sequence number and the sequence number list; the method also includes:
[0024] Based on the start sequence number, the end sequence number and the sequence number list, data packets other than second data packets corresponding to the plurality of second sequence numbers in the sequence number list are deleted from the local first database.
[0025] In the above scheme, the method further comprises:
[0026] When the second sequence number cached in the first database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission period;
[0027] Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
[0028] In the above solution, determining the retransmission message based on the second sequence number, the second data message and preset retransmission identification information includes:
[0029] Place the second sequence number in the header of the second data message to obtain a data message carrying the sequence number;
[0030] The retransmission identification information is set in the high order of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
[0031] The embodiment of the present application also provides an Internet of Things information transmission method, which is applied to a receiving end and includes:
[0032] A plurality of first information sent by a transmitting end is received within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message;
[0033] Sort the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result;
[0034] Determine a second sequence number of the lost second data packet based on the sorting result;
[0035] Sending second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain a second data message corresponding to the second sequence number in a local first database; caching the first data message to be sent and the corresponding first sequence number in the first database; determining a retransmission message based on the second sequence number, the second data message and preset retransmission identification information;
[0036] Receive the retransmission message resent by the sending end.
[0037] In the above solution, before receiving a plurality of first information sent by the transmitting end within a preset period, the method further includes:
[0038] Receiving third information sent by the receiving end; the third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter;
[0039] Confirming the starting sequence number, the preset period and the retransmission window parameter;
[0040] When the starting sequence number, the preset period, and the retransmission window parameter have been confirmed, sending fourth information to the sending end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0041] The starting sequence number, the preset period and the retransmission window parameter are stored.
[0042] In the above scheme, the method further includes:
[0043] If the sending end does not receive the fourth information sent by the receiving end, re-receive the third information sent by the sending end;
[0044] If the sending end fails to receive the fourth information sent by the receiving end for multiple times, receiving the alarm information reported by the sending end;
[0045] The reason why the sending end did not receive the fourth information is found based on the alarm information, so as to take measures to solve the reason.
[0046] In the above solution, after receiving the retransmission message resent by the sending end, the method further includes:
[0047] The second sequence number corresponding to the retransmitted message is deleted from a local second database; and the second sequence number of the lost second data message is cached in the second database.
[0048] In the above scheme, in the case where there are multiple second sequence numbers, the multiple second sequence numbers form a sequence number list; the preset period includes the time for sending N data messages, where N is an integer greater than or equal to 2; the second information also includes the start sequence number, the end sequence number and the sequence number list; the end sequence number is determined by the start sequence number and N; the method also includes:
[0049] When at least one retransmission message corresponding to the second sequence number among the retransmission messages corresponding to the multiple second sequence numbers has not been received, wait until the next preset period arrives and send second information to the sending end until all the retransmission messages corresponding to the multiple second sequence numbers are received.
[0050] In the above scheme, the method further comprises:
[0051] When the second sequence number cached in the second database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline;
[0052] Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
[0053] The embodiment of the present application also provides an Internet of Things information transmission device, which is arranged on a sending end and includes:
[0054] A first sending unit is used to send a plurality of first information to a receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; and determine a second sequence number of a lost second data message based on the sorting result;
[0055] A first receiving unit, configured to receive second information sent by the receiving end; the second information includes the second sequence number;
[0056] An acquiring unit, configured to acquire the second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database;
[0057] A first determining unit, configured to determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information;
[0058] The first sending unit is further used to resend the retransmission message to the receiving end.
[0059] The embodiment of the present application also provides an IoT information transmission device, which is arranged on a receiving end and includes:
[0060] A second receiving unit, configured to receive a plurality of first information sent by a sending end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message;
[0061] a sorting unit, configured to sort the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result;
[0062] A second determining unit, configured to determine a second sequence number of a lost second data message based on the sorting result;
[0063] A second sending unit is used to send second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain a second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database; a retransmission message is determined based on the second sequence number, the second data message and preset retransmission identification information;
[0064] The second receiving unit is further used to receive the retransmission message resent by the sending end.
[0065] An embodiment of the present application also provides an Internet of Things information transmission device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods on the sending end side are implemented, or the steps of any of the above-mentioned methods on the receiving end side are implemented.
[0066] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods on the sending end side, or implements the steps of any of the above-mentioned methods on the receiving end side.
[0067] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods on the sending end side are implemented, or the steps of any of the above-mentioned methods on the receiving end side are implemented.
[0068] The Internet of Things information transmission method, device, related equipment, product and storage medium provided by the embodiments of the present application, the method is applied to the sending end, and the method includes: sending multiple first information to the receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message; the multiple first information is used to sort the multiple first data messages according to the multiple first sequence numbers after the receiving end receives them within the preset period to obtain a sorting result; determine the second sequence number of the lost second data message based on the sorting result; receive the second information sent by the receiving end; the second information includes the second sequence number; obtain the second data message corresponding to the second sequence number in the local first database; cache the first data message to be sent and the corresponding first sequence number in the first database; determine the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information; resend the retransmission message to the receiving end. An embodiment of the present application is adopted, by sending multiple first information to a receiving end (for example, an Internet of Things platform) within a preset period; the first information includes a first data packet and a first sequence number located at the header of the first data packet; the multiple first information is used to sort the multiple first data packets according to the multiple first sequence numbers after the receiving end receives them within the preset period, and determine the second sequence number of the lost second data packet; receive the second information sent by the receiving end; the second information includes the second sequence number; obtain the second data packet corresponding to the second sequence number in the local first database; determine the retransmission message based on the second sequence number, the second data packet and the preset retransmission identification information; resend the retransmission message to the receiving end; that is, the data discarded or lost in the network transmission is resent through the retransmission message, so as to solve the problem of incomplete data received by the platform and realize reliable data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 This is a schematic diagram of a method flow for information transmission in the Internet of Things according to an embodiment of the present application;
[0070] Figure 2 A schematic diagram of the architecture of a method for transmitting information in the Internet of Things;
[0071] Figure 3 This is a flow chart of another method for transmitting information in the Internet of Things according to an embodiment of the present application;
[0072] Figure 4 A schematic diagram of an application scenario of the method for transmitting information in the Internet of Things;
[0073] Figure 5 This is a schematic diagram of the structure of an Internet of Things information transmission device according to an embodiment of the present application;
[0074] Figure 6This is a structural diagram of another IoT information transmission device according to an embodiment of the present application;
[0075] Figure 7 This is a schematic diagram of the structure of the transmitting end of an embodiment of the present application;
[0076] Figure 8 This is a schematic diagram of the structure of the receiving end in the embodiment of the present application;
[0077] Fig. 9 This is a schematic diagram of the structure of an Internet of Things information transmission system according to an embodiment of the present application. DETAILED DESCRIPTION
[0078] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0079] The present application embodiment provides an Internet of Things information transmission method, which is applied to a sending end, such as Figure 1 As shown, Figure 1 The present invention provides a schematic flow chart of a method for transmitting information in the Internet of Things according to an embodiment of the present invention, including:
[0080] Step 101: sending a plurality of first information to a receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; determining a second sequence number of a lost second data message based on the sorting result;
[0081] Step 102: receiving second information sent by the receiving end; the second information includes the second sequence number;
[0082] Step 103: Acquire the second data message corresponding to the second sequence number in the local first database; cache the first data message to be sent and the corresponding first sequence number in the first database;
[0083] Step 104: Determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information;
[0084] Step 105: Resend the retransmission message to the receiving end.
[0085] It should be noted that the sending end can be determined according to actual conditions and is not limited here. As an example, the sending end can include an Internet of Things gateway. The sending end can be called a network device. In practical applications, the sending end can also be called a network device side or a sending end side.
[0086] In step 101, the receiving end may be determined according to actual conditions, which is not limited here. As an example, the receiving end may include an IoT platform. The receiving end may be referred to as a server. In practical applications, the receiving end may also be referred to as a server side or a receiving end side. Figure 2 To understand, Figure 2 This is a schematic diagram of the architecture of the method for transmitting information in the Internet of Things. Figure 2 In this example, the sending end is the IoT gateway and the receiving end is the IoT platform.
[0087] The preset period can be determined according to actual conditions and is not limited here. As an example, the preset period can be a time period of 200 messages or 30 seconds. In practical applications, the preset period can be understood as a confirmation time period, which can be referred to as a confirmation period. As an example, the confirmation period can be 200 messages or 30 seconds.
[0088] The first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message; in other words, the first information includes the first data message and the first sequence number located in the header of the first data message. In practical applications, the first information can be understood as a data message with certain characteristics; wherein the certain characteristics can be understood as a data message with a sequence number, and each first information message has a different sequence number.
[0089] The first sequence number being located at the head of the first data message can be understood as a sequence number calibration for the data message; wherein, the specific position of the first sequence number at the head of the first data message can be determined according to actual conditions, and is not limited here. As an example, a 2-byte sequence number can be added to the head of the first data message. For example, the starting sequence number of the first sequence number is 10, and starting from the starting sequence number, each data message increases by 1.
[0090] Sending multiple first messages to the receiving end within a preset period can be understood as sending multiple first messages to the receiving end in sequence within a preset period; the sequence number and data message in each first message are different. For ease of understanding, an example is given here, assuming that the preset period is a time period of 200 messages; the first first message is recorded as message 1, the second first message is recorded as message 2, ..., and the 200th first message is recorded as message 200; message 1 includes data message 1 and sequence number 1 located at the head of data message 1, message 2 includes data message 2 and sequence number 2 located at the head of data message 2, ..., and message 200 includes data message 200 and sequence number 200 located at the head of data message 200; in actual applications, data message 1 can be called the first message, data message 2 can be called the second message, ..., and data message 200 can be called the 200th message. As an example, sequence number 1 can be 10, sequence number 2 can be 11, ..., and sequence number 200 can be 210. In actual applications, when a sender sends a message, a 2-byte serial number is added to the header of each data message, that is, starting from the negotiated starting sequence number, each message increases by 1. For example, if the negotiated start number is 10, the first message is 10, the second message is 11, ..., the 100th message is 110, ..., and the 200th message is 210.
[0091] The multiple first information are used to sort the multiple first data packets according to the multiple first sequence numbers after the receiving end receives them within the preset period to obtain a sorting result; determining the second sequence number of the lost second data packet based on the sorting result can be understood as the receiving end sorting the multiple first data packets according to the multiple first sequence numbers after receiving the first information within the preset period to determine the second sequence number of the lost second data packet. Among them, sorting multiple first data packets according to multiple first sequence numbers to determine the second sequence number of the lost second data packet can be to sort multiple first data packets in order from small to large or from large to small to obtain a sorting result, and determine the missing sequence number in the sorting result as the second sequence number of the lost second data packet; in actual application, for the sake of ease of understanding, an example is given here, assuming that the preset period is a time period of 200 messages, and the message sequence numbers sent within the preset period are 10 to 210, a total of 200 messages, but within this period, the receiving end only receives 195 messages, then the number of lost messages is 5, and the lost sequence numbers can be reversed according to the sequence numbers, such as 95, 96, 97, 98, 99.
[0092] In step 102, the second information including the second sequence number can be understood as the second information including the second sequence number of the lost second data packet.
[0093] Receiving the second information sent by the receiving end can be understood as the transmitting end receiving the second information sent by the receiving end; as an example, the transmitting end receiving the second information sent by the receiving end can be understood as the IoT gateway receiving the second information sent by the IoT platform; wherein, the second information can be determined according to actual conditions, and is not limited here. As an example, the second information can be indication information, indication message, etc. The indication information or indication message may include a sequence number list of lost messages, a start sequence number, and an end sequence number.
[0094] For ease of understanding, here is an example. Assume that the message sequence numbers sent in this cycle are 10 to 210, a total of 200 messages, but in this cycle, the receiving end only received 195 messages, then 5 messages were lost, and the lost sequence numbers can be reversed based on the sequence numbers, such as 95, 96, 97, 98, 99. Then the receiving end sends an indication message, and the indication message content includes: start sequence number: 10, end sequence number 210, lost sequence number list: [95, 96, 97, 98, 99].
[0095] In step 103, the first data message to be sent and the corresponding first sequence number cached in the first database can be understood as the data message to be sent and the corresponding sequence number cached in the first database; wherein, the first database can be determined according to actual conditions, and is not limited here. As an example, the first database can be a memory or a disk, etc. The data message to be sent and the corresponding sequence number cached in the first database can be understood as the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end. In actual applications, the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end can be the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end within a preset period. For example, the message to be sent or the message within the confirmation period is cached at the sending end, that is, the message to be sent is saved in the memory or disk.
[0096] In step 104, the specific determination process of determining the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information can be determined according to actual conditions and is not limited here. As an example, the determination of the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information may include placing the second sequence number at the head of the second data message to obtain a data message carrying the sequence number; and setting the retransmission identification information in the high bit of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
[0097] In step 105, resending the retransmission message to the receiving end can be understood as the sending end resending the retransmission message to the receiving end. As an example, the sending end resending the retransmission message to the receiving end can be the IoT gateway resending the retransmission message to the IoT platform.
[0098] In an embodiment of the present application, multiple first information is sent to a receiving end (for example, an Internet of Things platform) within a preset period; the first information includes a first data message and a first sequence number located at the header of the first data message; the multiple first information is used to sort the multiple first data messages according to the multiple first sequence numbers after the receiving end receives them within the preset period, so as to determine the second sequence number of the lost second data message; receive the second information sent by the receiving end; the second information includes the second sequence number; obtain the second data message corresponding to the second sequence number in the local first database; determine the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information; resend the retransmission message to the receiving end; that is, the data discarded or lost in the network transmission is resent through the retransmission message, so as to solve the problem of incomplete data received by the platform and realize reliable data transmission.
[0099] In one embodiment, before sending a plurality of first information to the receiving end within a preset period, the method further includes:
[0100] Sending third information to the receiving end; the third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; the third information is used by the receiving end to confirm the starting sequence number, the preset period and the retransmission window parameter;
[0101] When the receiving end has confirmed the starting sequence number, the preset period, and the retransmission window parameter, receiving fourth information sent by the receiving end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0102] The starting sequence number, the preset period and the retransmission window parameter are stored.
[0103] In this embodiment, sending the third information to the receiving end may be the sending end sending the third information to the receiving end. As an example, the sending end sending the third information to the receiving end may be the IoT gateway sending the third information to the IoT platform; wherein the third information may be determined according to specific circumstances, and is not limited here. As an example, the third information may be a startup message.
[0104] The third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; wherein the starting sequence number, the preset period and the retransmission window parameter can be determined according to the specific situation, and are not limited here. As an example, the starting sequence number can be 10; the preset period can be a time period of 200 messages or 30 seconds; the retransmission window parameter can be a retransmission window of 1000. In practical applications, the starting sequence number can also be called the starting sequence number; the preset period can also be called the confirmed time period, which can also be referred to as the confirmed period; the retransmission window parameter can also be called the sequence number window or the retransmission window.
[0105] The third information is used by the receiving end to confirm the starting sequence number, the preset period and the retransmission window parameter, which can be understood as a process in which the sending end and the receiving end negotiate the starting sequence number, the preset period and the retransmission window parameter.
[0106] When the receiving end has confirmed the starting sequence number, the preset period and the retransmission window parameter, the fourth information sent by the receiving end is received; wherein, the fourth information can be determined according to actual conditions and is not limited here. As an example, the fourth information can be understood as the same message as the startup message.
[0107] The storing of the start sequence number, the preset period and the retransmission window parameter can be understood as the sending end storing the start sequence number, the preset period and the retransmission window parameter; as an example, the sending end storing the start sequence number, the preset period and the retransmission window parameter can be the Internet of Things gateway storing the start sequence number, the preset period and the retransmission window parameter.
[0108] In actual applications, the sender sends a startup message when it starts to notify the receiver, and agrees on the starting sequence number, sequence number window, and confirmation time period. For example, the starting sequence number for this transmission is 10, the confirmation period is 200 messages or 30 seconds, and the retransmission window is 1000. After receiving the startup message, the receiver sends the same message to indicate that the message has been confirmed and both parties have negotiated the starting sequence number, sequence number window, and confirmation time period.
[0109] In one embodiment, the method further comprises:
[0110] If the fourth information sent by the receiving end is not received, resending the third information to the receiving end;
[0111] If the fourth information sent by the receiving end is not received for multiple times, an alarm message is reported to the receiving end; the alarm message is used by the receiving end to find out the reason why the sending end did not receive the fourth information, so as to take measures to solve the reason.
[0112] In this embodiment, if the fourth information sent by the receiving end is not received, the third information is resent to the receiving end, which can be understood as if the sending end does not receive the fourth information sent by the receiving end, the third information is resent to the receiving end. As an example, if the sending end does not receive the fourth information sent by the receiving end, the third information is resent to the receiving end, which can be understood as if the IoT gateway does not receive the fourth information sent by the IoT platform, the third information is resent to the IoT platform.
[0113] If the fourth information sent by the receiving end is not received for multiple times, reporting the alarm information to the receiving end can be understood as if the sending end has not received the fourth information sent by the receiving end for multiple times, reporting the alarm information to the receiving end; as an example, if the sending end has not received the fourth information sent by the receiving end for multiple times, reporting the alarm information to the receiving end can be that the IoT gateway has not received the fourth information sent by the IoT platform for multiple times, reporting the alarm information to the IoT platform. The specific number of times can be determined according to actual conditions, and is not limited here. As an example, the times can be three times.
[0114] In actual applications, the sender sends a startup message when it starts to notify the receiver, and agrees on the starting sequence number, sequence number window, and confirmation time period. For example, the starting sequence number for this transmission is 10, the confirmation period is 200 messages or 30 seconds, and the retransmission window is 1000. After receiving the startup message, the receiver sends the same message to indicate that the message has been confirmed and the two parties have negotiated the starting sequence number, sequence number window, and confirmation time period. If the sender does not receive the message, it will resend it. If there is no response for three times, the transmission fails, an alarm is reported, and the transmission process is restarted.
[0115] In one embodiment, the preset period includes the time for sending N data messages, where N is an integer greater than or equal to 2, and the method further includes:
[0116] The first sequence number and the first data message are determined according to the starting sequence number and the length of the sequence number added to each data message in the N data messages.
[0117] In this embodiment, the specific value of N can be determined according to actual conditions and is not limited here. As an example, N can be 200.
[0118] The starting sequence number can be determined according to actual conditions and is not limited here. As an example, the starting sequence number can be 10; in actual applications, the starting sequence number can also be called the start sequence number.
[0119] Determining the first sequence number and the first data message according to the starting sequence number and the length of the sequence number added to each data message in the N data messages can be as follows: the sequence number of the header of data message 1 among the N data messages is the starting sequence number as the first sequence number; the sequence number of the header of data message 2 among the N data messages is the starting sequence number plus 1 as the first sequence number; ...; that is, starting from the starting sequence number, each message increases by 1. For example, if the negotiated start is 10, the sequence number of the header of data message 1 is 10, the sequence number of the header of data message 2 is 11, and so on. Among them, the length of the sequence number added to each data message can be determined according to the actual situation and is not limited here. As an example, the length of the sequence number added to each data message can be 1.
[0120] For ease of understanding, an example is given here, assuming that N is 200; the first first information is recorded as information 1, the second first information is recorded as information 2, ..., and the 200th first information is recorded as information 200; information 1 includes data message 1 and sequence number 1 located at the head of the data message 1, information 2 includes data message 2 and sequence number 2 located at the head of the data message 2, ..., information 200 includes data message 200 and sequence number 200 located at the head of the data message 200; in actual applications, data message 1 can be called the first message, data message 2 can be called the second message, ..., and data message 200 can be called the 200th message. As an example, sequence number 1 can be 10, sequence number 2 can be 11, ..., and sequence number 200 can be 210. In actual applications, when a sender sends a message, a 2-byte serial number is added to the header of each data message, that is, starting from the negotiated starting sequence number, each message increases by 1. For example, if the negotiated start number is 10, the first message is 10, the second message is 11, ..., the 100th message is 110, ..., and the 200th message is 210.
[0121] In one embodiment, when the first sequence number is an end sequence number, the end sequence number is determined by the start sequence number and N; the method further includes:
[0122] Determine whether the end sequence number is greater than a preset threshold;
[0123] In the case that the end sequence number is greater than the preset threshold, the first sequence number and the first data message are re-determined according to the start sequence number and the length of the sequence number added to each data message in the N data messages.
[0124] In this embodiment, the end sequence number is determined by the start sequence number and N; the specific determination process of the end sequence number can be determined according to actual conditions and is not limited here. As an example, the end sequence number can start from the start sequence number, and the sequence number of each data message in the N data messages increases by 1. For example, if the start sequence number is 10, the sequence number 1 of the header of data message 1 is 10, the sequence number 2 of the header of data message 2 is 11, ..., the sequence number N of the header of data message N is 10+N.
[0125] Determine whether the end sequence number is greater than a preset threshold; the preset threshold can be determined based on actual conditions and is not limited here. As an example, the preset threshold can be 32767. In the case where the end sequence number is greater than the preset threshold, the first sequence number and the first data message are redetermined based on the start sequence number and the length of the sequence number added to each data message in the N data messages. It can be understood that in the case where the end sequence number is greater than 32767, the first sequence number and the first data message are redetermined based on the start sequence number and the length of the sequence number added to each data message in the N data messages. Among them, the end sequence number being greater than the preset threshold can also be understood as the end sequence number exceeding the preset threshold.
[0126] In actual applications, when a sender sends a message, a 2-byte sequence number is added to the header of each data message, that is, starting from the negotiated starting sequence number, the sequence number of each message increases by 1 from the starting sequence number. For example, if the negotiated start number is 10, the first message is 10, the second message is 11, and the 100th message is 110; if the sequence number exceeds 32767, it returns to the beginning of sending.
[0127] In one embodiment, when there are multiple second sequence numbers, the multiple second sequence numbers form a sequence number list; the second information also includes the start sequence number, the end sequence number and the sequence number list; the method further includes:
[0128] Based on the start sequence number, the end sequence number and the sequence number list, data packets other than second data packets corresponding to the plurality of second sequence numbers in the sequence number list are deleted from the local first database.
[0129] In this embodiment, the second sequence number being multiple can be understood as the number of lost data packets being multiple. The specific number of the second sequence number being multiple can be determined according to actual conditions and is not limited here. As an example, the specific number of the second sequence number being multiple can be 5, for example, 95, 96, 97, 98, 99.
[0130] A plurality of the second sequence numbers form a sequence number list; wherein the sequence number list can be understood as a sequence number list of lost data packets. The sequence number list of lost data packets can also be referred to as a lost sequence number list. As an example, the specific number of the plurality of second sequence numbers can be 5, for example, 95, 96, 97, 98, 99. The lost sequence number list is [95, 96, 97, 98, 99].
[0131] The second information also includes the start sequence number, the end sequence number and the sequence number list; wherein, the second information can be determined according to actual conditions and is not limited here. As an example, the second information can be indication information. The sequence number list can be understood as a sequence number list of lost messages. In actual applications, when the confirmation cycle is reached, the receiving end sends an indication message, which includes: a sequence number list of lost messages, a start sequence number, and an end sequence number.
[0132] Deleting data packets except second data packets corresponding to multiple second sequence numbers in the sequence number list from the local first database based on the start sequence number, the end sequence number and the sequence number list can be understood as deleting data packets and corresponding sequence numbers that are not lost in this transmission from the local first database based on the start sequence number, the end sequence number and the sequence number list.
[0133] For ease of understanding, here is an example. Assume that the message sequence numbers sent in this cycle are 10 to 210, a total of 200 messages, but in this cycle, the receiving end only received 195 messages, so 5 messages were lost. The lost sequence numbers can be reversed based on the sequence numbers, such as 95, 96, 97, 98, 99. Then the receiving end sends an indication message, the message content includes: start sequence number: 10, end sequence number 210, lost sequence number list: [95, 96, 97, 98, 99]. If no message is lost in this transmission, the start sequence number and end sequence number are sent directly.
[0134] In one embodiment, the method further comprises:
[0135] When the second sequence number cached in the first database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission period;
[0136] Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
[0137] In this embodiment, the retransmission window parameter can be determined according to actual conditions and is not limited here. As an example, the retransmission window parameter can be referred to as the retransmission window; the retransmission window can be 1000.
[0138] When the second sequence number cached in the first database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline can be understood as confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline when the lost sequence number cached in the first database exceeds the retransmission window. As an example, if the sequence number sent by the sender is 1100, and the sequence number of the retransmitted message is 99, and the retransmission window is 1000, the message with sequence number 99 is considered to have expired, and is directly deleted from the cache queue and no longer retransmitted.
[0139] In one embodiment, determining the retransmission message based on the second sequence number, the second data message, and preset retransmission identification information includes:
[0140] Place the second sequence number in the header of the second data message to obtain a data message carrying the sequence number;
[0141] The retransmission identification information is set in the high order of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
[0142] In this embodiment, the data message carrying the sequence number can be determined according to actual conditions and is not limited here. As an example, the data message carrying the sequence number can be understood as a lost data message. Placing the second sequence number in the header of the second data message to obtain the data message carrying the sequence number can be understood as placing the second sequence number in the header of the second data message to obtain the lost data message.
[0143] The retransmission identification information is set in the high bit of the sequence number in the data message carrying the sequence number to obtain the retransmission message; wherein, the retransmission identification information can be determined according to actual conditions and is not limited here. As an example, the retransmission identification information can be to set the high bit of the sequence number in the data message carrying the sequence number to 1. Setting the retransmission identification information in the high bit of the sequence number in the data message carrying the sequence number to obtain the retransmission message can be understood as setting the high bit of the sequence number in the data message carrying the sequence number to 1 to obtain the retransmission message; wherein, the 1 identifies the retransmission message.
[0144] In actual applications, the sender resends the corresponding cached messages in the lost sequence number list, and the high bit of the sequence number of these messages is set to 1, marking them as retransmitted messages, and the sequence number remains unchanged. Assume that the original sequence number is x, and the repeated sequence number y=x|8000H.
[0145] In the embodiment of the present application, the discarded message information is exchanged through a sequence number calibration and sequence number confirmation algorithm and an interactive protocol, and the IoT gateway performs retransmission. An interactive protocol algorithm is set between the sending IoT gateway and the receiving IoT platform. The IoT gateway sends data messages with certain characteristics, and the IoT platform, as the receiving end, makes a judgment and instructs the sending end whether to resend certain data messages. Through this algorithm, both parties can understand the data transmission status and realize reliable data transmission from the IoT gateway to the IoT platform.
[0146] Accordingly, the present application also provides an Internet of Things information transmission method, such as Figure 3 As shown, Figure 3 This is a flow chart of another method for transmitting information in the Internet of Things according to an embodiment of the present application, which is applied to a receiving end and includes:
[0147] Step 301: receiving a plurality of first information sent by a transmitting end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message;
[0148] Step 302: sorting the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result;
[0149] Step 303: Determine a second sequence number of the lost second data message based on the sorting result;
[0150] Step 304: Sending second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain a second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database; a retransmission message is determined based on the second sequence number, the second data message and preset retransmission identification information;
[0151] Step 305: Receive the retransmission message resent by the sending end.
[0152] It should be noted that the receiving end can be determined according to actual conditions and is not limited here. As an example, the receiving end can include an IoT platform. The receiving end can be called a server. In practical applications, the receiving end can also be called a server side or a receiving end side.
[0153] In step 301, the transmitting end may be determined according to actual conditions, which is not limited here. As an example, the transmitting end may include an Internet of Things gateway. The transmitting end may be referred to as a network device. In practical applications, the transmitting end may also be referred to as a network device side or a transmitting end side.
[0154] The preset period can be determined according to actual conditions and is not limited here. As an example, the preset period can be a time period of 200 messages or 30 seconds. In practical applications, the preset period can be understood as a confirmation time period, which can be referred to as a confirmation period. As an example, the confirmation period can be 200 messages or 30 seconds.
[0155] The first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message; in other words, the first information includes the first data message and the first sequence number located in the header of the first data message. In practical applications, the first information can be understood as a data message with certain characteristics; wherein the certain characteristics can be understood as a data message with a sequence number, and each first information message has a different sequence number.
[0156] The first sequence number being located at the head of the first data message can be understood as a sequence number calibration for the data message; wherein, the specific position of the first sequence number at the head of the first data message can be determined according to actual conditions, and is not limited here. As an example, a 2-byte sequence number can be added to the head of the first data message. For example, the starting sequence number of the first sequence number is 10, and starting from the starting sequence number, each data message increases by 1.
[0157] Receiving multiple first messages sent by the sender within a preset period can be understood as the receiving end receiving multiple first messages sent by the sender within a preset period; the sequence number and data message in each first message are different. For ease of understanding, an example is given here, assuming that the preset period is a time period of 200 messages; the first first message is recorded as message 1, the second first message is recorded as message 2, ..., and the 200th first message is recorded as message 200; message 1 includes data message 1 and sequence number 1 located at the head of data message 1, message 2 includes data message 2 and sequence number 2 located at the head of data message 2, ..., and message 200 includes data message 200 and sequence number 200 located at the head of data message 200; the message sequence numbers sent within this period are 10 to 210, a total of 200 messages, but within this period, the receiving end only received 195 messages, so the number of lost messages is 5. In actual applications, data message 1 can be called the first message, data message 2 can be called the second message, ..., data message 200 can be called the 200th message. As an example, sequence number 1 can be 10, sequence number 2 can be 11, ..., sequence number 200 can be 210. In actual applications, when a sender sends a message, a 2-byte sequence number is added to the header of each data message, that is, starting from the negotiated starting sequence number, each message increases by 1. For example, if the negotiated starting number is 10, the first message is 10, the second message is 11, ..., the 100th message is 110, ..., and the 200th message is 210.
[0158] In step 302, the multiple first data messages are sorted according to the multiple first sequence numbers, and the sorting result can be understood as sorting the multiple first data messages from small to large according to the multiple first sequence numbers to obtain the sorting result; as an example, assuming that the message sequence numbers sent within the preset period are 10 to 210, with a total of 200 messages, but within this period, the receiving end only receives 195 messages, then the number of lost messages is 5, and according to the sequence number sorting, the sorting results are 10 to 94, 100-210.
[0159] In step 303, determining the second sequence number of the lost second data message based on the sorting result can be understood as that after the receiving end receives the first information within the preset period, the plurality of first data messages are sorted according to the plurality of first sequence numbers to determine the second sequence number of the lost second data message. Among them, sorting the plurality of first data messages according to the plurality of first sequence numbers to determine the second sequence number of the lost second data message can be to sort the plurality of first sequence numbers in order from small to large or from large to small to obtain the sorting result, and determine the missing sequence number in the sorting result as the second sequence number of the lost second data message.
[0160] In practical applications, determining the second sequence number of the lost second data message based on the sorting result can be understood as determining the second sequence number of the lost second data message based on the missing sequence number in the ordered sequence numbers in the sorting result; as an example, assuming that the message sequence numbers sent within the preset period are 10 to 210, a total of 200 messages, but within this period, the receiving end only received 195 messages, then the number of lost messages is 5, and according to the sequence number sorting, the sorting results are 10 to 94, 100-210, and the lost sequence numbers can be reversed according to the sequence numbers 10 to 210 to find out that they are 95, 96, 97, 98, 99.
[0161] In step 304, the second information including the second sequence number can be understood as the second information including the second sequence number of the lost second data packet.
[0162] Sending the second information to the transmitting end can be understood as the receiving end sending the second information to the transmitting end; as an example, the receiving end sending the second information to the transmitting end can be understood as the IoT platform sending the second information to the IoT gateway; wherein, the second information can be determined according to actual conditions, and is not limited here. As an example, the second information can be indication information, indication message, etc. The indication information or indication message can include a sequence number list of lost messages, a start sequence number, and an end sequence number.
[0163] For ease of understanding, here is an example. Assume that the message sequence numbers sent in this cycle are 10 to 210, a total of 200 messages, but in this cycle, the receiving end only received 195 messages, then 5 messages were lost, and the sorting results are 10 to 94, 100-210. The lost sequence numbers can be found out from sequence numbers 10 to 210 as 95, 96, 97, 98, 99. Then the receiving end sends an indication message, and the indication message content includes: start sequence number: 10, end sequence number 210, and lost sequence number list: [95, 96, 97, 98, 99].
[0164] The first data message to be sent and the corresponding first sequence number cached in the first database can be understood as the data message to be sent and the corresponding sequence number cached in the first database; wherein, the first database can be determined according to actual conditions, and is not limited here. As an example, the first database can be a memory or a disk, etc. The data message to be sent and the corresponding sequence number cached in the first database can be understood as the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end. In actual applications, the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end can be the data message to be sent and the corresponding sequence number cached in the memory or disk of the sending end within a preset period. For example, the sending end caches the message to be sent or the message within the confirmation period and caches it at the sending end, that is, the sent message is saved in the memory or disk.
[0165] The specific determination process in determining the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information can be determined according to actual conditions and is not limited here. As an example, the determination of the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information can include placing the second sequence number in the header of the second data message to obtain a data message carrying the sequence number; and setting the retransmission identification information in the high bit of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
[0166] In step 305, receiving the retransmission message resent by the sending end can be understood as the receiving end receiving the retransmission message resent by the sending end. As an example, the receiving end receiving the retransmission message resent by the sending end can be the IoT platform receiving the retransmission message resent by the IoT gateway.
[0167] In an embodiment of the present application, multiple first information is sent to a receiving end (for example, an Internet of Things platform) within a preset period; the first information includes a first data message and a first sequence number located at the header of the first data message; the multiple first information is used to sort the multiple first data messages according to the multiple first sequence numbers after the receiving end receives them within the preset period, so as to determine the second sequence number of the lost second data message; receive the second information sent by the receiving end; the second information includes the second sequence number; obtain the second data message corresponding to the second sequence number in the local first database; determine the retransmission message based on the second sequence number, the second data message and the preset retransmission identification information; resend the retransmission message to the receiving end; that is, the data discarded or lost in the network transmission is resent through the retransmission message, so as to solve the problem of incomplete data received by the platform and realize reliable data transmission.
[0168] In one embodiment, before receiving a plurality of first information sent by a transmitting end within a preset period, the method further includes:
[0169] receiving third information sent by the receiving end; the third information includes a starting sequence number of the first data message, the preset period and a retransmission window parameter;
[0170] Confirming the starting sequence number, the preset period and the retransmission window parameter;
[0171] When the starting sequence number, the preset period, and the retransmission window parameter have been confirmed, sending fourth information to the sending end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0172] The starting sequence number, the preset period and the retransmission window parameter are stored.
[0173] In this embodiment, receiving the third information sent by the receiving end may be the receiving end receiving the third information sent by the receiving end. As an example, the receiving end receiving the third information sent by the receiving end may be the IoT platform receiving the third information sent by the IoT gateway; wherein the third information may be determined according to specific circumstances, and is not limited here. As an example, the third information may be a startup message.
[0174] The third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; wherein the starting sequence number, the preset period and the retransmission window parameter can be determined according to the specific situation, and are not limited here. As an example, the starting sequence number can be 10; the preset period can be a time period of 200 messages or 30 seconds; the retransmission window parameter can be a retransmission window of 1000. In practical applications, the starting sequence number can also be called the starting sequence number; the preset period can also be called the confirmed time period, which can also be referred to as the confirmed period; the retransmission window parameter can also be called the sequence number window or the retransmission window.
[0175] The confirmation of the starting sequence number, the preset period and the retransmission window parameter can be understood as a process in which the sending end and the receiving end negotiate the starting sequence number, the preset period and the retransmission window parameter.
[0176] When the starting sequence number, the preset period and the retransmission window parameter have been confirmed, the fourth information is sent to the sending end; wherein, the fourth information can be determined according to actual conditions and is not limited here. As an example, the fourth information can be understood as the same message as the startup message.
[0177] The storing of the start sequence number, the preset period and the retransmission window parameter can be understood as the receiving end storing the start sequence number, the preset period and the retransmission window parameter; as an example, the storing of the start sequence number, the preset period and the retransmission window parameter by the receiving end can be the storage of the start sequence number, the preset period and the retransmission window parameter by the IoT platform.
[0178] In actual applications, the sender sends a startup message when it starts to notify the receiver, and agrees on the starting sequence number, sequence number window, and confirmation time period. For example, the starting sequence number for this transmission is 10, the confirmation period is 200 messages or 30 seconds, and the retransmission window is 1000. After receiving the startup message, the receiver sends the same message to indicate that the message has been confirmed and both parties have negotiated the starting sequence number, sequence number window, and confirmation time period.
[0179] In one embodiment, the method further comprises:
[0180] If the sending end does not receive the fourth information sent by the receiving end, re-receive the third information sent by the sending end;
[0181] If the sending end fails to receive the fourth information sent by the receiving end for multiple times, receiving the alarm information reported by the sending end;
[0182] The reason why the sending end did not receive the fourth information is found based on the alarm information, so as to take measures to solve the reason.
[0183] In this embodiment, if the transmitting end does not receive the fourth information sent by the receiving end, the receiving end re-receives the third information sent by the transmitting end, which can be understood as if the transmitting end does not receive the fourth information sent by the receiving end, the receiving end re-receives the third information sent by the transmitting end. As an example, if the transmitting end does not receive the fourth information sent by the receiving end, the receiving end re-receives the third information sent by the transmitting end, which can be if the IoT gateway does not receive the fourth information sent by the IoT platform, the IoT platform re-receives the third information sent by the IoT gateway.
[0184] If the sending end fails to receive the fourth information sent by the receiving end for multiple times, receiving the alarm information reported by the sending end can be understood as if the sending end fails to receive the fourth information sent by the receiving end for multiple times, the receiving end receives the alarm information reported by the sending end; as an example, if the sending end fails to receive the fourth information sent by the receiving end for multiple times, the receiving end receives the alarm information reported by the sending end can be that the IoT gateway fails to receive the fourth information sent by the IoT platform for multiple times, and the IoT platform receives the alarm information reported by the IoT gateway. The specific number of times can be determined according to actual conditions, and is not limited here. As an example, the times can be three times.
[0185] In actual applications, the sender sends a startup message when it starts to notify the receiver, and agrees on the starting sequence number, sequence number window, and confirmation time period. For example, the starting sequence number for this transmission is 10, the confirmation period is 200 messages or 30 seconds, and the retransmission window is 1000. After receiving the startup message, the receiver sends the same message to indicate that the message has been confirmed and the two parties have negotiated the starting sequence number, sequence number window, and confirmation time period. If the sender does not receive the message, it will resend it. If there is no response for three times, the transmission fails, an alarm is reported, and the transmission process is restarted.
[0186] In one embodiment, after receiving the retransmission message resent by the transmitting end, the method further includes:
[0187] The second sequence number corresponding to the retransmitted message is deleted from a local second database; and the second sequence number of the lost second data message is cached in the second database.
[0188] In this embodiment, the second sequence number of the second data message cached in the second database can be understood as the sequence number of the lost data message cached in the database of the receiving end. In practical applications, the sequence number of the lost data message can constitute a sequence number list of lost messages, and the receiving end can be an IoT platform, and the receiving end caches the sequence number list of lost messages.
[0189] Deleting the second sequence number corresponding to the retransmitted message from the local second database can be understood as the receiving end confirming that the received retransmitted message is not lost and deleting the message confirmed not lost from the local cache.
[0190] In actual applications, after receiving the retransmitted message, the receiving end deletes the confirmed message from the cache, indicating that the message has been received.
[0191] In one embodiment, when there are multiple second sequence numbers, the multiple second sequence numbers form a sequence number list; the preset period includes the time for sending N data messages, where N is an integer greater than or equal to 2; the second information also includes the start sequence number, the end sequence number and the sequence number list; the end sequence number is determined by the start sequence number and N; the method further includes:
[0192] When at least one retransmission message corresponding to the second sequence number among the retransmission messages corresponding to the multiple second sequence numbers has not been received, wait until the next preset period arrives and send second information to the sending end until all the retransmission messages corresponding to the multiple second sequence numbers are received.
[0193] In this embodiment, the second sequence number being multiple can be understood as the number of lost data packets being multiple. The specific number of the second sequence number being multiple can be determined according to actual conditions and is not limited here. As an example, the specific number of the second sequence number being multiple can be 5, for example, 95, 96, 97, 98, 99.
[0194] A plurality of the second sequence numbers form a sequence number list; wherein the sequence number list can be understood as a sequence number list of lost data packets. The sequence number list of lost data packets can also be referred to as a lost sequence number list. As an example, the specific number of the plurality of second sequence numbers can be 5, for example, 95, 96, 97, 98, 99. The lost sequence number list is [95, 96, 97, 98, 99].
[0195] The second information also includes the start sequence number, the end sequence number and the sequence number list; wherein, the second information can be determined according to actual conditions and is not limited here. As an example, the second information can be indication information. The sequence number list can be understood as a sequence number list of lost messages. In actual applications, when the confirmation cycle is reached, the receiving end sends an indication message, which includes: a sequence number list of lost messages, a start sequence number, and an end sequence number.
[0196] In actual applications, after receiving the retransmitted message, the receiving end deletes the confirmed message from the cache, indicating that the message has been received. Other messages that have not been received are still in the lost receiving end sequence number list. When the next retransmission cycle arrives, the receiving end can be instructed to resend.
[0197] In one embodiment, the method further comprises:
[0198] When the second sequence number cached in the second database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline;
[0199] Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
[0200] In this embodiment, the retransmission window parameter can be determined according to actual conditions and is not limited here. As an example, the retransmission window parameter can be referred to as the retransmission window; the retransmission window can be 1000.
[0201] When the second sequence number cached in the second database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline can be understood as confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline when the lost sequence number cached in the second database exceeds the retransmission window. As an example, when a message with a sequence number of 1100 is received, and there is a sequence number of 99 in the lost sequence number list that needs to be retransmitted, and the retransmission window is 1000, which also exceeds the retransmission window, it is directly deleted from the lost sequence number list, and the sender is no longer required to resend the message with sequence number 99 in the next indication message.
[0202] For ease of understanding, the example IoT information transmission method of this application is specifically a method for caching and retransmitting IoT data. Under low-speed and unstable wireless networks, large-capacity data is easily discarded during network transmission, resulting in incomplete data received by the platform. Through a sequence number calibration and sequence number confirmation algorithm and interactive protocol, the discarded message information is exchanged and retransmitted by the IoT gateway.
[0203] When the Internet of Things transmits a large amount of data through low bandwidth or when the network conditions are not very good, key data, such as emergency alarms, may be lost. This time, an interactive protocol algorithm is set between the sending IoT gateway and the receiving IoT platform. The IoT gateway sends data packets with certain characteristics, and the IoT platform, as the receiving end, makes judgments and instructs the sending end whether to resend certain data packets. Through this algorithm, both parties can understand the data transmission status and realize reliable data transmission from the IoT gateway to the IoT platform.
[0204] The sender refers to the IoT gateway, which caches the messages to be sent. The receiver refers to the IoT platform, which caches the sequence number list of lost messages. Figure 4 To understand, Figure 4 This is a schematic diagram of the application scenario of the method for transmitting information in the Internet of Things. Figure 4In the embodiment, the sending end is the IoT gateway, the receiving end is the IoT platform, the IoT gateway sends a data message with certain characteristics to the IoT platform, and the IoT platform sends an indication message to the IoT gateway; wherein, the data message with certain characteristics can be understood as a message with a serial number; the data message with certain characteristics can be referred to as a data message; the indication message can be understood as retransmitting certain data messages. As an example, the indication message can include a list of serial numbers of lost messages, a start serial number, and an end serial number.
[0205] The specific steps are as follows:
[0206] 1. When the sending end starts, it sends a startup message to notify the receiving end, and agrees on the starting sequence number, sequence number window and confirmation time period. For example, the starting sequence number for this transmission is 10, the confirmation period is 200 messages or 30 seconds, and the retransmission window is 1000.
[0207] 2. After receiving the startup message, the receiving end sends the same message to indicate that the message has been confirmed and the two parties have negotiated the starting sequence number. If the receiving end does not receive the message, the sending end will resend it. If there is no response for three times, the sending fails, an alarm is reported, and the sending process is restarted.
[0208] 3. When a sender sends a message, a 2-byte sequence number is added to the header of each data message, that is, starting from the negotiated starting sequence number, each message increases by 1. For example, if the negotiated starting number is 10, the first message is 10, the second message is 11, and the 100th message is 110; if the sequence number exceeds 32767, it will return to 1 and start sending again.
[0209] 4. When the receiving end receives the message, it can sort it according to the sequence number. At the same time, in order to save bandwidth, it is not necessary to send an indication message for each received data message, but to confirm it within a set time period. The messages within the confirmation period are cached at the sending end, that is, the sent messages are saved in memory or on disk. For example, in the above example, if 200 messages have been received, a confirmation message needs to be sent.
[0210] 5. When the confirmation cycle is reached, the receiving end sends an indication message, which includes: a list of sequence numbers of lost messages, a start sequence number, and an end sequence number.
[0211] As in the above example, assume that the message sequence numbers sent in this cycle are 10 to 210, a total of 200 messages, but in this cycle, the receiving end only received 195 messages, then 5 messages were lost, and the lost sequence numbers can be reversed based on the sequence numbers, such as 95, 96, 97, 98, 99. Then the receiving end sends an indication message, the message content includes: start sequence number: 10, end sequence number 210, lost sequence number list: [95, 96, 97, 98, 99].
[0212] If no message is lost during this transmission, the start sequence number and the end sequence number are sent directly.
[0213] 6. When the sender receives the indication message, it deletes the messages that have been confirmed not to be lost from the local cache, and reorganizes and sends the messages corresponding to the lost sequence numbers according to the contents of the messages.
[0214] 7. The sender resends the corresponding cached messages in the received lost sequence number list, and the high bit of the sequence number of these messages is set to 1, marking them as retransmitted messages, and the sequence number remains unchanged. Assume that the original sequence number is x, and the repeated sequence number y = x|8000H.
[0215] 8. After receiving the retransmitted message, the receiving end deletes the confirmed message from the cache, indicating that the message has been received. Other messages that have not been received are still in the lost receiving end sequence number list. When the next retransmission cycle arrives, the receiving end can be instructed to resend.
[0216] 9. When the cached messages or cached lost sequence numbers at both ends exceed the retransmission window, such as the sender has sent a sequence number of 1100, and the retransmitted message sequence number is 99, and the retransmission window is 1000, the message with sequence number 99 is considered expired and is directly deleted from the cache queue and no longer retransmitted; similarly, at the receiving end, when a message with sequence number 1100 is received, and there is a sequence number of 99 in the lost sequence number list that needs to be retransmitted, this also exceeds the retransmission window, and it is directly deleted from the lost sequence number list, and the sender is no longer required to resend the message with sequence number 99 in the next indication message.
[0217] Through the above-mentioned novel protocol interaction method, it can be ensured that all messages can be sent completely.
[0218] In this embodiment, the discarded message information is exchanged through a sequence number calibration and sequence number confirmation algorithm and an interactive protocol, and the Internet of Things gateway retransmits it.
[0219] In this embodiment, an interactive protocol algorithm is set between the sending end IoT gateway and the receiving end IoT platform. The IoT gateway sends data messages with certain characteristics, and the IoT platform, as the receiving end, makes judgments and instructs the sending end whether to resend certain data messages. Through this algorithm, both parties can understand the data transmission status and realize reliable data transmission from the IoT gateway to the IoT platform.
[0220] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an Internet of Things information transmission device 500, which is arranged on the sending end, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of an IoT information transmission device according to an embodiment of the present application; the device 500 includes:
[0221] The first sending unit 501 is used to send a plurality of first information to the receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; and determine the second sequence number of the lost second data message based on the sorting result;
[0222] A first receiving unit 502 is configured to receive second information sent by the receiving end; the second information includes the second sequence number;
[0223] The acquiring unit 503 is configured to acquire the second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database;
[0224] A first determining unit 504, configured to determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information;
[0225] The first sending unit 501 is further configured to resend the retransmission message to the receiving end.
[0226] In one embodiment, before sending a plurality of first information to the receiving end within a preset period, the device 500 further includes a first storage unit; wherein,
[0227] The first sending unit 501 is further used to send third information to the receiving end; the third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; the third information is used by the receiving end to confirm the starting sequence number, the preset period and the retransmission window parameter;
[0228] The first receiving unit 502 is further configured to receive fourth information sent by the receiving end when the receiving end has confirmed the starting sequence number, the preset period, and the retransmission window parameter; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0229] The first storage unit is used to store the starting sequence number, the preset period and the retransmission window parameter.
[0230] In one embodiment, the first sending unit 501 is also used to resend the third information to the receiving end if the fourth information sent by the receiving end is not received; and report alarm information to the receiving end if the fourth information sent by the receiving end is not received for multiple times; the alarm information is used by the receiving end to find the reason why the sending end did not receive the fourth information, so as to take measures to resolve the reason.
[0231] In one embodiment, the preset period includes the time for sending N data packets, N is an integer greater than or equal to 2, and the first determination unit 504 is also used to determine the first sequence number and the first data packet based on the starting sequence number and the sequence number length added to each data packet in the N data packets.
[0232] In one embodiment, when the first sequence number is an end sequence number, the end sequence number is determined by the start sequence number and N; the device 500 further includes a judgment unit for judging whether the end sequence number is greater than a preset threshold;
[0233] The first determination unit 504 is further configured to, when the end sequence number is greater than the preset threshold, redetermine the first sequence number and the first data message according to the start sequence number and the sequence number length added to each data message in the N data messages.
[0234] In one embodiment, when there are multiple second sequence numbers, the multiple second sequence numbers constitute a sequence number list; the second information also includes the start sequence number, the end sequence number and the sequence number list; the device 500 also includes a deletion unit, which is used to delete data packets in the local first database except for the second data packets corresponding to the multiple second sequence numbers in the sequence number list based on the start sequence number, the end sequence number and the sequence number list.
[0235] In one embodiment, the deletion unit is also used to confirm that the second data packet corresponding to the second sequence number has exceeded the retransmission deadline when the second sequence number cached in the first database does not fall within the range of the retransmission window parameter; and delete the second sequence number that has exceeded the retransmission deadline and the corresponding second data packet.
[0236] In one embodiment, the first determination unit 504 is further used to place the second sequence number in the header of the second data message to obtain a data message carrying the sequence number; and to set the retransmission identification information in the high bit of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
[0237] In order to implement the method on the receiving end side of the embodiment of the present application, the embodiment of the present application also provides an Internet of Things information transmission device, which is arranged on the receiving end, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of another IoT information transmission device according to an embodiment of the present application. The device 600 includes:
[0238] The second receiving unit 601 is used to receive a plurality of first information sent by a transmitting end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in the header of the first data message;
[0239] A sorting unit 602, configured to sort the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result;
[0240] A second determining unit 603, configured to determine a second sequence number of a lost second data message based on the sorting result;
[0241] The second sending unit 604 is used to send second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain the second data message corresponding to the second sequence number in the local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database; the retransmission message is determined based on the second sequence number, the second data message and the preset retransmission identification information;
[0242] The second receiving unit 601 is further configured to receive the retransmission message resent by the sending end.
[0243] In one embodiment, before receiving the plurality of first information sent by the transmitting end within the preset period, the device 600 further includes a confirmation unit and a second storage unit; wherein,
[0244] The second receiving unit 601 is further configured to receive third information sent by the receiving end; the third information includes a start sequence number of the first data message, the preset period and a retransmission window parameter;
[0245] The confirmation unit is used to confirm the starting sequence number, the preset period and the retransmission window parameter;
[0246] The second sending unit 604 is further configured to send fourth information to the sending end when the starting sequence number, the preset period, and the retransmission window parameter have been confirmed; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter;
[0247] The second storage unit is used to store the starting sequence number, the preset period and the retransmission window parameter.
[0248] In one embodiment, the device 600 further includes a search unit; wherein,
[0249] The second receiving unit 601 is further configured to, if the transmitting end does not receive the fourth information sent by the receiving end, re-receive the third information sent by the transmitting end; if the transmitting end does not receive the fourth information sent by the receiving end for multiple times, receive the alarm information reported by the transmitting end;
[0250] The searching unit is used to search the reason why the sending end does not receive the fourth information based on the alarm information, so as to take measures to solve the reason.
[0251] In one embodiment, after receiving the retransmission message resent by the sending end, the device 600 also includes a deletion unit for deleting the second sequence number corresponding to the retransmission message from a local second database; the second sequence number of the lost second data message is cached in the second database.
[0252] In one embodiment, in the case where there are multiple second sequence numbers, the multiple second sequence numbers constitute a sequence number list; the preset period includes the time for sending N data packets, N is an integer greater than or equal to 2; the second information also includes the start sequence number, the end sequence number and the sequence number list; the end sequence number is determined by the start sequence number and N; the second sending unit 604 is also used to wait for the next preset period to arrive, and send the second information to the sending end when there is at least one retransmission message corresponding to the second sequence number among the retransmission messages corresponding to the multiple second sequence numbers that has not been received, until all the retransmission messages corresponding to the multiple second sequence numbers are received.
[0253] In one embodiment, the deletion unit is also used to confirm that the second data packet corresponding to the second sequence number has exceeded the retransmission deadline when the second sequence number cached in the second database does not fall within the range of the retransmission window parameter; and delete the second sequence number that has exceeded the retransmission deadline and the corresponding second data packet.
[0254] It should be noted that: the IoT information transmission device provided in the above embodiment only uses the division of the above program modules as an example when performing IoT information transmission. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the IoT information transmission device provided in the above embodiment and the IoT information transmission method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0255] Based on the hardware implementation of the above-mentioned program module, an embodiment of the present application also provides an Internet of Things information transmission device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the methods described in the above-mentioned sending end side are implemented; or, when the processor executes the program, the steps of any one of the methods described in the above-mentioned receiving end side are implemented;.
[0256] Correspondingly, an embodiment of the present application provides a computer program product, including a computer program, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods described in the above-mentioned sending end side are implemented; or, when the processor executes the program, the steps of any one of the methods described in the above-mentioned receiving end side are implemented.
[0257] Correspondingly, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods described in the above-mentioned sending end side are implemented; or, when the processor executes the program, the steps of any one of the methods described in the above-mentioned receiving end side are implemented.
[0258] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0259] It should be noted that the IoT information transmission device may be a sending end; Figure 7 Schematic diagram of the structure of the transmitting end of the embodiment of the present application, such as Figure 7As shown, the transmitting end 700 includes: a first processor 701 and a first memory 703 . Optionally, the transmitting end 700 may also include a first communication interface 702 .
[0260] It can be understood that the first memory 703 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The first memory 703 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0261] The method disclosed in the above embodiment of the present application can be applied to the first processor 701, or implemented by the first processor 701. The first processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the first processor 701 or an instruction in the form of software. The above-mentioned first processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The first processor 701 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the first memory 703, and the first processor 701 reads the information in the first memory 703, and completes the steps of the above method in combination with its hardware.
[0262] It should be noted that the IoT information transmission device may be a receiving end; Figure 8 is a schematic diagram of the structure of the receiving end in the embodiment of the present application, such as Figure 8 As shown, the receiving end 800 includes: a second processor 801 and a second memory 803 . Optionally, the receiving end 800 may also include a second communication interface 802 .
[0263] It can be understood that the second memory 803 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The second memory 803 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0264] The method disclosed in the above embodiment of the present application can be applied to the second processor 801, or implemented by the second processor 801. The second processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the second processor 801. The above second processor 801 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The second processor 801 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the second memory 803, and the second processor 801 reads the information in the second memory 803, and completes the steps of the above method in combination with its hardware.
[0265] In order to implement the method provided in the embodiment of the present application, the embodiment of the present application also provides an Internet of Things information transmission system, such as Fig. 9 As shown, Fig. 9 This is a schematic diagram of the structure of an Internet of Things information transmission system according to an embodiment of the present application. The system includes: a transmitting end 901 and a receiving end 902.
[0266] Here, it should be noted that the specific processing procedures of the sending end 901 and the receiving end 902 have been described in detail above and will not be repeated here.
[0267] In an exemplary embodiment, the device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.
[0268] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0269] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0270] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0271] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0272] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0273] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0274] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0275] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0276] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for transmitting information of the Internet of Things, characterized in that: Applied to the sending end, including: Sending a plurality of first information to a receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located at a header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; determining a second sequence number of a lost second data message based on the sorting result; receiving second information sent by the receiving end; the second information includes the second sequence number; Acquire a second data message corresponding to the second sequence number in a local first database; cache the first data message to be sent and the corresponding first sequence number in the first database; Determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information; Resending the retransmission message to the receiving end.
2. The method according to claim 1, characterized in that Before sending a plurality of first information to the receiving end within a preset period, the method further includes: Sending third information to the receiving end; the third information includes the starting sequence number of the first data message, the preset period and the retransmission window parameter; the third information is used by the receiving end to confirm the starting sequence number, the preset period and the retransmission window parameter; When the receiving end has confirmed the starting sequence number, the preset period, and the retransmission window parameter, receiving fourth information sent by the receiving end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter; The starting sequence number, the preset period and the retransmission window parameter are stored.
3. The method according to claim 2, characterized in that The method further comprises: If the fourth information sent by the receiving end is not received, resending the third information to the receiving end; If the fourth information sent by the receiving end is not received for multiple times, an alarm message is reported to the receiving end; the alarm message is used by the receiving end to find out the reason why the sending end did not receive the fourth information, so as to take measures to solve the reason.
4. The method according to claim 2, characterized in that The preset period includes the time for sending N data messages, where N is an integer greater than or equal to 2, and the method further includes: The first sequence number and the first data message are determined according to the starting sequence number and the length of the sequence number added to each data message in the N data messages.
5. The method according to claim 4, characterized in that In the case where the first sequence number is an end sequence number, the end sequence number is determined by the start sequence number and N; the method further includes: Determine whether the end sequence number is greater than a preset threshold; In the case that the end sequence number is greater than the preset threshold, the first sequence number and the first data message are re-determined according to the start sequence number and the length of the sequence number added to each data message in the N data messages.
6. The method according to claim 5, characterized in that In the case where there are multiple second sequence numbers, the multiple second sequence numbers form a sequence number list; the second information also includes the start sequence number, the end sequence number and the sequence number list; the method also includes: Based on the start sequence number, the end sequence number and the sequence number list, data packets other than second data packets corresponding to the plurality of second sequence numbers in the sequence number list are deleted from the local first database.
7. The method according to claim 2, characterized in that The method further comprises: When the second sequence number cached in the first database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission period; Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
8. The method according to any one of claims 1 to 7, characterized in that: The determining the retransmission message based on the second sequence number, the second data message and preset retransmission identification information includes: Place the second sequence number in the header of the second data message to obtain a data message carrying the sequence number; The retransmission identification information is set in the high order of the sequence number in the data message carrying the sequence number to obtain the retransmission message.
9. A method for transmitting information of the Internet of Things, characterized in that: Applied to the receiving end, including: A plurality of first information sent by a transmitting end is received within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message; Sort the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result; Determine a second sequence number of the lost second data packet based on the sorting result; Sending second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain a second data message corresponding to the second sequence number in a local first database; caching the first data message to be sent and the corresponding first sequence number in the first database; determining a retransmission message based on the second sequence number, the second data message and preset retransmission identification information; Receive the retransmission message resent by the sending end.
10. The method according to claim 9, characterized in that Before receiving a plurality of first information sent by the transmitting end within a preset period, the method further includes: receiving third information sent by the receiving end; the third information includes a starting sequence number of the first data message, the preset period and a retransmission window parameter; Confirming the starting sequence number, the preset period and the retransmission window parameter; When the starting sequence number, the preset period, and the retransmission window parameter have been confirmed, sending fourth information to the sending end; the fourth information indicates that the sending end and the receiving end have reached an agreement on the starting sequence number, the preset period, and the retransmission window parameter; The starting sequence number, the preset period and the retransmission window parameter are stored.
11. The method according to claim 10, characterized in that The method further comprises: If the sending end does not receive the fourth information sent by the receiving end, re-receive the third information sent by the sending end; If the sending end fails to receive the fourth information sent by the receiving end for multiple times, receiving the alarm information reported by the sending end; The reason why the sending end did not receive the fourth information is found based on the alarm information, so as to take measures to solve the reason.
12. The method according to claim 9, characterized in that After receiving the retransmission message resent by the transmitting end, the method further includes: The second sequence number corresponding to the retransmitted message is deleted from a local second database; and the second sequence number of the lost second data message is cached in the second database.
13. The method according to claim 10, characterized in that In the case where there are multiple second sequence numbers, the multiple second sequence numbers constitute a sequence number list; the preset period includes the time for sending N data messages, where N is an integer greater than or equal to 2; the second information also includes the start sequence number, the end sequence number and the sequence number list; The end sequence number is determined by the start sequence number and N; the method further comprises: When at least one retransmission message corresponding to the second sequence number among the retransmission messages corresponding to the multiple second sequence numbers has not been received, wait until the next preset period arrives and send second information to the sending end until all the retransmission messages corresponding to the multiple second sequence numbers are received.
14. The method according to claim 12, characterized in that The method further comprises: When the second sequence number cached in the second database does not fall within the range of the retransmission window parameter, confirming that the second data message corresponding to the second sequence number has exceeded the retransmission deadline; Delete the second sequence number and the corresponding second data message whose retransmission deadline has expired.
15. An Internet of Things information transmission device, characterized in that: The settings on the sending end include: A first sending unit is used to send a plurality of first information to a receiving end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message; the plurality of first information is used to sort the plurality of first data messages according to the plurality of first sequence numbers after the receiving end receives the plurality of first data messages within the preset period to obtain a sorting result; and determine a second sequence number of a lost second data message based on the sorting result; A first receiving unit, configured to receive second information sent by the receiving end; the second information includes the second sequence number; An acquiring unit, configured to acquire the second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database; A first determining unit, configured to determine a retransmission message based on the second sequence number, the second data message and preset retransmission identification information; The first sending unit is further used to resend the retransmission message to the receiving end.
16. An Internet of Things information transmission device, characterized in that: The settings on the receiving end include: A second receiving unit, configured to receive a plurality of first information sent by a transmitting end within a preset period; the first information includes a first sequence number and a first data message; the first sequence number is located in a header of the first data message; a sorting unit, configured to sort the plurality of first data messages according to the plurality of first sequence numbers to obtain a sorting result; A second determining unit, configured to determine a second sequence number of a lost second data message based on the sorting result; A second sending unit is used to send second information to the sending end; the second information includes the second sequence number; the second sequence number is used by the sending end to obtain a second data message corresponding to the second sequence number in a local first database; the first data message to be sent and the corresponding first sequence number are cached in the first database; a retransmission message is determined based on the second sequence number, the second data message and preset retransmission identification information; The second receiving unit is further used to receive the retransmission message resent by the sending end.
17. An Internet of Things information transmission device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method described in any one of claims 1 to 8 are implemented; or, when the processor executes the program, the steps of the method described in any one of claims 9 to 14 are implemented.
18. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 8 when executed by a processor; or, the computer program implements the steps of the method according to any one of claims 9 to 14 when executed by a processor.
19. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented; or, when the computer program is executed by a processor, the steps of the method described in any one of claims 9 to 14 are implemented.
