Data transmission method, device and medium based on low-power wireless sensor network

By dynamically switching transmission mode in a low-power wireless sensor network, adjusting the protocol based on the number of successful transmission times and lost transmission times, the problems of low transmission efficiency and large energy consumption are solved, and data integrity and transmission reliability are improved.

CN113541858BActive Publication Date: 2024-12-03SHENZHEN INST OF ADVANCED TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010309448.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-17
Publication Date
2024-12-03
Estimated Expiration
2040-04-17

AI Technical Summary

Technical Problem

In low-power wireless sensor networks, existing transmission protocols (TCP and UDP) have problems such as low transmission efficiency, large energy consumption and easy data loss.

Method used

By dynamically switching transmission modes between node equipment and processing equipment, the transmission protocol is adjusted according to the number of transmission successes and losses, thereby improving transmission efficiency and reducing energy consumption while ensuring data integrity and transmission reliability.

Benefits of technology

It realizes switching to a high-efficiency and low-energy transmission mode under stable communication signals and good communication quality, and switches to a reliable transmission mode when communication quality is low and packet loss is severe, ensuring data integrity and transmission reliability, and improving transmission efficiency And reduces energy consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113541858B_ABST
    Figure CN113541858B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data transmission method, device and medium based on a low-power wireless sensor network, wherein the method includes sending a first data packet to a first processing device, the first data packet is a data packet transmitted using a first transmission mode; if a first response message matching the first data packet is received within a preset time range, the number of successful consecutive data packet transmissions in the first transmission mode is counted according to the first response message; if the number of successful transmissions reaches a switching threshold, the first transmission mode is switched to a second transmission mode, and a second data packet and a first sequence number are sent to the first processing device, the second data packet matches the first sequence number, and the second data packet is a data packet transmitted using the second transmission mode. By adopting the embodiment of the present invention, the transmission efficiency is improved and the energy consumption is reduced on the basis of ensuring the integrity and transmission reliability of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a data transmission method, device and medium based on a low-power wireless sensor network. Background Art

[0002] Low-power wireless sensor networks are composed of a large number of battery-powered sensor nodes, which form a multi-hop, self-organizing wireless network system through wireless communication. The system is used to sense, collect, process and transmit information about the sensed objects within the geographical area covered by the network, and send the information to the network owner. At present, the common forms of information transmission mainly include the following two: Transmission Control Protocol (TCP) using handshake transmission and User Datagram Protocol (UDP) using connectionless transmission. However, the handshake transmission form used in the first method leads to low transmission efficiency and high energy consumption; the second method has the problem of easy loss of transmission data and poor reliability. Summary of the invention

[0003] The embodiments of the present invention provide a data transmission method, device and medium based on a low-power wireless sensor network, which improves transmission efficiency and reduces energy consumption while ensuring data integrity and transmission reliability.

[0004] In a first aspect, an embodiment of the present invention provides a data transmission method based on a low-power wireless sensor network, comprising:

[0005] Sending a first data packet to a first processing device, where the first data packet is a data packet transmitted using a first transmission mode;

[0006] If a first response message matching the first data packet is received within a preset time range, counting the number of successful consecutive transmissions of data packets in the first transmission mode according to the first response message;

[0007] If the number of successes reaches the switching threshold, the first transmission mode is switched to the second transmission mode, and a second data packet and a first serial number are sent to the first processing device, the second data packet matches the first serial number, and the second data packet is a data packet transmitted using the second transmission mode.

[0008] In this technical solution, the node device uses the first transmission mode to send a first data packet to the first processing device. When the first processing device receives the first data packet, it sends a first response message to the node device. If the node device receives the first response message within a preset time range, it means that the first data packet is successfully transmitted during the transmission process. The number of successful consecutive transmissions of data packets in the first transmission mode is counted. If the number of successful transmissions reaches the switching threshold, the first transmission mode is switched to the second transmission mode. Through this method, when it is determined that the communication signal has reached stability and the communication quality is good, the first transmission mode can be switched to a second transmission mode with higher efficiency and less energy consumption. Then, on the basis of ensuring data integrity and transmission reliability, the transmission efficiency is improved and energy consumption is reduced.

[0009] In a second aspect, an embodiment of the present invention provides a data transmission method based on a low-power wireless sensor network, comprising:

[0010] receiving the first data packet from the node device, and generating the first response information matching the first data packet according to the first data packet;

[0011] Sending the first response information to the node device;

[0012] receiving the second data packet and the first sequence number from the node device, where the second data packet matches the first sequence number, and the second data packet is data transmitted in a second transmission mode;

[0013] If the first sequence number does not satisfy the sequence condition, obtaining the number of losses, where the number of losses is the number of times within a preset sequence length that a sequence number does not satisfy the sequence condition;

[0014] If the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device, where the switching instruction is used to instruct the node device to switch the second transmission mode to the first transmission mode.

[0015] In this technical solution, the node device uses the second transmission mode to send a second data packet and a first serial number matching the second data packet to the first processing device. The first processing device determines whether the first serial number satisfies the sequence condition. If not, the number of data packet losses within the preset sequence length range is obtained. If the number of data packet losses within the preset sequence length range is greater than the fault tolerance threshold, a switching instruction is sent to the node device so that the node device switches the second transmission mode to the first transmission mode according to the switching instruction. Through this method, during high-speed transmission using the second transmission mode, if the communication quality is low and the data packet loss is serious, the second transmission mode is switched to the first transmission mode with higher reliability and less data loss, thereby ensuring data integrity and transmission reliability.

[0016] In a third aspect, an embodiment of the present invention provides a data transmission device based on a low-power wireless sensor network, including:

[0017] A transceiver unit, configured to send a first data packet to a first processing device, wherein the first data packet is a data packet transmitted in a first transmission mode;

[0018] a processing unit, configured to count the number of successful consecutive transmissions of data packets in the first transmission mode according to the first response information if a first response information matching the first data packet is received within a preset time range; and switch the first transmission mode to a second transmission mode if the number of successful transmissions reaches a switching threshold;

[0019] The transceiver unit is further used to send a second data packet and a first serial number to the first processing device, the second data packet matches the first serial number, and the second data packet is a data packet transmitted using a second transmission mode.

[0020] In a fourth aspect, an embodiment of the present invention provides a data transmission device based on a low-power wireless sensor network, comprising:

[0021] A transceiver unit, configured to receive the first data packet from a node device;

[0022] a processing unit, configured to generate, according to the first data packet, the first response information matching the first data packet;

[0023] The transceiver unit is further configured to send the first response information to the node device; receive the second data packet and the first sequence number from the node device, the second data packet matches the first sequence number, and the second data packet is data transmitted using a second transmission mode;

[0024] The processing unit is further configured to obtain a number of loss times if the first sequence number does not satisfy a sequence condition, where the number of loss times is the number of times a sequence number does not satisfy the sequence condition within a preset sequence length range;

[0025] The transceiver unit is further configured to send a switching instruction to the node device if the number of losses is greater than a fault tolerance threshold, wherein the switching instruction is configured to instruct the node device to switch the second transmission mode to the first transmission mode.

[0026] In a fifth aspect, an embodiment of the present invention provides a data transmission device based on a low-power wireless sensor network, including a processor and a memory, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect or the second aspect. The implementation method and beneficial effects of the processing device to solve the problem can refer to the method and beneficial effects described in the first aspect or the second aspect above, and the repeated parts will not be repeated.

[0027] In a sixth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method described in the first aspect or the second aspect.

[0028] In the embodiment of the present application, the node device can first adopt the first transmission mode to transmit the first data packet. If the first response information matching the first data packet is received within the preset time range, the transmission is determined to be successful. If the number of consecutive successful transmissions is greater than the switching threshold when the data packet is transmitted using the first transmission mode, the node device switches the first switching mode to a more efficient and energy-saving second transmission mode, and continues to transmit the second data packet and the first sequence number matching the second data packet using the second transmission mode. If it is determined that the first sequence number does not meet the sequence condition, it is determined that there is a data packet loss, and the number of data packet losses within the preset sequence length range up to the current first sequence number is obtained. If the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device, and the node device can switch the second transmission mode to a more reliable first transmission mode. It can be seen that through this embodiment, the self-adjustment of the transmission mode is realized, and the transmission efficiency is improved and the energy consumption is reduced on the basis of ensuring the integrity and transmission reliability of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 It is an architecture diagram of a data transmission system based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0031] Figure 2 is a flow chart of a data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of a method for determining the number of successful transmissions provided by an embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of a transmission mode switching process provided by an embodiment of the present invention;

[0034] Figure 5 is a flow chart of another data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0035] Figure 6 is a flow chart of another data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0036] Figure 7 is a flow chart of another data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0037] Figure 8 It is a structural schematic diagram of a data transmission device based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0038] Fig. 9 It is a structural schematic diagram of another data transmission device based on a low-power wireless sensor network provided by an embodiment of the present invention;

[0039] Fig.10 It is a structural schematic diagram of another data transmission device based on a low-power wireless sensor network provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] The terms "first", "second", "third", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.

[0042] In order to better understand a data transmission method based on a low-power wireless sensor network disclosed in an embodiment of the present invention, the system architecture applicable to the embodiment of the present invention is first described below.

[0043] See also Figure 1 , Figure 1 The data transmission system architecture diagram based on the low-power wireless sensor network of the present invention may include a node device 101, a first processing device 102 and a second processing device 103. The form and quantity of the node device 101 and the second processing device 103 are used for example and do not constitute a limitation on the embodiments of the present invention. For example: two node devices 101 may be included, and two second processing devices 103 may also be included. Optionally, one or more node devices 101 in this embodiment use the same channel for communication without channel hopping.

[0044] The node device 101, the first processing device 102 and the second processing device 103 together constitute a wireless sensor network, wherein the node device 101 is a wireless node device that sends a first data packet and a second data packet to the first processing device 102, and may also be a wireless node device that receives data to be sent from the second processing device 103. The node device may include but is not limited to: a client, a server and other devices. The client may be any of the following: a terminal, an independent application, an application programming interface (Application Programming Interface, API) or a software development kit (Software Development Kit, SDK). The terminal may include but is not limited to: a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a portable personal computer, a mobile Internet device (Mobile Internet Devices, MID) and other devices, which are not limited in the embodiment of the present invention. The first processing device 102 is a device that receives the first data packet and the second data packet sent by the above-mentioned node device 101, and the first processing device 102 may include but is not limited to: a concentrator, a base station and other devices. The second processing device 103 is a device for collecting data to be sent, and sends the collected data to be sent to the node device 101. The node device 101 can store the data to be sent in a cache set. The second processing device 103 can include but is not limited to: a collector, a sensor and other devices.

[0045] In an embodiment of the present invention, the node device 101 adopts a first transmission mode to send a first data packet to the first processing device 102. If the first processing device 102 receives the first data packet, it sends a first response message to the node device 101. If the node device 101 does not receive the first response message matching the first data packet within a preset time range, it is considered that the transmission has failed and the sent first data packet has been lost, and the lost first lost data packet is resent to the first processing device 102. If the first response message matching the first data packet is received within the preset time range, it is considered that the transmission is successful. When the number of successful consecutive data transmissions reaches the switching threshold, it is considered that the wireless communication quality is stable, and the transmission mode can be switched from the first transmission mode to the second transmission mode.

[0046] In the embodiment of the present invention, the node device 101 may also adopt the second transmission mode to send a second data packet and a first sequence number matching the second data packet to the first processing device 102. If the first processing device 102 determines that the first sequence number does not meet the sequence condition, it is determined that there is lost data, and the cumulative number of losses within the preset sequence length range is obtained. If the cumulative number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device 101, so that the node device 101 switches the transmission mode from the second transmission mode to the first transmission mode according to the switching instruction. And in the case of determining that there is lost data, a second acquisition request is sent to the node device 101, and the second acquisition request includes a second sequence number, which is the sequence number of the lost data packet, and can be the previous sequence number of the first sequence number, and the node device 101 resends the second lost data packet matching the second sequence number to the first processing device 102.

[0047] In the embodiment of the present invention, the second processing device 103 can also send the data to be sent to the node device 101, and the node device 101 stores the data to be sent in a cache set, which includes at least one data, and the at least one data includes a first data packet and a second data packet. Further, the first data packet can be sent to the first processing device 102 using the first transmission mode.

[0048] Optionally, this embodiment can be used to collect students' bedtime. The first data packet can be pressure data, and the second processing device 103 can be a pressure data collection device. After collecting the pressure data, the second processing device 102 transmits the pressure data to the node device 101 for storage. The node device 101 sends the stored pressure data to the first processing device 102 one by one to complete the centralized data collection.

[0049] See also Figure 2 , Figure 2 is a flow chart of a data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention, such as Figure 2 As shown, the data transmission method may include parts 201-213, wherein:

[0050] 201 . The node device 101 sends a first data packet to the first processing device 102 .

[0051] Specifically, the node device 101 sends a first data packet to the first processing device 102, and correspondingly, the first processing device 102 receives the first data packet from the node device 101, and the first data packet is a data packet transmitted using a first transmission mode. The first transmission mode is a reliable transmission mode that is not prone to data loss, and the transmission mode may include but is not limited to a TCP transmission mode. The first data packet is a data packet transmitted by the node device 102 using the first transmission mode, and the data packet may include but is not limited to: a pressure data packet, a temperature data packet, an electric meter data packet, an audio data packet, and the like.

[0052] 202. The first processing device 102 generates first response information matching the first data packet according to the first data packet.

[0053] Specifically, when the first processing device 102 receives the first data packet transmitted in the first transmission mode, it generates a first response information matching the first data packet. The first response information is used to determine that the first data packet sent by the node device 101 has been received, that is, the node device 101 has successfully sent the first data packet to the first processing device 102. The first response information may include but is not limited to an acknowledgment character (Acknowledgement, ACK).

[0054] 203 . The first processing device 102 sends first response information to the node device 101 .

[0055] Specifically, the first processing device 102 sends the first response information to the node device 101, and accordingly, the node device 101 receives the first response information from the first processing device 102, so that the node device 101 can determine that the first data packet matching the first response information has been sent successfully.

[0056] 204. The node device 101 determines whether first response information matching the first data packet is received within a preset time range.

[0057] Specifically, if the node device 101 receives the first response information matching the first data packet within the preset time range, it is determined that the first data packet is sent successfully, and the number of successful continuous data transmissions in the first transmission mode can be counted based on the first response information, that is, step 205 is executed; if the node device 101 does not receive the first response information matching the first data packet within the preset time range, it is determined that the first data packet is lost, and the lost first data packet, that is, the first lost data, can be re-sent to the first processing device. The preset time range can be a period of time, for example: within 10 seconds after the first data packet is sent. Optionally, it can also be a time point, for example: if the time of sending is 9:08, then at 9:09, if the first response information is not received, it means that the sending failed and the first data packet is lost.

[0058] 205. The node device 101 counts the number of successful consecutive data transmissions in the first transmission mode according to the first response information.

[0059] Specifically, if the node device 101 determines whether the first response information matching the first data packet is received within the preset time range, the number of successful consecutive data transmissions in the first transmission mode can be counted based on the first response information. Among them, successful transmission can be understood as receiving the first response information matching the first data packet within the preset time range, and then the first data packet is successfully transmitted. The data transmitted in the first transmission mode may include but is not limited to the first data packet, that is, the data transmitted in the first transmission mode may be one or more. The number of successes can be the number of consecutive successful transmissions of the one or more data in the first transmission mode. The detailed process of determining the number of successes is as follows:

[0060] like Figure 3As shown, A1 represents the process of transmitting data packet x1 in TCP mode for the first time, R1 represents the process of waiting and receiving ACK response information y1 matching data packet x1, T represents the preset duration, if ACK response information y1 is received within the T length, that is, there is an R1 process and the duration of the R1 process is less than or equal to T, then it means that data packet x1 is successfully transmitted, and the number of successes is 1, A2 represents the process of transmitting data packet x2 in TCP mode for the second time, if ACK response information y2 matching x2 is received within the preset duration T, then data x2 is successfully transmitted, and the number of successes is 2, and so on. If the number of successive transmissions reaches the switching threshold, the first transmission mode can be switched to the second transmission mode, that is, steps 206 and 207 are executed. If a transmission failure occurs, for example, when transmitting data packet x4, no ACK response information y4 matching x4 is received within the preset time T, it means that the transmission of data packet x4 fails, and the number of successes is recorded as 0. The number of successes is recounted, and after the lost data packet x4 is resent to the first processing device, the data packet is continuously transmitted in TCP mode. If the fifth transmission of data packet x5 in TCP mode is successful, the number of successes is 1. If the sixth transmission of data packet x6 in TCP mode is successful, the number of successes is 2, and so on.

[0061] Specifically, the first data packet described in this embodiment may be the above Figure 3 Any data packet x in the data packets transmitted in the first mode n , n is a positive integer. For example: it can be data packet x1, data packet x2 or data packet x6, etc.

[0062] 206. The node device 101 determines whether the number of successes reaches a switching threshold.

[0063] Specifically, after determining the number of successes, the node device 101 determines whether the number of successes reaches the switching threshold. The method for determining the number of successes can refer to the relevant description in step 205, which will not be repeated here. The switching threshold is a preset maximum value that reaches the standard for switching the transmission mode. For example, the switching threshold is 20 times. When the TCP mode is used to transmit the data packet for the 30th time, it is determined that the number of successful continuous transmissions of the data packet has reached 20 times, and the transmission mode can be switched, that is, step 207 is executed; conversely, when the TCP mode is used to transmit the data packet for the 30th time, it is determined that the number of successful continuous transmissions of the data packet is 15 times, which has not reached 20 times. At this time, the TCP mode continues to be used to send data without switching the transmission mode.

[0064] 207. The node device 101 switches the first transmission mode to the second transmission mode.

[0065] If the node device 101 determines that the number of successes has reached the switching threshold, it means that the communication quality is relatively stable, and the first transmission mode can be switched to the second transmission mode. The relevant description of the first transmission mode can refer to the relevant description in step 201, which is not repeated here. The second transmission mode is a transmission mode with high transmission efficiency and low energy consumption, which can include but is not limited to the UDP transmission mode.

[0066] By executing the method described in steps 201-207, the node device 101 can first use the first transmission mode to send data packets to the first processing device 102 one by one. The sending method can be: sending a first data packet to the first processing device 102, and the first processing device 102 sends a first response message to the node device 101 when receiving the first data packet. If the node device 101 receives the first response message within a preset time range, it means that the first data packet is not lost during the transmission process, and the transmission is successful. The number of successful consecutive transmissions of data packets in the first transmission mode is counted. If the number of successful transmissions reaches the switching threshold, the first transmission mode is switched to the second transmission mode. Through this embodiment, it is possible to switch the first transmission mode to a second transmission mode with higher efficiency and less energy consumption when it is determined that the communication signal has reached stability and the communication quality is good. Then, on the basis of ensuring the integrity of the data and the reliability of the transmission, the transmission efficiency is improved and the energy consumption is reduced.

[0067] 208 . The node device 101 sends the second data packet and the first sequence number to the first processing device 102 .

[0068] Specifically, if the transmission mode is switched from the first transmission mode to the second transmission mode, the second transmission mode is used to send the second data packet and the first serial number to the first processing device 102. The second data packet matches the first serial number, and the second data packet and the first data packet are both the same type of data packets from the node device 101. For example, the node device 101 stores a number of data packets R = {x1, x2, x3 ... x n}, the first data packet can be any data packet in R, for example, it may be x1 or x5, and the second data packet can also be any data packet in R, for example, it may be x 10 or x 12 Therefore, the first data packet and the second data packet in this embodiment may be any data packet in the node device 101, wherein the first data packet only represents the data packet sent using the first transmission mode, and the second data packet only represents the data packet sent using the second transmission mode. The first sequence number is the sequence number that matches the second data packet. For example, data packet x 10 The serial number is 1, x 11 The sequence number of the packet is 2, and so on. Each data packet corresponds to a unique sequence number.

[0069] 209. The first processing device 102 determines whether the first sequence number meets a sequence condition.

[0070] Specifically, the first processing device 102 can determine whether the first sequence number meets the sequence condition based on the first sequence number matched with the second data packet. The sequence condition can be understood as whether the first sequence number meets the predetermined sequence order. For example, for data packet R = {x1, x2...x n}, the sequence numbers correspond to {1,2…n} respectively. If the data received this time has a sequence number of 5, and the data received last time has a sequence number of 3, it can be considered that the sequence number 5 does not meet the sequence condition. The data with a sequence number of 4 that has not been received can be considered to have been lost, and there is a situation where the data packet is lost. Optionally, before executing step 209, the same sequence number rule can be formulated for the node device 101 and the first processing device 102. Optionally, before executing step 209, the node device 101 can send the current round of sequence number rules to the first processing device, for example: a mutual correspondence table between sequence numbers and data packets. The first processing device can determine whether the first sequence number meets the sequence condition based on the correspondence table. By executing this embodiment, the first processing device 102 can more intuitively and simply determine whether there is a lost data packet. Furthermore, if the first processing device 102 determines that the first sequence number meets the sequence condition, it continues to transmit the next data packet in the second transmission mode; if the first processing device 102 determines that the first sequence number does not meet the sequence condition, it obtains the number of losses, that is, executes step 210.

[0071] 210. The first processing device 102 obtains the number of losses.

[0072] Specifically, when determining that the received first sequence number does not satisfy the sequence condition, the first processing device 102 obtains the number of losses, which is the number of times that the sequence number does not satisfy the sequence condition within the preset sequence length range. The preset sequence length may be a preset sequence number range length. For example, the preset sequence length is a sequence length range specified in a sequence range corresponding to data packets transmitted continuously in the second transmission mode, for example, a data packet R in the node device 101 = {x1, x2, x3…x n}, where R1 = {x1, x2, x3…x 10}Using the first transmission mode, from x 11 Switch to the second transmission mode, at this time the data packet x 11 The serial number is 1, x 50The sequence number is 40. If, when receiving the data packet with sequence number 40, it is confirmed that the data packet with sequence number 39 has not been received, it is determined that the data packet with sequence number 39 is lost, and the preset sequence length is 30, the number of corresponding data packet losses within the sequence length range from sequence number 11 to sequence number 40 can be obtained.

[0073] Furthermore, the methods for obtaining the number of losses may include the following two methods:

[0074] In a first approach, if the preset sequence length is greater than the sequence length corresponding to the acquired data packet, the number of times data packet loss occurs in all data packets that are continuously transmitted in the second transmission mode can be obtained.

[0075] For example, the preset sequence length is 30. After receiving the data packet with sequence number 26, the first processing device 102 confirms that it has not received the data packet with sequence number 25. At this time, when obtaining the number of losses, the preset sequence length 30 is greater than the sequence number 26. At this time, it is only necessary to obtain the loss of the data packets corresponding to sequence numbers 1 to 26. It is obtained that among the data packets corresponding to sequence numbers 1 to 26, including the lost data packet with sequence number 25, the sequence numbers do not meet the sequence condition, that is, the number of times the data packet loss has occurred is 4 times in total, and it is determined that the number of losses at this time is 4 times.

[0076] In the second method, if the preset sequence length is less than or equal to the sequence length corresponding to the acquired data packet, the number of times the data packet is lost within the preset sequence length range can be obtained.

[0077] For example, the preset sequence length is 30. After receiving the data packet with sequence number 42, the first processing device 102 confirms that it has not received the data packet with sequence number 41. At this time, when obtaining the number of losses, the preset sequence length 30 is less than the sequence length of the received data packets. At this time, it is necessary to obtain the loss of the data packets corresponding to sequence numbers 13 to 42. Among the data packets corresponding to sequence numbers 13 to 42, including the lost data packet with sequence number 41, the number of times that the sequence number does not meet the sequence condition is 3 times in total, and it is determined that the number of losses at this time is 3 times.

[0078] 211. The first processing device 102 determines whether the number of losses is greater than a fault tolerance threshold.

[0079] Specifically, the first processing device 102 determines whether the number of losses is greater than the fault tolerance threshold based on the number of losses obtained. The fault tolerance threshold is the maximum number of times that data packets are allowed to be lost within the preset sequence length. For example, the fault tolerance threshold is that when the preset sequence length is 30, the number of lost data packets shall not exceed 3 times. For the situation where the preset sequence length in step 210 is greater than the sequence length corresponding to the acquired data packets, for example: the first processing device 102 determines that when receiving the data packet with sequence number 26, it is found that data packet No. 25 is lost. At this time, it is determined that 4 data packets have been lost, including data packet No. 25, and data packet No. 25 is the fourth lost data packet. It is confirmed that the number of lost data packets has exceeded 3 times within the range of sequence length 30, and a switching instruction can be sent to the node device 101, that is, step 212 is executed. For the case where the preset sequence length in step 210 is less than or equal to the sequence length corresponding to the acquired data packet, for example: the first processing device 102 determines that when receiving the data packet with sequence number 42, it finds that data packet No. 41 is lost. At this time, it is necessary to obtain the loss of data packets with sequence numbers 13 to 42, and judge that including data packet No. 41, there have been 4 lost data packets, and data packet No. 41 is the 4th lost data packet. It is confirmed that the lost data packets have exceeded 3 times within the range of sequence length 30, and then a switching instruction can be sent to the node device 101, that is, step 212 is executed. According to the above judgment method, if the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device 101, that is, step 212 is executed; if the number of losses is less than or equal to the fault tolerance threshold, the second transmission mode is continued to be used for data transmission.

[0080] 212 . The second processing device 102 sends a switching instruction to the node device 101 .

[0081] Specifically, when it is determined that the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device 101, and the switching instruction is used to instruct the node device 101 to switch the second transmission mode to the first transmission mode. For the first transmission mode and the second transmission mode, please refer to the relevant description in step 201 and step 207, which will not be repeated here. Optionally, the switching instruction may include a node device identifier of the node device 101, so as to send the switching instruction to the node device 101 matching the node device identifier.

[0082] 213. The node device 101 switches the second transmission mode to the first transmission mode according to the switching instruction.

[0083] Specifically, upon receiving the switching instruction, the node device 101 switches the second transmission mode to the first transmission mode with more reliable transmission, and then continues to transmit data packets in the first transmission mode.

[0084] By executing the method described in steps 208-213, the node device 101 uses the second transmission mode to send data packets to the first processing device 102 one by one. The sending method can be: sending a second data packet and a first sequence number matching the second data packet to the first processing device 102. When the first processing device 102 receives the second data packet and the first sequence number, it determines whether the first sequence number satisfies the sequence condition. If not, the number of data packet losses within the preset sequence length range is obtained. If the number of data packet losses within the preset sequence length range is greater than the fault tolerance threshold, a switching instruction is sent to the node device 101, so that the node device 101 switches the second transmission mode to the first transmission mode according to the switching instruction. Through this embodiment, it can be achieved that during the high-speed transmission process using the second transmission mode, if the communication quality is low and the data packet loss is serious, the second transmission mode is switched to the first transmission mode with higher reliability and less data loss, thereby ensuring the integrity of the data and the reliability of transmission.

[0085] It can be seen that through the implementation Figure 2 The described method can first adopt the first transmission mode to transmit the first data packet. If the first response information matching the first data packet is received within the preset time range, it is determined that the transmission is successful. If the number of consecutive successful transmissions is greater than the switching threshold when the data packet is transmitted using the first transmission mode, the node device 101 switches the first switching mode to a more efficient and energy-saving second transmission mode, and continues to transmit the second data packet and the first sequence number matching the second data packet using the second transmission mode. If it is determined that the first sequence number does not meet the sequence condition, it is determined that there is a data packet loss, and the number of losses of such data packet loss within the preset sequence length range up to the current first sequence number is obtained. If the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device 101, and the node device 101 can switch the second transmission mode to a more reliable first transmission mode. Through the self-adjustment of the transmission mode, it is possible to improve the transmission efficiency and reduce energy consumption on the basis of ensuring the integrity and transmission reliability of the data.

[0086] For example:

[0087] like Figure 4 As shown, the node device 101 pre-transmits a number of data packets R = {x1, x2, x3...x 50} to the first processing device 102, TCP is first used to send a data packet to the first processing device 102, and the transmission starts from data packet x1, wherein A1 represents the process of transmitting data packet x1 in TCP mode, R1 represents the process of waiting for and receiving ACK response information y1 matching data packet x1, T represents the preset time length, and in the process of sequential transmission, it is found that data packet x1 and data packet x2 are both successfully sent, and the number of successes is 2 at this time, and data packet x3 does not receive response information y3 within the specified preset time length T after being sent, then TCP mode is used to continue transmission, and the number of successes is reset to zero. At this time, after the lost data packet x3 is resent to the first processing device, data packets are continuously sent from data packet x4 in sequence, and when data packet x3 is sent to 13 , it has been successful 10 times in a row, the number of successes is recorded as 10 times, and the switching threshold 10 has been reached. The node device 101 can switch the transmission mode from TCP to UDP. The node device 101 continues to send data packets in UDP mode. 14 and data packet x 14 The matching sequence number 1, when transmitted to packet x 17 When the first processing device 102 determines that the data packet x with the sequence number 3 is not received 16 , then count the number of losses, the number of losses at this time is 1, and the fault tolerance threshold is not reached. Then, after retransmitting the lost data packet with sequence number 3, 16 After that, continue to transmit data packets x 18 , where the fault tolerance threshold is that the number of data packets corresponding to the 30 sequence numbers must not exceed 2 times, that is, the number of data packets corresponding to the sequence numbers 1-30 is 14 -x 43 The number of packet losses within a period shall not exceed 2. 26 When the first processing device 102 determines that the data packet x with the sequence number 12 is not received 25 , then count the number of losses, the number of losses at this time is 2 times, which does not reach the fault tolerance threshold. After retransmitting the lost data packet with sequence number 12, 25 After that, continue to transmit data packets x 27 , when transmitted to data packet x 31 When the first processing device 102 determines that the data packet x with the sequence number 17 is not received 30 , the number of lost packets is counted as 3. At this time, when 18 packets corresponding to sequence numbers 1-18 are transmitted, 3 packets have been lost, which exceeds the preset fault tolerance threshold that the number of lost packets corresponding to 30 sequence numbers shall not exceed 2. Then the first processing device 102 receives the retransmitted lost packet x with sequence number 17. 30After that, a switching instruction is sent to the node device 101, and the node device 101 switches the transmission mode from UDP back to TCP mode and continues to use TCP mode to transmit data packets x 32 , the number of successes starts again from 1, that is, data packet x 32 If the sending is successful, the number of successes is recorded as 1, and so on.

[0088] See also Figure 5 , Figure 5 is a flow chart of a data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention, such as Figure 5 As shown, the data transmission method may include parts 501-506, wherein:

[0089] 501. The node device 101 sends a first data packet to a first processing device.

[0090] 502. The first processing device 102 generates first response information matching the first data packet according to the first data packet.

[0091] 503 . The first processing device 102 sends first response information to the node device 101 .

[0092] 504. The node device 101 determines whether first response information matching the first data packet is received within a preset time range.

[0093] The specific implementation of steps 501-504 can refer to the description of steps 201-204 above, which will not be repeated here.

[0094] If the node device 101 does not receive the first response information matching the first data packet within the preset time range, then the first lost data packet matching the first response information not received is acquired, that is, step 505 is executed.

[0095] 505. The node device 101 obtains a first lost data packet that matches the first response information that is not received.

[0096] Specifically, if the node device 101 does not receive the first response information matching the first data packet within the preset time range, it obtains the first lost data packet matching the first response information that has not been received, and the first lost data packet is the first data packet lost during the transmission process.

[0097] 506 . The node device 101 sends the first lost data packet to the first processing device 102 .

[0098] Specifically, the node device 101 resends the first lost data packet lost during the transmission process to the first processing device 102 , and correspondingly, the first processing device 102 receives the first lost data packet sent by the node device 101 .

[0099] By executing Figure 5 In the implementation mode, if the node device 101 does not receive the first response information within a preset time range, it is determined that the first data packet has been lost, the lost first lost data packet is obtained, and the first lost data packet is sent to the first processing device 102, thereby effectively avoiding the loss of data during the transmission process using the first transmission mode and ensuring the integrity of the data.

[0100] See also Figure 6 , Figure 6 is a flow chart of a data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention, such as Figure 6 As shown, the data transmission method may include parts 601-605, wherein:

[0101] 601 . The node device 101 sends a second data packet and a first sequence number to the first processing device 102 .

[0102] 602. The first processing device 102 determines whether the first sequence number satisfies a sequence condition.

[0103] The specific implementation of steps 601 and 602 can refer to the description of steps 208 and 209 above, which will not be repeated here.

[0104] If the first sequence number does not satisfy the sequence condition, the first processing device 102 sends a second acquisition request to the node device 101 , ie, executes step 603 .

[0105] 603 . The first processing device 102 sends an acquisition request to the node device 101 .

[0106] Specifically, if the first sequence number does not meet the sequence condition, the first processing device 102 sends an acquisition request to the node device 101, and the acquisition request includes a second sequence number, and the second sequence number is the previous sequence number of the first sequence number. The lake area request is used to obtain the second lost data packet matching the second sequence number according to the second sequence number. Among them, the relevant description of the first sequence number can refer to the relevant description of step 208, which is not repeated here. The second sequence number is the previous sequence number of the first sequence number, that is, the sequence number corresponding to the lost data packet. For example, data packets with sequence numbers 1, 2, and 3 have been obtained, and then a data packet with sequence number 5 is obtained at this time. In order to obtain a data packet with sequence number 4, it is determined that the data packet with sequence number 4 is lost, wherein the first sequence number is 5 and the second sequence number is 4. Then a request for acquisition can be sent to obtain the second lost data packet with sequence number 4.

[0107] 604. The node device 101 obtains a second lost data packet matching the second sequence number.

[0108] Specifically, the node device 101 may obtain a second lost data packet matching the second sequence number according to the second sequence number included in the received acquisition request, where the second lost data packet is a data packet with a sequence number one digit before the second data packet.

[0109] 605 . The node device 101 sends a second lost data packet matching the second sequence number to the first processing device 102 .

[0110] Specifically, the node device 101 resends the second lost data packet lost during the transmission process to the first processing device 102 , and correspondingly, the first processing device 102 receives the second lost data packet sent by the node device 101 .

[0111] By executing Figure 6 In the implementation mode, if the first processing device 102 determines that the first sequence number does not meet the sequence condition based on the received first sequence number, it is determined that the data packet with the sequence number one digit before the second data packet has been lost, that is, the data packet corresponding to the second sequence number is lost, and the second sequence number is sent to the node device 101. The node device 101 obtains the second lost data packet matching the second sequence number, and sends the second lost data packet to the first processing device 102, which effectively avoids the loss of data during the transmission process using the second transmission mode and ensures the integrity of the data.

[0112] See also Figure 7 , Figure 7 is a flow chart of a data transmission method based on a low-power wireless sensor network provided by an embodiment of the present invention, such as Figure 7 As shown, the data transmission method may include parts 701-709, wherein:

[0113] 701 . The node device 101 sends a connection request to the first processing device 102 .

[0114] Specifically, after being powered on, the node device 101 sends a connection request to the first processing device 102. The connection request includes the node device identification of the node device 101. The connection request is used to request to obtain a connection address. Then, the node device 101 can establish a connection with the first processing device 102 according to the connection address. The connection request can be a broadcast message. The node device 101 can perform header processing on the broadcast information, for example, specifying a receiving address. Then, only the first processing device 102 can identify and receive the broadcast message of the node device 101. The first processing device 102 generates a unique connection address according to the broadcast message, and sends the connection address to the node device 101 according to the node device identification.

[0115] 702. The first processing device 102 determines an access order of connection requests, and generates a connection address according to the access order.

[0116] Specifically, the first processing device 102 determines the access order of the node device 101, and generates a connection address according to the access order of the node device 101. The node device 101 may be one of the multiple node devices that send a connection request to the first processing device 102. After being powered on, each node device will send a connection request to the first processing device 102. The first processing device 102 receives the connection requests of each node device respectively, and determines the access order of each node device according to the order in which the connection requests are received. For example, if the first processing device 102 receives the connection request of the node device 101 for the third time, the access order of the node device 101 is determined to be 3. Then, the first processing device 102 can generate a connection address of the node device 101 according to the access order. The connection address is a unique connection address. The node device 101 can establish a connection with the first processing device 102 according to the connection address and determine its own access order. Optionally, before executing step 702 , the first processing device 102 may generate a short address after being powered on. The short address is the address of the first processing device 102 , and the powered-on node device 101 can communicate with the first processing device 102 through the short address.

[0117] 703. The first processing device 102 sends a connection address to the node device 101 according to the node device identifier.

[0118] Specifically, the first processing device 102 may send the generated connection address to the corresponding node device 101 according to the node device identifier sent by the node device 101, and correspondingly, the node device 101 receives the connection address.

[0119] 704. The node device 101 establishes a connection with the first processing device 102 according to the connection address.

[0120] Specifically, the node device 101 establishes a connection with the first processing device 102 according to the received connection address, that is, the node device 101 joins the wireless sensor network.

[0121] 705 . The second processing device 103 sends the data to be sent to the node device 101 .

[0122] Specifically, the second processing device 103 can send the collected data to be sent to the node device 101. Optionally, the second processing device 103 can actively send the data to be sent to the node device 101, and the node device 101 can also send a data acquisition request to the second processing device 103, so that the second processing device 103 can send the data to be sent to the node device 101 according to the data acquisition request. The data to be sent may include one or more data packets. Optionally, the second processing device 103 can send the data to be sent to the node device 101 when the preset sending time is reached. In this way, the node device 101 can regularly obtain the data to be sent of the second processing device 103.

[0123] 706. The node device 101 stores the data to be sent into a cache set.

[0124] Specifically, the node device 101 may store one or more data packets included in the received data to be sent in a cache set, which may be a cache area set by the node device 101. Then, before sending the data packet to the first processing device 101, the node device 101 may store all received data packets in the cache set. The first data packet and the second data packet may be any data packet in the cache set, for example: the cache set S = {x1, x2, x3…x n}, where n is a positive integer. Then the first data packet may be any data packet in the cache set S, and the second data packet may also be any data packet in the cache set S.

[0125] Specifically, steps 705 and 706 may be performed before steps 701 to 704 or after steps 701 to 704, which is not limited in the present invention.

[0126] 707. The node device 101 determines the time condition according to the connection address.

[0127] Specifically, the node device 101 determines the time condition according to the connection address sent by the first processing device 102. The time condition is the time condition that needs to be met for the data to be sent included in the cache set in the sending node device 101. The time condition can be a time point, for example: start sending at 20:48, or a time range, for example: wait for 20 minutes from the current time, and start sending after the waiting time is completed. Optionally, the time condition includes a reserved time, which is the time required for the loss and retransmission of data. Through this embodiment, the possibility of data loss and retransmission can be fully considered. If the previous node device of the node device 101 has not completed the transmission of the data packet after the time condition is reached, the previous node of the node device 101 can stop transmission, and the node device 101 starts to transmit the data packet. Through this embodiment, overlapping during transmission can be avoided.

[0128] Optionally, before executing step 707, the first processing device 102 may send a trigger instruction to the node device 101, the trigger instruction is used to trigger the node device 101 to determine the time condition according to the connection address and wait for timing. Through this embodiment, each node device can send data packets separately, realizing a time division multiple access transmission mode.

[0129] 708. The node device 101 determines whether the current time point meets the time condition.

[0130] Specifically, the node device 101 can determine whether the time condition has been met based on the current time point. For example: at 9 o'clock, the node device 101 receives the trigger instruction from the first processing device 102, and calculates that it can start transmitting the data to be sent after 60 minutes based on its own connection address. Then the waiting time is performed. When it is 10 o'clock, the node device 101 confirms that 60 minutes have passed, and confirms that the current time point meets the time condition of waiting for 60 minutes, and the data to be sent can be sent to the first processing device 102; if the current time point does not meet the time condition, it will continue to wait until the time point that meets the time condition is reached, and then send the data to be sent to the first processing device 102.

[0131] 709 . The node device 101 sends the data to be sent to the first processing device 102 in sequence.

[0132] Specifically, if the current time point meets the time condition, the node device 101 sequentially sends one or more data packets included in the data to be sent to the first processing device 102. The data to be sent includes one or more data packets, and the node device 101 can send the one or more data packets to the first processing device 102 one by one. The data to be sent includes a first data packet and a second data packet, wherein the relationship between the data to be sent and the first data packet and the second data packet can refer to the relevant description in step 706, which is not repeated here.

[0133] It can be seen that through the implementation Figure 7 In the described method, the node device 101 sends a connection request to the first processing device 102. The first processing device 102 generates a connection address corresponding to the node device 101 according to the access order of the node device 101, and sends the connection address to the node device 101. The node device 101 connects with the first processing device 102 according to the connection address to establish a wireless sensor network. The node device 101 receives the data to be sent collected by the second processing device 103, stores the data to be sent in the cache set of the node device 101, determines the time condition according to the connection address, and if the current time point meets the time condition, sends the data to be sent in the cache set to the first processing device 102. Through this embodiment, even in the case of a large number of node devices, the orderly transmission of data packets can still be achieved, and the time division multiple access data upload method is realized, which improves the transmission efficiency.

[0134] Based on the description of the above method embodiment, the embodiment of the present invention also proposes a data transmission device based on a low-power wireless sensor network. The data transmission device based on a low-power wireless sensor network can be a computer program (including program code) running in a processing device; see Figure 8 As shown, the data transmission device can run the following units:

[0135] The transceiver unit 801 is configured to send a first data packet to a first processing device, where the first data packet is a data packet transmitted in a first transmission mode;

[0136] The processing unit 802 is configured to count the number of successful transmissions of the data packets in the first transmission mode according to the first response information if the first response information matching the first data packet is received within a preset time range; and switch the first transmission mode to the second transmission mode if the number of successful transmissions reaches a switching threshold;

[0137] The transceiver unit 801 is further configured to send a second data packet and a first sequence number to the first processing device, wherein the second data packet matches the first sequence number and is a data packet transmitted using a second transmission mode.

[0138] In one implementation, the transceiver unit 801 may also be configured to receive a switching instruction from the first processing device;

[0139] The processing unit 802 may be further configured to switch the second transmission mode to the first transmission mode according to the switching instruction.

[0140] In another embodiment, the first data packet includes a first lost data packet processing unit 802, which is further configured to obtain the first lost data packet matching the first response information that has not been received if the first response information matching the first data packet is not received within a first preset time period;

[0141] The transceiver unit 801 may also be configured to send the first lost data packet to the first processing device.

[0142] In another embodiment, before sending the first data packet to the first processing device, the transceiver unit 801 may also be used to send a connection request to the first processing device, the connection request includes a node device identifier, the connection request is used to request to obtain a connection address, and the connection address is used to establish a connection with the first processing device;

[0143] The processing unit 802 may also be configured to receive the connection address and establish a connection with the first processing device according to the connection address.

[0144] In another embodiment, before sending the first data packet to the first processing device, the transceiver unit 801 may also be used to receive data to be sent from the second processing device;

[0145] The processing unit 802 may also be used to store the data to be sent into a cache set;

[0146] The transceiver unit 801 may also be configured to sequentially send the data to be sent to the first processing device, where the data to be sent includes the first data packet and the second data packet.

[0147] In another embodiment, before sending the first data packet to the first processing device, the processing unit 802 may also be used to determine a time condition according to the connection address, where the time condition is a time condition for sending the data to be sent;

[0148] The transceiver unit 801 may also be configured to send the data to be sent to the first processing device if the current time point satisfies the time condition, wherein the data to be sent includes the first data packet and the second data packet.

[0149] According to one embodiment of the present invention, Figure 2 , Figure 5, Figure 6 and Figure 7 Some of the steps involved in the data transmission method based on a low-power wireless sensor network shown can be executed by a processing unit in a data transmission device based on a low-power wireless sensor network. For example, Figure 2 Steps 201 and 208 shown in the figure may be executed by the transceiver unit 801; for example, Figure 2 Step 204 shown may be executed by the processing unit 802. According to another embodiment of the present invention, each unit in the data transmission device based on the low-power wireless sensor network may be separately or completely combined into one or more other units to form, or one (or more) of the units may be further divided into multiple functionally smaller units to form, which may achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention.

[0150] See also Fig. 9 The embodiment of the present invention also proposes a data transmission device based on a low-power wireless sensor network. The data transmission device can run the following units:

[0151] The transceiver unit 901 is configured to receive the first data packet from the node device;

[0152] The processing unit 902 is configured to generate, according to the first data packet, the first response information matching the first data packet;

[0153] The transceiver unit 901 is further configured to send the first response information to the node device; receive the second data packet and the first sequence number from the node device, the second data packet matches the first sequence number, and the second data packet is data transmitted using the second transmission mode;

[0154] The processing unit 902 is further configured to obtain a number of loss times if the first sequence number does not satisfy a sequence condition, where the number of loss times is a number of times that a sequence number does not satisfy the sequence condition within a preset sequence length range;

[0155] The transceiver unit 901 is further configured to send a switching instruction to the node device if the number of losses is greater than a fault tolerance threshold, wherein the switching instruction is configured to instruct the node device to switch the second transmission mode to the first transmission mode.

[0156] In one implementation, the second data packet includes a second lost data packet, and the transceiver unit 901 may be further configured to send a request for obtaining a second lost data packet matching the second sequence number if the first sequence number does not satisfy the sequence condition, the request for obtaining the second sequence number includes a second sequence number, the second sequence number is a sequence number preceding the first sequence number, and the request for obtaining the second lost data packet matching the second sequence number according to the second sequence number;

[0157] The second lost data packet matching the second sequence number is received.

[0158] In another embodiment, before receiving the first data packet from the node device, the transceiver unit 901 may also be used to receive the connection request from the node device, wherein the connection request includes a node device identifier;

[0159] The processing unit 902 may also be configured to determine an access order of the connection requests and generate the connection address according to the access order;

[0160] The transceiver unit 901 may also be configured to send the connection address to the node device according to the node device identifier.

[0161] It should be noted that Fig. 9 The contents not mentioned in the corresponding embodiments and the specific implementation methods of the steps executed by each unit can be found in Figure 2 , Figure 5 , Figure 6 and Figure 7 The embodiments shown in and the aforementioned contents are not repeated here.

[0162] See also Fig.10 , is a structural diagram of a data transmission device based on a low-power wireless sensor network provided by an embodiment of the present invention, the data transmission device includes a processor 1001, a memory 1002 and a communication interface 1003, the processor 1001, the memory 1002 and the communication interface 1003 are connected through at least one communication bus, the processor 1001 is configured to support the processing device to execute Figure 2 , Figure 5 , Figure 6 and Figure 7 The corresponding functions of the device are processed in the method.

[0163] The memory 1002 is used to store at least one instruction suitable for being loaded and executed by the processor. These instructions may be one or more computer programs (including program codes).

[0164] The communication interface 1003 is used to receive data and to send data. For example, the communication interface 1003 is used to send a first data packet.

[0165] In the embodiment of the present invention, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0166] Sending a first data packet to a first processing device through the communication interface 1003, where the first data packet is a data packet transmitted using a first transmission mode;

[0167] If a first response message matching the first data packet is received within a preset time range, counting the number of successful consecutive transmissions of data packets in the first transmission mode according to the first response message;

[0168] If the number of successes reaches the switching threshold, the first transmission mode is switched to the second transmission mode, and a second data packet and a first serial number are sent to the first processing device through the communication interface 1003. The second data packet matches the first serial number, and the second data packet is a data packet transmitted using the second transmission mode.

[0169] As an optional implementation, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0170] Receiving a switching instruction from the first processing device through the communication interface 1003;

[0171] According to the switching instruction, the second transmission mode is switched to the first transmission mode.

[0172] As an optional implementation manner, the first data packet includes a first lost data packet, and the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0173] If the first response information matching the first data packet is not received within a first preset time period, acquiring the first lost data packet matching the first response information that has not been received;

[0174] The first lost data packet is sent to the first processing device through the communication interface 1003 .

[0175] As an optional implementation, before sending the first data packet to the first processing device, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0176] Sending a connection request to the first processing device through the communication interface 1003, the connection request including a node device identifier, the connection request being used to request to obtain a connection address, and the connection address being used to establish a connection with the first processing device;

[0177] The connection address is received through the communication interface 1003, and a connection is established with the first processing device according to the connection address.

[0178] As an optional implementation, before sending the first data packet to the first processing device, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0179] receiving data to be sent from the second processing device via the communication interface 1003;

[0180] Storing the data to be sent in a cache set;

[0181] The data to be sent are sent to the first processing device in sequence through the communication interface 1003 , and the data to be sent include the first data packet and the second data packet.

[0182] As an optional implementation, before sending the first data packet to the first processing device, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0183] Determine a time condition according to the connection address, the time condition being a time condition for sending the data to be sent;

[0184] If the current time point meets the time condition, the data to be sent is sent to the first processing device through the communication interface 1003, and the data to be sent includes the first data packet and the second data packet.

[0185] Furthermore, the processor 1001 may also cooperate with the communication interface 1003 to execute Figure 2 , Figure 5 , Figure 6 and Figure 7 For the corresponding operations in the embodiment shown in , please refer to the description in the method embodiment, which will not be repeated here.

[0186] See also Fig.10 , is a structural diagram of a data transmission device based on a low-power wireless sensor network provided by an embodiment of the present invention, the data transmission device includes a processor 1001, a memory 1002 and a communication interface 1003, the processor 1001, the memory 1002 and the communication interface 1003 are connected through at least one communication bus, the processor 1001 is configured to support the processing device to execute Figure 2 , Figure 5 , Figure 6 and Figure 7 The corresponding functions of the device are processed in the method.

[0187] In the embodiment of the present invention, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0188] receiving the first data packet from the node device through the communication interface 1003, and generating the first response information matching the first data packet according to the first data packet;

[0189] Sending the first response information to the node device through the communication interface 1003;

[0190] receiving the second data packet and the first sequence number from the node device through the communication interface 1003, wherein the second data packet matches the first sequence number, and the second data packet is data transmitted using the second transmission mode;

[0191] If the first sequence number does not satisfy the sequence condition, obtaining the number of losses, where the number of losses is the number of times within a preset sequence length that a sequence number does not satisfy the sequence condition;

[0192] If the number of losses is greater than the fault tolerance threshold, a switching instruction is sent to the node device through the communication interface 1003, and the switching instruction is used to instruct the node device to switch the second transmission mode to the first transmission mode.

[0193] As an optional implementation manner, the second data packet includes a second lost data packet, and the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0194] If the first sequence number does not meet the sequence condition, an acquisition request is sent through the communication interface 1003, and the acquisition request includes a second sequence number, where the second sequence number is the previous sequence number of the first sequence number, and the acquisition request is used to request to obtain a second lost data packet matching the second sequence number based on the second sequence number.

[0195] The second lost data packet matching the second sequence number is received through the communication interface 1003 .

[0196] As an optional implementation manner, before receiving the first data packet from the node device, the processor 1001 may call the program code stored in the memory 1002 to perform the following operations:

[0197] Receiving the connection request from the node device through the communication interface 1003, the connection request including the node device identification;

[0198] Determining an access order of the connection requests, and generating the connection address according to the access order;

[0199] The connection address is sent to the node device through the communication interface 1003 according to the node device identification.

[0200] Furthermore, the processor 1001 may also cooperate with the communication interface 1003 to execute Figure 2 , Figure 5 , Figure 6 and Figure 7 For the corresponding operations in the embodiment shown in , please refer to the description in the method embodiment, which will not be repeated here.

[0201] The embodiment of the present invention also provides a computer-readable storage medium (Memory), which can be used to store Figure 2 , Figure 5 , Figure 6 and Figure 7 The computer software instructions used by the processing device in the embodiment shown in the figure also store at least one instruction suitable for being loaded and executed by the processor in the storage space. These instructions can be one or more computer programs (including program codes).

[0202] The computer-readable storage medium includes but is not limited to a flash memory, a hard disk, and a solid-state drive.

[0203] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0204] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0205] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A data transmission method based on a low-power wireless sensor network, characterized in that: The method comprises: Sending a first data packet to a first processing device, where the first data packet is a data packet transmitted in a first transmission mode, and the first data packet includes a first lost data packet; If a first response message matching the first data packet is received within a preset time range, counting the number of successful consecutive transmissions of data packets in the first transmission mode according to the first response message; If the number of successes reaches the switching threshold, the first transmission mode is switched to the second transmission mode, and a second data packet and a first sequence number are sent to the first processing device, the second data packet matches the first sequence number, and the second data packet is a data packet transmitted using the second transmission mode; If the first response information matching the first data packet is not received within the preset time range, the number of successes is recorded as 0, the number of successes is recounted, and the first lost data packet is sent to the first processing device.

2. The method according to claim 1, characterized in that The method further comprises: receiving a switching instruction from the first processing device; According to the switching instruction, the second transmission mode is switched to the first transmission mode.

3. The method according to claim 1, characterized in that Before sending the first data packet to the first processing device, the method further includes: Sending a connection request to the first processing device, the connection request including a node device identifier, the connection request being used to request to obtain a connection address, the connection address being used to establish a connection with the first processing device; The connection address is received, and a connection is established with the first processing device according to the connection address.

4. The method according to claim 3, characterized in that Before sending the first data packet to the first processing device, the method further includes: receiving data to be sent from a second processing device; Storing the data to be sent in a cache set; The data to be sent are sent to the first processing device in sequence, wherein the data to be sent includes the first data packet and the second data packet.

5. The method according to claim 4, characterized in that Before sending the first data packet to the first processing device, the method further includes: Determine a time condition according to the connection address, the time condition being a time condition for sending the data to be sent; If the current time point meets the time condition, the data to be sent is sent to the first processing device, and the data to be sent includes the first data packet and the second data packet.

6. A data transmission method based on a low-power wireless sensor network, characterized in that: The method comprises: receiving a first data packet from a node device, and generating first response information matching the first data packet according to the first data packet, wherein the first data packet is a data packet transmitted in a first transmission mode, and the first data packet includes a first lost data packet; Sending the first response information to the node device, where the first response information is used by the node device to count the number of successful consecutive transmissions of data packets in the first transmission mode; receiving a second data packet and a first sequence number from the node device, the second data packet matching the first sequence number, the second data packet being data transmitted in a second transmission mode, the second transmission mode being obtained by the node device switching when the number of successes reaches a switching threshold; If the first sequence number does not satisfy the sequence condition, obtaining the number of losses, where the number of losses is the number of times within a preset sequence length that a sequence number does not satisfy the sequence condition; If the number of losses is greater than the fault tolerance threshold, sending a switching instruction to the node device, the switching instruction is used to instruct the node device to switch the second transmission mode to the first transmission mode; A first lost data packet is received from a node device, where the first lost data packet is sent when the node device does not receive the first response information matching the first data packet within a preset time range.

7. The method according to claim 6, characterized in that The second data packet includes a second lost data packet, and the method further includes: If the first sequence number does not meet the sequence condition, sending an acquisition request, the acquisition request including a second sequence number, the second sequence number being a sequence number preceding the first sequence number, the acquisition request being used to request, according to the second sequence number, to acquire a second lost data packet matching the second sequence number; The second lost data packet matching the second sequence number is received.

8. The method according to claim 6, characterized in that Before receiving the first data packet from the node device, the method further includes: receiving a connection request from the node device, wherein the connection request includes a node device identifier; Determining an access order of the connection requests, and generating a connection address according to the access order; The connection address is sent to the node device according to the node device identifier.

9. A data transmission device based on a low-power wireless sensor network, characterized in that: include: A transceiver unit, configured to send a first data packet to a first processing device, wherein the first data packet is a data packet transmitted in a first transmission mode, and the first data packet includes a first lost data packet; a processing unit, configured to count the number of successful consecutive transmissions of data packets in the first transmission mode according to the first response information if a first response information matching the first data packet is received within a preset time range; If the number of successes reaches a switching threshold, switching the first transmission mode to a second transmission mode; The transceiver unit is further used to send a second data packet and a first sequence number to the first processing device, the second data packet matches the first sequence number, and the second data packet is a data packet transmitted using a second transmission mode; The processing unit is further configured to record the number of successes as 0, re-count the number of successes, and send the first lost data packet to the first processing device if the first response information matching the first data packet is not received within the preset time range.

10. A data transmission device based on a low-power wireless sensor network, characterized in that: The invention comprises a processor, a memory and a communication interface, wherein the processor, the memory and the communication interface are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the data transmission method based on a low-power wireless sensor network as described in any one of claims 1 to 5; or execute the data transmission method based on a low-power wireless sensor network as described in any one of claims 6 to 8.