A method for OTA upgrade and related components thereof

CN115686569BActive Publication Date: 2026-08-21GEER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211334416.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-28
Publication Date
2026-08-21
Estimated Expiration
2042-10-28

AI Technical Summary

Technical Problem

[0003]随着智能设备等的快速发展,设备对性能和资源的要求越来越高,由于单芯片对智能设备性能的支持逐渐乏力,无法满足实际需求,而提高单芯片配置后,各模块在后台运行占用资源影响待机功耗,为了解决此问题,目前智能设备采用了双系统设计

Benefits of technology

[0051]本发明所提供的一种OTA升级的方法,包括:下载待升级包,并解析待升级包得到解析结果,当基于解析结果确定待升级包满足升级条件时,将待升级包传输至Slave端。然后,在Slave端通过待升级包升级完成后,获取Slave端发送的硬件信号,并在根据该硬件信号确定Slave端升级成功后,进入升级模式进行升级。由此可见,本申请所提供的技术方案,硬件信号不受通信协议影响,Host端在任意情况下均可获取Slave端发送的硬件信号以确定Slave端的升级状态,由此避免基于通信协议进行交互的方式在通信协议发生改变时,Host端和Slave端之间无法正常通信的情况,提升升级可靠性。同时,Host端在确定Slave端升级成功后才继续升级,进一步提升升级效率和可靠性,提升用户体验感。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686569B_ABST
    Figure CN115686569B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of system upgrading, and discloses an OTA upgrading method and related components thereof, which comprise the following steps: downloading an upgrading package, and analyzing the upgrading package to obtain an analysis result; when it is determined based on the analysis result that the upgrading package meets an upgrading condition, transmitting the upgrading package to a Slave end for upgrading; acquiring a hardware signal sent by the Slave end; and after it is determined based on the hardware signal that the Slave end is successfully upgraded, entering an upgrading mode. It can be seen that the hardware signal is not affected by a communication protocol, the Host end can acquire the hardware signal sent by the Slave end under any condition to determine the upgrading state of the Slave end, thereby avoiding the situation that the two ends cannot normally communicate when the communication protocol changes based on the interaction mode of the communication protocol, and improving the upgrading reliability. Meanwhile, the Host end continues to upgrade only after it is determined that the Slave end is successfully upgraded, further improving the upgrading reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of system upgrade technology, and in particular to an OTA upgrade method and related components. Background Technology

[0002] Over-the-Air (OTA) upgrades are a standard software upgrade method provided by the Android system. It is a technology that remotely manages SIM card data and applications through the air interface of mobile communication (GSM or CDMA).

[0003] With the rapid development of smart devices, the requirements for performance and resources of these devices are becoming increasingly demanding. As single-chip support for the performance of smart devices gradually becomes insufficient and fails to meet actual needs, increasing the configuration of single chips leads to the resource consumption of each module running in the background, affecting standby power consumption. To solve this problem, smart devices currently adopt a dual-system design.

[0004] When upgrading a dual system, the main approach is to upgrade each system sequentially and individually. After the Slave is upgraded, it notifies the Host to upgrade via a communication protocol. However, if the communication protocol between the Slave and Host is modified during this dual-system upgrade process, the Slave and Host will be unable to communicate and thus will be unable to know the other's current upgrade status.

[0005] Therefore, how to prevent the communication protocol between the Slave and Host from being modified during dual-system upgrades, ensure normal communication between the Slave and Host, and improve the reliability and success rate of the upgrade is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide an OTA upgrade method and related components to avoid modification of the communication protocol between the Slave and Host during system upgrades, ensure normal communication between the Slave and Host, improve upgrade reliability and success rate, and thus enhance user experience.

[0007] To address the aforementioned technical problems, this application provides a method for OTA upgrades, comprising:

[0008] Download the upgrade package and parse it to obtain the parsing result;

[0009] Based on the analysis results, it is determined whether the upgrade version number of the package to be upgraded is different from the corresponding current version number, and whether the upgrade version number of the Slave is different from the corresponding current version number, to determine whether the package to be upgraded meets the upgrade conditions.

[0010] When it is determined that the package to be upgraded meets the upgrade conditions, the package to be upgraded is transmitted to the Slave end so that the Slave end can perform the upgrade;

[0011] Obtain the hardware signals sent by the Slave to determine the current upgrade status of the Slave;

[0012] After confirming that the current upgrade status of the Slave is successful, it enters upgrade mode.

[0013] Preferably, if the current upgrade status of the Slave is determined to be an upgrade failure, the method further includes:

[0014] Determine if the system is currently powered on;

[0015] If the system is powered on, an upgrade failure signal will be transmitted to the server, and the server will be requested to complete the package before the upgrade in order to restore the system.

[0016] If the device is powered off, it transmits a power-off signal and a request to restore the version number signal to the server so that the server can issue a new upgrade package and enter the forced burning mode to perform the upgrade.

[0017] Preferably, obtaining the hardware signals sent by the Slave terminal to determine the current upgrade status of the Slave terminal includes:

[0018] A handshake protocol is established with the Slave terminal using preset rules;

[0019] Acquire the hardware signal sent by the Slave terminal;

[0020] The upgrade status analysis result is obtained by parsing the hardware signals based on the handshake protocol.

[0021] The current upgrade status of the Slave terminal is determined based on the upgrade status parsing results.

[0022] Preferably, the handshake protocol with the Slave terminal via preset rules includes:

[0023] M groups of N high-level signals and M groups of N low-level signals are used as a set of handshake signals in the handshake protocol to perform a handshake with the Slave end; where M and N are natural numbers greater than zero;

[0024] The parsing of the hardware signals based on the handshake protocol includes:

[0025] The duration of a single signal is calculated based on the total duration occupied by the M groups of N high-level signals and the M groups of N low-level signals;

[0026] The hardware signal is analyzed based on the duration of each individual signal.

[0027] Preferably, after acquiring the hardware signal sent by the Slave terminal, the method further includes:

[0028] Set the hardware signal to a low level;

[0029] When the upgrade status of the Slave is determined to be a successful upgrade based on the upgrade status parsing result, the hardware signal is set to a high level signal so that the Slave can determine the current upgrade status of the Host based on the hardware signal after a preset time.

[0030] When the upgrade status of the Slave is determined to be an upgrade failure based on the upgrade status parsing result, the hardware signal is kept at a low level so that the Slave can determine after a preset time whether the number of times the hardware signal is at a low level has reached a preset number. If it has not reached the preset number, the Slave will proceed to the step of performing a handshake protocol with the Slave according to preset rules. If it has reached the preset number, the upgrade will be terminated.

[0031] Preferably, the process further includes the following steps before downloading the upgrade package:

[0032] Receive upgrade instructions;

[0033] Determine if the current system's remaining battery power allows for an upgrade;

[0034] If permitted, proceed to the step of downloading the upgrade package;

[0035] If not allowed, a prompt signal will be sent to the terminal.

[0036] Preferably, the upgrade of the Slave end includes:

[0037] Obtain the upgrade package transmitted from the host;

[0038] Determine if the system's current remaining storage space allows for an upgrade;

[0039] If permitted, the upgrade will be performed based on the upgrade package after verifying its integrity.

[0040] If not allowed, a prompt signal will be sent to the terminal;

[0041] The hardware signal is sent to the Host so that the Host enters upgrade mode after determining that the current upgrade status of the Slave is a successful upgrade.

[0042] To address the aforementioned technical problems, this application also provides an OTA (Over-The-Air) upgrade device, comprising:

[0043] The preprocessing module is used to download the upgrade package and parse the upgrade package to obtain the parsing result;

[0044] The judgment module is used to determine, based on the parsing result, whether the upgrade version number of the package to be upgraded is different from the corresponding current version number, and whether the upgrade version number of the Slave is different from the corresponding current version number, to determine whether the package to be upgraded meets the upgrade conditions.

[0045] The transmission module is used to transmit the upgrade package to the Slave end when it is determined that the upgrade package meets the upgrade conditions so that the Slave end can perform the upgrade.

[0046] The first acquisition module is used to acquire hardware signals sent by the Slave terminal to determine the current upgrade status of the Slave terminal;

[0047] The determination module is used to enter the upgrade mode after determining that the current upgrade status of the Slave is a successful upgrade.

[0048] To address the aforementioned technical problems, this application also provides a smartphone, including a memory for storing computer programs;

[0049] A processor, used to implement the steps of the OTA upgrade method when executing the computer program.

[0050] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, wherein the steps of the OTA upgrade method are executed by a processor.

[0051] The present invention provides an OTA upgrade method, comprising: downloading an upgrade package and parsing the package to obtain a parsing result; when the parsing result determines that the upgrade package meets the upgrade conditions, transmitting the upgrade package to the slave terminal. Then, after the slave terminal completes the upgrade using the upgrade package, acquiring the hardware signal sent by the slave terminal, and after determining that the slave terminal has successfully upgraded based on the hardware signal, entering upgrade mode to perform the upgrade. Therefore, the technical solution provided by this application ensures that the hardware signal is not affected by the communication protocol. The host terminal can acquire the hardware signal sent by the slave terminal under any circumstances to determine the upgrade status of the slave terminal, thereby avoiding the situation where the host and slave terminals cannot communicate normally when the communication protocol changes, thus improving upgrade reliability. Furthermore, the host terminal only continues the upgrade after confirming that the slave terminal has successfully upgraded, further improving upgrade efficiency and reliability, and enhancing the user experience.

[0052] In addition, this application also provides an OTA upgrade device and medium, which correspond to the above-described OTA upgrade method and have the same effect. Attached Figure Description

[0053] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A flowchart illustrating an OTA upgrade method provided in this application embodiment;

[0055] Figure 2 A flowchart illustrating another OTA upgrade method provided in this application embodiment;

[0056] Figure 3 A structural diagram of an OTA upgrade device provided in an embodiment of this application;

[0057] Figure 4 This is a structural diagram of an electronic device provided in another embodiment of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0059] The core of this application is to provide an OTA upgrade method and related components. By utilizing the characteristic that hardware signals are not affected by communication protocols, hardware signals are used to interact between two systems in order to determine the upgrade status between the two sides to be upgraded, thereby improving the accuracy and reliability of the upgrade.

[0060] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] With the continuous development of technology, electronic devices such as smartphones have increasingly higher requirements for performance and resources. At this time, traditional single-chip devices can no longer meet user needs. However, after increasing the configuration of a single chip, the various modules running in the background occupy resources and affect standby power consumption. To solve this problem, dual-system design has entered people's lives.

[0062] To improve system performance, the dual systems need to be upgraded periodically. During the upgrade, the main approach is to upgrade each system sequentially. After the Slave is upgraded, the Host is notified to upgrade via a communication protocol. However, if the communication protocol between the Slave and Host is modified during this dual-system upgrade process, the Slave and Host will be unable to communicate and thus will be unable to know the other's current upgrade status.

[0063] To address the aforementioned technical issues and prevent the communication protocol between the Slave and Host from being modified during upgrades, thus preventing either side from obtaining the other's current upgrade status, this application provides an OTA upgrade method. This method leverages the characteristic that hardware signals are unaffected by communication protocols, using hardware signals for interaction between the Slave and Host. This ensures that both the Slave and Host can obtain each other's current upgrade status under any circumstances, thereby improving upgrade reliability.

[0064] For ease of understanding, the application environment involved in this application is described below. The OTA upgrade method provided in this application can be applied to any dual-device communication device, such as smartwatches, virtual reality devices, and augmented reality devices. When performing an OTA upgrade, the host is usually an Android operating system, while the slave is usually a microcontroller unit (MCU). Of course, the slave and host can also be used in reverse, and this application does not specifically limit this.

[0065] Figure 1 A flowchart of an OTA upgrade method provided in an embodiment of this application is shown below. Figure 1 As shown, the method includes:

[0066] S10: Download the upgrade package and parse it to obtain the parsing results;

[0067] S11: Based on the parsing results, determine whether the upgrade version number of the package to be upgraded is different from the corresponding current version number, and whether the upgrade version number of the Slave is different from the corresponding current version number, to determine whether the package to be upgraded meets the upgrade conditions.

[0068] In a specific embodiment, when the dual system needs to be upgraded, the host needs to download the upgrade package first. After obtaining the upgrade package, it first determines whether the current battery level of the system meets the current upgrade requirements. It is understandable that the entire upgrade process takes a certain amount of time. Therefore, in order to ensure that the system upgrade is successful, it is necessary to determine whether the current battery level of the system is sufficient to support the entire upgrade process before the upgrade.

[0069] Once it is confirmed that the current system power meets the upgrade requirements, the downloaded upgrade package is parsed to obtain the parsing results. Based on the parsing results, it is determined whether the upgrade version number on the Host side of the upgrade package is the same as the corresponding current version number, and whether the upgrade version number on the Slave side is the same as the corresponding current version number. When the upgrade version numbers on both ends are different from the version number before the upgrade, it is determined that the upgrade package meets the upgrade conditions.

[0070] Of course, in practice, an upgrade does not necessarily require both the Host and Slave sides to be upgraded. Therefore, after parsing the upgrade package, it is necessary to first determine whether the Slave side needs to be upgraded based on the parsing results. If an upgrade is required, the upgrade version number of the Slave side should be determined.

[0071] S12: When it is determined that the upgrade package meets the upgrade conditions, the upgrade package is transmitted to the Slave end so that the Slave end can perform the upgrade;

[0072] S13: Obtain hardware signals sent by the Slave to determine the current upgrade status of the Slave;

[0073] After determining in step S11 that the upgrade package meets the upgrade conditions, the Host transmits the upgrade package to the Slave. Upon receiving the upgrade package, the Slave needs to verify its integrity to ensure a high success rate. Additionally, it needs to determine if the system's current storage space meets the upgrade requirements. When it is confirmed that the upgrade package is complete and the system's current storage space meets the upgrade requirements, the Slave enters the upgrade phase.

[0074] After a pre-set waiting period, the host receives the hardware signal sent by the slave and parses the signal to determine the current upgrade status of the slave. It should be noted that the host can also receive the hardware signal in real time; this application does not limit this.

[0075] S14: After confirming that the current upgrade status on the Slave is successful, enter upgrade mode.

[0076] Furthermore, when the host determines from the hardware signals that the slave's current upgrade status is a successful upgrade, it decides that it can enter upgrade mode and proceeds with the upgrade. Conversely, if the host determines that the slave's current upgrade status is a failed upgrade, it terminates the upgrade process.

[0077] The OTA upgrade method provided in this application includes: downloading the upgrade package and parsing it to obtain a parsing result; when the parsing result determines that the upgrade package meets the upgrade conditions, transmitting the upgrade package to the slave end. Then, after the slave end completes the upgrade using the upgrade package, the host end obtains the hardware signal sent by the slave end, and after determining that the slave end has successfully upgraded based on the hardware signal, enters the upgrade mode to perform the upgrade. Therefore, the technical solution provided in this application ensures that the hardware signal is not affected by the communication protocol. The host end can obtain the hardware signal sent by the slave end under any circumstances to determine the upgrade status of the slave end, thereby avoiding the situation where the host end and slave end cannot communicate normally when the communication protocol changes, thus improving upgrade reliability. Furthermore, the host end only continues the upgrade after determining that the slave end has successfully upgraded, further improving upgrade efficiency and reliability, and enhancing the user experience.

[0078] During implementation, a failed upgrade on the slave end may result in either a bootable system or a bootable system. To further improve the success rate of system upgrades, after confirming that the current upgrade status on the slave end is an upgrade failure, the following steps are also taken:

[0079] Determine if the system is currently powered on;

[0080] If the system is powered on, an upgrade failure signal will be transmitted to the server, and the server will be requested to complete the package before the upgrade in order to restore the system.

[0081] If the device is powered off, it will transmit a power-off signal and a request to restore the version number signal to the server so that the server can send a new upgrade package and enter the forced burning mode to perform the upgrade.

[0082] Once it is confirmed that the system is powered on, it can be determined that the upgrade failure was caused by other reasons. At this time, the upgrade failure signal is transmitted to the server, and the server is requested to complete the package before the upgrade so that the system can be restored. This ensures that the system can be restored to the version before the upgrade in a timely manner after the upgrade fails.

[0083] When it is determined that the system is in a shutdown state, that is, the system cannot be turned on, the upgrade failure may be due to the system's inability to turn on. In this case, the system cannot be turned on (shutdown signal) and the request to restore the version number signal are transmitted to the server so that the server can download a brand new upgrade package and force the download of the brand new upgrade package to be burned to achieve the upgrade.

[0084] The OTA upgrade method provided in this application, when determining that the current upgrade status on the Slave is an upgrade failure, if the system is currently powered on, transmits an upgrade failure signal to the server and requests the complete package before the upgrade for system recovery. This ensures that the system can quickly revert to the previous version after an upgrade failure, guaranteeing normal user operation. If the system is currently powered off, transmits a power-off signal and a request for a recovery version number signal to the server, so that the server can issue a new upgrade package and enter forced flashing mode for upgrade. This avoids upgrade failure due to the system being unable to boot, further ensuring upgrade success rate and reliability.

[0085] Understandably, pure hardware signals are unaffected by communication protocols. Before the Slave and Host interact with each other, a handshake protocol needs to be established according to preset rules. This allows the Slave and Host to get to know each other before signal interaction, and then interact based on the handshake protocol. After the handshake protocol is established, the Host receives the hardware signals sent by the Slave and parses the hardware signals based on the handshake protocol to determine the current upgrade status of the Slave.

[0086] The handshake protocol with the Slave end through preset rules includes: using N high-level signals and N low-level signals as a set of handshake signals to perform a handshake protocol with the Slave end, where N is a natural number greater than zero.

[0087] Furthermore, when parsing hardware signals based on the handshake protocol, the duration of a single signal is calculated based on the total duration of N high-level signals and N low-level signals. Then, the hardware signal can be parsed based on the duration of each single signal. For ease of understanding, an example will be provided below.

[0088] For example, taking GPIO signals as an example, with M=3 and N=10, three sets of 10 high-level signals and three sets of 10 low-level signals are used as a handshake signal to conduct a handshake protocol with the Slave. GPIO is low by default. When the Host receives a high level, it starts the handshake protocol and determines the upgrade status of the Slave.

[0089] Assuming the total duration of the three sets of ten high-level signals and the three sets of ten low-level signals is 60 seconds, then the duration of a single signal is 1 second. After receiving the hardware signals sent by the slave, the host parses them based on the 1-second duration. If the parsing result 000111111000 represents a successful upgrade, other parsing results indicate an upgrade failure. For example, 000111000 represents an upgrade failure. Therefore, the upgrade status of the slave can be determined based on the hardware signals.

[0090] Of course, in practice, to quickly determine the cause of Slave upgrade failure, different parsing results corresponding to hardware signals are pre-set. When parsing the hardware signals transmitted by the Slave, the cause of the current Slave upgrade failure is determined based on the parsing result. For example, if the parsing result 000111111000 represents a successful upgrade, other parsing results indicate upgrade failure. Among them, 000100000000 indicates that the upgrade package transmission failed, 000110000000 indicates that the upgrade package verification failed, and 000111000000 indicates that the Slave startup failed. Of course, other types of upgrade failure reasons can also be included. This application does not limit the parsing results and corresponding failure types for upgrade failures.

[0091] The OTA upgrade method provided in this application uses hardware signals for signal transmission, which is simple to parse and unaffected by communication protocols. It can ensure that the host can obtain the upgrade status of the slave under any circumstances, thereby improving the accuracy of the upgrade.

[0092] Figure 2 A flowchart of another OTA upgrade method provided in this application embodiment, as a preferred embodiment, is shown below. Figure 2 As shown, after acquiring the hardware signals sent by the Slave, the process also includes:

[0093] S20: Set the hardware signal to a low level;

[0094] S21: When the upgrade status of the Slave is determined to be successful based on the upgrade status analysis result, the hardware signal is set to a high level signal so that the Slave can determine the current upgrade status of the Host based on the hardware signal after a preset time.

[0095] In practice, after receiving the hardware signal sent by the slave, that is, after receiving the signal indicating the slave's upgrade status, the host first sets the communication signal to a low level. Then, the host determines whether the slave's upgrade was successful based on the upgrade status resolution result. If the upgrade was successful, the host sets the communication signal to a high level, i.e., sets the current hardware signal to a high level, so that the slave can determine the host's current upgrade status based on the current hardware signal after a preset time.

[0096] In fact, after confirming a successful upgrade on the slave side, the host will automatically enter upgrade mode to perform the upgrade. At this time, the slave can determine that the host is upgrading based on the high-level signal. Furthermore, after its own upgrade is successful, the host can set the hardware signal back to a low level, at which point the slave can confirm a successful upgrade based on the hardware signal.

[0097] S22: When the upgrade status of the Slave is determined to be upgrade failure based on the upgrade status analysis result, the hardware signal is kept low so that the Slave can determine after a preset time whether the number of times the current hardware signal is low has reached a preset number. If it has not reached the preset number, the Slave will proceed to the step of handshaking with the Slave according to the preset rules. If it has reached the preset number, the upgrade will be terminated.

[0098] Of course, if the upgrade status of the Slave is determined to be an upgrade failure based on the upgrade status analysis result, the current hardware signal will remain at a low level. In order to avoid misjudgment of the upgrade status due to errors in the transmitted hardware signal, the Slave will first check whether the number of times the current hardware signal is at a low level has been determined has reached a preset number after a preset time. If it has not reached the preset number, the host will re-establish the handshake protocol with the Slave according to the preset rules. That is, the host will re-acquire the hardware signal to analyze and determine the upgrade status of the Slave. If the host reaches the preset number, the upgrade of the Slave will be determined to have failed, and the upgrade will be terminated.

[0099] The OTA upgrade method provided in this application, after obtaining the hardware signal sent by the Slave, controls the setting of the hardware signal to high and low to notify the Slave of the current host's parsing result of the hardware signal and the current upgrade status of the host, thereby ensuring that both the host and the Slave can obtain each other's upgrade status and improving upgrade reliability.

[0100] In a specific embodiment, to further ensure the reliability of OTA upgrades, before downloading the upgrade package and after receiving the upgrade command, the remaining battery power of the system is first checked to determine whether the current remaining battery power allows for the upgrade. If it allows, the upgrade package is downloaded; if it does not allow, a prompt signal is sent to the terminal to remind the user that the current remaining battery power is insufficient and the upgrade is terminated.

[0101] The OTA upgrade method provided in this application first determines whether the remaining battery power of the current system allows for the upgrade after receiving the upgrade instruction. If it does, the upgrade package is downloaded to avoid upgrade failure due to insufficient battery power, thereby improving upgrade reliability. At the same time, it can also reduce unnecessary operations and save resources.

[0102] Understandably, OTA upgrades require a certain amount of system storage space. To ensure the success rate and reliability of the upgrade, after the slave receives the upgrade package transmitted by the host, it first checks the current remaining storage space of the system to determine whether the remaining storage space allows for the upgrade. If the upgrade is allowed, it further verifies the integrity of the upgrade package. Once the integrity of the upgrade package is confirmed, the upgrade is performed based on the upgrade package.

[0103] If the system's current remaining storage space does not allow for the upgrade, a prompt signal will be transmitted to the terminal to inform the user that there is insufficient storage space and to terminate the upgrade. Similarly, if the upgrade package is found to be incomplete during the integrity verification process, a prompt signal will also be sent to the terminal to inform the user that the upgrade has failed.

[0104] Furthermore, after the upgrade is complete, a hardware signal is sent to the host so that the host can enter upgrade mode after confirming that the current upgrade status of the slave is successful.

[0105] The OTA upgrade method provided in this application embodiment first verifies the remaining storage space of the system and the upgrade package when the slave performs the upgrade, thereby improving the upgrade success rate and reliability.

[0106] In the above embodiments, the method for OTA upgrades applied to the host side has been described in detail. This application also provides embodiments of an apparatus for OTA upgrades applied to the host side. It should be noted that this application describes the embodiments of the apparatus from two perspectives: one is based on functional modules, and the other is based on hardware structure.

[0107] Figure 3 A structural diagram of an OTA upgrade device provided in an embodiment of this application is shown below. Figure 3 The device includes:

[0108] The preprocessing module 10 is used to download the upgrade package and parse the upgrade package to obtain the parsing result;

[0109] The judgment module 11 is used to determine whether the upgrade version number of the package to be upgraded and the corresponding current version number, as well as the upgrade version number of the Slave and the corresponding current version number, are different based on the parsing results to determine whether the package to be upgraded meets the upgrade conditions.

[0110] The transmission module 12 is used to transmit the upgrade package to the Slave end when it is determined that the upgrade package meets the upgrade conditions so that the Slave end can perform the upgrade.

[0111] The first acquisition module 13 is used to acquire hardware signals sent by the Slave to determine the current upgrade status of the Slave.

[0112] The determination module 14 is used to enter the upgrade mode after determining that the current upgrade status on the Slave is successful.

[0113] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0114] The OTA upgrade apparatus provided in this application includes: downloading an upgrade package and parsing the package to obtain a parsing result; when the parsing result determines that the upgrade package meets the upgrade conditions, transmitting the upgrade package to the slave end. Then, after the slave end completes the upgrade using the upgrade package, it acquires the hardware signal sent by the slave end, and after determining that the slave end has successfully upgraded based on the hardware signal, it enters upgrade mode to perform the upgrade. Therefore, the technical solution provided in this application ensures that the hardware signal is not affected by the communication protocol. The host end can acquire the hardware signal sent by the slave end under any circumstances to determine the upgrade status of the slave end, thereby avoiding the situation where the host end and slave end cannot communicate normally when the communication protocol changes, thus improving upgrade reliability. Furthermore, the host end only continues the upgrade after determining that the slave end has successfully upgraded, further improving upgrade efficiency and reliability, and enhancing the user experience.

[0115] Figure 4 A structural diagram of an electronic device provided in another embodiment of this application, such as... Figure 4 As shown, the electronic device includes: a memory 20 for storing computer programs;

[0116] The processor 21 is configured to execute a computer program to implement the steps of the OTA upgrade method as described in the above embodiments.

[0117] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, smartwatches, virtual reality devices, augmented reality devices, tablets, laptops, or desktop computers.

[0118] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0119] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the OTA upgrade method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, relevant data involved in the OTA upgrade method.

[0120] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0121] Those skilled in the art will understand that Figure 4 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0122] The electronic device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: an OTA upgrade method.

[0123] The electronic device provided in this application embodiment, because its hardware signals are unaffected by communication protocols, interacts via hardware signals. The host can obtain the hardware signals sent by the slave under any circumstances to determine the slave's upgrade status. This avoids the situation where communication protocols fail to allow normal communication between the host and slave when the communication protocol changes, thus improving upgrade reliability. Furthermore, the host only continues the upgrade process after confirming that the slave's upgrade is successful, further improving upgrade efficiency and reliability, and enhancing the user experience.

[0124] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments (which may be a method corresponding to the Host end, a method corresponding to the Slave end, or a method corresponding to both the Host end and the Slave end).

[0125] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] The above provides a detailed description of an OTA upgrade method and its related components provided in this application. The various embodiments in the specification 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 apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. 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 the claims of this application.

[0127] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only 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.

Claims

1. A method for OTA (Over-The-Air) upgrades, characterized in that, include: Download the upgrade package and parse it to obtain the parsing result; Based on the analysis results, it is determined whether the upgrade version number of the package to be upgraded is different from the corresponding current version number, and whether the upgrade version number of the Slave is different from the corresponding current version number, to determine whether the package to be upgraded meets the upgrade conditions. When it is determined that the package to be upgraded meets the upgrade conditions, the package to be upgraded is transmitted to the Slave end so that the Slave end can perform the upgrade; Obtain the hardware signals sent by the Slave to determine the current upgrade status of the Slave; After confirming that the current upgrade status of the Slave is successful, it enters upgrade mode; The step of obtaining the hardware signals sent by the Slave to determine the current upgrade status of the Slave includes: A handshake protocol is established with the Slave terminal using preset rules; Acquire the hardware signal sent by the Slave terminal; The upgrade status analysis result is obtained by parsing the hardware signals based on the handshake protocol. The current upgrade status of the Slave terminal is determined based on the upgrade status parsing results; The handshake protocol with the Slave terminal based on preset rules includes: M groups of N high-level signals and M groups of N low-level signals are used as a set of handshake signals in the handshake protocol to perform a handshake with the Slave end; where M and N are natural numbers greater than zero; The parsing of the hardware signals based on the handshake protocol includes: The duration of a single signal is calculated based on the total duration occupied by the M groups of N high-level signals and the M groups of N low-level signals; The hardware signal is analyzed based on the duration of each individual signal occupation. After acquiring the hardware signal sent by the Slave terminal, the method further includes: Set the hardware signal to a low level; When the upgrade status of the Slave is determined to be a successful upgrade based on the upgrade status parsing result, the hardware signal is set to a high level signal so that the Slave can determine the current upgrade status of the Host based on the hardware signal after a preset time. When the upgrade status of the Slave is determined to be an upgrade failure based on the upgrade status parsing result, the hardware signal is kept at a low level so that the Slave can determine after a preset time whether the number of times the hardware signal is at a low level has reached a preset number. If it has not reached the preset number, the Slave will proceed to the step of performing a handshake protocol with the Slave according to preset rules. If it has reached the preset number, the upgrade will be terminated.

2. The OTA upgrade method according to claim 1, characterized in that, If the current upgrade status of the Slave is determined to be an upgrade failure, the following steps are also included: Determine if the system is currently powered on; If the system is powered on, an upgrade failure signal will be transmitted to the server, and the server will be requested to complete the package before the upgrade in order to restore the system. If the device is powered off, it transmits a power-off signal and a request to restore the version number signal to the server so that the server can issue a new upgrade package and enter the forced burning mode to perform the upgrade.

3. The OTA upgrade method according to claim 1, characterized in that, The process also includes downloading the upgrade package before: Receive upgrade instructions; Determine if the current system's remaining battery power allows for an upgrade; If permitted, proceed to the step of downloading the upgrade package; If not allowed, a prompt signal will be sent to the terminal.

4. The OTA upgrade method according to claim 1, characterized in that, The upgrade of the Slave end includes: Obtain the upgrade package transmitted from the host; Determine if the system's current remaining storage space allows for an upgrade; If permitted, the upgrade will be performed based on the upgrade package after verifying its integrity. If not allowed, a prompt signal will be sent to the terminal; The hardware signal is sent to the Host so that the Host enters upgrade mode after determining that the current upgrade status of the Slave is a successful upgrade.

5. An OTA (Over-The-Air) upgrade device, characterized in that, include: The preprocessing module is used to download the upgrade package and parse the upgrade package to obtain the parsing result; The judgment module is used to determine, based on the parsing result, whether the upgrade version number of the package to be upgraded is different from the corresponding current version number, and whether the upgrade version number of the Slave is different from the corresponding current version number, to determine whether the package to be upgraded meets the upgrade conditions. The transmission module is used to transmit the upgrade package to the Slave end when it is determined that the upgrade package meets the upgrade conditions so that the Slave end can perform the upgrade. The first acquisition module is used to acquire hardware signals sent by the Slave terminal to determine the current upgrade status of the Slave terminal; The determination module is used to enter the upgrade mode after determining that the current upgrade status of the Slave is a successful upgrade; Specifically, the first acquisition module is used to perform a handshake protocol with the Slave terminal according to preset rules; acquire the hardware signals sent by the Slave terminal; parse the hardware signals based on the handshake protocol to obtain an upgrade status parsing result; and determine the current upgrade status of the Slave terminal based on the upgrade status parsing result. The first acquisition module is specifically used to use M groups of N high-level signals and M groups of N low-level signals as a set of handshake signals for the handshake protocol to perform a handshake protocol with the Slave end; wherein M and N are natural numbers greater than zero; calculate the duration of a single signal based on the total duration of the M groups of N high-level signals and the M groups of N low-level signals; and parse the hardware signal based on the duration of the single signal. The OTA upgrade device is further configured to: set the hardware signal to a low level; when the upgrade status of the Slave is determined to be a successful upgrade based on the upgrade status parsing result, set the hardware signal to a high level so that the Slave can determine the current upgrade status of the Host based on the hardware signal after a preset time; when the upgrade status of the Slave is determined to be a failed upgrade based on the upgrade status parsing result, keep the hardware signal at a low level so that the Slave can determine after a preset time whether the number of times the hardware signal is at a low level has reached a preset number; if not, proceed to the step of performing a handshake protocol with the Slave according to preset rules; if the handshake has reached the preset number, terminate the upgrade.

6. An electronic device, characterized in that, Includes memory used to store computer programs; A processor for executing the computer program to implement the steps of the OTA upgrade method as described in any one of claims 1 to 4.

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 as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Intelligent terminal and upgrade method thereof

    CN107122202A

  • Serial port communication control method, processor, serial port communication system and storage medium

    CN112162944A