Method, device and medium for processing wireless communication data packet loss
By synchronizing the gateway time and device-side response judgment, the problem of synchronous frequency interference in LoRa wireless communication is solved, and the timeliness and transmission distance of LoRa communication is unified, ensuring the stability and reliability of data transmission.
Patent Information
- Application Number
- CN202211707872.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The existing LoRa wireless communication is susceptible to homofrequency interference, resulting in air packet collisions between the corresponding gateways of multiple terminal devices, making it difficult to unify the timeliness of communication and the reliability of transmission distance.
By synchronizing the gateway time, the server controls the gateway sending time entry point, adopts the corresponding response judgment and code return optimization of the device side to realize half-duplex mode, avoids the same frequency packet collision between the gateways, and optimizes the data communication status.
In the case of low LoRa, the coexistence of the transmit state and the receiving state is realized, solving the problem of few downlink channels of the gateway, and ensuring the timeliness of communication and the reliability of transmission distance.
Smart Images

Figure CN116133006B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a method, device, and medium for processing wireless communication data packet loss. Background Art
[0002] LoRa is a wireless communication technology designed for long-distance, low-power communications. Its modulation method significantly increases the communication distance compared to other communication methods. It can be widely used in a variety of long-distance, low-rate IoT wireless communications, such as automatic meter reading, building automation equipment, wireless security systems, and industrial monitoring and control.
[0003] Existing LoRa wireless communications often use a single gateway for multiple terminals, resulting in a limited number of downlink channels. Furthermore, to maintain a certain transmission distance, the lower the LoRa communication rate, the higher the reliability. This results in a conflict between communication timeliness and other performance indicators, making it difficult to achieve uniformity. Furthermore, LoRa communications are susceptible to co-frequency interference. Multiple devices transmitting on the same frequency can cause over-the-air packet collisions, leading to data corruption. Summary of the Invention
[0004] The embodiments of the present application provide a method, device, and medium for processing wireless communication data packet loss, which are used to solve the following technical problems: existing LoRa wireless communications are susceptible to co-frequency interference, resulting in mutual over-the-air packet collisions between gateways corresponding to multiple terminal devices at the same frequency.
[0005] The embodiments of this application adopt the following technical solutions:
[0006] On the one hand, an embodiment of the present application provides a method for processing wireless communication data packet loss, including: obtaining the device number of the device end according to the usage scenario of the server end; performing gateway time calibration on each data according to the device number sent by the server end, and determining the data sending time of the server end; based on the data sending time and the area ranges of several gateways, performing overlapping range screening on the area ranges to determine the data communication status of the gateway; based on the device number and the data communication status, performing response judgment on the device end, obtaining a response result, and sending the data in the server end in sequence.
[0007] The embodiment of the present application synchronizes the gateway time, and the server controls the gateway sending time entry point to avoid packet collision when sending the same frequency between different gateways. At the same time, the device side optimizes the judgment of the response return code, realizing a half-duplex mode in which the sending state and the receiving state coexist, solving the problems of one gateway corresponding to multiple device ends and few gateway downlink channels, while ensuring a certain transmission distance. In the case of low-speed Lora communication, the timeliness of communication and the reliability of transmission distance coexist, achieving the greatest degree of mutual unity.
[0008] In a feasible implementation, according to the usage scenario of the server, the device number of the device end is obtained, specifically including: based on the preset usage scenario of the device end, a number of the device ends are grouped by the server to obtain a group number; the sending data corresponding to the group number is obtained; and according to the sending data, the device number corresponding to each device end in the group number is obtained.
[0009] In a feasible implementation, gateway time is performed on each piece of data according to the device number sent by the server to determine the data sending time corresponding to the server, specifically including: obtaining the device number through the server; obtaining the single sending time of each piece of data in the server according to the device number; and performing gateway time-synchronization on the single sending time of each piece of data through a preset TCP timing to obtain the data sending time corresponding to the server; wherein the time synchronization difference of the gateway time synchronization is less than or equal to 20ms.
[0010] In a feasible implementation, based on the data transmission time and the area ranges of several gateways, the area ranges are screened for overlapping ranges to determine the data communication status of the gateways, specifically including: if the coverage area of the first gateway and the coverage area of the second gateway are overlapping area ranges, then according to a preset gateway order, the first gateway and the second gateway are sequentially communicating data with the same frequency, and corresponding data communication states are sequentially obtained; wherein the data communication status includes: sending state, receiving state, and waiting to receive state.
[0011] In a feasible implementation, based on the data transmission time and the area ranges of several gateways, the area ranges are screened for overlapping ranges to determine the data communication status of the gateways, specifically including: if the coverage area of the first gateway and the coverage area of the second gateway are non-overlapping area ranges, the first gateway and the second gateway are simultaneously communicating data at the same frequency to obtain the same data communication status.
[0012] In a feasible implementation, the first gateway and the second gateway communicate data with the same frequency in sequence, specifically including: if the data with the same frequency is data with the same content, the first gateway and the second gateway simultaneously obtain the same data communication state; if the data with the same frequency is data with different content, the first gateway and the second gateway are sequentially communicated with the data at staggered times according to the built-in time parameters of the data with different content, and the staggered data communication states are sequentially obtained.
[0013] The embodiment of the present application identifies the overlapping areas of gateways so that the data packets of gateways in the two overlapping areas will not collide with each other, and the data packets in the non-overlapping areas are sent simultaneously, thereby reducing the conflicts of data packets with the same frequency and achieving time saving.
[0014] In a feasible implementation manner, a response judgment is performed on the device side according to the device number and the data communication status to obtain a response result so as to sequentially send the data in the server side, specifically including: obtaining the device number of the server side; obtaining the device data communication status of the device side; wherein the device data communication status corresponds to the data communication status of the gateway; performing a response return code judgment on the device data communication status according to the data communication frequency of the gateway and the device number; wherein the response return code is a protocol code indicating reception; if the response result is that a return code needs to be sent, the return code corresponding to the gateway output data in the device side is sent back to realize normal reception of the gateway output data by the device side; if the response result is that a return code does not need to be sent, the gateway output data is sent sequentially according to the preset configuration parameters of the gateway, and the device data communication status is changed accordingly.
[0015] This application optimizes the selection of the response code to ensure that the device can receive the data normally when the gateway outputs the data, and uses the gateway output data to resend it in sequence, which can switch the device from the time-consuming sending state to the waiting state to the stable and fast state, thereby realizing the optimization of the response code.
[0016] In a feasible implementation manner, the state switching time of the device data communication state in the device end is less than the single packet data time interval of the gateway output data.
[0017] In a second aspect, an embodiment of the present application also provides a wireless communication data packet loss processing device, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a wireless communication data packet loss processing method described in any of the above embodiments.
[0018] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium, characterized in that the storage medium is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each of which includes instructions, and when the instructions are executed by the terminal, the terminal executes a wireless communication data packet loss processing method described in any of the above embodiments.
[0019] The present application provides a method, device and medium for processing wireless communication data packet loss. By synchronizing gateway time, the server controls the gateway sending time entry point to avoid packet collision when different gateways send the same frequency. At the same time, the device side optimizes the judgment of the response return code, realizing a half-duplex mode in which the sending state and the receiving state coexist, solving the problems of one gateway corresponding to multiple device ends and the few downlink channels of the gateway, while ensuring a certain transmission distance. In the case of low Lora communication rate, the timeliness of communication and the reliability of transmission distance coexist, achieving the greatest degree of mutual unity. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0021] Figure 1 A flow chart of a method for processing wireless communication data packet loss provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a gateway overlapping area provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of a wireless communication data packet loss processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions in this application, the following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0025] The present application provides a method for processing wireless communication data packet loss, such as Figure 1 As shown, the wireless communication data packet loss processing method specifically includes steps S101-S104:
[0026] It should be noted that this application is a method for processing wireless communication data packet loss for LoRa (a wireless communication technology dedicated to long-distance and low-power consumption), in which the data communication between the server, gateway, and device ends is all based on LoRa communication data transmission, data identification, and data processing.
[0027] S101. Obtain the device ID of the device according to the usage scenario of the server.
[0028] Specifically, based on the preset usage scenarios of the device terminals, the server terminal groups the plurality of device terminals to obtain group numbers, obtains the transmission data corresponding to the group numbers, and obtains the device number corresponding to each device terminal in the group number based on the transmission data.
[0029] As a feasible implementation, the server groups devices based on usage scenarios. Each device receives its current group number upon power-up. The server then sends data to each grouped device, sending only one data packet per group. All devices in the group can receive data simultaneously.
[0030] S102: Perform gateway time calibration on each piece of data according to the device number sent by the server to determine the data sending time corresponding to the server.
[0031] Specifically, the server obtains the device number. Based on the device number, the server obtains the single send time of each piece of data. Using the preset TCP timing, the gateway synchronizes the single send time of each piece of data to obtain the data send time corresponding to the server. The time synchronization error of the gateway synchronization is less than or equal to 20ms.
[0032] As a feasible implementation, the server controls the time at which each piece of data is sent and regularly calibrates the gateway via TCP, achieving a time synchronization error of no more than 20ms. In other words, the gateway's time is regularly calibrated within a controllable range, and the server configures the specific time at which the gateway sends each piece of data.
[0033] S103: Based on the data sending time and the area ranges of several gateways, overlapping area ranges are screened to determine the data communication status of the gateways.
[0034] Specifically, if the coverage area of the first gateway overlaps with the coverage area of the second gateway, the first gateway and the second gateway will communicate data on the same frequency in sequence according to the preset gateway order, and obtain corresponding data communication states in sequence. The data communication states include: sending state, receiving state, and waiting to receive state.
[0035] If the data transmitted at the same frequency is data with the same content, the first and second gateways simultaneously obtain the same data communication state. If the data transmitted at the same frequency is data with different content, staggered data communication is performed on the first and second gateways in sequence according to the built-in time parameters of the different content data, resulting in staggered data communication states.
[0036] If the coverage area of the first gateway and the coverage area of the second gateway are non-overlapping areas, the first gateway and the second gateway are configured to simultaneously perform data communication at the same frequency to obtain the same data communication state.
[0037] In one embodiment, Figure 2 A schematic diagram of a gateway overlapping area provided in an embodiment of the present application is shown as follows: Figure 2 As shown in the figure, in actual applications, there will be signal coverage blind spots when the gateways are far apart. Figure 2 Usage scenario. To improve the timeliness of device reception, Figure 2 Gateways 1 and 2 overlap partially. To prevent packets from colliding, they must be sent sequentially. However, Gateway 3 only overlaps with Gateway 2, so it can send packets simultaneously with Gateway 1 without conflict. Similarly, each gateway network can achieve time savings through algorithms.
[0038] As a feasible implementation method, gateway time is synchronized, and the server controls the gateway's transmission start point to avoid packet collisions when sending packets on the same frequency between gateways. When the gateways do not overlap, the starting point of the same-frequency transmission is not restricted. When the gateways overlap, the starting point of the same-frequency transmission needs to be queued and sent in the order of the gateways. It is also possible to configure relevant parameters to control the gateways in the overlapping area, allowing the same content data to be sent simultaneously, different content data to be sent at staggered times, and gateways in non-overlapping areas to communicate the same-frequency data simultaneously.
[0039] S104: Based on the device number and data communication status, the device side is judged for response, and a response result is obtained to sequentially send the data in the server side.
[0040] Specifically, the device ID of the server is obtained, and the device data communication status of the device is obtained. The device data communication status corresponds to the data communication status of the gateway.
[0041] Furthermore, according to the data communication frequency of the gateway and the device number, the data communication status of the device is judged by the response code, wherein the response code is a protocol code indicating reception.
[0042] If the response result indicates that a return code needs to be sent, the return code corresponding to the gateway output data on the device side will be sent back to ensure that the device side can normally receive the gateway output data. If the response result indicates that a return code is not required, the gateway output data will be sent in sequence according to the preset configuration parameters of the gateway, and the device data communication status will be changed accordingly.
[0043] The time taken for switching the data communication state of the device on the device side is less than the single packet data time interval of the gateway output data.
[0044] In one embodiment, even if the Lora same-frequency communication packet is not for this device, it needs to be discarded after receiving and processing. When the frequency of the gateway sending data is relatively high, the device side will frequently enter the receiving and waiting to receive states, that is, the device data communication state. If there is a response code, it will enter the sending state again. It takes a relatively long time for the device side to switch from the sending state to the waiting to receive state, and it greatly affects the stability of reception. The response code is to ensure that the gateway sends this time so that the device side can normally receive the gateway output data. And using the gateway output data to resend in sequence can switch the device side from the time-consuming state of the sending state to the waiting to receive state to a stable and fast state, thereby achieving optimal selection of the response code. At the same time, the device side will respond to the server side based on the device number and communication status; the server side will confirm whether to retry multiple times or wait for the device side to respond based on the device number.
[0045] In addition, the embodiment of the present application also provides a wireless communication data packet loss processing device, such as Figure 3 As shown, the wireless communication data packet loss processing device 300 specifically includes:
[0046] At least one processor 301; and a memory 302 in communication with the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301, so as to enable the at least one processor 301 to perform:
[0047] Get the device ID of the device based on the usage scenario of the server.
[0048] According to the device number sent by the server, the gateway calibrates the time of each data to determine the data sending time corresponding to the server;
[0049] Based on the data sending time and the area ranges of several gateways, the overlapping area ranges are screened to determine the data communication status of the gateway;
[0050] According to the device number and data communication status, the device side is judged to respond and the response result is obtained to send the data in the server side in sequence.
[0051] The embodiments of the present application provide a method, device and medium for processing wireless communication data packet loss. By synchronizing gateway time, the server controls the gateway sending time entry point to avoid packet collision when sending the same frequency between different gateways. At the same time, the device side optimizes the judgment of the response return code, realizing a half-duplex mode in which the sending state and the receiving state coexist, solving the problems of one gateway corresponding to multiple device ends and the few downlink channels of the gateway, while ensuring a certain transmission distance. In the case of low-speed LoRa communication, the timeliness of communication and the reliability of the transmission distance coexist, achieving the greatest degree of mutual unity.
[0052] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device and medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.
[0053] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0054] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0055] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0056] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0057] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0058] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0059] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0060] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0061] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0062] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for processing wireless communication data packet loss, characterized in that: The method comprises: Get the device ID of the device based on the usage scenario of the server. Performing gateway time calibration on each piece of data according to the device number sent by the server to determine the data sending time corresponding to the server; Based on the data sending time and the area ranges of several gateways, overlapping range screening is performed on the area ranges to determine the data communication status of the gateways; According to the device number and the data communication status, a response judgment is performed on the device end to obtain a response result so as to sequentially send the data in the server end, specifically including: Obtain the device number of the server; Acquire the device data communication status of the device end; wherein the device data communication status corresponds to the data communication status of the gateway; According to the data communication frequency of the gateway and the device number, a response code is determined for the data communication status of the device; wherein the response code is a protocol code indicating reception; If the response result indicates that a return code needs to be sent, the return code corresponding to the gateway output data in the device side is sent back to enable the device side to normally receive the gateway output data; If the response result is that a return code does not need to be sent, the gateway output data is sent in sequence according to the preset configuration parameters of the gateway, and the device data communication state is changed accordingly; Among them, the data communication between the server, the gateway and the device is based on data transmission, data identification and data processing under LoRa communication.
2. A method for processing wireless communication data packet loss according to claim 1, characterized in that: According to the usage scenario of the server, obtain the device ID of the device, including: Based on the preset usage scenarios of the device terminals, the server terminal groups the plurality of the device terminals to obtain group numbers; Acquire the transmission data corresponding to the group number; According to the sent data, the device number corresponding to each device end in the group number is obtained.
3. The method for processing wireless communication data packet loss according to claim 1, wherein: According to the device number sent by the server, gateway time calibration is performed on each piece of data to determine the data sending time corresponding to the server, specifically including: Obtain the device number through the server; According to the device number, obtain the single sending time of each data in the server; Through the preset TCP timing, the single sending time of each data is gateway-synchronized to obtain the data sending time corresponding to the server; wherein the time synchronization difference of the gateway timing is less than or equal to 20ms.
4. The method for processing wireless communication data packet loss according to claim 1, wherein: Based on the data transmission time and the area ranges of several gateways, overlapping range screening is performed on the area ranges to determine the data communication status of the gateways, specifically including: If the coverage area of the first gateway overlaps with the coverage area of the second gateway, the first gateway and the second gateway are sequentially used to communicate data at the same frequency according to a preset gateway order, and corresponding data communication states are obtained in sequence; wherein the data communication states include: sending state, receiving state, and waiting to receive state.
5. The method for processing wireless communication data packet loss according to claim 4, wherein: Based on the data transmission time and the area ranges of several gateways, overlapping range screening is performed on the area ranges to determine the data communication status of the gateways, specifically including: If the coverage area of the first gateway and the coverage area of the second gateway are non-overlapping areas, the first gateway and the second gateway are configured to simultaneously perform data communication with the same frequency to obtain the same data communication state.
6. A method for processing wireless communication data packet loss according to claim 4, characterized in that: The first gateway and the second gateway sequentially communicate same-frequency data, specifically including: If the same-frequency data is data with the same content, the first gateway and the second gateway simultaneously obtain the same data communication state; If the same-frequency data is data of different contents, staggered data communication is performed on the first gateway and the second gateway in sequence according to the built-in time parameters of the data of different contents, and staggered data communication states are obtained in sequence.
7. The method for processing wireless communication data packet loss according to claim 1, wherein: The time taken for the state switching of the device data communication state in the device end is less than the single packet data time interval of the gateway output data.
8. A wireless communication data packet loss processing device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute the method for processing wireless communication data packet loss according to any one of claims 1-7.
9. A non-volatile computer storage medium, characterized in that The storage medium is a non-volatile computer-readable storage medium, which stores at least one program. Each program includes instructions. When the instructions are executed by the terminal, the terminal executes the wireless communication data packet loss processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
LoRa gateway with channel self-adaption function and network system based on LoRa gateway
CN107801172A
Time synchronization method, device and system and computer storage medium
CN110677212A