An OTA upgrade method, apparatus, control terminal, and medium for electronic devices.
By embedding identification information in multiple flash areas of smart wearable devices and dynamically configuring the program loading area, the problem of long OTA upgrade times for smart wearable devices is solved, achieving a more efficient upgrade process and user experience.
Patent Information
- Application Number
- CN202110286624.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-17
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2041-03-17
AI Technical Summary
During the OTA upgrade process of existing smart wearable devices, the upgrade process takes a long time and affects the user experience because the data in the download cache needs to be moved to the flash memory in the working area.
By embedding identification information in multiple flash areas of an electronic device, the program loading area and non-loading area can be identified. Application upgrade data is downloaded to the non-loading area, and the identification information is modified to configure it as the loading area for the next startup, thus avoiding data migration.
The upgrade process has been simplified, the upgrade time has been reduced, and the upgrade efficiency and user experience have been improved.
Smart Images

Figure CN113031996B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of OTA upgrade technology, and in particular to an OTA upgrade method, apparatus, control terminal and computer-readable storage medium for electronic devices. Background Technology
[0002] With the proliferation and technological advancements in modern smart electronic devices (especially smart wearable products such as smartwatches, smart bracelets, and smart Bluetooth headsets), the external flash memory of wearable products is becoming increasingly larger, and the corresponding application upgrade packages are also becoming larger, posing a significant challenge to the upgrade experience and upgrade time.
[0003] Currently, OTA (Over-the-Air Technology) upgrades for smart wearable devices involve establishing a communication connection between the mobile app and the device. The phone then accesses an OTA server to obtain the new version upgrade package, downloads it from the server, and then transmits it to the wearable device's download cache (flash) via Bluetooth. Once all data has been downloaded, the bootloader moves the data from the download cache to a designated working area. The device always loads the application from this working area upon startup. Because the upgrade process requires the bootloader to move data from the download cache to the working flash, this undoubtedly increases the upgrade time.
[0004] Therefore, providing a solution to the above-mentioned technical problems is something that those skilled in the art urgently need to focus on. Summary of the Invention
[0005] The purpose of this application is to provide an OTA upgrade method, device, control terminal, and computer-readable storage medium for electronic devices, so as to effectively simplify the upgrade process, reduce upgrade time, and improve upgrade efficiency and user experience.
[0006] To address the aforementioned technical problems, this application discloses an OTA (Over-The-Air) upgrade method for an electronic device. The electronic device is configured with multiple flash memory areas for storing applications. Each flash memory area has an identification information in its header structure. This identification information identifies whether the electronic device is currently loading and using an application stored in the flash memory area. The method is applied to a control terminal communicatively connected to the electronic device and includes:
[0007] Read the identification information from the header structure of each flash area in the electronic device;
[0008] The current program loading area and program non-loading area are identified based on the identification information;
[0009] Determine the target flash area from the program's unloaded area;
[0010] The application upgrade data obtained from the server will be downloaded to the target flash area;
[0011] Modify the identification information in the header structure of each flash area so that the target flash area can be used as the program loading area for the next startup.
[0012] Optionally, downloading the application upgrade data obtained from the server to the target flash area includes:
[0013] Perform integrity verification on the application upgrade data sent by the server;
[0014] If the verification passes, the application upgrade data will be downloaded to the target flash area.
[0015] Optionally, the integrity verification of the application upgrade data sent by the server includes:
[0016] Perform hash verification or MD5 verification on the application upgrade data sent by the server.
[0017] Optionally, modifying the identification information in the header structure of each flash area includes:
[0018] After the electronic device completes the upgrade of non-resource components based on the bootloader, the identification information in the header structure of each flash area is modified.
[0019] Optionally, determining the target flash area from the program unloaded area includes:
[0020] The non-loaded area of the program with the fewest historical usages is determined as the target flash area.
[0021] In another aspect, this application discloses an OTA upgrade device for an electronic device, wherein the electronic device is configured with multiple flash areas for storing applications, and each flash area has an identification information in its header structure, the identification information being used to identify whether the electronic device is currently loading and using an application stored in the flash area; the device is applied to a control terminal communicatively connected to the electronic device, and includes:
[0022] The reading module is used to read the identification information in the header structure of each flash area in the electronic device;
[0023] The determination module is used to identify the current program loading area and program unloading area based on the identification information; and to determine the target flash area from the program unloading area;
[0024] The download module is used to download application upgrade data obtained from the server to the target flash area;
[0025] The configuration module is used to modify the identification information in the header structure of each flash area so as to use the target flash area as the program loading area at the next startup.
[0026] Optionally, the download module is specifically used for:
[0027] The integrity of the application upgrade data sent by the server is verified; if the verification passes, the application upgrade data obtained from the server is downloaded to the target flash area.
[0028] Optionally, the download module, when performing integrity verification on the application upgrade data sent by the server, is specifically used for:
[0029] Perform hash verification or MD5 verification on the application upgrade data sent by the server.
[0030] Optionally, when modifying the identification information in the header structure of each flash area, the configuration module is specifically used for:
[0031] After the electronic device completes the upgrade of non-resource components based on the bootloader, the identification information in the header structure of each flash area is modified.
[0032] Optionally, the determining module, when determining the target flash area from the program's unloaded area, is specifically used for:
[0033] The non-loaded area of the program with the fewest historical usages is determined as the target flash area.
[0034] In another aspect, this application also discloses a control terminal, including:
[0035] Memory, used to store computer programs;
[0036] A processor for executing the computer program to implement the steps of the OTA upgrade method for any of the electronic devices described above.
[0037] In another aspect, this application also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the steps of the OTA upgrade method for any of the electronic devices described above.
[0038] This application provides an OTA upgrade method for an electronic device. The electronic device is configured with multiple flash memory areas for storing applications. Each flash memory area has an identification information in its header structure to identify whether the electronic device is currently loading and using an application stored in the flash memory area. The method is applied to a control terminal communicatively connected to the electronic device and includes: reading the identification information in the header structure of each flash memory area in the electronic device; identifying the current program loading area and program unloading area based on the identification information; determining a target flash memory area from the program unloading area; downloading application upgrade data obtained from a server to the target flash memory area; and modifying the identification information in the header structure of each flash memory area so that the target flash memory area can be used as the program loading area for the next startup.
[0039] The beneficial effects of the OTA upgrade method, apparatus, control terminal, and computer-readable storage medium for electronic devices provided in this application are as follows: This application configures whether a flash area is a program loading area based on the identification information embedded in the header structure of each flash area of the electronic device. Thus, after the application upgrade data is downloaded, the flash area where it is located is reconfigured as a new program loading area for use after the next boot. This eliminates the need to move the application upgrade data, effectively simplifies the upgrade process, reduces upgrade time, and thus improves upgrade efficiency and user experience. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the prior art and the embodiments of this application, the accompanying drawings used in the description of the prior art and the embodiments of this application will be briefly introduced below. Of course, the accompanying drawings described below with respect to the embodiments of this application are only a part of the embodiments in this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort, and such other drawings also fall within the protection scope of this application.
[0041] Figure 1 This is a flowchart of an OTA upgrade method for an electronic device disclosed in an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the storage structure of the flash area of an electronic device disclosed in an embodiment of this application;
[0043] Figure 3 This is a flowchart illustrating another OTA upgrade method for an electronic device disclosed in an embodiment of this application;
[0044] Figure 4 This is a structural block diagram of an OTA upgrade device for an electronic device disclosed in an embodiment of this application;
[0045] Figure 5 This is a structural block diagram of a control terminal disclosed in an embodiment of this application. Detailed Implementation
[0046] The core of this application is to provide an OTA upgrade method, device, control terminal, and computer-readable storage medium for electronic devices, so as to effectively simplify the upgrade process, reduce upgrade time, and improve upgrade efficiency and user experience.
[0047] To provide a clearer and more complete description of the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be described below with reference to the accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0048] OTA (Over-the-Air Technology) upgrades are a technology that upgrades a system or application by downloading an upgrade package from a remote server via a wireless network. With the proliferation and technological advancements in modern smart electronic devices (especially wearable products such as smartwatches, smart bracelets, and smart Bluetooth headsets), the external flash memory of wearable products is becoming increasingly larger, resulting in larger upgrade packages for corresponding applications. This poses a significant challenge to the upgrade experience and time.
[0049] Currently, OTA (Over-the-Air Technology) upgrades for smart wearable devices involve a mobile app establishing a communication connection, the phone accessing an OTA server to obtain the new version upgrade package, downloading the package from the OTA server to the phone, and then transmitting the upgrade package to the smart wearable device's download cache flash via Bluetooth. Once all data has been downloaded, the bootloader moves the data from the download cache flash to a fixed working area. The device always loads the application from this fixed working area upon startup. Because the upgrade process requires the bootloader to move data from the download cache to the working area flash, this undoubtedly increases the upgrade time. Therefore, this application provides an OTA upgrade solution for electronic devices that effectively solves the above problems.
[0050] See Figure 1As shown in the figure, this application discloses an OTA upgrade method for an electronic device. The electronic device is configured with multiple flash areas for storing applications. Each flash area has an identification information in its header structure. This identification information is used to identify whether the electronic device is currently loading and using an application stored in that flash area. The method is applied to a control terminal communicatively connected to the electronic device and includes:
[0051] S101: Read the identification information in the header structure of each flash area in the electronic device.
[0052] Specifically, the electronic device can be a smart wearable device such as a smart bracelet or smartwatch; the control terminal can be a terminal device such as a mobile phone, tablet, or computer, and the control terminal can establish a communication connection with the electronic device through Bluetooth or other means.
[0053] Specifically, the structural diagrams of each flash area in the electronic device can be found by referring to [reference needed]. Figure 2 Each flash memory area has a header structure, which stores identification information. The space outside the header structure is used to store the application program. Specifically, the identification information indicates whether the flash memory area is the current program loading area for the electronic device.
[0054] It's easy to understand that the flash area where the application currently being loaded and used by the electronic device is located is the program loading area; while other flash areas, that is, flash areas where the electronic device does not currently have any applications being loaded and used, are program non-loading areas.
[0055] As a specific embodiment, the identification information can be a binary number. Further, when its value is "1", it can indicate that the flash area is the current program loading area of the electronic device; when its value is "0", it can indicate that the flash area is the current program unloading area of the electronic device.
[0056] S102: Identify the current program loading area and program non-loading area based on the identification information.
[0057] S103: Determine the target flash area from the program non-loaded area.
[0058] It's easy to understand that since the application in the program loading area is currently being run by the electronic device, the application upgrade data cannot be downloaded to that program loading area. Instead, one of the non-loading areas should be selected as the target flash area for downloading and storing the upgrade package.
[0059] S104: Download the application upgrade data obtained from the server to the target flash area.
[0060] S105: Modify the identification information in the header structure of each flash area so that the target flash area can be used as the program loading area at the next startup.
[0061] It should be noted that after downloading the application upgrade data to the target flash area, this application modifies the identification information to change the target flash area to the program loading area after the next system startup. This allows the upgraded application to be loaded directly from the new program loading area upon the next system startup. Therefore, it is no longer necessary to use the bootloader to move the application upgrade data from one flash area to another, greatly reducing the upgrade time.
[0062] In other words, this application dynamically configures the program loading area based on the marking information in the header structure, and can use the same flash area as the program loading area and the non-loading area in a cycle.
[0063] It is easy to understand that when modifying the identification information, it is necessary not only to modify the identification information in the header structure of the target flash area, but also to modify the identification information in the header structure of the flash area currently used as the program loading area.
[0064] As can be seen, the OTA upgrade method for electronic devices provided in this application configures whether a flash area is a program loading area based on the identification information embedded in the header structure of each flash area of the electronic device. After the application upgrade data is downloaded, the flash area where it is located is reconfigured as a new program loading area for use after the next boot. This eliminates the need to move the application upgrade data, effectively simplifies the upgrade process, reduces upgrade time, and thus improves upgrade efficiency and user experience.
[0065] As a specific embodiment, the OTA upgrade method for electronic devices provided in this application, based on the above content, downloads application upgrade data obtained from the server to the target flash area, including:
[0066] Perform integrity verification on the application upgrade data sent by the server;
[0067] If the verification passes, the application upgrade data will be downloaded to the target flash memory.
[0068] As a specific embodiment, the OTA upgrade method for electronic devices provided in this application embodiment, based on the above content, performs integrity verification on the application upgrade data sent by the server, including: performing hash verification or MD5 verification on the application upgrade data sent by the server.
[0069] Of course, those skilled in the art can also use other verification methods, and this application does not limit them.
[0070] As a specific embodiment, the OTA upgrade method for electronic devices provided in this application, based on the above content, modifies the identification information in the header structure of each flash area, including:
[0071] After the electronic device completes the upgrade of non-resource components based on the bootloader, the identification information in the header structure of each flash area is modified.
[0072] Once the application upgrade data (which is resource-based data) has been completely downloaded to the target flash area, the Bootloader can proceed to upgrade and install other non-resource-based components. After confirming that the upgrade and installation of non-resource-based components are complete, the identification information can be further modified.
[0073] As a specific embodiment, the OTA upgrade method for electronic devices provided in this application, based on the above content, determines the target flash area from the non-loaded program area, including:
[0074] The program's unloaded area with the fewest historical usages is identified as the target flash area.
[0075] Specifically, in this embodiment, from a performance balance perspective, the program's unloaded area with the fewest historical usages was selected as the target flash area. Of course, those skilled in the art can also use other methods to select it, such as random selection.
[0076] It is easy to understand that the electronic device in this application has multiple flash areas, that is, at least two. When there are two flash areas, there is no need to select one, and the other flash area will automatically be used as the target flash area for this purpose.
[0077] For specific details on OTA upgrade methods for electronic devices with two flash memory zones, please refer to [link / reference]. Figure 3 ,include:
[0078] S201: Read the identification information in the header structure of each flash area in the electronic device.
[0079] S202: Determine whether the first flash area is the current program loading area; if yes, proceed to S203; if no, proceed to S204.
[0080] S203: Designate the second flash area as the target flash area; proceed to S205.
[0081] S204: Set the first flash area as the target flash area; proceed to S205.
[0082] S205: Download the application upgrade data obtained from the server to the target flash area.
[0083] S206: After the electronic device completes the upgrade of non-resource components based on the bootloader, modify the identification information in the header structure of the two flash areas so that the target flash area can be used as the program loading area for the next startup.
[0084] See Figure 4 This application discloses an OTA upgrade device for an electronic device. The electronic device is equipped with multiple flash memory areas for storing applications. Each flash memory area has an identification information in its header structure. The identification information is used to identify whether the electronic device is currently loading and using an application stored in the flash memory area. The device is applied to a control terminal that is communicatively connected to the electronic device and includes:
[0085] The reading module 301 is used to read the identification information in the header structure of each flash area in the electronic device;
[0086] The determination module 302 is used to identify the current program loading area and program unloading area based on the identification information; and to determine the target flash area from the program unloading area.
[0087] Download module 303 is used to download application upgrade data obtained from the server to the target flash area;
[0088] Configuration module 304 is used to modify the identification information in the header structure of each flash area so that the target flash area can be used as the program loading area at the next startup.
[0089] As can be seen, the OTA upgrade device for electronic devices disclosed in this application configures whether a flash area is a program loading area based on the identification information embedded in the header structure of each flash area of the electronic device. After the application upgrade data is downloaded, the flash area where it is located is reconfigured as a new program loading area for use after the next boot. This eliminates the need to move the application upgrade data, effectively simplifies the upgrade process, reduces upgrade time, and thus improves upgrade efficiency and user experience.
[0090] For details regarding the OTA upgrade device for the aforementioned electronic devices, please refer to the aforementioned detailed introduction to the OTA upgrade method for electronic devices, which will not be repeated here.
[0091] As a specific embodiment, the OTA upgrade device for electronic devices disclosed in this application, based on the above content, has the download module 303 specifically used for:
[0092] Perform integrity verification on the application upgrade data sent by the server; if the verification passes, download the application upgrade data obtained from the server to the target flash area.
[0093] As a specific embodiment, the OTA upgrade device for electronic devices disclosed in this application, based on the above content, specifically uses the download module 303 to perform integrity verification on the application upgrade data sent by the server when performing the following:
[0094] Perform hash verification or MD5 verification on the application upgrade data sent by the server.
[0095] As a specific embodiment, the OTA upgrade device for electronic devices disclosed in this application, based on the above content, specifically uses the configuration module 304 to modify the identification information in the header structure of each flash area when modifying the identification information in the header structure of each flash area:
[0096] After the electronic device completes the upgrade of non-resource components based on the bootloader, the identification information in the header structure of each flash area is modified.
[0097] As a specific embodiment, the OTA upgrade device for electronic devices disclosed in this application, based on the above content, specifically uses module 302 to determine the target flash area from the program non-loading area when determining the target flash area:
[0098] The program's unloaded area with the fewest historical usages is identified as the target flash area.
[0099] See Figure 5 As shown in the figure, this application discloses a control terminal, including:
[0100] Memory 401 is used to store computer programs;
[0101] Processor 402 is configured to execute the computer program to implement the steps of the OTA upgrade method for any of the electronic devices described above.
[0102] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the steps of the OTA upgrade method for any of the electronic devices described above.
[0103] For details regarding the control terminal and computer-readable storage medium mentioned above, please refer to the aforementioned detailed introduction to the OTA upgrade method for electronic devices, which will not be repeated here.
[0104] The various embodiments in this application are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0105] It should also be noted that in this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0106] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. An OTA upgrade method for an electronic device, characterized in that, The electronic device is configured with multiple flash areas for storing applications. Each flash area has an identification information in its header structure. The identification information is used to identify whether the electronic device is currently loading and using an application stored in the flash area. The method is applied to a control terminal that is communicatively connected to the electronic device, including: Read the identification information from the header structure of each flash area in the electronic device; the electronic device is a smart wearable device; The current program loading area and program unloading area are identified based on the identification information; wherein, the flash area where the application currently being loaded and used by the electronic device is located is the program loading area; the flash area where the electronic device does not currently have an application being loaded and used is the program unloading area; Determine the target flash area from the program's unloaded area; The application upgrade data obtained from the server is downloaded to the target flash area; this includes: performing an integrity check on the application upgrade data sent by the server; if the check passes, the application upgrade data is downloaded to the target flash area; the application upgrade data is resource-type data; After the application upgrade data is completely downloaded to the target flash area, the bootloader is entered to upgrade and install the non-resource components. After the electronic device completes the upgrade of the non-resource components based on the bootloader, the identification information in the header structure of each flash area is modified so that the target flash area can be used as the program loading area for the next startup.
2. The OTA upgrade method for electronic devices according to claim 1, characterized in that, The integrity verification of the application upgrade data sent by the server includes: Perform hash verification or MD5 verification on the application upgrade data sent by the server.
3. The OTA upgrade method for electronic devices according to claim 1, characterized in that, Determining the target flash area from the program's unloaded area includes: The non-loaded area of the program with the fewest historical usages is determined as the target flash area.
4. An OTA upgrade device for electronic devices, characterized in that, The electronic device is configured with multiple flash areas for storing applications. Each flash area has an identification information in its header structure. The identification information is used to identify whether the electronic device is currently loading and using an application stored in the flash area. The device is applied to a control terminal that is communicatively connected to the electronic device, and includes: A reading module is used to read the identification information in the header structure of each flash area in the electronic device; the electronic device is a smart wearable device. The determination module is used to identify the current program loading area and program unloading area based on the identification information; and to determine the target flash area from the program unloading area; wherein, the flash area where the application currently being loaded and used by the electronic device is located is the program loading area; and the flash area where the electronic device does not currently have an application being loaded and used is the program unloading area; The download module is used to download application upgrade data obtained from the server to the target flash area; including: performing integrity verification on the application upgrade data sent by the server; if the verification passes, downloading the application upgrade data to the target flash area; the application upgrade data is resource-type data; The configuration module is used to enter the bootloader to upgrade and install non-resource components after the application upgrade data is completely downloaded to the target flash area. After the electronic device completes the upgrade of non-resource components based on the bootloader, it modifies the identification information in the header structure of each flash area so that the target flash area can be used as the program loading area for the next startup.
5. The OTA upgrade device for electronic devices according to claim 4, characterized in that, The download module is specifically used for: verifying the integrity of application upgrade data sent by the server. Perform hash verification or MD5 verification on the application upgrade data sent by the server.
6. A control terminal, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the OTA upgrade method for an electronic device as described in any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the OTA upgrade method for an electronic device as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method, apparatus and system for operating embedded software program
CN101354660A
ECU program backup and cyclic upgrade control method and device
CN110231952A