A breakpoint continuation control method and system based on LORA

By numbering the LoRa terminal program files and controlling breakpoint resume, the transmission interruption problem during the program upgrade process was solved, ensuring file integrity and upgrade success rate.

CN116319734BActive Publication Date: 2026-01-13MH ROBOT & AUTOMATION
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211557677.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2026-01-13
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

During the upgrade process of LoRa terminal products, transmission interruptions and prolonged connection failures are prone to occur, resulting in data block loss and upgrade failure.

Method used

By numbering the program files and resuming transmission according to the number of data frames already received by the terminal, the breakpoint location can be determined, ensuring the integrity of the program files.

Benefits of technology

It improved the success rate of program upgrades, ensured the integrity of program files, and enhanced the reliability of the upgrade process after network recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319734B_ABST
    Figure CN116319734B_ABST
Patent Text Reader

Abstract

The application provides a breakpoint continuation control method and system based on LORA, and relates to the technical field of communication. The method is used for an ad hoc network system, the ad hoc network system comprises a gateway and a terminal, the gateway and the terminal are connected in communication, and comprises the following steps: acquiring a program file, sequentially numbering the program file according to a first frame number; receiving a waiting program upgrade message sent by the terminal, sending the program file according to the number, and receiving a second frame number fed back by the terminal; detecting the network state between the gateway and the terminal, sending an upgrade query message to the terminal in the case that the first frame number and the second frame number are not equal and the network state is abnormal; determining a breakpoint position according to the data frame number fed back by the terminal; determining the program file after the breakpoint according to the breakpoint position, and sending the program file after the breakpoint to the terminal. Through the method, the integrity of the program file in the upgrading process can be ensured, and the success rate of upgrading is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of communication, and particularly relates to a breakpoint resuming transmission control method and system based on LORA. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art known to those skilled in the art.

[0003] LORA technology was developed by France and Switzerland about ten years ago, and by now, LORA technology has become an indispensable part of the development and application of the Internet of Things. More and more gateways and terminal devices are applied to various scenes of the Internet of Things, and with the enrichment of system functions, the number of gateways and terminals in each scene is also increasing.

[0004] At present, the LORA terminal product program upgrade mostly adopts a local connection mode, and in the program upgrade process, transmission breakpoints are prone to occur, and even long-time connection failure occurs. When the network recovers, if the data block sent by the gateway is continued to be sent, data block loss may occur, resulting in upgrade failure. SUMMARY

[0005] In order to solve the above problems, the present application provides a breakpoint resuming transmission control method and system based on LORA, which numbers the program file and resumes transmission according to the data frame number received by the terminal during resuming transmission, so as to ensure the integrity of the program file and improve the success rate of upgrade.

[0006] In order to achieve the above purpose, the present application mainly includes the following aspects:

[0007] In a first aspect, the present application provides a breakpoint resuming transmission control method based on LORA, which is used in an ad hoc network system, the ad hoc network system includes a gateway and a terminal, the gateway and the terminal are connected in communication, and the method comprises the following steps:

[0008] Obtaining a program file, sequentially numbering the program file according to a first frame number;

[0009] Receiving a waiting program upgrade message sent by the terminal, sending the program file according to the number, and receiving a second frame number fed back by the terminal;

[0010] Detecting the network state between the gateway and the terminal, and sending an upgrade query message to the terminal in the case that the first frame number and the second frame number are not equal and the network state is abnormal;

[0011] Determining the breakpoint position according to the data frame number fed back by the terminal;

[0012] Determine a program file after the breakpoint according to the breakpoint position, and send the program file after the breakpoint to the terminal.

[0013] In a possible implementation, the method for establishing the ad hoc network comprises:

[0014] establishing a communication channel between the gateway and the terminal;

[0015] The gateway broadcasts an in-network query packet every preset time.

[0016] Receiving the in-network request packet sent by the terminal, adding the terminal to the ad hoc network, and allocating a new communication channel to the terminal; wherein, after receiving the query packet, the terminal feeds back an in-network request packet.

[0017] In a possible implementation, the method for establishing the ad hoc network comprises:

[0018] establishing a communication channel between the gateway and the terminal;

[0019] After the terminal completes program initialization, if no query packet broadcasted by the gateway is received within a preset time period, the terminal actively sends an in-network request packet to the gateway;

[0020] The gateway receives the in-network request packet on the network channel, judges whether the terminal meets the in-network condition, if the terminal meets the in-network condition, sends an in-network success packet to the terminal, and allocates a communication channel to the terminal.

[0021] In a possible implementation, if the terminal fails to enter the network, the terminal sends an in-network request packet again; when the number of request failures is greater than a preset number threshold, the terminal enters a sleep state, and after the sleep state ends, the terminal continues to send an in-network request packet.

[0022] In a possible implementation, after sequentially numbering the first frame number of the program file, before receiving the waiting program upgrade packet sent by the terminal, the method further comprises: sending an upgrade query packet, wherein the upgrade packet comprises an identity of the terminal and an upgrade program version number of the program file;

[0023] Receiving the terminal program version number fed back by the terminal, if it is determined that the terminal program version number and the upgrade program version number are different, sending a program upgrade configuration packet to the terminal, and receiving the waiting program upgrade packet fed back by the terminal.

[0024] In a possible implementation, the method further comprises: in the case that the first frame number and the second frame number are not equal and the network state is normal, receiving a retransmission request sent by the terminal, and re-sending the program file according to the numbering.

[0025] In a possible implementation, the method further includes: if the first frame number and the second frame number are equal, sending an upgrade end message to the terminal, the upgrade end message being used to instruct the terminal to end the upgrade state and jump to a program running after the upgrade.

[0026] In a second aspect, the embodiments of the present application further provide a breakpoint resuming transmission control system based on LORA, used in an ad hoc network system, the ad hoc network system including a gateway and a terminal, the gateway and the terminal being communicatively connected, and including:

[0027] The acquisition module is configured to acquire a program file and sequentially number the program file according to a first frame number.

[0028] The transceiver module is configured to receive a waiting program upgrade message sent by the terminal, send the program file according to the number, and receive a second frame number fed back by the terminal.

[0029] The detection module is configured to detect a network state between the gateway and the terminal, and send an upgrade query message to the terminal in a case where the first frame number and the second frame number are not equal and the network state is abnormal.

[0030] The determination module is configured to determine a breakpoint position according to the data frame number fed back by the terminal.

[0031] The resuming transmission module is configured to determine a program file after the breakpoint according to the breakpoint position, and send the program file after the breakpoint to the terminal.

[0032] In a possible implementation, the detection module is further configured to, in a case where the first frame number and the second frame number are not equal and the network state is normal, receive a retransmission request sent by the terminal, and resend the program file according to the number.

[0033] In a possible implementation, the detection module is further configured to, if the first frame number and the second frame number are equal, send an upgrade end message to the terminal, the upgrade end message being used to instruct the terminal to end the upgrade state and jump to a program running after the upgrade.

[0034] The above one or more technical solutions have the following beneficial effects:

[0035] The application provides a breakpoint resuming control method based on LORA, the program file is sequentially numbered, and the program file is sent to the terminal according to the number, in the case that the first frame number of sending is not equal to the second frame number received by the terminal and the network state is abnormal, the data frame number fed back by the terminal is inquired and the breakpoint position is determined, and the program file after the breakpoint is sent to the terminal according to the breakpoint position. In this way, when the transmission breakpoint appears, the breakpoint position is determined according to the data received by the terminal and the resuming is started, the integrity of the program file in the upgrading process is ensured, and therefore the success rate of upgrading is improved. BRIEF DESCRIPTION OF DRAWINGS

[0036] The accompanying drawings, which form a part of this specification, are included to provide a further understanding of the application and are incorporated by reference herein. The embodiments illustrated in the drawings are presented by way of example in explaining the present application and are not meant to limit the present application.

[0037] Figure 1 is one of flow diagrams of the self-organizing network establishment method provided by the embodiment one of the application;

[0038] Figure 2 is the second flow diagram of the self-organizing network establishment method provided by the embodiment one of the application;

[0039] Figure 3 is the flow diagram of the program upgrading method in the self-organizing network system provided by the embodiment one of the application;

[0040] Figure 4 is the flow diagram of the breakpoint resuming control method based on LORA provided by the embodiment one of the application. DETAILED DESCRIPTION

[0041] The application will be further described below in conjunction with the drawings and embodiments.

[0042] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0043] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a presence of the features, steps, operations, devices, components and / or combinations thereof.

[0044] Embodiment one

[0045] The embodiment provides a breakpoint resuming transmission control method based on LORA, which is used for an ad hoc network system, the ad hoc network system comprises a gateway and a terminal, the gateway and the terminal are connected in communication with each other, and the ad hoc network system comprises the following steps.

[0046] Obtaining a program file, sequentially numbering according to a first frame number of the program file;

[0047] Receiving a waiting program upgrade message sent by the terminal, sending the program file according to the number, and receiving a second frame number fed back by the terminal;

[0048] Detecting a network state between the gateway and the terminal, and sending an upgrade query message to the terminal in the case that the first frame number and the second frame number are not equal and the network state is abnormal;

[0049] Determining a breakpoint position according to a data frame number fed back by the terminal;

[0050] Determining a program file after the breakpoint according to the breakpoint position, and sending the program file after the breakpoint to the terminal.

[0051] In the specific implementation, the breakpoint resuming transmission control method based on LORA provided by the embodiment can be applied to an ad hoc network system, the ad hoc network system comprises a gateway and a terminal, and the gateway and the terminal can be connected in communication through a wired communication network or a wireless communication network. First, the terminal needs to be added to the network of the LoRa ad hoc network through a network access process of the ad hoc network, and the establishment method of the ad hoc network comprises the following several ways.

[0052] (1) A communication channel 0 between the gateway and the terminal is established; the gateway broadcasts a network access query message every preset time (for example, 1 min); if a terminal receives the query message on the communication channel 0, a network access request message with terminal ID, position and other information is replied, and the gateway adds the terminal to the ad hoc network and allocates a new communication channel 1 to the terminal after receiving the reply message within a timeout time. The terminal receives a network access success message and modifies the LoRa frequency band to the channel 1, and the establishment process of the ad hoc network is as shown in Figure 1 .

[0053] (2) In the programs of the gateway and the terminal, a communication channel 0 is set for networking, after the program initialization of the terminal is completed, if the terminal does not receive the query access message broadcast on the networking channel by the gateway for more than 2 minutes, the terminal actively sends an access request message with the terminal ID, location and other information, the gateway receives the access request message on the networking channel, judges whether the terminal meets the access conditions, if the terminal meets the access conditions, the gateway returns an access success message and allocates a communication channel 1, if the terminal does not meet the access conditions, the gateway returns an access denial message. The terminal receives the access success message and modifies the LORA frequency band to channel 1, if the access fails, the terminal sends the access request again, if the access request fails for 3 times, the terminal enters sleep, and continues to send the access request after sleeping for half an hour, the establishment process of the self-networking is as shown in Figure 2

[0054] In this way, the establishment of the self-networking through the above method can improve the efficiency of the terminal access, and when the terminal is disconnected from the network, the terminal can quickly access the network again, which is beneficial to improve the efficiency of the network disconnection and transmission.

[0055] After the self-networking system is established, the terminal is upgraded, and the upgrade process is as shown in Figure 3 The gateway sends a configuration command through a serial port to enter the terminal upgrade state, and sends the program to be upgraded, the gateway receives and confirms the first frame number of the downloaded program file, and sequentially numbers from 0 according to the first frame number, the gateway sends the identity (such as the terminal ID) of the terminal to be upgraded and the upgrade program version number V0 through the serial port, the gateway broadcasts the upgrade query message with the terminal ID on the communication channel, and the corresponding terminal returns the terminal program version number V1 after receiving the query message.

[0056] The gateway receives VI, compares the upgrade program version number V0 and the terminal program version number V1, if the two are the same, the gateway returns the same program information to the serial port, if the two are different, the gateway broadcasts the program upgrade terminal configuration message with the terminal ID.

[0057] The terminal receives the program upgrade terminal configuration message, enters the waiting program upgrade state, and returns the waiting program upgrade message, the gateway receives the message, starts sending the program file from frame number 0, the terminal returns the second frame number after receiving the program file, the gateway compares the first frame number and the second frame number, and sends the upgrade end message in the case that the first frame number and the second frame number are equal, the terminal receives the upgrade end message, automatically jumps to the upgraded program and runs.

[0058] In the upgrade process, the network state between the gateway and the terminal is detected. Specifically, in the case of normal communication, the gateway and the terminal judge whether the network state is normal through the heartbeat packet mechanism.

[0059] ​In the case that the first frame number and the second frame number are not equal and the network state is abnormal, a query message for upgrading is sent to the terminal; the breakpoint position is determined according to the frame number of the data fed back by the terminal; and the program file after the breakpoint is determined according to the breakpoint position and is sent to the terminal. Figure 4 As shown in the figure, if the program upgrading is abnormal, the gateway sends again the query message for upgrading with the terminal ID, the terminal replies the frame number of the received data, and the gateway receives and continues to send the program data frame from the frame number of the breakpoint.

[0060] As an optional embodiment, in the case that the first frame number and the second frame number are not equal and the network state is normal, the retransmission request sent by the terminal is received, and the program file is re-sent according to the number. If the first frame number and the second frame number are equal, an end message for upgrading is sent to the terminal, which is used to instruct the terminal to end the upgrading state and jump to the running of the upgraded program.

[0061] The embodiment provides a breakpoint resuming transmission control method based on LORA. The program file is sequentially numbered, and the program file is sent to the terminal according to the number. In the case that the first frame number of the sent data and the second frame number of the received data by the terminal are not equal and the network state is abnormal, the frame number of the data fed back by the terminal is inquired and the breakpoint position is determined, and the program file after the breakpoint is sent to the terminal according to the breakpoint position. In this way, the consistency of the data sent by the gateway and the data received by the terminal can be ensured by comparing the sent frame and the received frame. In the case that the transmission breakpoint occurs, the breakpoint position is determined according to the data received by the terminal and the resuming transmission is started, the integrity of the program file in the upgrading process can be ensured, and therefore the success rate of the upgrading is improved.

[0062] Embodiment two

[0063] The embodiment of the application further provides a breakpoint resuming transmission control system based on LORA, which is used in an ad hoc network system, the ad hoc network system comprises a gateway and a terminal, the gateway and the terminal are in communication connection with each other, and comprises:

[0064] The acquisition module is used for acquiring a program file, and sequentially numbering the program file according to a first frame number of the program file;

[0065] The transceiver module is used for receiving a waiting program upgrading message sent by the terminal, sending the program file according to the number, and receiving a second frame number fed back by the terminal;

[0066] The detection module is used for detecting the network state between the gateway and the terminal, and sending a query message for upgrading to the terminal in the case that the first frame number and the second frame number are not equal and the network state is abnormal;

[0067] determining module, configured to determine the breakpoint position according to the data frame number fed back by the terminal;

[0068] continuation module, configured to determine the program file after the breakpoint according to the breakpoint position, and send the program file after the breakpoint to the terminal.

[0069] As an optional implementation, the detection module is further configured to receive a retransmission request sent by the terminal when the first frame number and the second frame number are not equal and the network state is normal, and resend the program file according to the number.

[0070] As an optional implementation, the detection module is further configured to send an upgrade end message to the terminal if the first frame number and the second frame number are equal, the upgrade end message being used to instruct the terminal to end the upgrade state and jump to the program running after the upgrade.

[0071] The LORA-based breakpoint continuation control system provided by the embodiment is used to implement the LORA-based breakpoint continuation control method described above, and therefore the specific embodiments of the LORA-based breakpoint continuation control system can be seen from the foregoing embodiment part of the LORA-based breakpoint continuation control method, and will not be described here in detail.

[0072] The above merely describes the preferred embodiments of the present application, but the present application is not limited to the above. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for resuming interrupted downloads based on LoRa, used in an ad hoc network system, the ad hoc network system comprising a gateway and terminals, the gateway and the terminals being communicatively connected to each other, characterized in that... include: Obtain the program file and number it sequentially according to the first frame number of the program file; Receive the waiting program upgrade message sent by the terminal, send the program file according to the number, and receive the second frame number fed back by the terminal; The network status between the gateway and the terminal is detected. If the first frame number and the second frame number are not equal and the network status is abnormal, an upgrade query message is sent to the terminal. If the first frame number and the second frame number are not equal and the network status is normal, receive the retransmission request sent by the terminal and retransmit the program file according to the number; The breakpoint location is determined based on the number of data frames returned by the terminal; The program file after the breakpoint is determined based on the breakpoint location, and the program file after the breakpoint is sent to the terminal; The method for establishing the self-organizing network includes: Establish a communication channel between the gateway and the terminal; If the terminal does not receive a query message broadcast by the gateway within a preset time period after the program initialization is completed, it will actively send a network access request message to the gateway. When the gateway receives a network access request message on the network channel, it determines whether the terminal meets the network access conditions. If the terminal meets the network access conditions, it sends a network access success message to the terminal and allocates a communication channel to the terminal.

2. The breakpoint resume control method based on LoRa as described in claim 1, characterized in that, The method for establishing the self-organizing network includes: Establish a communication channel between the gateway and the terminal; The gateway broadcasts incoming query messages at preset intervals; The system receives the network access request message sent by the terminal, adds the terminal to the ad hoc network, and assigns a new communication channel to the terminal; wherein, after receiving the query message, the terminal sends back a network access request message.

3. The breakpoint resume control method based on LoRa as described in claim 1, characterized in that, If the terminal fails to join the network, it will send the network joining request message again; if the number of failed requests exceeds a preset threshold, it will enter a sleep state, and after the sleep state ends, it will continue to send the network joining request message.

4. The breakpoint resume control method based on LoRa as described in claim 1, characterized in that, After sequentially numbering according to the first frame number of the program file, and before receiving the waiting program upgrade message sent by the terminal, the process also includes: sending an upgrade query message, the upgrade message including the terminal's identity identifier and the upgrade program version number of the program file; The system receives the terminal program version number from the terminal. If it determines that the terminal program version number and the upgrade program version number are different, it sends a program upgrade configuration message to the terminal and receives a waiting program upgrade message from the terminal.

5. The breakpoint resume control method based on LoRa as described in claim 1, characterized in that, Also includes: If the first frame count and the second frame count are equal, an upgrade end message is sent to the terminal. The upgrade end message is used to instruct the terminal to end the upgrade state and jump to the upgraded program execution.

6. A LoRa-based breakpoint resume control system for an ad hoc network system, the ad hoc network system comprising a gateway and terminals, the gateway and the terminals being communicatively connected to each other, characterized in that, include: The acquisition module is used to acquire program files and number them sequentially according to the first frame number of the program files. The transceiver module is used to receive the waiting program upgrade message sent by the terminal, send the program file according to the number, and receive the second frame number fed back by the terminal. The detection module is used to detect the network status between the gateway and the terminal, and send an upgrade query message to the terminal when the first frame number and the second frame number are not equal and the network status is abnormal. If the first frame number and the second frame number are not equal and the network status is normal, receive the retransmission request sent by the terminal and retransmit the program file according to the number; The determination module is used to determine the breakpoint location based on the number of data frames fed back by the terminal; The resume module is used to determine the program file after the breakpoint based on the breakpoint location, and send the program file after the breakpoint to the terminal. The method for establishing the self-organizing network includes: Establish a communication channel between the gateway and the terminal; If the terminal does not receive a query message broadcast by the gateway within a preset time period after the program initialization is completed, it will actively send a network access request message to the gateway. When the gateway receives a network access request message on the network channel, it determines whether the terminal meets the network access conditions. If the terminal meets the network access conditions, it sends a network access success message to the terminal and allocates a communication channel to the terminal.

7. The LoRa-based breakpoint resume control system as described in claim 6, characterized in that, The detection module is further configured to send an upgrade end message to the terminal if the first frame count and the second frame count are equal. The upgrade end message is used to instruct the terminal to end the upgrade state and jump to the upgraded program execution.

Citation Information

Patent Citations

  • Air upgrading method and system of LoRa terminal device

    CN107835088A

  • Firmware over-the-air upgrading method and device, computer equipment and storage medium

    CN113194461A

  • System and method for efficiently and safely upgrading switch software

    CN114697312A