Firmware upgrade method and apparatus

CN123011275APending Publication Date: 2026-10-30XIAOMI TECH (WUHAN) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611215176.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而当网络拥塞、设备资源紧张时,固定升级策略易导致下载失败、业务中断或升级反复重试

Benefits of technology

其中,所述处理器被配置为执行所述存储器中的所述可执行指令,以实现本公开第一方面所提供的固件升级方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011275A_ABST
    Figure CN123011275A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a firmware upgrade method and device. The method comprises: obtaining running data of a target device, the running data comprising at least one of network state data, device state data and historical statistical data; determining the degree of adaptation of each candidate upgrade scheme to the running data; determining a target upgrade scheme according to the candidate upgrade scheme corresponding to the highest degree of adaptation; and upgrading the firmware of the target device using the target upgrade scheme. In this way, by collecting multi-dimensional running data such as network state, device state and historical statistical data, the optimal target upgrade scheme is dynamically selected from multiple candidate schemes, which can improve the flexibility and reliability of firmware upgrade, improve the upgrade success rate, reduce the risk of business interruption and optimize the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to a firmware upgrade method and apparatus. Background Technology

[0002] Existing firmware upgrade technologies typically employ pre-configured fixed upgrade strategies, such as full upgrades or incremental upgrades. However, when network congestion or device resource constraints arise, fixed upgrade strategies are prone to causing download failures, service interruptions, or repeated upgrade retries. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a firmware upgrade method, apparatus, electronic device, storage medium, and program product.

[0004] According to a first aspect of the present disclosure, a firmware upgrade method is provided, comprising: Acquire operational data of the target device, wherein the operational data includes at least one of network status data, device status data, and historical statistical data; Determine the compatibility between each candidate upgrade scheme and the operational data; Based on the candidate upgrade schemes corresponding to the highest fit, the target upgrade scheme is determined; The target device is upgraded using the target upgrade scheme.

[0005] In the above technical solution, by collecting multi-dimensional operational data such as network status, device status, and historical statistics, the optimal target upgrade scheme can be dynamically selected from multiple candidate upgrade schemes, which can improve the flexibility and reliability of firmware upgrades, increase the upgrade success rate, reduce the risk of service interruption, and optimize user experience.

[0006] In some possible implementations, the candidate upgrade schemes include at least two of the following: cloud upgrade scheme, local upgrade scheme, hybrid upgrade scheme, and full upgrade scheme; The hybrid upgrade scheme enables the target device to obtain the missing upgrade data from the cloud and combine it with the locally stored firmware data to complete the firmware upgrade.

[0007] The above technical solution provides four differentiated candidate solutions: cloud upgrade, local upgrade, hybrid upgrade, and full upgrade, which can cover upgrade needs under various conditions and enable dynamic selection of the upgrade solution in the future.

[0008] In some possible implementations, Determining the compatibility between each candidate upgrade scheme and the operational data includes: Based on the operational data, extract multidimensional evaluation information; The adaptability of the cloud upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: network quality evaluation information, cloud availability evaluation information, cloud historical performance evaluation information, and traffic cost evaluation information, and their respective weight coefficients. Based on at least two of the version matching evaluation information, storage space evaluation information, patch quality evaluation information, and local historical performance evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the local upgrade scheme is determined. The suitability of the hybrid upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: local basic evaluation information, network quality evaluation information, missing block ratio evaluation information, and parallel efficiency evaluation information, and their respective weight coefficients. Based on the network quality evaluation information and the full package storage space evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the full upgrade scheme is determined.

[0009] Among the above technical solutions, the adaptability of cloud upgrade solutions can be comprehensively quantified from multiple dimensions such as network quality, cloud availability, historical performance, and traffic cost, thereby improving the comprehensiveness of the assessment and the accuracy of the decision; the adaptability of local upgrade solutions can be comprehensively quantified from multiple dimensions such as version matching, storage space, patch quality, and historical performance, thereby improving the comprehensiveness and accuracy of local upgrade feasibility assessment; the adaptability of hybrid upgrade solutions can be comprehensively quantified from multiple dimensions such as version matching, network quality, missing block ratio, and device parallel processing capability, thereby improving the comprehensiveness and accuracy of hybrid upgrade feasibility assessment; and the adaptability of full upgrade solutions can be comprehensively quantified from multiple dimensions such as network quality and storage space, thereby improving the comprehensiveness and accuracy of full upgrade feasibility assessment.

[0010] In some possible implementations, the network quality evaluation information is determined based on the stability, transmission latency, and available bandwidth of the current network environment, wherein the stability is positively correlated with the network quality evaluation information, the transmission latency is negatively correlated with the network quality evaluation information, and the available bandwidth is positively correlated with the network quality evaluation information. The cloud availability evaluation information is determined based on whether there is an incremental upgrade package from the current firmware version of the target device to the target firmware version in the cloud, and a first version gap, wherein the first version gap is the version difference between the current firmware version and the target firmware version, and the first version gap is negatively correlated with the cloud availability evaluation information. The cloud-based historical performance evaluation information is determined based on a first success rate, wherein the first success rate is the success rate of firmware upgrades completed through the cloud-based upgrade scheme within a historical statistical period, and the first success rate is positively correlated with the cloud-based historical performance evaluation information. The traffic cost evaluation information is determined based on the traffic resource consumption level under the current network environment, wherein the traffic resource consumption level is negatively correlated with the traffic cost evaluation information.

[0011] The above technical solution further defines the specific methods for determining network quality evaluation information, cloud availability evaluation information, cloud historical performance evaluation information, and traffic cost evaluation information, making the quantitative evaluation process clearer and ensuring the accuracy and reliability of the cloud upgrade solution adaptability calculation.

[0012] In some possible implementations, the version matching evaluation information is determined based on a second version gap, wherein the second version gap is the version difference between the target firmware version and the local preset firmware version of the target device, and the second version gap is negatively correlated with the version matching evaluation information. The storage space evaluation information is determined based on the size of the remaining storage space of the target device relative to the space required for local upgrade, wherein the size of the remaining storage space of the target device relative to the space required for local upgrade is positively correlated with the storage space evaluation information; The patch quality evaluation information is determined based on the confidence level of the upgrade patch generated through local differential processing in a preset version relationship graph, wherein the confidence level is positively correlated with the patch quality evaluation information; The local historical performance evaluation information is determined based on a second success rate, wherein the second success rate is the success rate of firmware upgrades completed through the local upgrade scheme within a historical statistical period, and the second success rate is positively correlated with the local historical performance evaluation information.

[0013] The above technical solution further defines the specific methods for determining version matching evaluation information, storage space evaluation information, patch quality evaluation information, and local historical performance evaluation information, making the quantitative evaluation process clearer and ensuring the accuracy and reliability of the local upgrade solution adaptation calculation.

[0014] In some possible implementations, the missing block ratio evaluation information is determined based on a first ratio, wherein the first ratio is the ratio of the number of locally available data blocks to the total number of data blocks in the target version, and the first ratio is negatively correlated with the missing block ratio evaluation information, wherein the data blocks are used to constitute the target version firmware. The parallel efficiency evaluation information is determined based on the CPU load of the target device, wherein the CPU load is negatively correlated with the parallel efficiency evaluation information. The full package storage space evaluation information is determined based on a second ratio, wherein the second ratio is the ratio of the remaining storage space of the target device to the total storage space of the target device, and the second ratio is positively correlated with the full package storage space evaluation information.

[0015] The above technical solution further defines the specific methods for determining the missing block ratio evaluation information, parallel efficiency evaluation information, and full package storage space evaluation information, making the quantitative evaluation process clearer and ensuring the accuracy and reliability of the compatibility calculation between the hybrid upgrade scheme and the full upgrade scheme.

[0016] In some possible implementations, determining the target upgrade scheme based on the candidate upgrade scheme corresponding to the highest fit includes: When the highest fit is greater than the fit threshold, the candidate upgrade scheme corresponding to the highest fit is determined as the target upgrade scheme; When the highest compatibility is less than or equal to the compatibility threshold, a prompt message is generated, and if the preset retry conditions are met, the target upgrade scheme is re-determined and the firmware upgrade is performed. The prompt message is used to remind the user that the current environment is not suitable for upgrading the firmware.

[0017] In the above technical solutions, the strategy with the highest matching degree with the current working conditions can be selected to perform the upgrade while ensuring the feasibility of the upgrade, thereby improving the success rate of the upgrade. When the target device is currently unable to support the reliable execution of any candidate upgrade scheme, a prompt message can be generated instead of continuing the upgrade, thereby avoiding upgrade failure, equipment abnormality or data corruption caused by poor environment, thus reducing the upgrade risk.

[0018] In some possible implementations, the preset retry condition includes at least one of the following: The duration since the generation of the prompt message has reached the duration threshold; The network quality meets the preset quality conditions; The target device's battery level rises to a battery threshold.

[0019] The above technical solution can automatically resume the upgrade attempt after the environmental conditions improve, which not only avoids invalid upgrades in harsh environments, but also ensures the timeliness of the upgrade opportunity and improves the completion rate of the upgrade task.

[0020] In some possible implementations, the method further includes: Obtain the current environmental status of the target device, wherein the current environmental status includes at least one of network quality, remaining battery power, and remaining storage space; Determine the amount of change between the current environmental state and the decision environmental state, wherein the decision environmental state is the environmental state when the target upgrade plan is determined; When the change exceeds the environmental change threshold, the target upgrade scheme is redefined to determine a new target upgrade scheme for firmware upgrade.

[0021] In the above technical solution, the upgrade strategy can be dynamically adjusted when the target device's environmental state changes significantly, ensuring that the upgrade plan always maintains optimal matching with the target device's current operating conditions, avoiding upgrade failure due to excessive differences in the environment between the decision-making time and the execution time, and further improving the robustness of firmware upgrades.

[0022] According to a second aspect of the present disclosure, a firmware upgrade apparatus is provided, comprising: The acquisition module is used to acquire the operating data of the target device, wherein the operating data includes at least one of network status data, device status data, and historical statistical data. The first determining module is used to determine the compatibility between each candidate upgrade scheme and the running data; The second determining module is used to determine the target upgrade scheme based on the candidate upgrade schemes corresponding to the highest fit. The upgrade module is used to perform firmware upgrades on the target device using the target upgrade scheme.

[0023] According to a third aspect of the present disclosure, a firmware upgrade apparatus is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to execute the executable instructions in the memory to implement the steps of the firmware upgrade method provided in the first aspect of this disclosure.

[0024] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the firmware upgrade method provided in the first aspect of the present disclosure.

[0025] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the firmware upgrade method provided in the first aspect of the present disclosure.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0028] Figure 1 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment.

[0029] Figure 2 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment.

[0030] Figure 3 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment.

[0031] Figure 4 This is a block diagram illustrating a firmware upgrade device according to an exemplary embodiment.

[0032] Figure 5 This is a block diagram illustrating a firmware upgrade device according to an exemplary embodiment. Detailed Implementation

[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0034] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are performed with authorization from the owner of the relevant device.

[0035] Figure 1 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment. Figure 1 As shown, the firmware upgrade method may include steps S101 to S103.

[0036] In step S101, the operating data of the target device is acquired.

[0037] The operational data may include at least one of network status data, device status data, and historical statistics.

[0038] In one embodiment, runtime data can be actively retrieved through a query interface.

[0039] Network status data may include at least one of the following: Signal Strength Indicator (RSSI), estimated available bandwidth, round-trip time (RTT), packet loss rate, network type identifier (WiFi / 4G / 5G / Ethernet), and traffic cost tier (CBT). ).

[0040] Device status data may include at least one of the following: battery level, device temperature, and remaining storage space. ), remaining running memory ( ), CPU load rate ( ), runtime (Uptime), and power type identifier (Battery / Powered).

[0041] Historical statistics may include at least one of the following: historical upgrade success rate, recent failure count, local version index, and patch confidence.

[0042] In step S102, the compatibility between each candidate upgrade scheme and the running data is determined.

[0043] In one embodiment, the candidate upgrade scheme may include at least two of the following: The cloud-based upgrade solution enables the target device to obtain incremental upgrade packages from the cloud for firmware upgrades. The local upgrade scheme enables the target device to generate an upgrade patch through local differential processing based on the target firmware version and the locally stored preset firmware version, and then use the upgrade patch to complete the firmware upgrade.

[0044] The hybrid upgrade solution enables the target device to obtain the missing upgrade data from the cloud and combine it with the locally stored firmware data to complete the firmware upgrade.

[0045] The full upgrade solution is used to perform a complete image overwrite upgrade of the firmware of the target device.

[0046] For example, in a cloud-based upgrade solution, the target device establishes a communication connection with a cloud server, retrieves a pre-generated incremental upgrade package from the cloud, and updates the current firmware based on this package. This solution is typically suitable for scenarios where cloud computing power is sufficient and network bandwidth can support incremental data transmission.

[0047] For example, in a local upgrade scheme, the target device obtains the target firmware version information and uses a locally stored preset firmware version (such as the baseline firmware pre-installed at the factory, or the backup firmware or best base version firmware retained after the last successful upgrade) as a reference. Differential processing is then performed locally on the target device to generate the upgrade patch required to upgrade from the current firmware version to the target firmware version. This upgrade patch is then used to complete the firmware update. This hybrid upgrade scheme does not require interaction with the cloud to download upgrade data and is typically suitable for scenarios where the device has local differential processing capabilities and has already stored a preset firmware version.

[0048] For example, in a hybrid upgrade scheme, the target device first obtains a data block index lookup table between the current firmware and the target firmware to determine which data blocks in the local firmware are available, which are missing, or which are inconsistent with the target version. The target device then uses this lookup table to filter out available data blocks locally and retrieves the missing data blocks from the cloud. Subsequently, using the available local data blocks as the main body, the target device concatenates and verifies the downloaded missing data blocks according to the index order locally to construct the complete target firmware, thereby completing the upgrade. In this hybrid upgrade scheme, the cloud acts as a data block repository, providing on-demand downloads without the need to pre-generate upgrade packages; difference comparison and firmware reassembly are all completed on the device side. This scheme is typically suitable for scenarios where some valid firmware data is already stored locally, network bandwidth is limited, and the device has a certain data processing capability.

[0049] For example, in a full upgrade solution, the target device obtains a complete image file of the target firmware version from the cloud or other upgrade sources, and uses this image file to completely overwrite the current firmware of the target device, replacing the entire device firmware with the target version. This full upgrade solution has simple implementation logic and strong compatibility, and is typically suitable for scenarios where the device has ample storage space and high requirements for upgrade stability, or where the current firmware version of the device is severely fragmented and unsuitable for differential matching.

[0050] Of the four options mentioned above, both the cloud-based upgrade and full-scale upgrade options may rely on the cloud as a data source, differing only in the amount of data transmitted. The local upgrade option performs differential calculations on the device itself, eliminating the need for network transmission. The hybrid upgrade option combines the features of cloud acquisition and local processing, utilizing existing local data to reduce transmission overhead. During the firmware upgrade process, the optimal option can be dynamically selected from the various candidate options based on the target device's operational data, network status data, device status data, and historical statistical data to achieve the firmware upgrade.

[0051] In one embodiment, the acquired operational data can be normalized to generate a standardized feature vector for evaluation. For example, a range normalization method can be used to map each piece of operational data to the interval [0, 100], and the fit between each candidate upgrade scheme and the aforementioned operational data can be determined by weighted summation based on the mapped data, so as to determine the target upgrade scheme based on the fit corresponding to each candidate upgrade scheme.

[0052] In step S103, the target upgrade scheme is determined based on the candidate upgrade schemes corresponding to the highest fit.

[0053] In one embodiment, the suitability of each candidate upgrade scheme can be compared, and the candidate upgrade scheme with the highest suitability can be selected as the target upgrade scheme to achieve accurate matching of the target upgrade strategy.

[0054] In one embodiment, when multiple candidate upgrade schemes have the same and highest fit, the target upgrade scheme is determined from the multiple candidate upgrade schemes according to a preset priority rule; or, the one with the smallest upgrade data volume among the multiple candidate upgrade schemes is determined as the target upgrade scheme; or, the one with the highest historical success rate among the multiple candidate upgrade schemes is determined as the target upgrade scheme. In this way, a clear decision-making basis can be provided when multiple schemes are equally good, ensuring the uniqueness of the target upgrade scheme.

[0055] In step S104, the target device is upgraded using the target upgrade scheme.

[0056] In one embodiment, if the target upgrade scheme is a full upgrade, the cloud sends a complete firmware image to the target device, and the target device performs a complete overwrite flash of the current firmware; if it is a cloud-based upgrade, the cloud sends an incremental upgrade package, and the target device completes the upgrade after verifying the incremental upgrade package. Furthermore, the device's operating status is continuously monitored during the upgrade process. If a device restart or network interruption is detected, the upgrade can be paused and resumed once conditions are restored.

[0057] In an exemplary embodiment of this disclosure, a multi-strategy dynamic optimization firmware upgrade method is provided. By collecting multi-dimensional operational data such as network status, device status, and historical statistics, the optimal target upgrade scheme is dynamically selected from multiple candidate upgrade schemes. This can improve the flexibility and reliability of firmware upgrades, increase the upgrade success rate, reduce the risk of service interruption, and optimize the user experience.

[0058] In some possible implementations, step S102 can be achieved in the following way: Extract multidimensional evaluation information based on operational data; The suitability of the cloud upgrade plan is determined based on at least two of the following multidimensional evaluation information: network quality evaluation information, cloud availability evaluation information, cloud historical performance evaluation information, and traffic cost evaluation information, as well as their respective weight coefficients. The suitability of the local upgrade plan is determined based on at least two of the following: version matching evaluation information, storage space evaluation information, patch quality evaluation information, and local historical performance evaluation information, as well as their respective weight coefficients. The suitability of the hybrid upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: local basic evaluation information, network quality evaluation information, missing block ratio evaluation information, and parallel efficiency evaluation information, and their respective weight coefficients. Based on the network quality evaluation information and the full package storage space evaluation information in the multi-dimensional evaluation information, as well as their respective weight coefficients, the adaptability of the full upgrade scheme is determined.

[0059] Thus, for different candidate upgrade schemes, different evaluation information is used to accurately determine their respective matching degree. The following is an exemplary description of the process of determining the matching degree of each candidate upgrade scheme, that is, a detailed explanation of step S102.

[0060] (I) Cloud-based upgrade solutions Based on operational data, evaluate at least two of the following: network quality, cloud availability, historical cloud performance, and traffic cost, and extract evaluation information from multiple first-dimensional dimensions. The suitability of the cloud upgrade solution is determined based on evaluation information from multiple primary dimensions.

[0061] In this way, the suitability of cloud upgrade solutions can be comprehensively quantified from multiple dimensions such as network quality, cloud availability, historical performance, and traffic costs, thereby improving the comprehensiveness of the assessment and the accuracy of the decision.

[0062] 1. Assessment results regarding network quality The network quality assessment results are known as network quality evaluation information, which reflects the current quality of the network environment.

[0063] In one embodiment, network quality assessment information is determined based on the stability of the current network environment, transmission latency, and available bandwidth. Stability may be determined based on signal strength indication and / or packet loss rate. Transmission latency may be determined based on round-trip time.

[0064] Stability is positively correlated with network quality evaluation information, transmission latency is negatively correlated with network quality evaluation information, and available bandwidth is positively correlated with network quality evaluation information. High stability indicates small network connection fluctuations, low packet loss rate, and reliable data transmission, thus corresponding to a higher network quality evaluation information. Low transmission latency indicates short data transmission time from sender to receiver, and timely delivery of upgrade packets, thus corresponding to a higher network quality evaluation information. High available bandwidth indicates a large amount of data that can be transmitted per unit time and short download time for upgrade packets, thus corresponding to a higher network quality evaluation information.

[0065] For example, network quality evaluation information can be determined using the following formula (1). : (1) in, As a network stability indicator, With a latency in milliseconds, With bandwidth in the Mbps range; , and They are respectively , , The corresponding weights can be pre-defined. , and The sum can be 1. Setting an upper limit for the bandwidth item can prevent a few ultra-high bandwidth scenarios from overly dominating the evaluation results, making the evaluation results more in line with the actual needs of firmware upgrade scenarios.

[0066] 2. Assessment results regarding cloud availability The assessment results of cloud availability are cloud availability evaluation information, which are used to reflect whether there are available incremental packages in the cloud and their quality.

[0067] In one embodiment, the cloud availability evaluation information is determined based on whether there is an incremental upgrade package from the current firmware version of the target device to the target firmware version in the cloud, and a first version gap, wherein the first version gap is the version difference between the current firmware version and the target firmware version, and the first version gap is negatively correlated with the cloud availability evaluation information.

[0068] If an incremental upgrade package exists in the cloud, from the current firmware version of the target device to the target firmware version, then it can be determined that the cloud can provide incremental upgrade support, and the cloud availability evaluation information is high. Conversely, if no incremental upgrade package exists, it can be determined that the cloud cannot directly provide incremental upgrade support, and the cloud availability evaluation information is low. The greater the version difference, the higher the complexity of the incremental upgrade package, the lower the probability of generating a reliable incremental upgrade package, and the lower the cloud availability evaluation information accordingly.

[0069] For example, cloud availability evaluation information can be determined using the following formula (2). : (2) in, This is a Boolean value, indicating whether an incremental upgrade package from the current version to the target version exists in the cloud. This is the first version difference. For example, if an incremental upgrade package exists. A value of 1 indicates that the incremental upgrade package does not exist. The value is 0.

[0070] 3. Evaluation results regarding historical performance in the cloud. The evaluation results of cloud historical performance are cloud historical performance evaluation information, which are used to reflect the upgrade success rate of cloud upgrade solutions within a historical period.

[0071] In one embodiment, the cloud-based historical performance evaluation information is determined based on a first success rate, where the first success rate is the success rate of firmware upgrades completed via the cloud-based upgrade scheme within a historical statistical period. The first success rate is positively correlated with the cloud-based historical performance evaluation information. A higher first success rate indicates that the cloud-based upgrade scheme has more stable upgrade performance and a lower failure rate within the historical statistical period, thus allowing for a higher cloud-based historical performance evaluation.

[0072] For example, the historical performance evaluation information in the cloud can be determined by the following formula (3). : (3) in, This represents the success rate of cloud upgrades over the past 7 days. Utilizing recent historical data objectively reflects the short-term performance of cloud upgrade solutions, ensuring the timeliness and ease of calculation of historical cloud performance evaluation information.

[0073] 4. Assessment results regarding traffic costs The assessment results of traffic costs are known as traffic cost evaluation information, which reflects network traffic expenses.

[0074] In one embodiment, the traffic cost evaluation information is determined based on the traffic resource consumption level under the current network environment, wherein the traffic resource consumption level is negatively correlated with the traffic cost evaluation information. The higher the traffic resource consumption level, the fewer available traffic resources there are, and therefore, lower traffic cost evaluation information can be given accordingly.

[0075] For example, traffic cost evaluation information can be determined using the following formula (4). : (4) in, This is a traffic cost level used to reflect the traffic resource consumption level in the current network environment, and its value range can be 0-10.

[0076] The aforementioned network quality evaluation information Cloud availability evaluation information Historical performance evaluation information in the cloud Traffic cost evaluation information All of these can be used as evaluation information in the first dimension. The suitability of the cloud upgrade solution can be determined by weighted summation of these first-dimensional evaluation information. For example, the suitability of the cloud upgrade solution can be determined by the following formula (5). : (5) in, , , and respectively under the cloud upgrade solution , , and The corresponding weights can be pre-defined. , , and The sum can be 1.

[0077] (II) Local upgrade plan Based on the operational data, evaluate at least two of the following: version matching degree, storage space adequacy, patch quality, and local historical performance, and extract multiple second-dimensional evaluation information. Based on evaluation information from multiple second-dimensional dimensions, the suitability of the local upgrade solution is determined.

[0078] In this way, the adaptability of local upgrade solutions can be comprehensively quantified from multiple dimensions such as version compatibility, storage space, patch quality, and historical performance, thereby improving the comprehensiveness and accuracy of local upgrade feasibility assessment.

[0079] 1. Evaluation results regarding version compatibility.

[0080] The evaluation result of the version matching degree is the version matching degree evaluation information, which reflects the similarity between the target firmware version and the local preset firmware version of the target device.

[0081] In one embodiment, the version matching evaluation information is determined based on the second version gap, wherein the second version gap is the version difference between the target firmware version and the local preset firmware version of the target device, and the second version gap is negatively correlated with the version matching evaluation information.

[0082] The local preset firmware version can be a pre-specified local best base version. The greater the difference between the second version and the target firmware version, the more changes are made when performing differential processing based on this benchmark, and the higher the risk of differential failure or patch deviation. Therefore, a lower version matching rating can be given accordingly.

[0083] For example, version matching evaluation information can be determined using the following formula (6). : (6) in, It is a piecewise function. This is the difference between the second and third versions. For example, if... ≤1, =100 (adjacent versions); if 1 < ≤5, =80 (similar version); if 5 < ≤20, =50 (older versions); if >20, =20 (very old version).

[0084] 2. Assessment results regarding storage space adequacy The assessment result of storage space adequacy is called storage space evaluation information, which reflects whether the target device currently has enough remaining storage space to store patches.

[0085] In one embodiment, the storage space evaluation information is determined based on the size of the remaining storage space of the target device relative to the space required for local upgrades. The size of the remaining storage space of the target device relative to the space required for local upgrades is positively correlated with the storage space evaluation information. The larger the remaining storage space relative to the required space, the more abundant the device's storage resources, and the lower the risk of failure due to insufficient storage space. Therefore, a higher storage space evaluation information can be given accordingly.

[0086] For example, storage space evaluation information can be determined using the following formula (7). : (7) in, For the remaining storage space, This refers to the space required for local upgrades, which can be understood as the estimated patch size.

[0087] 3. Evaluation results regarding patch quality The results of patch quality assessment are known as patch quality evaluation information, which reflects the reliability of upgrade patches generated in the local upgrade scheme.

[0088] In one embodiment, the patch quality evaluation information is determined based on the confidence level of the upgrade patch in a preset version relationship graph, wherein the confidence level is positively correlated with the patch quality evaluation information.

[0089] A version relationship graph can be a graph consisting of multiple firmware versions as nodes and upgrade paths between versions as edges, used to represent the topological relationships between firmware versions. Confidence can be obtained by weighted summation of several factors: historical success rate, version gap, and patch coverage completeness. All of these factors are positively correlated with confidence; the higher the value of each factor, the higher the confidence and the higher the patch quality evaluation information. Specifically, historical success rate is the ratio of the number of successful upgrades from the local preset firmware version to the target firmware version to the total number of attempts; version gap is the degree of difference between the local preset firmware version and the target firmware version; and patch coverage completeness is the extent to which the patch covers all files or data blocks involved in the changes to the target version.

[0090] The higher the confidence level, the higher the historical success rate of the upgrade path corresponding to the upgrade patch in the version relationship graph, the lower the risk of version span and the more complete the change coverage, and the more reliable the local differential upgrade is. Therefore, higher patch quality evaluation information can be given accordingly.

[0091] For example, patch quality evaluation information can be determined using the following formula (8). : (8) in, Preset firmware version for local use. For the target firmware version, This is a preset confidence function. If the version relationship graph does not contain [a specific function]... arrive If the upgrade path is not historically verified or predefined, the reliability of the patch lacks a basis. The default value is 50.

[0092] 4. Assessment results regarding local historical performance The assessment results of local historical performance are local historical performance evaluation information, which are used to reflect the success rate of local upgrade plans within a historical period.

[0093] In one embodiment, the local historical performance evaluation information is determined based on a second success rate, where the second success rate is the success rate of firmware upgrades completed through the local upgrade scheme within the historical statistical period. The second success rate is positively correlated with the local historical performance evaluation information. A higher second success rate indicates that the upgrade performance of the local upgrade scheme is more stable and the failure rate is lower within the historical statistical period, thus allowing for a higher local historical performance evaluation.

[0094] For example, local historical performance evaluation information can be determined using the following formula (9). : (9) in, This represents the local upgrade success rate over the past 7 days. Utilizing recent historical data objectively reflects the short-term performance of local upgrade solutions, ensuring the timeliness and ease of calculation of local historical performance evaluation information.

[0095] The aforementioned version matching evaluation information Storage space evaluation information Patch quality evaluation information and local historical performance evaluation information All of these can be used as evaluation information in the second dimension. The suitability of the local upgrade scheme can be determined by weighted summation of these second-dimensional evaluation information. For example, the suitability of the local upgrade scheme can be determined by the following formula (10). : (10) in, , , and Local upgrade plan , , and The corresponding weights can be pre-defined. , , and The sum can be 1.

[0096] (III) Regarding the hybrid upgrade solution Based on the operational data, at least two of the following are evaluated: version matching degree, network quality, missing block ratio, and device parallel processing capability, and multiple third-dimensional evaluation information is extracted. Based on evaluation information from multiple third dimensions, the suitability of the hybrid upgrade solution is determined.

[0097] In this way, the suitability of the hybrid upgrade solution can be comprehensively quantified from multiple dimensions such as version matching degree, network quality, missing block ratio and device parallel processing capability, thereby improving the comprehensiveness and accuracy of the hybrid upgrade feasibility assessment.

[0098] 1. Evaluation results regarding version compatibility The evaluation result of version matching is the version matching evaluation information. The relevant embodiments have been given in the section on version matching evaluation information for local upgrade schemes, and will not be repeated here.

[0099] 2. Assessment results regarding network quality The network quality assessment results are known as network quality evaluation information. Relevant examples have been given in the section on network quality evaluation information for cloud upgrade solutions, and will not be repeated here.

[0100] 3. Assessment results regarding the proportion of missing blocks The assessment result of the missing block ratio is the missing block ratio evaluation information, which reflects the proportion of missing data blocks that need to be downloaded from the cloud for hybrid upgrades.

[0101] In one embodiment, the missing block ratio evaluation information is determined based on a first ratio, wherein the first ratio is the ratio of the number of locally available data blocks to the total number of data blocks in the target version, and the first ratio is negatively correlated with the missing block ratio evaluation information, and the data blocks are used to constitute the target version firmware.

[0102] Firmware can be divided into multiple data blocks according to preset partitioning rules. Each data block corresponds to a continuous data range in the firmware. By comparing the differences between the locally stored firmware and the target version firmware in each data block, it can be determined which data blocks are available locally and which data blocks need to be downloaded from the cloud.

[0103] The higher the first ratio, the higher the proportion of locally stored usable data blocks, the less data needs to be downloaded from the cloud, and the lower the proportion of missing blocks. Therefore, a higher evaluation information on the proportion of missing blocks can be given.

[0104] For example, the missing block ratio evaluation information can be determined by the following formula (11). : (11) in, This represents the number of locally available data blocks. This represents the total number of data blocks in the target version.

[0105] 4. Evaluation results of the equipment's parallel processing capability The evaluation result of the device's parallel processing capability is the parallel efficiency evaluation information, which reflects the processing efficiency of the target device when executing parallel tasks under the current CPU load.

[0106] In one embodiment, the parallel efficiency evaluation information is determined based on the CPU load of the target device, wherein the CPU load is negatively correlated with the parallel efficiency evaluation information. The higher the CPU load of the target device, the fewer idle CPU resources are currently available for hybrid upgrade-related computing tasks, and the lower the parallel processing efficiency, thus a lower parallel efficiency evaluation information can be given accordingly.

[0107] For example, the parallel efficiency evaluation information can be determined by the following formula (12). : (12) in, For empirical functions, The CPU load of the target device. This refers to the remaining RAM of the target device. For example, if... <50 and >512KB =100; if <80, =60; otherwise =30.

[0108] The aforementioned network quality evaluation information Version compatibility evaluation information Missing block ratio evaluation information and parallel efficiency evaluation information All of these can be used as evaluation information in the third dimension. The suitability of the hybrid upgrade scheme can be determined by weighted summation of these third-dimensional evaluation information. For example, the suitability of the hybrid upgrade scheme can be determined by the following formula (13). : (13) in, , , and respectively under the hybrid upgrade scheme , , and The corresponding weights can be pre-defined. , , and The sum can be 1.

[0109] (iv) For the full upgrade plan Based on operational data, network quality and storage space are evaluated, and multiple fourth-dimensional evaluation information is extracted. Based on evaluation information from multiple fourth dimensions, the suitability of the full upgrade plan is determined.

[0110] In this way, the suitability of the full upgrade solution can be comprehensively quantified from multiple dimensions such as network quality and storage space, thereby improving the comprehensiveness and accuracy of the feasibility assessment of the full upgrade.

[0111] 1. Assessment results regarding network quality The network quality assessment results are known as network quality evaluation information. Relevant examples have been given in the section on network quality evaluation information for cloud upgrade solutions, and will not be repeated here.

[0112] 2. Assessment results regarding storage space The assessment result of the storage space situation is the full package storage space evaluation information, which reflects whether the target device's current remaining storage space can accommodate the full upgrade package and the data during the decompression and installation process.

[0113] The full package storage space evaluation information is determined based on a second ratio, which is the ratio of the target device's remaining storage space to its total storage space. This second ratio is positively correlated with the full package storage space evaluation information. A higher second ratio indicates a larger proportion of remaining storage space to total storage space, resulting in a lower risk of failure due to insufficient storage space during the download, decompression, and installation of the full upgrade package. Therefore, a higher full package storage space evaluation information can be provided.

[0114] For example, the full package storage space evaluation information can be determined using the following formula (14). : (14) in, The remaining storage space of the target device. This refers to the total storage space of the target device.

[0115] The aforementioned network quality evaluation information And full package storage space evaluation information All of these can be used as evaluation information in the fourth dimension. The suitability of the full upgrade plan can be determined by weighted summation of these fourth-dimensional evaluation information. For example, the suitability of the full upgrade plan can be determined by the following formula (15). : (15) in, and The full upgrade plan is as follows and The corresponding weights can be pre-defined. and The sum can be 1.

[0116] The following is a detailed explanation of step S202.

[0117] In some possible implementations, step S103 can be achieved in the following way: When the highest fit is greater than the fit threshold, the candidate upgrade solution corresponding to the highest fit is determined as the target upgrade solution; When the highest compatibility is less than or equal to the compatibility threshold, a prompt message is generated, and if the preset retry conditions are met, the target upgrade plan is re-determined and the firmware upgrade is performed. This prompt message is used to inform the user that the current environment is not suitable for upgrading the firmware.

[0118] For example, the fit threshold can be pre-defined based on actual needs. If the highest fit is greater than the fit threshold, it can be determined that the current operating environment can support the effective execution of at least one candidate upgrade scheme. In this case, the candidate upgrade scheme corresponding to the highest fit is determined as the target upgrade scheme. Under the premise of ensuring upgrade feasibility, the strategy with the highest matching degree with the current operating conditions can be selected for upgrade execution. If the highest fit is less than or equal to the fit threshold, it can be determined that the target device cannot currently support the reliable execution of any candidate upgrade scheme. In this case, a prompt message is generated instead of continuing the upgrade, which can avoid upgrade failure, device abnormality or data corruption caused by poor environment, thereby reducing upgrade risk.

[0119] For example, the preset retry conditions include at least one of the following: the time elapsed since the prompt message was generated reaches a time threshold, the network quality meets preset quality conditions, and the target device's battery level rises to a battery threshold. In this way, upgrade attempts can be automatically resumed after environmental conditions improve, avoiding invalid upgrades in adverse environments, ensuring timely upgrades, and improving the completion rate of upgrade tasks.

[0120] Both the duration threshold and the power threshold can be pre-calibrated based on actual needs.

[0121] If the duration from the generation of the prompt message reaches the duration threshold, it can be determined that the target device has waited for a sufficient amount of time, and the network environment or device load may have changed. At this time, the target upgrade plan can be re-determined and the firmware upgrade can be performed in a timely manner to avoid the upgrade task being stalled for a long time due to indefinite waiting.

[0122] If the network signal strength of the target device rises to the signal strength threshold and / or the network latency drops below the latency threshold, it can be determined that the network quality meets the preset quality conditions. At this time, the target upgrade plan is redefined and the firmware upgrade is executed. This can avoid the risk of upgrade package download failure or timeout in a weak network environment and improve the upgrade success rate.

[0123] If the target device's battery level rises to the battery threshold, it can be determined that the device's current battery level is sufficient to support the power consumption required for the upgrade process. At this point, re-determining the target upgrade plan and executing the firmware upgrade can avoid the upgrade being interrupted due to insufficient battery power, thereby ensuring the safety and integrity of the upgrade process.

[0124] Figure 2 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment. Figure 2 As shown, the firmware upgrade method may also include steps S301 to S303.

[0125] In step S301, the current environmental status of the target device is obtained.

[0126] The current environmental status includes at least one of the following: network quality, remaining battery power, and remaining storage space.

[0127] In step S302, the change between the current environmental state and the decision environmental state is determined.

[0128] Among them, the decision-making environment state refers to the environmental state when determining the target upgrade plan.

[0129] In one embodiment, the difference between each parameter in the current environmental state and the corresponding parameter in the decision environmental state can be calculated separately; each difference can be normalized; and the normalized differences can be weighted and summed to obtain the change.

[0130] In step S303, when the change exceeds the environmental change threshold, the target upgrade scheme is redefined to determine a new target upgrade scheme for firmware upgrade.

[0131] In one embodiment, the environmental change threshold can be pre-calibrated based on actual needs.

[0132] If the change does not exceed the environmental change threshold, it can be determined that the current environmental state has not changed significantly compared with the time of decision-making, and the determined target upgrade plan is still effective and applicable in the current environment. At this time, continuing to perform firmware upgrade according to the determined target upgrade plan can avoid unnecessary strategy switching overhead.

[0133] If the change exceeds the environmental change threshold, it can be determined that the current environment has changed significantly, and the original target upgrade plan may no longer be suitable for the current operating conditions. In this case, re-determine the target upgrade plan and switch to the new target upgrade plan to perform the firmware upgrade. This can respond to environmental changes in a timely manner, avoid upgrade failures caused by mismatch between the target upgrade plan and the operating conditions, and improve the time-varying adaptability of the upgrade.

[0134] After determining the new target upgrade plan, it can be determined whether the new target upgrade plan is the same as the target upgrade plan that is currently being executed or to be executed. If they are the same, the current upgrade plan is kept unchanged. If they are different, the firmware upgrade is performed by switching to the new target upgrade plan.

[0135] After determining a new target upgrade plan, the compatibility of the new plan can be compared with that of the current plan. If the compatibility of the new plan is higher than that of the current plan and the difference exceeds a preset threshold, the firmware upgrade is switched to the new plan. Otherwise, the current plan remains unchanged. This avoids frequent switching when the improvement in compatibility is not significant, ensuring upgrade stability and preventing unnecessary upgrade interruptions and resource consumption caused by changes in the target upgrade plan.

[0136] Based on the technical solutions provided in steps S301 to S303, the upgrade strategy can be dynamically adjusted when the target device's environmental state changes significantly, ensuring that the upgrade plan always maintains optimal matching with the target device's current operating conditions, avoiding upgrade failure due to excessive differences in the environment between the decision-making and execution times, and further improving the robustness of firmware upgrades.

[0137] Figure 3 This is a flowchart illustrating a firmware upgrade method according to an exemplary embodiment. Figure 3 This allows for a clearer understanding of the implementation process of the firmware upgrade method provided in this disclosure. For example... Figure 3 The specific embodiments of each step shown have been described in detail in the corresponding step descriptions above, and will not be repeated here.

[0138] In one embodiment, , and The values ​​are 0.4, 0.3, and 0.3 respectively. , , and The values ​​are 0.4, 0.3, 0.2, and 0.1, respectively. , , and The values ​​are 0.5, 0.2, 0.2, and 0.1, respectively. , , and The values ​​are 0.3, 0.3, 0.2, and 0.2, respectively. and They are 0.6 and 0.4 respectively.

[0139] The current firmware version is v1.4, the target firmware version is v1.5, and the local default firmware version is also v1.4. and The values ​​are all 1.

[0140] Network status data includes: RSSI=-85dBm, Bandwidth=200Mbps, Latency=200ms, Stability=40. =7; Equipment status data includes: Battery=30%, Temperature=42℃. =8MB, =0.5MB, =60%; Historical statistics include: cloud-based historical upgrade success rate =70%, local historical upgrade success rate =90%.

[0141] ; ; =30; ; =100; = =100 ; ; =0.2; =80; ; ; ; =80 ; at this time, At its highest level, the local upgrade solution can be used as the target upgrade solution to achieve firmware upgrade.

[0142] Figure 4 This is a block diagram illustrating a firmware upgrade apparatus according to an exemplary embodiment. (Refer to...) Figure 4 The firmware upgrade device 500 includes an acquisition module 501, a first determination module 502, a second determination module 503, and an upgrade module 504.

[0143] The acquisition module 501 is used to acquire the operating data of the target device, wherein the operating data includes at least one of network status data, device status data, and historical statistical data. The first determining module 502 is used to determine the compatibility between each candidate upgrade scheme and the running data; The second determining module 503 is used to determine the target upgrade scheme based on the candidate upgrade scheme corresponding to the highest adaptability. Upgrade module 504 is used to perform firmware upgrade on the target device using the target upgrade scheme.

[0144] In the above technical solution, by collecting multi-dimensional operational data such as network status, device status, and historical statistics, the optimal target upgrade solution is dynamically selected from multiple candidate solutions, which can improve the flexibility and reliability of firmware upgrades, increase the upgrade success rate, reduce the risk of service interruption, and optimize user experience.

[0145] In some possible implementations, the candidate upgrade schemes include at least two of the following: cloud upgrade scheme, local upgrade scheme, hybrid upgrade scheme, and full upgrade scheme; The hybrid upgrade scheme enables the target device to obtain the missing upgrade data from the cloud and combine it with the locally stored firmware data to complete the firmware upgrade.

[0146] In some possible implementations, the first determining module 502 is used to determine the compatibility of each candidate upgrade scheme with the operational data in the following manner: Based on the operational data, extract multidimensional evaluation information; The adaptability of the cloud upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: network quality evaluation information, cloud availability evaluation information, cloud historical performance evaluation information, and traffic cost evaluation information, and their respective weight coefficients. Based on at least two of the version matching evaluation information, storage space evaluation information, patch quality evaluation information, and local historical performance evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the local upgrade scheme is determined. The suitability of the hybrid upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: local basic evaluation information, network quality evaluation information, missing block ratio evaluation information, and parallel efficiency evaluation information, and their respective weight coefficients. Based on the network quality evaluation information and the full package storage space evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the full upgrade scheme is determined.

[0147] In some possible implementations, the network quality evaluation information is determined based on the stability, transmission latency, and available bandwidth of the current network environment, wherein the stability is positively correlated with the network quality evaluation information, the transmission latency is negatively correlated with the network quality evaluation information, and the available bandwidth is positively correlated with the network quality evaluation information. The cloud availability evaluation information is determined based on whether there is an incremental upgrade package from the current firmware version of the target device to the target firmware version in the cloud, and a first version gap, wherein the first version gap is the version difference between the current firmware version and the target firmware version, and the first version gap is negatively correlated with the cloud availability evaluation information. The cloud-based historical performance evaluation information is determined based on a first success rate, wherein the first success rate is the success rate of firmware upgrades completed through the cloud-based upgrade scheme within a historical statistical period, and the first success rate is positively correlated with the cloud-based historical performance evaluation information. The traffic cost evaluation information is determined based on the traffic resource consumption level under the current network environment, wherein the traffic resource consumption level is negatively correlated with the traffic cost evaluation information.

[0148] In some possible implementations, the version matching evaluation information is determined based on a second version gap, wherein the second version gap is the version difference between the target firmware version and the local preset firmware version of the target device, and the second version gap is negatively correlated with the version matching evaluation information. The storage space evaluation information is determined based on the size of the remaining storage space of the target device relative to the space required for local upgrade, wherein the size of the remaining storage space of the target device relative to the space required for local upgrade is positively correlated with the storage space evaluation information; The patch quality evaluation information is determined based on the confidence level of the upgrade patch generated through local differential processing in a preset version relationship graph, wherein the confidence level is positively correlated with the patch quality evaluation information; The local historical performance evaluation information is determined based on a second success rate, wherein the second success rate is the success rate of firmware upgrades completed through the local upgrade scheme within a historical statistical period, and the second success rate is positively correlated with the local historical performance evaluation information.

[0149] In some possible implementations, the missing block ratio evaluation information is determined based on a first ratio, wherein the first ratio is the ratio of the number of locally available data blocks to the total number of data blocks in the target version, and the first ratio is negatively correlated with the missing block ratio evaluation information, wherein the data blocks are used to constitute the target version firmware. The parallel efficiency evaluation information is determined based on the CPU load of the target device, wherein the CPU load is negatively correlated with the parallel efficiency evaluation information; The full package storage space evaluation information is determined based on a second ratio, wherein the second ratio is the ratio of the remaining storage space of the target device to the total storage space of the target device, and the second ratio is positively correlated with the full package storage space evaluation information.

[0150] In some possible implementations, the second determining module 503 is configured to determine the target upgrade scheme based on the candidate upgrade scheme corresponding to the highest fit in the following manner: When the highest fit is greater than the fit threshold, the candidate upgrade scheme corresponding to the highest fit is determined as the target upgrade scheme; When the highest compatibility is less than or equal to the compatibility threshold, a prompt message is generated, and if the preset retry conditions are met, the target upgrade scheme is re-determined to perform the firmware upgrade. The prompt message is used to remind the user that the current environment is not suitable for upgrading the firmware.

[0151] In some possible implementations, the preset retry condition includes at least one of the following: The duration since the generation of the prompt message has reached the duration threshold; The network quality meets the preset quality conditions; The target device's battery level rises to a battery threshold.

[0152] In some possible implementations, the acquisition module 501 is further configured to acquire the current environmental status of the target device, the current environmental status including at least one of network quality, remaining battery power, and remaining storage space; The first determining module 502 is further configured to determine the amount of change between the current environmental state and the decision environmental state, wherein the decision environmental state is the environmental state when the target upgrade scheme is determined; when the amount of change exceeds the environmental change threshold, the adaptability of each candidate upgrade scheme to the running data is re-determined, and the target upgrade scheme is re-determined using the second determining module 503, so as to determine a new target upgrade scheme for firmware upgrade.

[0153] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0154] Figure 5 This is a block diagram illustrating a firmware upgrade device 800 according to an exemplary embodiment. For example, device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0155] Reference Figure 5The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output interface 812, a sensor component 814, and a communication component 816.

[0156] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the firmware upgrade method described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0157] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0158] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.

[0159] Multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0160] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0161] Input / output interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0162] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0163] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0164] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the firmware upgrade method described above.

[0165] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to complete the firmware upgrade method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0166] In another exemplary embodiment, this disclosure also provides a computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the firmware upgrade method described above when executed by the programmable device.

[0167] In another exemplary embodiment, this disclosure also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the firmware upgrade provided in this disclosure.

[0168] Those skilled in the art will also understand that the various illustrative logical blocks and steps listed in the embodiments of this application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functionality using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of this application.

[0169] It should be understood that, unless otherwise specifically indicated, features of various embodiments of this disclosure described herein can be combined with each other. As used herein, "at least one of..." includes any of the associated listed items and any combination of any two or more.

[0170] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In this description, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0171] Furthermore, the term “exemplarily” is used herein to indicate that it serves as an example, instance, or illustration. Any aspect or design described herein as “exemplarily” is not necessarily to be construed as advantageous compared to other aspects or designs. Rather, the use of the term “exemplarily” is intended to present concepts in a concrete manner. As used herein, the term “or” is intended to indicate an inclusive “or” rather than an exclusive “or.” That is, unless otherwise specified or clearly understood from the context, “X applies A or B” is intended to indicate any of the natural inclusive arrangements. That is, “X applies A or B” satisfies any of the foregoing instances if X applies A; X applies B; or both X applies A and B. Additionally, unless otherwise specified or clearly understood from the context to refer to the singular form, the articles “a” and “an” as used in this application and the appended claims are generally understood to mean “one or more.”

[0172] Similarly, although this disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the accompanying drawings. This disclosure includes all such modifications and variations and is limited only by the scope of the claims. In particular, with respect to the various functions performed by the components described above (e.g., elements, resources, etc.), unless otherwise indicated, the terminology used to describe such components is intended to correspond to any component (functionally equivalent) that performs the specific function of the described component, even if structurally not equivalent to the disclosed structure. Furthermore, although specific features of this disclosure may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations, as may be desired and advantageous to any given or particular application. Moreover, with regard to the terms “comprising,” “owning,” “having,” “having,” or variations thereof as used in the detailed description or claims, such terms are intended to be inclusive in a manner similar to the term “including.”

[0173] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

[0174] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A firmware upgrade method, characterized in that, include: Acquire operational data of the target device, wherein the operational data includes at least one of network status data, device status data, and historical statistical data; Determine the compatibility between each candidate upgrade scheme and the operational data; Based on the candidate upgrade schemes corresponding to the highest fit, the target upgrade scheme is determined; The target device is then upgraded using the target upgrade scheme.

2. The method according to claim 1, characterized in that, The candidate upgrade solutions include at least two of the following: cloud upgrade solution, local upgrade solution, hybrid upgrade solution, and full upgrade solution; The hybrid upgrade scheme enables the target device to obtain the missing upgrade data from the cloud and combine it with the locally stored firmware data to complete the firmware upgrade.

3. The method according to claim 2, characterized in that, Determining the compatibility between each candidate upgrade scheme and the operational data includes: Based on the operational data, extract multidimensional evaluation information; The adaptability of the cloud upgrade scheme is determined based on at least two of the following in the multidimensional evaluation information: network quality evaluation information, cloud availability evaluation information, cloud historical performance evaluation information, and traffic cost evaluation information, and their respective weight coefficients. Based on at least two of the version matching evaluation information, storage space evaluation information, patch quality evaluation information, and local historical performance evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the local upgrade scheme is determined. The suitability of the hybrid upgrade scheme is determined based on at least two of the local basic evaluation information, the network quality evaluation information, the missing block ratio evaluation information, and the parallel efficiency evaluation information in the multidimensional evaluation information, and their respective weight coefficients. Based on the network quality evaluation information and the full package storage space evaluation information in the multi-dimensional evaluation information, and their respective weight coefficients, the adaptability of the full upgrade scheme is determined.

4. The method according to claim 3, characterized in that, The network quality evaluation information is determined based on the stability, transmission latency, and available bandwidth of the current network environment. The stability is positively correlated with the network quality evaluation information, the transmission latency is negatively correlated with the network quality evaluation information, and the available bandwidth is positively correlated with the network quality evaluation information. The cloud availability evaluation information is determined based on whether there is an incremental upgrade package from the current firmware version of the target device to the target firmware version in the cloud, and a first version gap, wherein the first version gap is the version difference between the current firmware version and the target firmware version, and the first version gap is negatively correlated with the cloud availability evaluation information. The cloud-based historical performance evaluation information is determined based on a first success rate, wherein the first success rate is the success rate of firmware upgrades completed through the cloud-based upgrade scheme within a historical statistical period, and the first success rate is positively correlated with the cloud-based historical performance evaluation information. The traffic cost evaluation information is determined based on the traffic resource consumption level under the current network environment, wherein the traffic resource consumption level is negatively correlated with the traffic cost evaluation information.

5. The method according to claim 3, characterized in that, The version matching evaluation information is determined based on the second version gap, wherein the second version gap is the version difference between the target firmware version and the local preset firmware version of the target device, and the second version gap is negatively correlated with the version matching evaluation information. The storage space evaluation information is determined based on the size of the remaining storage space of the target device relative to the space required for local upgrade, wherein the size of the remaining storage space of the target device relative to the space required for local upgrade is positively correlated with the storage space evaluation information; The patch quality evaluation information is determined based on the confidence level of the upgrade patch generated through local differential processing in a preset version relationship graph, wherein the confidence level is positively correlated with the patch quality evaluation information; The local historical performance evaluation information is determined based on a second success rate, wherein the second success rate is the success rate of firmware upgrades completed through the local upgrade scheme within a historical statistical period, and the second success rate is positively correlated with the local historical performance evaluation information.

6. The method according to claim 3, characterized in that, The missing block ratio evaluation information is determined based on a first ratio, wherein the first ratio is the ratio of the number of locally available data blocks to the total number of data blocks in the target version, and the first ratio is negatively correlated with the missing block ratio evaluation information, wherein the data blocks are used to constitute the target version firmware; The parallel efficiency evaluation information is determined based on the CPU load of the target device, wherein the CPU load is negatively correlated with the parallel efficiency evaluation information; The full package storage space evaluation information is determined based on a second ratio, wherein the second ratio is the ratio of the remaining storage space of the target device to the total storage space of the target device, and the second ratio is positively correlated with the full package storage space evaluation information.

7. The method according to claim 1, characterized in that, The step of determining the target upgrade scheme based on the candidate upgrade schemes corresponding to the highest fit includes: When the highest fit is greater than the fit threshold, the candidate upgrade scheme corresponding to the highest fit is determined as the target upgrade scheme; When the highest compatibility is less than or equal to the compatibility threshold, a prompt message is generated, and if the preset retry conditions are met, the target upgrade scheme is re-determined and the firmware upgrade is performed. The prompt message is used to remind the user that the current environment is not suitable for upgrading the firmware.

8. The method according to claim 7, characterized in that, The preset retry conditions include at least one of the following: The duration since the generation of the prompt message has reached the duration threshold; The network quality meets the preset quality conditions; The target device's battery level rises to a battery threshold.

9. The method according to claim 1, characterized in that, The method further includes: Obtain the current environmental status of the target device, wherein the current environmental status includes at least one of network quality, remaining battery power, and remaining storage space; Determine the amount of change between the current environmental state and the decision environmental state, wherein the decision environmental state is the environmental state when the target upgrade plan is determined; When the change exceeds the environmental change threshold, the target upgrade scheme is redefined to determine a new target upgrade scheme for firmware upgrade.

10. A firmware upgrade device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the executable instructions in the memory to implement the steps of the firmware upgrade method according to any one of claims 1-9.