A Reliable OTA Upgrade Method for an Animal Field Experiment Device under an Unstable Network

Through the two-stage differential upgrade method and the design of the public backup area, the reliable OTA upgrade problem of animal field experimental equipment under network instability is solved, the upgrade efficiency and success rate are improved, manpower and material investment is reduced, and scientific research efficiency is improved.

CN115617375BActive Publication Date: 2025-08-01DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211405232.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-08-01
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

In the case of unstable network, it is difficult for the prior art to achieve reliable differential program upgrades for animal field experimental devices, resulting in long upgrade time, large power consumption and low success rate, which affects experimental efficiency and accuracy.

Method used

The two-stage method is used to perform OTA upgrades: in the first stage, the differential upgrade packet is subcontracted to the device when the network is unstable, and the second stage is partitioned according to the received differential upgrade packets, and the public backup area is used to store the last upgrade packet to ensure that the correct upgrade packet is used when the upgrade conditions are met.

Benefits of technology

Reliable differential upgrades are achieved in the situation of unstable networks, which improves the efficiency and success rate of upgrades, reduces manpower and material investment, and improves scientific research efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617375B_ABST
    Figure CN115617375B_ABST
Patent Text Reader

Abstract

The present invention provides a reliable OTA upgrade method for an animal field experiment device under an unstable network, belonging to the field of bioelectronic scientific research. The OTA upgrade method described in the present invention mainly includes two stages: receiving a differential upgrade package released by a server through an unstable network and using the differential upgrade package to perform program upgrades on devices with A / B system partitions. This method can solve the problem that current animal field experiment devices are all pre-programmed and written once by wire, resulting in inflexible program upgrades, and can effectively save the manpower and material resources required for animal field experiments, improving the experimental efficiency and accuracy of scientific researchers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of bioelectronics research, and in particular relates to an OTA upgrade method for an animal field tracking experimental unit. Background Art

[0002] In recent years, scientific research in wildlife tracking, monitoring, and control has rapidly developed. In particular, cross-disciplinary research involving brain-computer interfaces (BCIs) has become a hot topic in this field. Currently, experimental devices used for these studies are programmed once over a wired network before deployment. When researchers need to update and optimize experimental strategies and algorithms, they must rewrite the updated program using a new module and then deploy it on a new animal. This is labor-intensive and resource-intensive, negatively impacting the efficiency and accuracy of experiments. Using Over-the-Air (OTA) technology for program updates allows for anytime, anywhere updates to animal experimental devices as long as there is a network connection. This increases the reuse rate of experimental devices, significantly reduces the labor and resource requirements, and improves experimental efficiency and accuracy.

[0003] When using OTA technology for software updates, Google uses an A / B system update method to prevent device problems during the update, which could render the device completely unusable. The A / B system means that the device has two working systems, A and B. This can be understood as one system partition and the other a backup partition. The system versions may or may not be the same. After the software is updated, simply restart the device to run the updated software.

[0004] Terminals with A / B partitions typically use full package upgrades. However, since animal field experimental equipment is often used in locations with poor network connectivity, using full package upgrades can result in significant time and battery consumption during package transfers, reducing transmission success rates. Furthermore, when terminals with A / B partitions use differential package upgrades, since differential packages can only upgrade a specific version, starting with the second upgrade, the obtained differential package cannot directly upgrade the program in the other partition. Summary of the Invention

[0005] In order to solve the problem of performing differential program upgrade on an embedded device with an A / B partition system under unstable network conditions, the present invention provides an OTA upgrade method for an animal field experiment device.

[0006] The technical solution of the present invention is:

[0007] A reliable OTA upgrade method for an animal field experimental device under an unstable network is proposed. The program upgrade process is mainly divided into two stages: the first stage is that the server transmits the differential upgrade package to the animal field experimental device in its entirety under an unstable network; the second stage is that the animal field experimental device performs partition upgrades on the program according to the received differential upgrade package.

[0008] In order to realize the first stage of transmitting the differential upgrade package data from the server to the animal field experiment device under the condition of unstable network, the present invention uses a communication method that can maintain intermittent transmission for a long time.

[0009] Step S1: Publish the prepared differential upgrade package on the server side and select the hardware number that needs to be upgraded. The server side subpackages the differential upgrade package. The information in each subpackage includes the hardware number, the source version of the differential upgrade package (before upgrade), the target version of the differential upgrade package (after upgrade), the total number of subpackages of the differential upgrade package, the current package sequence number, the differential upgrade package information and the checksum. The subpackage specific information is as follows: Figure 2 Then the server software will issue a program upgrade command to the selected hardware.

[0010] Step S2: The animal field experiment device sends a request for differential upgrade package subpackaging to the server according to the received program upgrade command.

[0011] Step S3: After receiving the request, the server sends the corresponding small package. After receiving it, the animal field experiment device verifies it according to the verification code. After the verification is successful, the differential program information is stored in the public backup area, and then the next differential upgrade package is requested.

[0012] Step S4: Repeat steps S2 and S3 until all differential upgrade package sub-packets are sent.

[0013] During the above execution process, if the animal field experiment device automatically shuts down due to insufficient power or there is a long-term network interruption, the server will maintain the connection status for 180 seconds. If it exceeds 180 seconds, the server will close the connection, but will create a table entry to record the device number for which the program upgrade has not been completed. When the animal field experiment device returns to normal working state (after the network returns to normal or the power is restored through solar charging), the transmission status flag will be queried. When the transmission status flag is 1, the current pending request packet number will be read and a request signal will be sent to the server. After receiving the request information, the server will query. If it is found that the previous program process of the device has been interrupted, the connection will be re-established and the differential upgrade package will be sent.

[0014] To achieve the second stage, the present invention provides an OTA upgrade method for an embedded device. The memory of the embedded device should include an A system partition, a B system partition, and a common backup area. The information stored in the common backup area is the software version number of the A system partition, the software version number of the B system partition, the current device hardware version number, the sequence number of the packet to be requested, the transmission status flag bit, the upgrade status flag bit, the differential upgrade package used during the last differential upgrade, and the differential upgrade package required for this upgrade. The schematic diagram of the stored information in the memory is as shown in Figure 3 shown. The OTA upgrade method includes:

[0015] Step S5: After the differential upgrade package is received, according to the obtained differential upgrade package data, check whether the B system partition meets the upgrade conditions (assuming that the partition where the device is currently running the system is the A system partition), and compare the B system partition version number with the source version number of the current differential upgrade package.

[0016] Step S6: If the program version number of the B system partition is the same as the source version number of the current differential upgrade package, it meets the upgrade conditions. The animal field experiment device upgrades the system in the B system partition according to the currently obtained differential upgrade package. After the upgrade is completed, restart the device to run the new version program. If it does not meet the upgrade conditions, then execute Step S7.

[0017] Step S7: If the program version number of the B system partition is different from the source version number of the current differential upgrade package, that is, it does not meet the upgrade conditions. The animal field experiment device first uses the differential upgrade package obtained last time to upgrade the software in the B system partition once to make it meet the upgrade conditions. Then use the current differential upgrade package to upgrade the B system partition. After the upgrade is completed, restart the device to run the new version program.

[0018] Advantages of the present invention: The present invention can reliably send differential upgrade packages under unstable network conditions, place the received differential upgrade packages in the common backup area, and both the A and B systems can use the differential upgrade packages for upgrades. And during the upgrade process, when the program version of a certain partition does not meet the upgrade conditions, there is no need to request from the server again a differential upgrade package with that version program as the source version. Only the differential upgrade package obtained last time stored in the common backup area can be used to complete the upgrade to meet the conditions. This effectively ensures the reliability and efficiency of the program upgrade, enables researchers to use a simple and fast update algorithm program, greatly improves the research efficiency of researchers, and reduces the expenditure of manpower and material resources. Brief Description of the Drawings

[0019] Figure 1 is the overall flowchart of the present invention.

[0020] Figure 2 is the schematic diagram of the sub-packet information of the differential upgrade package described in the present invention.

[0021] Figure 3 It is a schematic diagram of the memory storage information of the present invention.

[0022] Figure 4 This is a flowchart illustrating the implementation case of the first phase.

[0023] Figure 5 This is a flowchart illustrating the implementation case of the second phase. DETAILED DESCRIPTION

[0024] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the present invention is further described below with reference to the accompanying drawings and in combination with specific implementation methods, so that those skilled in the art can implement it with reference to the text of the specification. The scope of protection of the present invention is not limited to the specific implementation methods.

[0025] like Figure 1 As shown, a reliable OTA upgrade method for an animal field experimental device under an unstable network includes two stages: the first stage is that the server transmits the differential upgrade package to the animal field experimental device under an unstable network; the second stage is that the animal field experimental device partitions the program according to the received differential upgrade package.

[0026] like Figure 4 As shown, the specific implementation of the first stage is as follows:

[0027] S1-1: The software publisher uploads the differential upgrade package to the server and selects the hardware number to be upgraded. The server subpackages the differential upgrade package. Each subpackage includes the hardware number, the source version of the differential upgrade package, the target version of the differential upgrade package, the total number of differential upgrade package subpackages, the current package sequence number, the differential upgrade package information, and a checksum. The server then sends an OTA program upgrade command to the selected animal field experiment device.

[0028] S1-2: After receiving the program upgrade command, the animal field experiment device starts the differential upgrade package transmission task, first sets the transmission status flag to 1 in the public backup area, then sends a differential upgrade package sub-packet request command to the server, and finally starts a 30-second timer.

[0029] S1-3: After receiving the differential upgrade package request command, the server starts the differential upgrade package delivery task and delivers the differential upgrade package sub-packages in sequence.

[0030] S1-4: After the animal field experiment device receives a certain packet and successfully verifies it according to the check code, the animal field experiment device will record it in the public backup area. After receiving the last packet, the animal field experiment device will query the reception record. If it is found that a certain packet has not been received successfully, a retransmission request with the hardware number and packet sequence number will be sent to the server; if all are received successfully, the reception completion information will be sent up and the reception task will end. When the animal field experiment device receives a packet, it will reset the timer started in step S1-2. When the timer is triggered (no new differential upgrade packet sub-packets are received within 30 seconds), the animal field experiment device will sleep the reception task for 15 minutes.

[0031] S1-5: After the server sends down the differential upgrade packet, a 180-second timer will be started. If no retransmission information or reception completion information is received within 180 seconds, the differential upgrade packet sending task will be put into sleep, and the task will be awakened when a sub-packet request message from this device is received again.

[0032] S1-6: After the animal field experiment device wakes up the reception task again, it will query the reception record in the public backup area, then send a retransmission message to the server and start the timer.

[0033] S1-7: If the reception is completed, the task ends; otherwise, step S1-6 is repeated until the reception task is completed. After the transmission task is completed, the transmission status flag in the public backup area is set to 0.

[0034] As Figure 5 shown, the specific implementation of the second stage is as follows:

[0035] When performing program differential upgrade, the differential upgrade packet can only upgrade a specific version of the program to another specific version. For example, when the differential upgrade packet sent by the server is the V2-V3 differential upgrade packet for upgrading the program from version V2 to version V3, this differential upgrade packet can only play an upgrading role for the program of version V2, and the V2-V3 differential upgrade packet cannot be used to upgrade the program of version V1.

[0036] When the device is in the initial state, the programs in partitions A and B are the same version V1. Assuming the initial system partition is partition A, when the differential upgrade packet (V1-V2) is received for the first time, this differential upgrade packet can be directly used to upgrade the program in partition B, and after the upgrade, partition B becomes the system partition. However, when the differential upgrade packet (V2-V3) is received for the second time, at this time, the program in partition A is still version V1, and at this time, the differential upgrade packet (V2-V3) cannot be directly used for upgrading.

[0037] In response to this problem, in the OTA upgrade method proposed in this application, in addition to the A and B system partitions, there is also a common backup area, which can be accessed by both the A system partition and the B system partition. The common backup area mainly stores the version information of the A and B system partitions, the upgrade status flag bits, and the two adjacent differential upgrade packages.

[0038] S2-1: After the first differential upgrade package is received (V1-V2 upgrade package), set the upgrade status flag bit to 1. At this time, the A and B system partitions both have the V1 version program. Assume that the current system partition is the A partition, then compare the program version number of the B system partition with the source version of the differential upgrade package (the version before upgrade). If the program version number of the B system partition is the same as the source version of the differential upgrade package, the current obtained differential upgrade package (V1-V2 upgrade package) can be directly used to upgrade the B system partition. After the upgrade is completed, set the upgrade status flag bit to 0 and restart the animal field experiment device. After restarting, the system partition is the B partition, the program version is V2, and the program version of the A system partition remains V1.

[0039] S2-2: After the second differential upgrade package is received (V2-V3 upgrade package), set the upgrade status flag bit to 1. At this time, there will be two received differential upgrade packages (V1-V2 upgrade package, V2-V3 upgrade package) in the common backup area. At this time, when detecting the upgrade conditions for the A partition, it will be found that the V2-V3 upgrade package cannot be directly used to upgrade the A partition. The animal field experiment device will first use the V1-V2 upgrade package in the common backup area to upgrade the A partition program to the V2 version, and then use the V2-V3 upgrade package to upgrade the A partition program to the V3 version. After the upgrade is completed, set the upgrade status flag bit to 0 and restart the animal field experiment device. After restarting, the program version of the A partition is V3, the program version of the B partition is V2, and the system partition is the A partition.

[0040] S2-3: After the third differential upgrade package is received (V3-V4 upgrade package), set the upgrade status flag bit to 1. At this time, there will be V2-V3 differential upgrade package and V3-V4 differential upgrade package in the common backup area. At this time, when detecting the upgrade conditions for the B partition, it will be found that the V3-V4 cannot be used to upgrade the B partition program. The animal field experiment device will first use the V2-V3 upgrade package in the common backup area to upgrade the B partition program, and then use the V3-V4 upgrade package to upgrade the B partition program. After the upgrade is completed, set the upgrade status flag bit to 0 and restart the animal field experiment device. After restarting, the program version of the B partition is V4, the program version of the A partition is V3, and the system partition is the B partition.

[0041] S2-4: For subsequent upgrades, refer to steps S2-2 and S2-3.

Claims

1. A reliable OTA upgrade method for an animal field experiment device under an unstable network, characterized in that The memory of the animal field experiment device includes a System A partition, a System B partition, and a common backup area. The OTA upgrade method includes the following steps: (1) The server transmits the differential upgrade package in its entirety to the animal field experiment device Step S1: At the server side, the prepared differential upgrade package is released, and the hardware number to be upgraded is selected. The server divides the differential upgrade package into sub-packages. The information of each small package includes the hardware number, the source version of the differential upgrade package, the target version of the differential upgrade package, the total number of sub-packages of the differential upgrade package, the current package serial number, the differential upgrade package information, and the check code. Then the server sends an OTA program upgrade command to the animal field experiment device with the selected number; Step S2: The animal field experiment device sends a request for a sub-package of the differential upgrade package to the server according to the received program upgrade command; Step S3: After receiving the request, the server sends the corresponding small package. After receiving it, the animal field experiment device performs verification according to the check code. After successful verification, the differential program information is stored in the common backup area, and then a request for the next sub-package of the differential upgrade package is sent; Step S4: Repeat steps S2 and S3 until all sub-packages of the differential upgrade package are sent; (2) The animal field experiment device upgrades the program by partitions according to the received differential upgrade package Step S5: Assume that the currently running system is in the System A partition. After the differential upgrade package is received, compare the version number of the System B partition with the source version number of the current differential upgrade package to verify whether the System B partition meets the upgrade conditions; Step S6: If the program version number of the System B partition is the same as the source version number of the current differential upgrade package, it meets the upgrade conditions: The animal field experiment device upgrades the system in the System B partition according to the currently obtained differential upgrade package. After the upgrade is completed, the animal field experiment device is restarted to run the new version program; if it does not meet the upgrade conditions, step S7 is executed; Step S7: If the program version number of the System B partition is different from the source version number of the current differential upgrade package, that is, it does not meet the upgrade conditions: The animal field experiment device first uses the previously obtained differential upgrade package to upgrade the software in the System B partition once to make it meet the upgrade conditions; then uses the current differential upgrade package to upgrade the System B partition. After the upgrade is completed, the animal field experiment device is restarted to run the new version program.

2. The reliable OTA upgrade method of an animal field experiment device according to claim 1 under an unstable network, characterized in that, In the first stage, the specific process of the server transmitting the differential upgrade package in its entirety to the animal field experiment device is as follows: 1) The software release personnel upload the differential upgrade package to the server and select the hardware number to be upgraded. The server divides the differential upgrade package into sub-packages and then sends an OTA program upgrade command to the animal field experiment device with the selected number; 2) After receiving the program upgrade command, the animal field experiment device starts the differential upgrade package transmission task. First, set the transmission status flag to 1 in the common backup area, then send a request command for a sub-package of the differential upgrade package to the server, and finally start a 30-second timer; 3) After the server receives the differential upgrade package request command, it starts the differential upgrade package distribution task and distributes the differential upgrade package in sub-packages sequentially. 4) After the animal field experiment device receives a certain sub-package and successfully verifies it according to the check code, it records it in the public backup area; after receiving the last sub-package, the animal field experiment device queries the received records. If it is found that a certain sub-package has not been received successfully, it sends a retransmission request with the hardware number and sub-package serial number to the server side; if all are received successfully, it uploads the reception completion information and ends the reception task; when the animal field experiment device receives a sub-package, it resets the timer started in process 2. When the timer is triggered, the animal field experiment device puts the reception task to sleep for 15 minutes. 5) When the server side finishes distributing the differential upgrade package, it starts a 180-second timer. If no retransmission information or reception completion information is received within 180 seconds, it will put the differential upgrade package distribution task into sleep. When it receives the sub-package request information from the animal field experiment device again, it wakes up the task. 6) After the animal field experiment device wakes up the reception task again, it queries the reception records in the public backup area, then sends retransmission information to the server and starts the timer. 7) If the reception is completed, the task ends; otherwise, it repeats process 6 until the reception task is completed; after the transmission task is completed, the transmission status flag in the public backup area is set to 0.

3. A reliable OTA upgrade method for an animal field experiment device under an unstable network according to claim 1 or 2, characterized in that, The information stored in the public backup area includes the software version number of the A system partition, the software version number of the B system partition, the current device hardware version number, the sub-package serial number to be requested, the transmission status flag, the upgrade status flag, the differential upgrade package used in the previous differential upgrade, and the differential upgrade package required for this upgrade.

Citation Information

Patent Citations

  • Remote upgrading method of automobile controller and computer readable storage medium

    CN110351314A

  • Online upgrade method for household appliance multi-MCU system, electronic device, and medium

    WO2021120887A1