Network broadcast upgrading method for low-power-consumption equipment
By independently judging and receiving upgrade files from low-power devices, verifying integrity by themselves and reporting missing information for frame-up, the problem of waiting time and power consumption wasted during the upgrade process of low-power devices is solved, and a more efficient upgrade process is achieved.
Patent Information
- Application Number
- CN202411165540.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-06
AI Technical Summary
During the network broadcast upgrade process of low-power devices, the device cannot receive the upgrade file in real time, resulting in wasting power consumption during waiting time, and the gateway needs to confirm the integrity of the upgrade file of the device one by one, affecting efficiency.
Low-power devices determine whether the upgrade file is its upgrade file by receiving the upgrade file information broadcast by the gateway. If so, switch to the upgrade channel to wait for the file to be received and verify the file integrity by itself, avoid waiting for the gateway to confirm. If it is incomplete, report missing information. Frame complement.
It reduces waiting time and power consumption, improves upgrade efficiency, and the equipment can independently verify file integrity and timely supplement missing data, improving the efficiency of the upgrade process.
Smart Images

Figure CN119094344A_ABST
Abstract
Description
Technical Field
[0001] The present invention specifically relates to a network broadcast upgrade method for low-power consumption equipment. Background Art
[0002] With the large-scale application of a large number of low-power intelligent IoT devices, low-power devices often need to be upgraded during operation due to new customer needs, new parameter configurations or device bugs. For network device upgrades, the broadcast upgrade method is generally used to reduce the upgrade time of the entire network. The gateway wakes up all low-power devices to be upgraded, and then broadcasts the upgrade file to the low-power devices. In order to ensure the integrity of the upgrade file, the gateway also needs to query the integrity of the upgrade file of each low-power device. If it is incomplete, it will be supplemented. If it is complete, it will be activated and upgraded.
[0003] For broadcast upgrade, it cannot be guaranteed that all low-power devices receive the upgrade file completely. Therefore, the gateway device needs to confirm the integrity of the upgrade file of the low-power devices one by one according to the file list. If frame loss occurs, the low-power devices need to be supplemented by broadcast. The low-power devices at the end of the file list may have received the complete upgrade file, but need to wait for the gateway to confirm the integrity of the upgrade file. This waiting time wastes power consumption. Summary of the invention
[0004] The present invention provides a low-power device network broadcast upgrade method to solve the above-mentioned technical problems, and specifically adopts the following technical solutions:
[0005] A low-power device network broadcast upgrade method, comprising:
[0006] The gateway traverses all channels to broadcast the upgrade file information to the low-power devices;
[0007] The low-power device determines whether it is its own upgrade file based on the upgrade file information broadcast by the gateway;
[0008] When it is determined that it is its own upgrade file, the low-power device switches to the upgrade channel of the gateway broadcasting the upgrade file frame and waits for the gateway to broadcast the upgrade file;
[0009] The gateway broadcasts the upgrade file in the upgrade channel;
[0010] Low-power devices receive upgrade files;
[0011] The low-power device verifies whether the upgrade file is complete;
[0012] After verifying that the upgrade file is complete, the low-power device starts the upgrade.
[0013] Furthermore, the upgrade file information includes file size, frame size, file checksum MD5, device type, file version and upgrade channel;
[0014] After receiving the upgrade file information, the low-power device switches to the upgrade channel of the gateway and waits for the gateway to send the upgrade file after determining that the device type is consistent with itself and the file version is newer than itself.
[0015] Furthermore, the low-power device calculates the total number of frames according to the file size and the frame size, and then calculates the number of bytes required by the bitMap according to the total number of frames. The low-power device applies for a space of corresponding size to record the reception of the upgrade package. The low-power device initializes the space of corresponding size to all 0xFF. When the upgrade file frame from the gateway is received, the 1 in the position of the corresponding frame number in the bitMap is changed to 0.
[0016] Furthermore, when the low-power device receives the command broadcast by the gateway or the interval time of receiving the upgrade frame exceeds the preset value, it calculates whether its own bitMap has a total frame number of bits that are 0 from the beginning. If so, it means that the data is complete.
[0017] Further, when the verification upgrade file is incomplete, the missing information is reported to the gateway;
[0018] The gateway broadcasts supplementary frames based on the missing information reported by the low-power device.
[0019] Furthermore, when verifying that the upgrade file is incomplete, the low-power device reports the missing information to the gateway after randomly delaying and waiting for a certain period of time.
[0020] Furthermore, when verifying that the upgrade file is incomplete, the low-power device reports the bitMap information to the gateway starting from the byte where the bitMap is vacant after a random delay. If the remaining bytes are very long, a maximum of 100 bytes of bitMap information will be uploaded.
[0021] Furthermore, when verifying that the upgrade file is incomplete, if the low-power device receives a broadcast supplementary frame during the delayed waiting time, it cancels reporting the missing information to the gateway and directly receives the supplementary frame. After receiving the supplementary frame, it verifies again whether the upgrade file is complete.
[0022] Furthermore, when it is determined that the upgrade file is not its own, the low-power device directly goes into sleep mode.
[0023] Furthermore, after the low-power device is upgraded, it reports the registration information carrying the version number to the gateway.
[0024] The invention is beneficial in that the network broadcast upgrade method for low-power devices provided by the gateway broadcasts the upgrade file information to the low-power device before sending the upgrade file. The low-power device determines whether it is its own upgrade file based on the file information. If not, it discards it and continues to sleep. Otherwise, it switches to the "receiving file channel" to wait for the gateway to broadcast the file frame. And the low-power device can verify the integrity of the file by itself. If it is complete, the upgrade is started without waiting for the gateway to query the file integrity, thereby saving waiting time, that is, saving power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0026] Figure 1 It is a schematic diagram of a star network formed between the low-power consumption device and the gateway of the present invention;
[0027] Figure 2 It is a schematic diagram of a low-power device network broadcast upgrade method of the present invention. DETAILED DESCRIPTION
[0028] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0029] For low-power devices, due to strict requirements on power consumption, low-power devices are usually in sleep mode to reduce power consumption. This results in the low-power devices being unable to update routes in real time. Therefore, a star network is usually formed between low-power devices and gateways, such as Figure 1 shown.
[0030] In order to prevent the gateway from waking up other low-power devices when reading meters downstream, low-power devices are generally divided into N channels according to their addresses, so that (N-1) / N low-power devices will not be affected when the gateway sends instructions downstream. When upgrading low-power devices, the gateway traverses N channels and broadcasts the upgrade file information to the low-power devices.
[0031] like Figure 2The present invention shows a method for upgrading a low-power device through network broadcast, comprising: S1: the gateway traverses all channels to broadcast the upgrade file information to the low-power device. S2: the low-power device determines whether it is its own upgrade file according to the upgrade file information broadcast by the gateway. S3: when it is determined that it is its own upgrade file, the low-power device switches to the upgrade channel of the gateway broadcasting the upgrade file frame, and waits for the gateway to broadcast the upgrade file. S4: the gateway broadcasts the upgrade file in the upgrade channel. S5: the low-power device receives the upgrade file. S6: the low-power device verifies whether the upgrade file is complete. S7: the low-power device starts the upgrade after verifying that the upgrade file is complete. In the method for upgrading a low-power device through network broadcast of the present invention, before the gateway sends the upgrade file, it broadcasts the upgrade file information to the low-power device. The low-power device determines whether it is its own upgrade file according to the file information, and if not, it discards and continues to sleep, otherwise it switches to the "receiving file channel" to wait for the gateway to broadcast the file frame. And the low-power device can verify the integrity of the file by itself. If it is complete, the upgrade is started without waiting for the gateway to query the integrity of the file, thereby saving waiting time and power consumption. The above steps are described in detail below.
[0032] For step S1: the gateway traverses all channels to broadcast the upgrade file information to the low-power devices.
[0033] In the implementation of the present application, six channels are divided as shown in the following Table 1. The low power consumption device divides the channels according to the addresses.
[0034] Table 1 Network channel division table
[0035] Channel Number Frequency MHz Bandwidth KHz Spreading Factor CH0 433.3 125 9 CH1 433.6 125 9 CH2 433.9 125 9 CH3 434.2 125 9 CH4 434.5 125 9 CH5 434.8 125 9
[0036] The server sends the upgrade file and upgrade file information of the low-power device to the gateway. The gateway will traverse 6 channels, broadcast to wake up the low-power device and broadcast the upgrade file information to the low-power device. As shown in Table 2 below, in an embodiment of the present application, the upgrade file information includes file size, frame size, file checksum MD5, device type, file version and upgrade channel.
[0037] Table 2 Broadcast upgrade information frame content
[0038]
[0039] Regarding step S2: the low-power device determines whether the upgrade file is its own upgrade file based on the upgrade file information broadcast by the gateway.
[0040] Specifically, after receiving the upgrade file information, the low-power device determines whether the device type is consistent with itself, and then determines whether the file version is newer than itself. If it is newer, it means that it is its own upgrade file.
[0041] Regarding step S3: when it is determined that the upgrade file is its own, the low-power device switches to the upgrade channel of the gateway broadcasting the upgrade file frame, and waits for the gateway to broadcast the upgrade file.
[0042] If it is updated, the low-power device switches to the channel CH of the gateway upgrade file (usually the service channel of the gateway) and waits for the gateway to send the upgrade file. Otherwise, the low-power device directly sleeps.
[0043] For step S4: the gateway broadcasts the upgrade file in the upgrade channel.
[0044] After the gateway traverses 6 channels to broadcast the upgrade file information, the gateway stays on the agreed channel number CH to broadcast the upgrade file. In this application, the gateway's service channel selects CH as 2, and broadcasts the upgrade file on channel 2.
[0045] The data frame format of the broadcast upgrade file is shown in Table 3:
[0046] Table 3 Data frame format of broadcast upgrade file
[0047]
[0048] For step S5: the low-power device receives the upgrade file.
[0049] In the implementation of the present application, the low-power device calculates the total number of frames according to the file size and the frame size. Specifically, according to the file size FileSize and the frame size F s Calculate the total number of frames:
[0050] Ft=(FileSize+F s –1) / F s
[0051] The gateway uses the frame number F n , broadcast the upgrade file frame by frame starting from 0. t -1, the gateway broadcasts all files and then broadcasts the sending completion command. The gateway can then wait for the low-power device to report the registration information with the version number. The information is then uploaded to the server, which can then count the upgrade status.
[0052] Frame length F l Is the length of the data in this frame. Generally, F l and F s are equal, but the last frame F l Less than or equal to F s .
[0053] Then calculate the number of bytes required for the required bitMap based on the total number of frames:
[0054] bitMap=(F t +7) / 8
[0055] The low-power device applies for a corresponding size of space to record the upgrade package reception. The low-power device initializes the corresponding size of space to all 0xFF (to facilitate the use of flash as a storage medium). When the gateway upgrade file frame is received, the low-power device receives the frame number F n Store the data in F n *F s The address space at the beginning of the frame. And change the 1 in the position corresponding to the frame number in the bitMap to 0.
[0056] For step S6: the low-power device verifies whether the upgrade file is complete.
[0057] When the low-power device receives the command broadcast by the gateway or the interval time of receiving the upgrade frame exceeds the preset value, it calculates whether its bitMap has the total number of frames with bits 0 from the beginning. If so, it means the data is complete.
[0058] For step S7: after verifying that the upgrade file is complete, the low-power device starts the upgrade.
[0059] After that, the file can be verified. If the verification calculated by the file is consistent with the file information, the upgrade can be started. After the upgrade is completed, the low-power device reports the registration information carrying the version number to the gateway, and the low-power device completes the upgrade.
[0060] In the implementation manner of the present application, when the verification upgrade file is incomplete, the missing information is reported to the gateway. The gateway broadcasts a supplementary frame according to the missing information reported by the low-power device.
[0061] It is understandable that in actual applications, due to wireless interference and other reasons, wireless communications may be discarded due to frame loss or frame check errors, which causes incomplete files received by low-power devices.
[0062] In an implementation manner of the present application, when verifying that the upgrade file is incomplete, the low-power device reports the missing information to the gateway after randomly delaying and waiting for a certain period of time.
[0063] Preferably, when verifying that the upgrade file is incomplete, the low-power device reports the bitMap information to the gateway starting from the byte where the bitMap is vacant after a random delay for a certain period of time. If the remaining bytes are very long, a maximum of 100 bytes of bitMap information is uploaded. The format of the reported bitMap frame is shown in Table 4 below.
[0064] Table 4 Reporting bitMap frame format
[0065]
[0066] The low-power device reports the bitMap information to the gateway starting from the byte where the bitMap is empty. Addr = F n / 8 is the starting address for uploading the bitMap information, and then the remaining bytes of the bitMap are uploaded. If the remaining bytes are very long, a maximum of 100 bytes of bitMap information will be uploaded.
[0067] The gateway can calculate the missing frames based on the received bitMap, and then broadcast the supplementary frames one by one, and then send the broadcast completion command after the supplementary frames are sent. The low-power device performs the low-power device verification and upgrade steps.
[0068] In an implementation manner of the present application, when verifying that the upgrade file is incomplete, if the low-power device receives a broadcast supplementary frame during the delayed waiting time (other devices may send supplementary frame requests during this period), it will cancel reporting the missing information to the gateway and directly receive the supplementary frame. After receiving the supplementary frame, it will verify again whether the upgrade file is complete.
[0069] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A low-power device network broadcast upgrade method, characterized in that: Include: The gateway traverses all channels to broadcast the upgrade file information to the low-power devices; The low-power device determines whether it is its own upgrade file based on the upgrade file information broadcast by the gateway; When it is determined that it is its own upgrade file, the low-power device switches to the upgrade channel of the gateway broadcasting the upgrade file frame and waits for the gateway to broadcast the upgrade file; The gateway broadcasts the upgrade file in the upgrade channel; Low-power devices receive upgrade files; The low-power device verifies whether the upgrade file is complete; After verifying that the upgrade file is complete, the low-power device starts the upgrade.
2. The low-power device network broadcast upgrade method according to claim 1, characterized in that: The upgrade file information includes file size, frame size, file checksum MD5, device type, file version and upgrade channel; After receiving the upgrade file information, the low-power device switches to the upgrade channel of the gateway and waits for the gateway to send the upgrade file after determining that the device type is consistent with itself and the file version is newer than itself.
3. The low-power device network broadcast upgrade method according to claim 2, characterized in that: The low-power device calculates the total number of frames based on the file size and frame size, and then calculates the number of bytes required for the bitMap based on the total number of frames. The low-power device applies for a space of the corresponding size to record the reception of the upgrade package. The low-power device initializes the space of the corresponding size to all 0xFF. When receiving the upgrade file frame from the gateway, the 1 in the position of the corresponding frame number in the bitMap is changed to 0.
4. The low-power device network broadcast upgrade method according to claim 3, characterized in that: When the low-power device receives the command broadcast by the gateway or the interval time of receiving the upgrade frame exceeds the preset value, it calculates whether its bitMap has the total number of frames with bits 0 from the beginning. If so, it means the data is complete.
5. The low-power device network broadcast upgrade method according to claim 4, characterized in that: When the verification upgrade file is incomplete, report the missing information to the gateway; The gateway broadcasts supplementary frames based on the missing information reported by the low-power device.
6. The low-power device network broadcast upgrade method according to claim 5, characterized in that: When verifying that the upgrade file is incomplete, the low-power device reports the missing information to the gateway after a random delay and waiting for a certain period of time.
7. The low-power device network broadcast upgrade method according to claim 6, characterized in that: When verifying that the upgrade file is incomplete, the low-power device reports the bitMap information to the gateway starting from the byte where the bitMap is vacant after a random delay. If the remaining bytes are very long, a maximum of 100 bytes of bitMap information will be uploaded.
8. The low-power device network broadcast upgrade method according to claim 6, characterized in that: When verifying that the upgrade file is incomplete, if the low-power device receives a broadcast supplementary frame within the delay waiting time, it will cancel reporting the missing information to the gateway and directly receive the supplementary frame. After receiving the supplementary frame, it will verify again whether the upgrade file is complete.
9. The low-power device network broadcast upgrade method according to claim 1, characterized in that: When determining that the upgrade file is not its own, the low-power device directly goes into sleep mode.
10. The low-power device network broadcast upgrade method according to claim 1, characterized in that: After the low-power device is upgraded, it reports the registration information with the version number to the gateway.
