Sensor, related method and network
By implementing application software compatibility check and update mechanisms in the sensor, the problem of long synchronization time after sensor update is solved, and the availability and battery life of the sensor are improved.
Patent Information
- Application Number
- CN202411216646.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-05
- Filing Date
- 2024-09-02
- Publication Date
- 2025-03-07
AI Technical Summary
When updating sensor application software, the sensor and gateway synchronization lasts longer, resulting in reduced sensor availability and increased power consumption, which in turn shortens battery life.
The duration of the initial software update is reduced by implementing the current version of the application software in the sensor to check the compatibility of the first version of the application software and guide the sensor to update the application software when compatible.
Reduces the duration of no communication between the sensor and the gateway, shortens the time for resynchronization, reduces the power consumption of the sensor, and extends battery life.
Smart Images

Figure CN119576378A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a sensor.
[0002] More particularly, the present invention relates to updating application software stored in a memory of a sensor. Background Art
[0003] Typically, a network may include multiple sensors that communicate wirelessly with a gateway to transmit measurements.
[0004] Each sensor comprises application software implemented by a processing unit of the sensor, for example for taking measurements, processing the measurements and sending the processed measurements to a gateway.
[0005] The application software can be updated.
[0006] During the update, the sensor is booted so that the initial software stored in the boot memory updates the application software stored in the sensor.
[0007] During the update, the sensor does not communicate with the gateway.
[0008] In a mesh network, each sensor is synchronized with a gateway. During an update of application software, the more important the duration of the update, the more the sensor is desynchronized from the mesh network and does not send data (e.g., measurements) to the gateway, thereby reducing the availability of the sensor.
[0009] Resynchronizing updated sensors that are completely out of sync is time consuming, for example up to 10 minutes.
[0010] Furthermore, when the sensor includes a battery to power the sensor, during resynchronization, the power consumption of the sensor increases, thereby reducing the life of the battery.
[0011] Furthermore, the boot memory is designed to store initial software intended to process updates of the sensor, thereby reducing the memory for storing application software, for example, when the memory size in the sensor is limited.
[0012] The initial software intended to handle the update of the sensor is more complex than the initial software and may include more errors than the initial software that does not include the update instructions.
[0013] The present invention therefore aims to reduce the duration of resynchronizing a sensor with a network after updating its application software, in order to increase the availability of the sensor and limit its power consumption. Summary of the invention
[0014] According to one aspect, a method for updating application software stored in a first memory of a sensor is proposed.
[0015] The method comprises:
[0016] - implementing a current version of the application software stored in the first memory to compare a predetermined sensor identifier stored in the second memory of the sensor with a first identifier of the first version of the application software stored in the third memory,
[0017] - when the first identifier comprises a predetermined sensor identifier, implementing the current version of the application software to set a flag stored in the fourth memory to a first state,
[0018] - when the flag stored in the fourth memory is in the first state, implementing the current version of the application software to boot the sensor to launch the initial software stored in the boot memory,
[0019] - implementing initial software to read the flag stored in the fourth memory, and
[0020] When the state of the flag is equal to the first state:
[0021] - implementing initial software to replace the current version of the application software stored in the first memory with the first version of the application software stored in the third memory, and setting the flag to a second state different from the first state so that the first memory stores the first version of the application software.
[0022] The current version of the application software checks the compatibility of the first version of the application software with the sensor, and if the first version of the application software is compatible with the sensor, the sensor is started to update the application software, thereby reducing the duration of the update implemented by the initial software to reduce the duration of no communication between the sensor and the gateway.
[0023] The reduction of the none communication duration reduces the duration for synchronizing the sensor with the gateway after an update and reduces the power consumption of the sensor, for example to increase the life of the sensor's battery.
[0024] Furthermore, since the compatibility check instructions are included in the current version of the application software, the initial software has a smaller size than the initial software known in the prior art, thereby allowing the size of the boot memory to be reduced, and is simpler than the initial software known in the prior art, thereby reducing the probability of errors in the initial software.
[0025] Preferably, the current version of the application software includes a second identifier, and the first version of the application software includes a second identifier, and the step of implementing the current version of the application software also includes: when the second identifier of the current version of the application software is equal to the second identifier of the first version of the application software, setting the flag to a second state.
[0026] Advantageously, the first version of the application software includes a first set of data and a second set of data for checking the integrity of the first set of data, and the method further includes: implementing initial software to check the integrity of the first set of data of the first version of the application software stored in the first memory based on the second set of data of the first version of the application software stored in the first memory, and when the first set of data of the first version of the application software stored in the first memory has integrity, implementing the first set of data of the first version of the application software stored in the first memory.
[0027] Preferably, when the first data set of the first version of the application software stored in the first memory does not have integrity, the method further includes: implementing initial software to erase the first memory, setting a flag to a first state, and booting a sensor to launch the initial software.
[0028] According to another aspect, a sensor is provided.
[0029] The sensor comprises:
[0030] - a first memory configured to store a current version of the application software,
[0031] - a second memory configured to store a predetermined sensor identifier,
[0032] - a third memory configured to store the first version of the application software,
[0033] - a fourth memory configured to store a flag,
[0034] - a boot memory configured to store initial software, and
[0035] - a processing unit configured to:
[0036] implementing the current version of the application software to compare the predetermined sensor identifier with the first identifier of the first version of the application software,
[0037] implementing the current version of the application software to set the flag to a first state when the first identifier includes a predetermined sensor identifier, and implementing the current version of the application software to direct the sensor to launch initial software stored in the boot memory when the flag stored in the third memory is in the first state,
[0038] implementing the initial software to read the flag stored in the third memory, and when the state of the flag is equal to the first state, implementing the initial software to replace the current version of the application software stored in the first memory with the first version of the application software stored in the third memory, and setting the flag to a second state different from the first state.
[0039] Advantageously, the processing component is further configured to: when the second identifier of the current version of the application software is equal to the second identifier of the first version of the application software, implement the current version of the application software to set the flag to the second state.
[0040] Preferably, the first version of the application software includes a first data set and a second data set for checking the integrity of the first data set, and the processing component is further configured to: implement initial software to check the integrity of the first data set of the first version of the application software stored in the first memory based on the second data set of the first version of the application software stored in the first memory, and when the first data set of the first version of the application software stored in the first memory has integrity, implement the first data set of the first version of the application software stored in the first memory.
[0041] Advantageously, when the first data set of the first version of the application software stored in the first memory does not have integrity, the processing component is further configured to: implement initial software to erase the first memory, and guide the sensor to start the initial software.
[0042] Preferably, the sensor further comprises an electrical storage component configured to supply power to the sensor.
[0043] According to another aspect, a network is provided.
[0044] The network includes:
[0045] - Gateway,
[0046] - At least one sensor as defined above, said sensor further comprising communication means configured to communicate wirelessly with said gateway. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Other advantages and features of the invention will emerge upon examination of the detailed description of embodiments which are by no means limiting and of the accompanying drawings, in which:
[0048] - Figure 1 schematically illustrates an example of a network according to the present invention; and
[0049] - Figure 2 An example of a method for updating sensors of a network according to the present invention is shown. DETAILED DESCRIPTION
[0050] refer to Figure 1 , which represents an example of a network including a gateway 1 , a first sensor 2 , and a second sensor 3 .
[0051] The network 1 may be a mesh network.
[0052] In a variant, the network 1 comprises more than two sensors.
[0053] The gateway 2 comprises a communication component 4 .
[0054] Since the first sensor 2 and the second sensor 3 have the same architecture, only the first sensor 2 is described in detail.
[0055] The first sensor 2 includes a boot memory 5 for storing initial software SOFT-I for booting the sensor, a first memory 6 for storing application software of the current version SOFT-0, a second memory 7 for storing a predetermined sensor identifier ID0, a third memory 8 for storing application software of the first version SOFT-1, and a fourth memory 9 for storing a flag FL.
[0056] The flag FL may be in a first state or a second state.
[0057] For example, the flag FL in the first state is equal to a Boolean value "1", and the flag FL in the second state is equal to a Boolean value "0".
[0058] The boot memory 5 and the second memory 7 are non-volatile memories, and the first memory 6 and the third memory 8 may be volatile or non-volatile memories.
[0059] In a variation, the first memory 6, the second memory 7, the third memory 8, and the fourth memory 9 may be one memory.
[0060] The sensor 2 also includes a communication component 10 , a processing component 11 , and may include an electrical storage component 12 .
[0061] The electric storage component 12 includes, for example, a battery.
[0062] In a variant, the sensor 2 may be provided with a grid.
[0063] The communication components 10 of the first sensor 2 and the second sensor 3 communicate with the communication component 4 of the gateway 1 .
[0064] The first sensor 2 further comprises a measuring component 13 .
[0065] The measuring means 13 comprise, for example, a measuring interface which measures the temperature outside the first sensor 2 and / or measures the vibrations of the machine on which the first sensor 4 is fastened.
[0066] The processing part 11 includes, for example, a processing unit that implements the boot memory 5 , the first memory 6 , the second memory 7 , the third memory 8 , and the fourth memory 9 , the communication part 10 , and the measurement part 13 .
[0067] The processing unit 11 implements the initial software SOFT-I and the application software of the current version SOFT-0.
[0068] The first sensor 2 , the second sensor 3 and the gateway 1 may communicate wirelessly, for example, using a mesh protocol or a Bluetooth protocol.
[0069] The predetermined sensor identifier ID0 is assigned to the first sensor 2 during its manufacture, and indicates a version of the hardware of the first sensor 2 .
[0070] Each version of the application software SOFT-0, SOFT-1 comprises a first data set DATA1, DATA10 and a first identifier ID1, ID10.
[0071] The first identifier ID1 , ID10 indicates the version(s) of the hardware of said sensor 2 , 3 that is compatible with said version SOFT- 0 , SOFT- 1 of the application software.
[0072] The first identifier ID1 of the application software of the current version SOFT0 is equal to the predetermined sensor identifier ID0.
[0073] The first data set DATA1, DATA10 comprises instructions for implementing the communication component 10 and the measurement component 13 as well as instructions for updating the current version of the application software.
[0074] Each version of the application software SOFT-0, SOFT-1 may include a second identifier ID2, ID20 indicating the version of the application software.
[0075] The second identifier ID2 indicates the version SOFT-0 of the application software stored in the first memory 6 , and the second identifier ID20 indicates the first version SOFT-1 of the application software stored in the third memory 8 .
[0076] Each version of the application software SOFT-0, SOFT-1 may also include a second data set DATA2, DATA20 for checking the integrity of the first data set DATA1, DATA10.
[0077] The second data set DATA2 , DATA20 is intended, for example, to perform a cyclic redundancy check CRC of the first data set DATA1 , DATA10 .
[0078] The application software of the first version SOFT-1 can be downloaded from the gateway 1 by the communication component 10 of the first sensor 2 .
[0079] Figure 2 An example of a method of updating a current version of application software stored in the first memory 6 of the first sensor 2 is shown.
[0080] It is assumed that the first sensor 2 and the second sensor 3 are synchronized with the gateway 1 so that the network is synchronized, and the processing component 11 implements the application software of the current version SOFT-0.
[0081] It is also assumed that the flag FL is in the second state.
[0082] During the first step 20, when the processing component 11 has detected that the application software of the first version SOFT-1 is stored in the third memory 8, the processing component 11 implements the application software of the current version SOFT-0 stored in the first memory 6 to compare the predetermined sensor identifier ID0 with the first identifier ID10 of the application software of the first version SOFT-1 stored in the third memory 8.
[0083] If the first identifier ID10 of the application software of the first version SOFT-1 is equal to the predetermined sensor identifier ID0 (step 21), then during step 22, the application software of the current version SOFT-0 implemented by the processing component 13 sets the flag FL to the first state and compares the second identifier ID2 of the application software of the current version SOFT-0 with the second identifier ID20 of the application software of the first version SOFT-1.
[0084] If the second identifier ID2 of the application software of the current version SOFT-0 is equal to the second identifier ID20 of the application software of the first version SOFT-1 (step 23 ), the method continues at step 24 .
[0085] If the second identifier ID2 of the application software of the current version SOFT-0 is not equal to the second identifier ID20 of the application software of the first version SOFT-1 (step 23 ), the method continues at step 25 .
[0086] If the first identifier ID10 of the first version SOFT- 1 of the application software is not equal to the predetermined sensor identifier ID0 ( step 21 ), the method continues at step 24 .
[0087] If at least one of the current version of the application software and the first version of the application software does not include the second identifier, the method skips step 23 .
[0088] During a step 24 , the application software of the current version SOFT-0 implemented by the processing means 13 sets the flag FL to a second state.
[0089] During a step 25 , the application software of the current version SOFT-0 implemented by the processing means 13 reads the state of the flag FL stored in the fourth memory 9 .
[0090] If the flag FL is in the second state (step 26 ), the updating is aborted, and the processing component 13 continues to execute the application software of the current version SOFT-0, so that the first sensor 2 continues to run with the application software of the current version SOFT-0.
[0091] If the flag FL is in the first state (step 26 ), during a step 27 , the application software of the current version SOFT-0 implemented by the processing means 13 directs the first sensor 2 to launch the initial software SOFT-I.
[0092] When the initial software SOFT-I is implemented by the processing unit 13 , in step 28 , the initial software SOFT-I implemented by the processing unit 13 reads the flag FL stored in the fourth memory 9 .
[0093] When the flag FL is in the second state (step 29), during step 30, the processing means 13 implements the current version of the application software SOFT-0 and the current version of the application software SOFT-0 implemented by the processing means 13 resynchronizes the first sensor 2 with the gateway 1. The updating of the current version of the application software is aborted.
[0094] When the flag FL is in the first state (step 29), during step 31, the initial software SOFT-I implemented by the processing unit 13 replaces the application software of the current version SOFT-0 stored in the first memory 6 with the application software of the first version SOFT-1 stored in the third memory 8, and sets the flag FL to the second state.
[0095] The first memory 6 stores application software of the first version SOFT-1.
[0096] During a step 32 , the initial software SOFT-I implemented by the processing means 13 checks the integrity of the first data set DATA10 of the application software of the first version SOFT-1 stored in the first memory 6 according to the second data set DATA20 of the application software of the first version SOFT-1 stored in the first memory 6 .
[0097] If the first data set DATA10 of the first version SOFT-1 application software stored in the first memory 6 is complete (step 33), then in step 34, the processing component 13 implements the first version SOFT-1 application software stored in the first memory 6, and the first version SOFT-1 application software stored in the first memory 6 is the current version of the application software.
[0098] During a step 36 , the current version of the application software implemented by the processing means 13 resynchronizes the first sensor 2 with the gateway 1 .
[0099] If the first data set DATA10 of the application software of the first version SOFT-1 stored in the first memory 6 does not have integrity (step 33), then in step 35, the initial software SOFT-I implemented by the processing component 13 erases the first memory 6 to erase the application software of the first version SOFT-1 stored in the memory 6, sets the flag to the first state, and guides the first sensor 2 to start the initial software SOFT-I.
[0100] The method continues at step 31 when the initial software SOFT-I is implemented by the processing means 13 .
[0101] When the application software of the first version SOFT-1 does not include the second data set DATA20, steps 32, 33, 34 and 35 are skipped, so that the method proceeds from step 31 to step 36, and the application software of the first version SOFT-1 stored in the first memory 6 is the current version of the application software.
[0102] The current version of the application software of the sensor checks the compatibility of the first version of the application software with the sensor, and if the first version of the application software is compatible with the sensor, guides the sensor to update the application software, thereby reducing the duration of the update implemented by the initial software to reduce the duration of no communication between the sensor and the gateway.
[0103] The reduction in the duration of no communication reduces the duration of synchronizing the sensor with the gateway after an update and reduces the power consumption of the sensor, for example to increase the life of the sensor's battery.
[0104] Furthermore, since the compatibility check instructions are included in the current version of the application software, the initial software has a smaller size than the initial software known in the prior art, thereby allowing the size of the boot memory to be reduced, and is simpler than the initial software known in the prior art, thereby reducing the probability of errors in the initial software.
Claims
1. A method for updating application software stored in a first memory (6) of a sensor (2), comprising: - implementing a current version (SOFT-0) of the application software stored in the first memory (6) to compare a predetermined sensor identifier (ID0) stored in the second memory (7) of the sensor with a first identifier (ID10) of a first version (SOFT-1) of the application software stored in the third memory (8), - implementing said current version (SOFT-0) of application software to set a flag (FL) stored in a fourth memory (9) to a first state when said first identifier (ID10) comprises said predetermined sensor identifier (ID0), - when the flag (FL) stored in the fourth memory (9) is in a first state, implementing the application software of the current version (SOFT-0) to guide the sensor (2) to start the initial software (SOFT-I) stored in the boot memory (5), - implementing said initial software (SOFT-I) to read the flag (FL) stored in said fourth memory (9), and When the state of the flag (FL) is equal to the first state: - Implementing the initial software (SOFT-I) to replace the current version (SOFT-0) of the application software stored in the first memory (5) with the first version (SOFT-1) of the application software stored in the third memory (9), and setting the flag (FL) to a second state different from the first state, so that the first memory (6) stores the first version (SOFT-1) of the application software.
2. The method according to claim 1, characterized in that The current version (SOFT-0) of the application software includes a second identifier (ID2), and the first version (SOFT-1) of the application software includes a second identifier (ID20). The step of implementing the current version (SOFT-0) of the application software also includes: when the second identifier (ID2) of the current version (SOFT-0) of the application software is equal to the second identifier (ID20) of the first version (SOFT-1), setting the flag (FL) to the second state.
3. The method according to any one of the preceding claims, characterized in that The first version (SOFT-1) of the application software includes a first data set (DATA10) and a second data set (DATA20) for checking the integrity of the first data set (DATA10). The method also includes: implementing the initial software (SOFT-0) to check the integrity of the first data set (DATA10) of the first version of the application software stored in the first memory (6) based on the second data set (DATA20) of the first version of the application software stored in the first memory (6), and when the first data set (DATA10) of the first version of the application software stored in the first memory has integrity, implementing the first data set (DATA10) of the first version of the application software stored in the first memory (6).
4. The method according to claim 3, characterized in that: When a first data set (DATA10) of a first version (SOFT-1) of application software stored in the first memory (6) does not have integrity, the method further comprises: implementing the initial software (SOFT-0) to erase the first memory (6), setting the flag (FL) in a first state, and directing the sensor (2) to start the initial software (SOFT-0).
5. A sensor (2), comprising: - a first memory (6) configured to store the current version (SOFT-0) of the application software, - a second memory (7) configured to store a predetermined sensor identifier (ID0), - a third memory (8) configured to store a first version (SOFT-1) of the application software, - a fourth memory (9) configured to store a flag (FL), - a boot memory (5) configured to store initial software (SOFT-I), and - a processing unit (11) configured to: implementing said current version (SOFT-0) of application software to compare said predetermined sensor identifier (ID0) with a first identifier (ID10) of said first version (SOFT-1) of application software, when the first identifier (ID10) includes the predetermined sensor identifier (ID0), implementing the application software of the current version (SOFT-0) to set the flag (FL) to a first state, and when the flag (FL) stored in the third memory (9) is in the first state, implementing the application software of the current version (SOFT-0) to guide the sensor (2) to start the initial software (SOFT-I) stored in the boot memory (5), ·The initial software (SOFT-I) is implemented to read the flag (FL) stored in the third memory (9), and when the state of the flag (FL) is equal to the first state, the initial software (SOFT-I) is implemented to replace the current version (SOFT-0) of the application software stored in the first memory (6) with the first version (SOFT-1) of the application software stored in the third memory (8), and set the flag (FL) to a second state different from the first state.
6. The sensor according to claim 5, characterized in that The processing component (11) is also configured to: when the second identifier (ID2) of the current version (SOFT-0) of the application software is equal to the second identifier (ID20) of the first version (SOFT-1) of the application software, implement the current version (SOFT-0) of the application software to set the flag (FL) to the second state.
7. The sensor according to claim 5 or 6, characterized in that: The first version (SOFT-1) of the application software includes a first data set (DATA10) and a second data set (DATA20) for checking the integrity of the first data set (DATA10), and the processing component (11) is also configured to: implement the initial software (SOFT-I) to check the integrity of the first data set (DATA10) of the first version of the application software stored in the first memory (6) based on the second data set (DATA20) of the first version of the application software stored in the first memory (6), and when the first data set (DATA10) of the first version of the application software stored in the first memory (6) has integrity, implement the first data set (DATA10) of the first version of the application software stored in the first memory (6).
8. The sensor according to claim 7, characterized in that When the first data set (DATA10) of the first version of the application software stored in the first memory (6) does not have integrity, the processing component (11) is also configured to: implement the initial software (SOFT-I) to erase the first memory (6), and guide the sensor to start the initial software (SOFT-I).
9. The sensor according to any one of claims 5 to 8, characterized in that Also includes: An electrical storage component (12) is configured to supply power to the sensor (2).
10. A network comprising: - Gateway (1), - At least one sensor (2, 3) according to any one of claims 5 to 9, said sensor further comprising communication means (10) configured to communicate wirelessly with said gateway (1).