A method, medium and terminal for automatic updating of Wi-SUN network software
Through point-to-point communication between nodes and boundary routers and neighbor nodes in Wi-SUN network, automatic synchronization and update of software versions is achieved, solving the inconvenience and complex problems of Wi-SUN network upgrade and update in the existing technology, and improving the Upgrade success rate and convenience.
Patent Information
- Application Number
- CN202411296073.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-18
AI Technical Summary
The upgrade and update of existing Wi-SUN network software is inconvenient, the operation is complex, and the OTA upgrade takes a long time. Some nodes fail due to communication signal problems or not accessing the network.
After the node is connected to the Wi-SUN network, unicast sends query version information to the boundary router. If the version is inconsistent, the parent node or neighbor node will be requested to synchronize the software version, and use point-to-point communication to perform local updates to reduce the complexity of maintenance operations.
The Wi-SUN network firmware update process is simplified, the convenience and success rate of upgrades are improved, the maintenance complexity is reduced, and the upgrade failure is avoided due to communication signal problems.
Smart Images

Figure CN118827369B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Wi-SUN communication technology, and in particular relates to a method, medium and terminal for automatic updating of Wi-SUN network software. Background Art
[0002] Wi-SUN is a networking technology defined from the physical layer to the transport layer. In recent years, based on advanced networking and self-healing technologies and powerful security encryption mechanisms, it has been widely used in various fields, such as power meters, photovoltaic energy, smart cities, etc.
[0003] In many Wi-SUN technology applications, in many scenarios, the device needs to be OTA upgraded or the abnormal module needs to be replaced on site. In the current Wi-SUN communication scheme, the OTA upgrade uses the MPL (Multicast Protocol for Low-Power and Lossy Networks) broadcast method to transmit the upgrade data packet. When the upgrade success rate is low, multiple full-network broadcast upgrades need to be performed, and a few nodes need to be manually upgraded; in addition, the on-site replacement of abnormal modules usually requires the module to be upgraded to the corresponding version before replacement. There are two defects in the above method. One is that the OTA upgrade takes a long time, and the other is that a few nodes will fail to upgrade due to communication signals or lack of access to the Wi-SUN network. The patent application with publication number CN107579863A provides a terminal OTA upgrade method, in which the network management server identifies the terminal to be upgraded that needs to be upgraded by an identification address and an address mask; by issuing an OTA upgrade command and carrying a unified upgrade start time in the OTA upgrade command, the terminal to be upgraded can be uniformly awakened and receive the firmware upgrade package distributed by the network management server on the broadcast channel for firmware upgrade when the upgrade start time arrives. The OTA upgrade in this patent application is the same as the upgrade method of the prior art, and has the same disadvantages as the prior art.
[0004] Therefore, how to reduce the operational complexity of the existing Wi-SUN network firmware update and provide a convenient method for updating and upgrading the Wi-SUN network software is an urgent problem to be solved by personnel in the field of this technology. Summary of the invention
[0005] In view of the deficiencies in the prior art, an object of the present invention is to provide a method for automatic updating of Wi-SUN network software to solve the problems in the prior art that the upgrade and update of Wi-SUN network software is inconvenient and the operation is complex; in addition, the present invention also provides a medium and a terminal based on automatic updating of Wi-SUN network software.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a method for automatically updating software based on a Wi-SUN network, comprising the following steps:
[0008] S10. After the node accesses the Wi-SUN network, it unicasts a version information query instruction to the border router, and the border router unicasts the node version information. S20. When the node version information is inconsistent with the version information replied by the border router, the node executes the automatic upgrade process request. S30. When the node unicasts a request for software version synchronization to the parent node or the surrounding neighbor nodes, the communication address uses the link local address of the node. After the parent node or the surrounding neighbor nodes receive the software version synchronization request instruction, they unicast the node's own version information. S40. When the parent node or the surrounding neighbor nodes receive the software version synchronization request, the upgrade process is started and a data packet with a sequence number of 1 is sent to the node. The data packet contains hardware information and software information before the update. S50. When the node detects a data packet with a sequence number of 1, if the version information in the data packet is consistent with its own, the data packet is discarded, the upgrade process is terminated, and a request for software synchronization instruction is sent to other surrounding nodes; if it is inconsistent, the upgrade process is started.
[0009] Furthermore, in step S30, the node first requests software synchronization from the parent node, and if the version information of the parent node is consistent with the node itself, the node requests software synchronization from surrounding neighboring nodes.
[0010] Furthermore, in step S30, software synchronization is applied to the parent node first. If the version information of the parent node is consistent with the own node, software synchronization is applied to the surrounding neighboring nodes.
[0011] Furthermore, when the parent node version information or the neighbor node version information is consistent with the node version information, the version determination method is as follows:
[0012] The version information sent by the border router includes hardware version information and software version information. The comparison rules are as follows:
[0013] Version consistency:
[0014]
[0015] Version inconsistency:
[0016]
[0017] Where H(b) is the hardware version information in the version information sent by the border router, H(n) is the hardware version information of the node itself, S(b) is the software version information in the version information sent by the border router, and S(n) is the current software version information of the node;
[0018] When the version information sent by the border router is consistent with the current version information of the node, there is no need to perform automatic update;
[0019] When the version information extracted from the reply data packet of the parent node or neighbor node is inconsistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed;
[0020] When the version information extracted from the reply data packet of the parent node or neighbor node is consistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed.
[0021] Furthermore, in step S50, the upgrade data includes the firmware size, firmware version, current data packet sequence number and data packet transmission interval.
[0022] Furthermore, the node firmware receiving status is stored in a Bitmap table, and the mapping relationship between the data packet and the Bitmap is as follows:
[0023]
[0024] Among them, PKT(k) represents the data packet with data packet sequence number k, B(n) represents the nth byte of Bitmap, and b(m) represents the mth bit of Bitmap.
[0025] In a second aspect, the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0026] In a third aspect, the present invention further provides an electronic terminal, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes the method as described above.
[0027] Compared with the prior art, the method, medium and terminal based on automatic update of Wi-SUN network software provided by the present invention have at least the following beneficial effects:
[0028] The OTA upgrade adopted by the existing Wi-SUN technology takes a long time. In addition, a few nodes will fail to upgrade due to communication signals or failure to connect to the Wi-SUN network. There are problems such as inconvenient upgrades and high operational complexity. The present invention has a simple process and convenient operation. It uses the point-to-point communication characteristics between nodes in the Wi-SUN network to obtain the software version information of the current network node by querying the BR (border router), and then uses the point-to-point communication characteristics to locally complete the update of the node software version. It can effectively reduce the maintenance operation complexity of the Wi-SUN network firmware update and improve the convenience of on-site module updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the scheme of the present invention, a brief introduction is given below to the figures required for use in the description of the embodiments. Obviously, the figures described below are some embodiments of the present invention. For ordinary technicians in this field, other figures can be obtained based on these figures without paying any creative work.
[0030] Figure 1 A flowchart of a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention;
[0031] Figure 2 A schematic diagram of querying version information of a node accessing the network based on a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention;
[0032] Figure 3 A schematic diagram of a version information query and reply data frame format of a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of node application version synchronization based on a method for automatic update of Wi-SUN network software provided by an embodiment of the present invention;
[0034] Figure 5 A schematic diagram of a request and response data packet of a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention;
[0035] Figure 6 A schematic diagram of a data packet transmission format of a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention;
[0036] Figure 7 A median diagram of a method for automatic updating of Wi-SUN network software provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0039] The present invention provides a method for automatic software update based on a Wi-SUN network, which is applied to an OTA upgrade process of a device. The method for automatic software update based on a Wi-SUN network includes the following steps:
[0040] S10. After the node accesses the Wi-SUN network, it unicasts a version information query instruction to the border router, and the border router unicasts the node version information. S20. When the node version information is inconsistent with the version information replied by the border router, the node executes the automatic upgrade process request. S30. When the node unicasts a request for software version synchronization to the parent node or the surrounding neighbor nodes, the communication address uses the link local address of the node. After the parent node or the surrounding neighbor nodes receive the software version synchronization request instruction, they unicast the node's own version information. S40. When the parent node or the surrounding neighbor nodes receive the software version synchronization request, the upgrade process is started and a data packet with a sequence number of 1 is sent to the node. The data packet contains hardware information and software information before the update. S50. When the node detects a data packet with a sequence number of 1, if the version information in the data packet is consistent with its own, the data packet is discarded, the upgrade process is terminated, and a request for software synchronization instruction is sent to other surrounding nodes; if it is inconsistent, the upgrade process is started.
[0041] The network firmware update operation of the present invention has low complexity and is easy to update and upgrade.
[0042] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.
[0043] The present invention provides a method for automatically updating software based on Wi-SUN network, which is applied to the OTA upgrade process of the device. Figures 1 to 6 In this embodiment, the method for automatic updating of Wi-SUN network software includes the following steps:
[0044] S10, after the node accesses the Wi-SUN network, it unicasts a version information query command to the border router, and the border router unicasts a reply of the node version information;
[0045] S20, when the version information of the node is inconsistent with the version information replied by the border router, the node executes the automatic upgrade process request;
[0046] S30, when a node unicasts to request software version synchronization to a parent node or a surrounding neighbor node, the communication address adopts the link local address of the node, and after receiving the software version synchronization request instruction, the parent node or the surrounding neighbor node unicasts to reply the node's own version information;
[0047] Specifically, in this embodiment, software synchronization is requested from the parent node first. If the version information of the parent node is consistent with the own node, software synchronization is requested from the surrounding neighbor nodes.
[0048] Furthermore, in this embodiment, when the version information of the parent node or the version information of the neighbor node is consistent with the version information of the node, the version determination method is as follows:
[0049] The version information sent by the border router includes hardware version information and software version information. The comparison rules are as follows:
[0050] Version consistency:
[0051] Version inconsistency:
[0052] Among them, H(b) is the hardware version information in the version information sent by the border router, H(n) is the hardware version information of the node itself, S(b) is the software version information in the version information sent by the border router, and S(n) is the current software version information of the node.
[0053] When the version information sent by the border router is consistent with the current version information of the node, there is no need to perform automatic update;
[0054] When the version information extracted from the reply data packet of the parent node or neighbor node is inconsistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed;
[0055] When the version information extracted from the reply data packet of the parent node or neighbor node is consistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed.
[0056] S40: When the parent node or the surrounding neighboring nodes receive the software version synchronization request, the upgrade process is started and a data packet with a sequence number of 1 is sent to the node, and the data packet contains hardware information and software information before the update;
[0057] S50, the node detects a data packet with a sequence number of 1. If the version information in the data packet is consistent with its own, the node discards the data packet, terminates the upgrade process, and sends a request for software synchronization instructions to other surrounding nodes; if they are inconsistent, the upgrade process is started.
[0058] Specifically, in this embodiment, the upgrade data includes the firmware size, firmware version, current data packet sequence number, and data packet transmission interval.
[0059] Furthermore, in this embodiment, the node firmware receiving state is stored in a Bitmap table, and the mapping relationship between the data packet and the Bitmap is as follows:
[0060]
[0061] Among them, PKT(k) represents the data packet with data packet sequence number k, B(n) represents the nth byte of Bitmap, and b(m) represents the mth bit of Bitmap.
[0062] The following is a description of the working process of a method for automatic software update based on Wi-SUN network provided by an embodiment of the present invention in conjunction with the accompanying drawings:
[0063] After the node accesses the Wi-SUN network, NODE4 establishes a communication link with BR through NODE2. Then NODE2 is the parent node of NODE4, the wireless signal sent by NODE5 is within the receiving range of NODE4, and NODE5 is the neighbor node of NOD4. The wireless signals sent by other nodes are not within the receiving range of NODE4, so they are not the neighbor nodes of NODE4.
[0064] NODE4 sends a network version query message to the border router, and the border router replies with version information. After NODE4 joins the network, it sends a version query message to BR, and BR replies with the current version information.
[0065] The node receives the version information replied by BR, which includes the hardware information and the software version information of the hardware;
[0066] When a node receives the version information replied by BR, if the version information replied by BR is inconsistent with the node version information, the node will first apply for software version synchronization to the parent node. If the version information of the parent node is inconsistent with the node version information, the node will perform version synchronization. If the version information replied by the parent node is consistent with the node version information, the node will send a software version synchronization request to the surrounding neighbor nodes.
[0067] When the node compares the version information replied by the parent node and the node's own information and the result is consistent, the node applies for version synchronization request to the surrounding neighbor nodes. When the neighbor node reply information is inconsistent with the node information, NODE4 applies for version synchronization to the surrounding neighbor node NODE5. NODE5 replies with a data packet with sequence number 1, and NODE4 enters the upgrade process. NODE4 receives an upgrade data packet with data packet sequence number 1. According to the total length of the firmware and the size of a single data packet, it calculates the bitmap size and sets bit0 of the first byte to 1. At the same time, it requests NODE5 to send an upgrade data packet with data packet sequence number 2. The timer is started according to the sending interval in the format. After the timer expires, if the node checks whether it has received an upgrade data packet with data packet sequence number 2, if it has not received a data packet with sequence number 2, the node requests NODE5 to resend the data packet with sequence number 2. If an upgrade data packet with sequence number 2 is received before the timer expires, bit1 of the first byte is set to 1, then the timer is restarted and a data packet with sequence number 3 is requested, and so on.
[0068] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any one of the methods in the present embodiment is implemented.
[0069] An embodiment of the present invention further provides an electronic terminal, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes any one of the methods in this embodiment.
[0070] The computer-readable storage medium in this embodiment can be understood by ordinary technicians in this field: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0071] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes each step of the above method.
[0072] Compared with the prior art, the method, medium and terminal for automatic software update based on Wi-SUN network described in the above embodiments are time-consuming for OTA upgrade adopted by the existing Wi-SUN technology. In addition, a few nodes fail to upgrade due to communication signals or lack of access to the Wi-SUN network, which results in inconvenient upgrade and high operation complexity. The present invention has a simple process and convenient operation. It utilizes the point-to-point communication characteristics between nodes of the Wi-SUN network, obtains the software version information of the current network node by querying the BR (border router), and then locally completes the update of the node software version by utilizing the point-to-point communication characteristics. It can effectively reduce the maintenance operation complexity of the Wi-SUN network firmware update and improve the convenience of on-site module updates.
[0073] Obviously, the embodiments described above are only preferred embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are shown in the accompanying drawings, but they do not limit the patent scope of the present invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to perform equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.
Claims
1. A method for automatic software update based on Wi-SUN network, characterized in that: The following steps are involved: S10, after the node accesses the Wi-SUN network, it unicasts a version information query command to the border router, and the border router unicasts a reply of the node version information; S20, when the version information of the node is inconsistent with the version information replied by the border router, the node executes the automatic upgrade process request; S30, when a node unicasts to request software version synchronization to a parent node or a surrounding neighbor node, the communication address adopts the link local address of the node, and after receiving the software version synchronization request instruction, the parent node or the surrounding neighbor node unicasts to reply the node's own version information; S40: When the parent node or the surrounding neighboring nodes receive the software version synchronization request, the upgrade process is started and a data packet with a sequence number of 1 is sent to the node, and the data packet contains hardware information and software information before the update; S50, the node detects a data packet with a sequence number of 1. If the version information in the data packet is consistent with its own, the node discards the data packet, terminates the upgrade process, and sends a request for software synchronization instructions to other surrounding nodes; if they are inconsistent, the upgrade process is started.
2. The method for automatic software update based on Wi-SUN network according to claim 1, characterized in that: In step S30, the node first requests software synchronization from the parent node, and if the version information of the parent node is consistent with the node itself, the node requests software synchronization from surrounding neighboring nodes.
3. The method for automatic software update based on Wi-SUN network according to claim 2, characterized in that: When the parent node version information or the neighbor node version information is consistent with the node version information, the version determination method is as follows: The version information sent by the border router includes hardware version information and software version information. The comparison rules are as follows: Version consistency: ; Version inconsistency: ; Where H(b) is the hardware version information in the version information sent by the border router, H(n) is the hardware version information of the node itself, S(b) is the software version information in the version information sent by the border router, and S(n) is the current software version information of the node; When the version information sent by the border router is consistent with the current version information of the node, there is no need to perform automatic update; When the version information extracted from the reply data packet of the parent node or neighbor node is inconsistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed; When the version information extracted from the reply data packet of the parent node or neighbor node is consistent with the current version information of the node, and the version information sent by the border router is inconsistent with the current version information of the node, automatic update needs to be performed.
4. The method for automatic software update based on Wi-SUN network according to claim 1, characterized in that: In step S50, the upgrade data includes the firmware size, firmware version, current data packet sequence number and data packet transmission interval.
5. The method for automatic software update based on Wi-SUN network according to claim 4, characterized in that: The node firmware receiving status is stored in a Bitmap table. The mapping relationship between the data packet and the Bitmap is as follows: ; Among them, PKT(k) represents the data packet with data packet sequence number k, B(n) represents the nth byte of Bitmap, and b(m) represents the mth bit of Bitmap.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
7. An electronic terminal, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes the method according to any one of claims 1 to 5.
