Software upgrade method and device for wearable device, wearable device and medium
By storing the upgrade package in the backup area of the wearable device and performing partition upgrades based on the running area information, the problem of device unusability caused by software upgrade failure is solved, and reliable upgrades and normal operation of the device are achieved.
Patent Information
- Application Number
- CN202111564666.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Existing wearable devices may become unusable when software upgrades fail.
Store the software upgrade package in the backup area, and after restarting the device, determine the partition that is not currently running the code based on the recorded running area information, obtain the software upgrade package from the backup area for the upgrade operation, and avoid device unavailability caused by direct upgrade.
Improves the reliability of software upgrades, ensuring that when one partition fails to upgrade, another partition can run normally, ensuring normal use of the device.
Smart Images

Figure CN114296757B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of wearable devices, and more specifically, to a software upgrade method for a wearable device, a software upgrade apparatus for a wearable device, a wearable device, and a computer-readable storage medium. Background Art
[0002] At present, the application of wearable devices such as smart watches and smart bracelets is becoming more and more widespread. Wearable devices usually need to upgrade their software functions. In related technologies, the software upgrade of wearable devices is implemented by directly upgrading the operating area. If the upgrade of the operating area is unsuccessful, the wearable device will become unusable. Summary of the Invention
[0003] An object of the embodiments of the present disclosure is to provide a new technical solution for software upgrade of a wearable device.
[0004] According to a first aspect of an embodiment of the present disclosure, the partitions of the wearable device include a first partition, a second partition, and a backup area, and the method includes:
[0005] Receive software upgrade packages;
[0006] Storing the software upgrade package in the backup area and restarting the wearable device;
[0007] When the wearable device needs to be upgraded after being restarted, determining a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information;
[0008] The software upgrade package is obtained from the backup area, and an upgrade operation is performed on the partition that is not currently running the code according to the software upgrade package.
[0009] Optionally, after storing the software upgrade package in the backup area and restarting the wearable device, the method further includes:
[0010] Obtain the flag information of the recorded system upgrade flag bit;
[0011] According to the flag information, it is determined whether the wearable device after restart needs to be upgraded.
[0012] Optionally, after performing the upgrade operation on the partition currently not running code according to the software upgrade package, the method further includes:
[0013] Verifying the software version of the upgraded partition that is not currently running the code according to the set verification items to obtain a first verification result;
[0014] When the first calibration result indicates that the upgraded software version of the partition that is not currently running the code has passed verification, the wearable device is restarted.
[0015] Optionally, the setting verification item includes: a verification item regarding whether the software version of the partition that is not currently running code after the upgrade is reliable.
[0016] Optionally, after storing the software upgrade package in the backup area and restarting the wearable device, the method further includes:
[0017] When the wearable device does not need to be upgraded after being restarted, verifying the software version of the first partition and the software version of the second partition according to the set verification item to obtain a second verification result;
[0018] When the second verification result indicates that the software version of the first partition passes verification and the software version of the second partition fails calibration, the first partition is used as the partition for currently running code;
[0019] When the second verification result indicates that the software version of the first partition fails verification and the software version of the second partition passes calibration, the second partition is used as the partition for currently running code.
[0020] Optionally, after the first calibration result indicates that the upgraded software version of the partition currently not running code has passed verification, the method further includes:
[0021] updating the operation area information;
[0022] The updating of the operating area information includes:
[0023] Update the partition identifier corresponding to the partition currently running the code
[0024] According to a second aspect of an embodiment of the present disclosure, a control apparatus for a wearable device is provided, wherein the partitions of the wearable device include a first partition, a second partition, and a backup area, and the apparatus includes:
[0025] A receiving module, used for receiving software upgrade packages;
[0026] A storage module, configured to store the software upgrade package in the backup area and restart the wearable device;
[0027] a determination module, configured to determine, when the wearable device needs to be upgraded after being restarted, a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information;
[0028] An upgrade module is used to obtain the software upgrade package from the backup area and perform an upgrade operation on the partition that is not currently running code according to the software upgrade package.
[0029] Optionally, the determining module is specifically configured to:
[0030] Obtain the flag information of the recorded system upgrade flag bit;
[0031] According to the flag information, it is determined whether the wearable device after restart needs to be upgraded.
[0032] According to a third aspect of an embodiment of the present disclosure, there is provided a wearable device, including:
[0033] Memory for storing executable computer instructions;
[0034] The processor is configured to execute the software upgrade method according to the first aspect above under the control of the executable computer instructions.
[0035] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the software upgrade method described in the first aspect is executed.
[0036] One beneficial effect of the disclosed embodiment is that the partitions of the wearable device include a first partition, a second partition, and a backup area. After receiving a software upgrade package, the wearable device does not directly upgrade the partitions of the wearable device based on the software upgrade package. Instead, the software upgrade package is written to the backup area, and the wearable device is restarted before determining whether an upgrade is required. This can improve the reliability of the software upgrade. At the same time, if the wearable device needs to be upgraded after being restarted, the partition that is not currently running code will be determined from the first partition and the second partition based on the recorded running area information. The upgrade operation is performed only on the partition that is not currently running code based on the software upgrade package obtained from the backup area. In this way, if the upgrade of one partition fails, the code can be run normally based on another partition to ensure the normal operation of the wearable device.
[0037] Other features and advantages of the present specification will become apparent from the following detailed description of exemplary embodiments of the present specification with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and, together with the description, serve to explain the principles of the specification.
[0039] Figure 1 is a schematic diagram of the hardware configuration of a wearable device according to an embodiment of the present disclosure;
[0040] Figure 2 is a flowchart of a software upgrade method for a wearable device according to an embodiment of the present disclosure;
[0041] Figure 3 is a flowchart of a software upgrade method for a wearable device according to an example of the present disclosure;
[0042] Figure 4 is a principle block diagram of a software upgrading apparatus for a wearable device according to an embodiment of the present disclosure;
[0043] Figure 5 4 is a principle block diagram of a wearable device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the embodiments of the present disclosure.
[0045] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0046] Technologies, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such technologies, methods, and equipment should be considered part of the specification.
[0047] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0048] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0049] <Hardware Configuration>
[0050] Figure 1 is a block diagram of a hardware configuration of a wearable device 1000 according to an embodiment of the present disclosure.
[0051] like Figure 1 As shown, the wearable device 1000 can be, for example, a smart watch, a smart bracelet, a head-mounted display, etc., which is not limited in the embodiments of the present disclosure.
[0052] In one embodiment, Figure 1As shown, the wearable device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like.
[0053] Among them, the processor 1100 may include but is not limited to a central processing unit CPU, a microprocessor MCU, etc. The memory 1200 includes, for example, ROM (read-only memory), RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 includes, for example, various bus interfaces, such as a serial bus interface (including a USB interface), a parallel bus interface, etc. The communication device 1400 is capable of wired or wireless communication. The display device 1500 is, for example, a liquid crystal display, an LED display, a touch display, etc. The input device 1600 includes, for example, a touch screen, a keyboard, a handle, etc. The wearable device 1000 can output audio information through the speaker 1700 and collect audio information through the microphone 1800.
[0054] It should be understood by those skilled in the art that although Figure 1 , multiple devices of the wearable device 1000 are shown; however, the wearable device 1000 of the embodiment of this specification may only involve some of the devices, or may also include other devices, which is not limited here.
[0055] In this embodiment, the memory 1200 of the wearable device 1000 is used to store instructions that control the processor 1100 to perform operations to implement or support the implementation of the wearable device software upgrade method according to any embodiment. A skilled person can design instructions based on the solutions disclosed in this specification. How instructions control the processor's operations is well known in the art and will not be described in detail here.
[0056] In the above description, a person skilled in the art can design instructions according to the solution provided by the present disclosure. How instructions control the operation of a processor is well known in the art and will not be described in detail here.
[0057] Figure 1 The wearable device shown is illustrative only and is in no way intended to limit the disclosure, its application, or uses.
[0058] <Method Example>
[0059] Figure 2 A software upgrade method for a wearable device according to an embodiment of the present disclosure is shown. The software upgrade method for the wearable device may be performed as follows. Figure 1The wearable device 1000 shown is implemented as follows. The wearable device 1000 can be a smart watch, a smart bracelet, a head-mounted display, etc. The partitions of the wearable device include a first partition, a second partition, and a backup partition. Generally, there is an active partition and an inactive partition in the first partition and the second partition, wherein the active partition is the partition currently running the code, and the inactive partition is the partition currently not running the code.
[0060] like Figure 2 As shown, the software upgrade method for a wearable device provided in this embodiment may include the following steps S2100 to S2400.
[0061] Step S2100: Receive a software upgrade package.
[0062] In this embodiment, when there is a software version upgrade, an external device such as a server can send a software upgrade package to the wearable device, and the wearable device can receive the software upgrade package sent by the server.
[0063] For example, the current software version is 3.0. If there is a software version upgrade in the server, such as software version 4.0, the software upgrade package corresponding to the software version 4.0 can be sent to the wearable device, and the wearable device can receive the software upgrade package corresponding to the software version 4.0.
[0064] After receiving the software upgrade package, enter:
[0065] Step S2200: store the software upgrade package in the backup area and restart the wearable device.
[0066] In related technologies, after receiving an upgrade package, a wearable device directly launches a bootloader and performs an upgrade based on the software upgrade package. In this embodiment, after receiving a software upgrade package, the wearable device first stores the software upgrade package in a backup area and restarts the wearable device before determining whether to perform an upgrade based on the software upgrade package on the partition of the wearable device that is not currently running code. This method of writing the software upgrade package to the backup area upon receipt improves the reliability of software upgrades and effectively avoids the problem of directly launching the bootloader and performing an upgrade based on the software upgrade package, which may result in an unsuccessful upgrade of the wearable device and subsequently render the wearable device unusable.
[0067] After storing the software upgrade package in the backup area and restarting the wearable device, enter:
[0068] Step S2300: When the wearable device needs to be upgraded after being restarted, a partition that is not currently running a code is determined from the first partition and the second partition according to the recorded running zone information.
[0069] In this embodiment, after restarting the wearable device, the wearable device will first obtain the flag information of the system upgrade flag recorded in the partition of the wearable device; and based on the flag information, determine whether the restarted wearable device needs to be upgraded. If it is determined that the restarted wearable device needs to be upgraded, it will determine the partition that is not currently running the code from the first partition and the second partition based on the recorded running area information.
[0070] Typically, after the software upgrade package is complete and successfully written to the backup area, the wearable device sets the system upgrade flag to 1 and records this flag in the wearable device's partition. Conversely, the system upgrade flag is set to 0 in the wearable device's partition and records this flag as 0. This means that if the flag is 1, the wearable device needs to be upgraded after reboot, and if it is 0, it does not need to be upgraded after reboot.
[0071] The above running zone information can indicate the partition identifier corresponding to the partition currently running the code. For example, when the flag information is 1, it indicates that the wearable device needs to be upgraded after restart. Here, the wearable device will obtain the running zone information recorded in the partition of the wearable device. For example, if the running zone information indicates that the partition identifier corresponding to the partition currently running the code is the first partition A, the first partition A will be used as the partition currently running the code, and the second partition B will be used as the partition not running the code.
[0072] When the wearable device needs to be upgraded after being restarted, after determining a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information, enter:
[0073] Step S2400: Obtain the software upgrade package from the backup area, and perform an upgrade operation on the partition that is not currently running code according to the software upgrade package.
[0074] In this embodiment, after determining the partition currently not running code from the first and second partitions, the software upgrade package can be retrieved from the backup area. Then, based on the software upgrade package, the upgrade operation is performed only on the partition currently not running code. In this way, even if the upgrade of the partition currently not running code fails, since the partition currently running code has the latest software version, the partition currently running code can continue to be used, ensuring normal use of the wearable device. In other words, by using active and inactive areas, the problem of ensuring normal use of the wearable device can be effectively avoided in the event of a partition upgrade failure.
[0075] Continuing with the above example, the first partition A is the partition currently running the code, and the second partition B is the partition currently not running the code. Here, the wearable device can obtain the software upgrade package from the backup area and upgrade the second partition B according to the software upgrade package. This ensures that even if the upgrade of the second partition B fails, the wearable device can still use the first partition A.
[0076] According to an embodiment of the present disclosure, the partitions of the wearable device include a first partition, a second partition, and a backup area. After receiving a software upgrade package, the wearable device does not directly upgrade the partitions of the wearable device based on the software upgrade package. Instead, the software upgrade package is written to the backup area, and the wearable device is restarted before determining whether an upgrade is required. This can improve the reliability of the software upgrade. At the same time, if the wearable device needs to be upgraded after being restarted, the partition that is not currently running code will be determined from the first partition and the second partition based on the recorded running area information. The upgrade operation is performed only on the partition that is not currently running code based on the software upgrade package obtained from the backup area. In this way, if the upgrade of one partition fails, the code can be run normally based on another partition to ensure the normal operation of the wearable device.
[0077] In one embodiment, after executing the above step S2400 to obtain the software upgrade package from the backup area and performing an upgrade operation on the partition that is not currently running code according to the software upgrade package, the software upgrade method of the wearable device of the embodiment of the present disclosure may further include the following steps S3100 to S3200:
[0078] Step S3100: Verify the software version of the upgraded partition that is not currently running the code according to the set verification items to obtain a first verification result.
[0079] The set check item includes a check item regarding whether the software version of the partition currently not running any code after the upgrade is reliable.
[0080] In this embodiment, a set cyclic redundancy check code is stored in the partition of the wearable device. The set cyclic redundancy check code is the cyclic redundancy check code of the reliable software version. Here, the wearable device can obtain the cyclic redundancy check code of the upgraded partition that is not currently running the code, and compare the cyclic redundancy check code with the set cyclic redundancy check code.
[0081] Step S3200: When the first calibration result indicates that the software version of the partition that is not currently running the code has passed the verification after the upgrade, restart the wearable device.
[0082] In this embodiment, when the cyclic redundancy check code of the upgraded partition that is not currently running the code is the same as the set cyclic redundancy check code, it indicates that the software version of the upgraded partition that is not currently running the code has passed the verification, and the software version of the upgraded partition that is not currently running the code is determined to be a reliable software version. At this time, the wearable device can be restarted.
[0083] According to this embodiment, the wearable device will be restarted only when the software version of the partition that is not currently running the code is verified and passes the verification, and the software version of the partition that is not currently running the code is used as the reliable software version, thereby ensuring the reliability of the software upgrade.
[0084] In one embodiment, after executing the above step S2200 to store the software upgrade package in the backup area and restarting the wearable device, the software upgrade method of the wearable device of the embodiment of the present disclosure may further include the following steps S4100 to S4300:
[0085] Step S4100: When the wearable device does not need to be upgraded after being restarted, the software version of the first partition and the software version of the second partition are verified according to the set verification item to obtain a second verification result.
[0086] In this embodiment, after the wearable device writes the received software upgrade package into the backup area according to the above step S2200 and restarts the wearable device, the wearable device will first obtain the flag information of the system upgrade flag bit pre-recorded in the partition of the wearable device; and based on the flag information, determine whether the restarted wearable device needs to be upgraded, and if it is determined that the restarted wearable device does not need to be upgraded, the software version of the first partition and the software version of the second partition are verified according to the above-set verification items.
[0087] For example, when the flag information is 0, it indicates that the wearable device does not need to be upgraded after restart. At this time, since a set cyclic redundancy check code is preset in the partition of the wearable device, the set cyclic redundancy check code is a cyclic redundancy check code of a reliable software version. Here, the wearable device can obtain the cyclic redundancy check code of the first partition and the cyclic redundancy check code of the second partition, and compare these two cyclic redundancy check codes with the set cyclic redundancy check code respectively.
[0088] Step S4200: When the second verification result indicates that the software version of the first partition passes verification and the software version of the second partition fails calibration, the first partition is used as the partition for currently running code.
[0089] In this embodiment, when the cyclic redundancy check code of the first partition is the same as the set cyclic redundancy check code, and the cyclic redundancy check code of the second partition is different from the set cyclic redundancy check code, it indicates that the software version of the first partition has passed the verification, and also indicates that the software version of the first partition is a reliable software version.
[0090] Step S4300: When the second verification result indicates that the software version of the first partition fails verification and the software version of the second partition passes calibration, the second partition is used as the partition for currently running code.
[0091] In this embodiment, when the cyclic redundancy check code of the first partition is different from the set cyclic redundancy check code, and the cyclic redundancy check code of the second partition is the same as the set cyclic redundancy check code, it indicates that the software version of the second partition has passed the verification, and also indicates that the software version of the second partition is a reliable software version.
[0092] According to this embodiment, when the wearable device does not need to be upgraded, the software versions in the activation area and the inactivation area are also verified to ensure that the wearable device is running a reliable software version.
[0093] In one embodiment, after executing the above step S3200 and the first calibration result indicates that the software version of the partition that is not currently running the code after the upgrade has passed the verification, the software upgrade method of the wearable device of the embodiment of the present disclosure may further include: updating the running area information.
[0094] In this embodiment, updating the running area information may further include: updating the partition identifier corresponding to the partition of the currently running code.
[0095] For example, if the running area information indicates that the partition currently running the code is the first partition A, then when the software version in the partition currently not running the code, i.e., the second partition B, is a reliable software version, the wearable device will update the running area information to indicate that the partition currently running the code is the second partition B.
[0096] According to this embodiment, when the partition that is not currently running the code is upgraded and it is determined that the software version of the partition that is not currently running the code is a reliable software version, the partition that is not currently running the code will be switched to the partition that is currently running the code, thereby ensuring that the wearable device always runs the latest software version.
[0097] Next, an example of a software upgrade method for a wearable device is shown. In this example, the partition of the wearable device includes combining Figure 3 As shown, the software upgrade method of the wearable device includes the following steps:
[0098] Step S501: Receive a software upgrade package.
[0099] Step S502: store the software upgrade package in the backup area.
[0100] Step S503: restart the wearable device.
[0101] Step S504, obtaining the flag information of the recorded system upgrade flag, and determining whether an upgrade is required based on the flag information, if an upgrade is required, executing step S505, otherwise executing step S514.
[0102] Step S505, when it is determined that an upgrade is required based on the flag information, further determine from the first partition A and the second partition B based on the recorded running area information whether the partition currently running the code is the first partition A. If so, execute step S506, otherwise execute step S510.
[0103] Step S506: When the partition currently running the code is the first partition A, a software upgrade package is obtained from the backup area, and an upgrade operation is performed on the partition currently not running the code, ie, the second partition B, according to the software upgrade package.
[0104] Step S507 , determining whether the software version of the upgraded second partition B is a reliable software version. If so, executing step S508 ; otherwise, executing step S509 .
[0105] Step S508: If the software version of the upgraded second partition B is a reliable software version, set the software version of the upgraded partition that is not currently running code, namely the second partition B, as a reliable software version, and execute step S517.
[0106] Step S509: If the software version of the upgraded second partition B is not a reliable software version, set the software version of the partition currently running the code, ie, the first partition A, to a reliable software version, and execute step S517.
[0107] Step S510: When the partition currently running the code is the second partition B, a software upgrade package is obtained from the backup area, and an upgrade operation is performed on the partition currently not running the code, ie, the first partition A, according to the software upgrade package.
[0108] Step S511, determining whether the software version of the upgraded first partition A is a reliable software version, if yes, executing step S512, otherwise executing step S513.
[0109] Step S512: If the software version of the upgraded first partition A is a reliable software version, set the software version of the upgraded partition that is not currently running code, ie, the first partition A, as a reliable software version, and execute step S517.
[0110] Step S513: If the software version of the upgraded first partition A is not a reliable software version, set the software version of the partition currently running the code, ie, the second partition B, to a reliable software version, and execute step S517.
[0111] Step S514: When it is determined that no upgrade is required according to the flag information, further determine whether the reliable software version is the software version of the first partition A. If yes, execute step S515; otherwise, execute step S516.
[0112] Step S515: If the reliable software version is the software version of the first partition A, jump to the first partition A and the process ends.
[0113] Step S516: If the reliable software version is not the software version of the first partition A, jump to the second partition B and the process ends.
[0114] Step S517: Restart the head mounted display device.
[0115] <Device Example>
[0116] Figure 4 FIG. 1 is a schematic diagram of a software upgrade apparatus for a wearable device according to an embodiment of the present invention. Figure 4 As shown, the control device 400 of the wearable device includes a receiving module 410, a storage module 420, a determination module 430 and an upgrading module 440.
[0117] The receiving module 410 is configured to receive a software upgrade package.
[0118] The storage module 420 is configured to store the software upgrade package in the backup area and restart the wearable device.
[0119] The determination module 430 is configured to determine, when the wearable device needs to be upgraded after being restarted, a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information.
[0120] The upgrading module 440 is configured to obtain the software upgrading package from the backup area and perform an upgrading operation on the partition that is not currently running a code according to the software upgrading package.
[0121] In one embodiment, the determination module 430 is specifically configured to: obtain flag information of the recorded system upgrade flag; and determine whether the wearable device needs to be upgraded after being restarted according to the flag information.
[0122] In one embodiment, the apparatus 400 further includes a verification module (not shown in the figure).
[0123] The verification module is used to verify the software version of the upgraded partition that is not currently running the code according to the set verification items to obtain a first verification result; if the first calibration result indicates that the software version of the upgraded partition that is not currently running the code has passed the verification, restart the wearable device.
[0124] In one embodiment, the setting check item includes: a check item regarding whether the software version of the partition currently not running any code after the upgrade is reliable.
[0125] In one embodiment, the verification module is also used to verify the software version of the first partition and the software version of the second partition according to the set verification item to obtain a second verification result when the wearable device does not need to be upgraded after restarting; when the second verification result indicates that the software version of the first partition has passed the verification and the software version of the second partition has failed the calibration, the first partition is used as the partition for the current running code; when the second verification result indicates that the software version of the first partition has failed the verification and the software version of the second partition has passed the calibration, the second partition is used as the partition for the current running code.
[0126] In one embodiment, the device further includes an updating module, and the updating module is configured to update the operating area information.
[0127] The update module is specifically used to update the partition identifier corresponding to the partition currently running the code.
[0128] According to an embodiment of the present disclosure, the partitions of the wearable device include a first partition, a second partition, and a backup area. After receiving a software upgrade package, the wearable device does not directly upgrade the partitions of the wearable device based on the software upgrade package. Instead, the software upgrade package is written to the backup area, and the wearable device is restarted before determining whether an upgrade is required. This can improve the reliability of the software upgrade. At the same time, if the wearable device needs to be upgraded after being restarted, the partition that is not currently running code will be determined from the first partition and the second partition based on the recorded running area information. The upgrade operation is performed only on the partition that is not currently running code based on the software upgrade package obtained from the backup area. In this way, if the upgrade of one partition fails, the code can be run normally based on another partition to ensure the normal operation of the wearable device.
[0129] <Equipment Example>
[0130] Figure 5 FIG is a schematic diagram of the hardware structure of a wearable device according to an embodiment. Figure 5 As shown, the wearable device 500 further includes a processor 510 and a memory 520 .
[0131] The memory 520 may be used to store executable computer instructions.
[0132] The processor 510 can be used to execute the control method of the wearable device according to the embodiment of the method of the present disclosure under the control of the executable computer instructions.
[0133] The wearable device 500 may be Figure 1 The wearable device 1000 shown may also be a device with other hardware structures, which is not limited here. The wearable device 500 may be, for example, a smart watch, a smart bracelet, a head-mounted display, etc., which is not limited in the embodiments of the present disclosure.
[0134] In another embodiment, the wearable device 500 may include the control device 400 of the above wearable device.
[0135] In one embodiment, each module of the software upgrade apparatus 400 for a wearable device can be implemented by the processor 510 executing computer instructions stored in the memory 520 .
[0136] According to an embodiment of the present disclosure, the partitions of the wearable device include a first partition, a second partition, and a backup area. After receiving a software upgrade package, the wearable device does not directly upgrade the partitions of the wearable device based on the software upgrade package. Instead, the software upgrade package is written to the backup area, and the wearable device is restarted before determining whether an upgrade is required. This can improve the reliability of the software upgrade. At the same time, if the wearable device needs to be upgraded after being restarted, the partition that is not currently running code will be determined from the first partition and the second partition based on the recorded running area information. The upgrade operation is performed only on the partition that is not currently running code based on the software upgrade package obtained from the backup area. In this way, if the upgrade of one partition fails, the code can be run normally based on another partition to ensure the normal operation of the wearable device.
[0137] <Computer-readable storage medium>
[0138] The embodiment of the present disclosure further provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the control method of the wearable device provided by the embodiment of the present disclosure is executed.
[0139] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0140] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0141] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0142] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0143] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0144] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0145] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0146] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
[0147] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, their practical applications, or technical improvements in the marketplace, or to enable other persons skilled in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.
Claims
1. A software upgrade method for a wearable device, wherein the partitions of the wearable device include a first partition, a second partition, and a backup area, and the method comprises: Receive software upgrade packages; Storing the software upgrade package in the backup area and restarting the wearable device; Obtain the flag information of the recorded system upgrade flag bit; Determining whether the wearable device after restart needs to be upgraded according to the flag information; When the wearable device does not need to be upgraded after being restarted, verifying the software version of the first partition and the software version of the second partition according to the set verification item to obtain a second verification result; When the second verification result indicates that the software version of the first partition passes verification and the software version of the second partition fails calibration, the first partition is used as the partition for currently running code; If the second verification result indicates that the software version of the first partition fails verification and the software version of the second partition passes calibration, use the second partition as the partition currently running the code; Among them, the software version that passes the verification is the reliable software version; When the wearable device needs to be upgraded after being restarted, determining a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information; Obtaining the software upgrade package from the backup area, and performing an upgrade operation on the partition that is not currently running the code according to the software upgrade package; during the upgrade operation, the wearable device normally uses the partition that is currently running the code; After performing the upgrade operation on the partition currently not running the code according to the software upgrade package, the method further includes: Verifying the software version of the upgraded partition that is not currently running code according to the set verification item to obtain a first verification result, including obtaining a cyclic redundancy check code of the upgraded partition that is not currently running code, and comparing the cyclic redundancy check code with a set cyclic redundancy check code to obtain the first verification result; If the first verification result indicates that the software version of the partition currently not running the code has passed the verification after the upgrade, restarting the wearable device; The setting check items corresponding to the first partition and the second partition are the same.
2. The method according to claim 1, characterized in that The set check item includes: a check item regarding whether the software version of the partition that is not currently running a code after the upgrade is reliable.
3. The method according to claim 1, characterized in that After the first verification result indicates that the software version of the partition currently not running the code has passed the verification after the upgrade, the method further includes: updating the operation area information; The updating of the operating area information includes: Update the partition identifier corresponding to the partition currently running the code.
4. A software upgrade device for a wearable device, wherein the partitions of the wearable device include a first partition, a second partition, and a backup area, and the device comprises: A receiving module, used for receiving software upgrade packages; A storage module, configured to store the software upgrade package in the backup area and restart the wearable device; an upgrading module, configured to, when the wearable device does not need to be upgraded after being restarted, verify the software version of the first partition and the software version of the second partition according to a set verification item to obtain a second verification result; If the second verification result indicates that the software version of the first partition passes verification and the software version of the second partition fails calibration, the first partition is used as the partition for currently running the code; if the second verification result indicates that the software version of the first partition fails verification and the software version of the second partition passes calibration, the second partition is used as the partition for currently running the code; wherein the software version that passes verification is a reliable software version; a determination module, configured to determine, when the wearable device needs to be upgraded after being restarted, a partition that is not currently running code from the first partition and the second partition according to the recorded running zone information; The upgrade module is further configured to obtain the software upgrade package from the backup area and perform an upgrade operation on the partition that is not currently running code according to the software upgrade package; The upgrade module is further used to verify the software version of the upgraded partition that is not currently running the code according to the set verification item to obtain a first verification result; when the first verification result indicates that the software version of the upgraded partition that is not currently running the code has passed the verification, restart the wearable device; wherein the set verification items corresponding to the first partition and the second partition are the same.
5. The device according to claim 4, characterized in that The determining module is specifically configured to: Obtain the flag information of the recorded system upgrade flag bit; According to the flag information, it is determined whether the wearable device after restart needs to be upgraded.
6. A wearable device, characterized in that: include: Memory for storing executable computer instructions; A processor, configured to execute the software upgrade method according to any one of claims 1 to 3 under the control of the executable computer instructions.
7. A computer-readable storage medium storing computer instructions, wherein the computer instructions are executed by a processor to execute the software upgrade method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method and device for upgrading firmware
CN105094903A
Upgrading method and device of control unit
CN108376077A
Method and device for processing equipment firmware and machine readable storage medium
CN110737449A