Online upgrade method, upgrade file providing method, device and storage medium

By recording and repairing verification failures in the device storage area in the online upgrade method, the problem of online upgrade failure caused by device memory abnormalities is solved, the success rate is improved, costs and space waste are reduced, and the user experience is improved.

CN112804071BActive Publication Date: 2024-09-06NANJING ZHONGXING XIN SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911108765.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-13
Publication Date
2024-09-06
Estimated Expiration
2039-11-13

AI Technical Summary

Technical Problem

In the existing online upgrade method, the version matching verification step may fail due to bad blocks or abnormal tampering of the device memory, causing the online upgrade to fail and the full upgrade space to be wasted, increasing equipment costs and poor user experience.

Method used

By obtaining the target version upgrade file, performing version matching verification, recording the unit storage area that failed the verification, downloading and installing the corresponding unit area repair file to repair the device storage area, improve the success rate of online upgrades and reduce storage space overhead.

Benefits of technology

It effectively solves the problem of online upgrade failure caused by device memory abnormalities, improves the success rate of online upgrades, reduces equipment costs and waste of storage space, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112804071B
    Figure CN112804071B
Patent Text Reader

Abstract

The present application relates to an online upgrade method, an upgrade file providing method, a device and a storage medium. The embodiments of the present application include: according to the result of the version matching check during the upgrade process, when the version matching check fails, recording the unit storage area where the check fails; downloading the unit area repair file corresponding to the unit storage area where the check fails; installing the unit area repair file. It is possible to perform device repair after the device version matching check fails, thereby improving the success rate of online upgrades, while reducing the storage space overhead of the upgrade process and reducing device costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to but are not limited to the field of terminal device technology, and in particular to an online upgrade method, an upgrade file providing method, a device and a storage medium. Background Art

[0002] Online upgrades, such as OTA (Over-The-Air) upgrades, are a means of effectively and reliably upgrading user terminal devices through network downloads. Online upgrades include upgrades to drivers, systems, functions, applications, etc., and are applicable to a wide range of terminals.

[0003] At present, conventional online upgrades may sometimes fail, resulting in poor user experience. For example, if the system firmware upgrade fails, it is often necessary to go to the after-sales service point to re-flash the device.

[0004] Since the version matching verification step will check whether the upgrade file and the corresponding version match, this step verification has the following defects: on the one hand, if the device has been used for too long or the device memory (such as Flash) is not of good quality, there may be bad blocks in the device memory; on the other hand, the device may be abnormally tampered with or the device memory partition data may be rewritten due to abnormal program writing. In this case, even if the correct upgrade file is downloaded online, the version matching verification will still fail to match, resulting in failure of the online upgrade. Summary of the invention

[0005] The embodiments of the present application provide an online upgrade method, an upgrade file providing method, a device and a storage medium, which can improve the success rate of online upgrades.

[0006] In a first aspect, an embodiment of the present application provides an online upgrade method, comprising:

[0007] Get the target version upgrade file;

[0008] Using the target version upgrade file to perform version matching verification;

[0009] When the version matching check fails, recording the unit storage area where the check fails;

[0010] Download the unit area repair file corresponding to the unit storage area that failed verification;

[0011] Install the unit area repair file.

[0012] In a second aspect, an embodiment of the present application provides a method for providing an upgrade file, comprising:

[0013] Get the unit area repair file download request from the device;

[0014] According to the unit area repair file download request, the corresponding unit area repair file is sent to the device.

[0015] In a third aspect, an embodiment of the present application provides a device, including: a first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein when the first processor executes the program, the following is achieved:

[0016] The online upgrade method as described in the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a server, comprising: a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, wherein when the second processor executes the program, the following is achieved:

[0018] The upgrade file providing method as described in the second aspect.

[0019] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to:

[0020] Execute the online upgrade method described in the first aspect;

[0021] or,

[0022] Execute the upgrade file providing method described in the second aspect.

[0023] The embodiment of the present application includes: according to the result of the version matching check during the upgrade process, when the version checking fails, recording the unit storage area where the checking fails; downloading the unit area repair file corresponding to the unit storage area where the checking fails; installing the unit area repair file. It is possible to perform device repair after the device version matching check fails, thereby improving the success rate of online upgrades, and at the same time reducing the storage space overhead of the upgrade process and reducing device costs.

[0024] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0026] Figure 1 is a flow chart of a known online upgrade method;

[0027] Figure 2 This is a schematic diagram of the connection structure between a device and a server in an online upgrade method provided in an embodiment of the present application;

[0028] Figure 3 This is a flow chart of an online upgrade method provided by an embodiment of the present application;

[0029] Figure 4 This is a schematic diagram of the connection structure between a device and a server in an online upgrade method provided in another embodiment of the present application;

[0030] Figure 5 is a flowchart of an online upgrade method provided in another embodiment of the present application;

[0031] Figure 6 is a flowchart of an online upgrade method provided in another embodiment of the present application;

[0032] Figure 7 is a flowchart of an online upgrade method provided in another embodiment of the present application;

[0033] Figure 8 is a flowchart of an online upgrade method provided in another embodiment of the present application;

[0034] Fig. 9 A flowchart of a method for providing an online upgrade file provided in another embodiment of the present application;

[0035] Fig.10 A flowchart of a method for providing an online upgrade file is provided in another embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.

[0037] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0038] Online upgrades, such as OTA (Over-The-Air) upgrades, are a means of effectively and reliably upgrading user terminal devices through network downloads. Online upgrades include upgrades to drivers, systems, functions, applications, etc., and are applicable to a wide range of terminals. Currently, conventional online upgrades sometimes fail, resulting in poor user experience. For example, if a system firmware upgrade fails, it is often necessary to go to an after-sales service point to re-flash the device.

[0039] For example, the current FOTA (Firmware Over-The-Air) upgrade, the core steps to achieve it refer to Figure 1 As shown, the download program first searches and downloads the corresponding differential upgrade package. After the download is complete, the installation begins, and the upgrade package integrity check (such as MD5 check) and version matching check (upgrade package and version check) are performed in sequence. After the check passes, it is generally necessary to install two systems, the normal system (normal system) and the recovery system (backup system). Install the recovery system under normal, and then install the normal system in the recovery system. The steps for other firmware online upgrades are similar to this. For example, the CPE (Customer Premises Equipment) firmware online upgrade uses U-Boot to boot the upgrade, which is essentially the same as the recovery system.

[0040] The version matching verification step will check whether the upgrade package and the corresponding version match. This step verification has the following defects:

[0041] On the one hand, the device may have been used for too long or the device memory (such as Flash) may not be of good quality, which may lead to bad blocks in the device memory. On the other hand, the device may be abnormally tampered with or the partition data may be rewritten due to abnormal program writing. In this case, even if OTA downloads the correct upgrade package, the version matching check will still fail to match, resulting in the termination of OTA installation.

[0042] In addition, if a full upgrade (that is, a full version upgrade) is used for verification failures, it will also be limited by the upgrade package space reserved on the device, and only a very small number of devices can meet the requirements. Even if the device can reserve enough space, it is not conducive to reducing device costs; for a single device, OTA upgrades are not often used, and reserving space for full upgrade packages will also cause a waste of storage resources.

[0043] Based on this, the embodiments of the present application provide an online upgrade method, an upgrade file providing method, a device and a storage medium, which can improve the success rate of online upgrades and save device storage space, thereby reducing device costs.

[0044] It should be noted that in the following various embodiments, the online upgrade method can be a method of online upgrade via OTA or TR069 (TR069 is a communication protocol for communication between CPE and ACS (Auto-Configuration Server)) or other download methods. Online upgrades include upgrades of drivers, systems, functions, applications, etc. The following only takes the online upgrade of system firmware via OTA as an example.

[0045] In the first aspect, the embodiment of the present application provides an online upgrade method, which is applied to the device side. The device can be a mobile terminal device or a non-mobile terminal device. The mobile terminal device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal device, a wearable device, a super mobile personal computer, a netbook, a personal digital assistant, a CPE, a UFI (wireless hotspot device), etc.; the non-mobile terminal device can be a personal computer, a television, a teller machine or a self-service machine, etc.; the embodiment of the present invention is not specifically limited.

[0046] In some embodiments, reference Figure 2 , the device is connected to the server for communication. The server may be an OTA server.

[0047] In some embodiments, reference Figure 3 , the online upgrade method includes the steps of:

[0048] S1000, obtain the target version upgrade file;

[0049] S2000, using the target version upgrade file to perform version matching verification;

[0050] S3000, recording the unit storage area that failed the verification according to the result of the version matching verification;

[0051] S4000, downloading a unit area repair file corresponding to the unit storage area that failed verification;

[0052] S5000, install unit area repair files.

[0053] In some embodiments, step S1000 includes:

[0054] S1100, download and obtain the target version upgrade file from the server;

[0055] In some embodiments, the device downloader can be used to search for the differential upgrade package of the source version and then start downloading the target version upgrade file. The target version upgrade file is a differential upgrade file. The differential upgrade file is also called a differential package, which means that the upgrade file adopts differential processing and only upgrades the difference part, thereby reducing the traffic caused by the upgrade.

[0056] Exemplary description of step S1100:

[0057] S1110, the downloader in the device starts searching, using HTTP (Hyper Text Transfer Protocol) or HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) protocol, carrying the device IMEI (International Mobile Equipment Identity), version information, model and other information, and obtains information from the OTA server whether there is a new version according to the pre-set service address.

[0058] In some examples, when the device is shipped, the partition started in boot (device boot program) sets the partition of the normal system. After each power-on, boot loads the partition of the normal system, and then completes the loading of the normal system. This system is the working system in the user scenario, and the recovery system partition is not loaded at this time.

[0059] Normal system polling checks whether there is an upgrade request. This section includes sub-steps:

[0060] S1111, an application-side program runs in the system, such as an update app. The update app first establishes a network connection with the OTA server and creates a polling thread therein.

[0061] S1112, generate an HTTP protocol packet in the polling thread, and agree with the OTA server on an upgrade flag, such as UpdateNowFlag, and send an HTTP protocol packet (HTTP request) to the OTA server to inquire whether there is a target upgrade file. The OTA server responds, if there is a target upgrade file, the upgrade flag UpdateNowFlag is set to 1, if there is no target upgrade file, the upgrade flag UpdateNowFlag is set to 0.

[0062] S1113, polling time interval, in order to save bandwidth and traffic, a longer polling time interval can be set, such as once every 5 minutes. Each time the device connects to the network, it sends a request, and then sends corresponding requests according to the corresponding polling time interval; after the network connection is disconnected, the polling thread is closed.

[0063] S1120, if the HTTP or HTTPS request return information is empty, it means that there is no target version upgrade file (upgrade package) information; if the HTTP or HTTPS request return information carries the target version number, target version upgrade file name, upgrade file size, device model information, etc., it means that there is a target version upgrade file that needs to be upgraded.

[0064] S1130, downloading the target version upgrade file from the server.

[0065] In some embodiments, reference Figure 4 , the device can be connected to the server through the relay device. For example, the device is connected to the relay device through short-distance communication, such as NFC and Zigbee, and the relay device is connected to the OTA server through the Internet. After the update app in the module normal system receives the upgrade instruction, it starts the short-distance transmission chip of the device through the pre-defined device node interface and starts sending heartbeat broadcast data packets to the relay device, such as data packetization according to protocol types such as NFC and Zigbee. The heartbeat data is a data packet with a fixed time interval, for example, it can be set to one data packet per minute. In this way, the power consumption is very small and the device runs in a low-power working mode.

[0066] To download the target version upgrade file from the server, a request, such as an HTTP request, is first sent to the server, wherein the HTTP request header consists of several lines of character strings.

[0067] The following is an example of the HTTP request header format:

[0068] Suppose you want to download the webpage http: / / www.****.com.cn / index.html, the HTTP request header is written as follows:

[0069] The first line includes the method, the content of the request, and the version of the HTTP protocol. For example, the GET method can generally be used for downloading; the content of the request is " / index.html"; the version of the HTTP protocol refers to the version supported by the browser, which is generally meaningless for downloading software, and version 1.1 "HTTP / 1.1" can be used. Therefore, in this example, the first line can be written as: "GET / index.htmlHTTP / 1.1".

[0070] The second line includes the host name. The host name format is "Host:Host". In this example, the second line can be written as: "Host:www.****.com.cn".

[0071] Line 3 includes the type of data accepted. Download software generally needs to accept all data types, so in this example, line 3 can be written as: "Accept: * / *".

[0072] Line 4 specifies the type of browser. Some servers may add or subtract some content depending on the type of client server. In this example, line 4 can be written as: "User-Agent: Mozilla / 4.0 (compatible; MSIE 5.00; Windows 98)".

[0073] Line 5 includes the connection settings. It can be set to always keep the connection, so in this example line 5 can be written as: "Connection:Keep-Alive".

[0074] Line 6 (if necessary) includes the location where the data is received for breakpoint resumable transmission. To implement breakpoint resumable transmission, you need to specify the location from which to receive data. The format is as follows:

[0075] "Range:bytes=starting position-ending position"

[0076] For example, to read the first 500 bytes, you can write: "Range: bytes = 0-499"; to start downloading from the 1000th byte, you can write:

[0077] "Range:bytes=999-"

[0078] Finally, add a blank line to indicate the end of the HTTP request header.

[0079] For example, the entire HTTP request header can be written as:

[0080] GET / index.html HTTP / 1.1

[0081] Host:www.****.com.cn

[0082] Accept:* / *

[0083] User-Agent:Mozilla / 4.0(compatible; MSIE 5.00; Windows 98)

[0084] Connection:Keep-Alive

[0085] S1140, after the target version upgrade file is downloaded, the downloader can determine whether the target version upgrade file has been downloaded by means of file size and the like.

[0086] Step S2000: Perform version matching verification using the target version upgrade file.

[0087] In some embodiments, step S2000 includes sub-steps:

[0088] S2100, performing file integrity check on the target version upgrade file;

[0089] S2200: When the file integrity check passes, a version matching check is performed using the target version upgrade file.

[0090] In some embodiments, step S2000 further includes sub-steps:

[0091] S2300, when the file integrity check fails, the device restarts and prompts that the installation failed. This upgrade process ends.

[0092] In step S2100, after the target version upgrade file is downloaded, the target version upgrade file is checked for file integrity. For example, an MD5 check may be performed on the target version upgrade file.

[0093] Reference Figure 5 In some embodiments, step S2100 includes sub-steps:

[0094] S2110, obtain a preset MD5 value M1. For example, the MD5 value M1 may be preset in the last 32 bytes of the target version upgrade file before sending. Wherein, M1 is the MD5 value of n bytes from the P1 position (such as the 0 position) to the P2 position (such as the 33rd byte from the end) of the target version upgrade file before sending. After the target version upgrade file is downloaded, the last 32 bytes of the target version upgrade file may be read to obtain the preset MD5 value M1.

[0095] S2120, obtain the MD5 value M2 of the downloaded target version upgrade file. Starting from the P1 position (such as the 0 position) of the downloaded target version upgrade file, read n bytes until the P2 position (such as the 33rd byte from the end), fill the n bytes into the MD5 algorithm interface, and calculate the MD5 value M2 according to the MD5 algorithm. Among them, M2 is the MD5 value of the corresponding n bytes (such as the remaining data except the last 32 bytes) in the downloaded target version upgrade file.

[0096] S2130, compare M1 and M2, if they are equal, it means that the downloaded target version upgrade file is complete. The file integrity check passes, the target upgrade file and the device version are checked for version matching, and then enter step S3000.

[0097] Step S3000: Record the unit storage area that failed the verification according to the result of the version matching verification.

[0098] In some embodiments, step S3000 includes sub-steps:

[0099] S3100, when the version matching verification succeeds, the target version upgrade file is installed;

[0100] S3200, when the version matching check fails, the number of unit storage areas that failed the check is recorded; when the number of unit storage areas that failed the check is less than a preset threshold, the unit storage areas that failed the check are recorded.

[0101] In some embodiments, step S3100 includes sub-steps:

[0102] S3110, the OTA installer installs the recovery system (backup system) related partitions. If the installation is successful, proceed to step S3120; otherwise, the device restarts and prompts that the installation failed.

[0103] S3120, after the recovery system is installed, set the flag to enter the recovery system.

[0104] S3130, the device restarts to enter the recovery system to install other partition data. If the installation is successful, go to step S3140; if the installation fails, the device restarts and prompts that the installation failed.

[0105] S3140, install the normal system. After the normal system is installed successfully, clear the recovery system flag, reboot into the normal system, and it will prompt that the installation is successful. The device can be used normally.

[0106] In some embodiments, step S3200 includes sub-steps:

[0107] S3210: When the version matching check fails, data check is performed on each unit storage area one by one, and the number of unit storage areas that fail the check is recorded.

[0108] S3220: When the number of unit storage areas that have failed verification is less than a preset threshold, the unit storage areas that have failed verification are recorded.

[0109] In some embodiments, reference Figure 6 , the steps of verifying the data of each unit storage area include:

[0110] S3211, reading binary data of the unit storage area of ​​the device that needs to be upgraded.

[0111] S3212, parsing the binary data of the target version upgrade file corresponding to the unit storage area.

[0112] S3213, the binary data of the above two steps are compared for difference, and whether the data matches is determined based on the comparison result.

[0113] S3214, record the number of unit storage areas that failed verification.

[0114] In some embodiments, in step S3213, the unit storage area can be a logic block or a storage partition, etc. The following only takes the logic block as an example for exemplary description. The target version upgrade file carries a unique identification code for each small segment (corresponding to each logic block to be upgraded) (the unique identification code used to identify the logic block can use a CRC check code related to the source version number, or other types of identification codes). During verification, the segmented unique identification code is also formed by reading the content of the device source file. Compare whether the two sets of unique identification codes are equal to determine whether the data on the device is correct: if the two sets of unique identification codes are equal, the data matching verification of the logic block is successful, and the logic block Sn is recorded, indicating that the nth logic block verification is successful; otherwise, the version matching verification fails, and the logic block Fn is recorded, indicating that the nth logic block verification fails. Record the number of logic blocks that failed verification.

[0115] In some embodiments, in step S3220, when the number of unit storage areas that have failed verification is less than a preset threshold, the unit storage areas that have failed verification are recorded. If most of the logical blocks fail to verify (such as all logical blocks fail to verify), then there may be an error in the target version upgrade file, the device restarts, and the installation fails. If a small number of blocks fail to verify, it means that the device memory may be abnormal, and the server is notified to automatically create and download the block repair file (i.e., the unit area repair file). Therefore, a threshold can be preset, and when the number of logical blocks that have failed verification is less than the preset threshold, the logical blocks that have failed verification are recorded, and step S4000 is entered to notify the server to automatically create and download the block repair file for the corresponding logical block.

[0116] Step S4000: downloading a unit area repair file corresponding to the unit storage area that failed verification.

[0117] Step S5000, installing the unit area repair file.

[0118] Reference Figure 7 In some embodiments, steps S4000 and S5000 may be executed cyclically to sequentially repair multiple logic blocks Fn that have failed data verification.

[0119] The repair process steps include:

[0120] S4100, read the record of logic block F1 (the first logic block that fails verification);

[0121] S4200: Send a local socket instruction to notify the device downloader to download the block repair file corresponding to the logic block F1 (the first logic block that failed verification). The device downloader downloads the corresponding block repair file according to the notification instruction.

[0122] S5100, after the block repair file is downloaded, it is forced to install.

[0123] S5200: After the installation is successful, repeat steps S4100 to S5200.

[0124] S5300: The repair process ends when the installation of n logic blocks is completed.

[0125] In some embodiments, the unit area repair file is a source version repair file corresponding to the unit storage area that failed the verification, such as a source version block repair file corresponding to the logic block Fn. The block repair file can be used to repair the data of the unit storage area. When the OTA upgrade process data is verified, it is verified step by step according to the logic block, and the failure is for the failure of the logic block verification, refer to the above steps S3211 to S3214. This failure is to find that the logic block verification data (unique identification code) in the device does not match the logic block verification data of the source version. In this case, the device downloader can upload a block repair file download request with a unique identification code of the logic block, and after uploading it to the OTA server, it is matched so that the OTA server can identify the logic block with problems. Since the size of the logic block generally occupies a small space, for example, for a 128K logic block, if there is a problem with the logic block, the maximum size of a block repair file is 128K, which greatly reduces the space occupation problem caused by the full package (full upgrade file) repair. Based on project experience, the number of problematic logical blocks is generally small, that is, the storage and message space occupied by the block repair files that need to be downloaded will not be too large; if the number of problematic logical blocks is large, batch repair can also be used to reduce the pressure of large block repair files on the device.

[0126] In some embodiments, step S5100 includes sub-steps:

[0127] S5110, perform a file integrity check on the unit area repair file. For example, an MD5 check method similar to the above steps S2110 to S2130 may be used to perform integrity check. The specific process is described in steps S2110 to S2130, which will not be described here. If the integrity check fails, restart the device and prompt that the installation failed.

[0128] S5120, when the file integrity check passes, the unit area repair file is forcibly installed. For example, the upgrade program can forcibly write the corresponding block repair file to the corresponding logical block of the Flash to implement the forced installation of the block repair file. If the forced installation of the corresponding logical block fails, the device is restarted and the installation failure is prompted.

[0129] Reference Figure 8 In some embodiments, the online upgrade method further comprises the steps of:

[0130] S6000 uses the target version upgrade file again to perform version matching verification to complete the installation of the target version upgrade file.

[0131] In some embodiments, after the repair process step, the problem of version matching verification failure can be effectively avoided. At this time, the normal upgrade step can be performed again to complete the installation of the target version upgrade file.

[0132] For example, step S6000 may include sub-steps:

[0133] S6100, obtain the target version upgrade file;

[0134] S6200, performs file integrity check on the target version upgrade file;

[0135] S6300, use the target version upgrade file to perform version matching verification;

[0136] S6400, when the version matching verification succeeds, the target version upgrade file is installed. In some embodiments, the step of installing the target version upgrade file can refer to the above steps S3110 to S3140, which will not be repeated here.

[0137] The online upgrade method of the first aspect can be used to repair the device after the device version matching verification fails, solving the problem that the device memory cannot be upgraded after an abnormality occurs, thereby improving the success rate of online upgrades and reducing the maintenance costs of after-sales personnel. At the same time, it can reduce the storage space overhead of the upgrade process and reduce the cost of equipment.

[0138] In a second aspect, an embodiment of the present application provides an upgrade file providing method, which is applied to a server side. The server is in communication connection with a device.

[0139] In some embodiments, reference Fig. 9 , a method for providing an upgrade file, comprising the steps of:

[0140] S8000, obtain a unit area repair file download request from the device;

[0141] S9000: Send the corresponding unit area repair file to the device according to the unit area repair file download request.

[0142] In some embodiments, the server is an OTA server, and the unit area repair file is a block repair file. The target upgrade file can be deployed to the OTA server, and the block repair files corresponding to each logical block of the source version are also deployed to the OTA server.

[0143] In some embodiments, the OTA server step responds to the above step S4200 and executes step S8000 and step S9000. First, the OTA server and the device establish a network connection and receive the block repair file download request of the device. Then parse the content of the block repair file download request, obtain the block repair file required by the device, and send the block repair file to the device. The OTA server can obtain the unique identification code of the corresponding logical block according to the block repair file download request, match it according to the unique identification code of the logical block, identify the logical block with the problem, and then automatically generate the block repair file required by the device on the OTA server. After the generation is completed, push the block repair file to the device.

[0144] Since the size of the logical block generally does not occupy much space, for example, for a 128K logical block, if there is a problem with the logical block, the maximum size of a block repair file is 128K, which greatly reduces the space occupation problem caused by the full package (full upgrade file) repair. From project experience, the number of logical blocks with problems is generally small, that is, the storage and message space occupied by the block repair files that need to be pushed will not be too large; if the number of logical blocks with problems is large, batch repair can also be used to reduce the pressure of large block repair files on the device.

[0145] Reference Fig.10 In some embodiments, the step S8000 further includes the following steps:

[0146] S7000, according to the target version upgrade file download request, sends the target upgrade file to the device.

[0147] In some embodiments, the OTA server executes step S7000 in response to the above step S1110 of the device, and S7000 includes sub-steps:

[0148] S7100, receiving a new version information search request from the device. For example, the new version information search request can be an HTTP or HTTPS request. The OTA server sends information to the device whether there is a new version (target version file); if there is no new version information, the return information is empty, for example, the upgrade flag UpdateNowFlag can be set to 0; if there is a target version upgrade file that needs to be upgraded, the HTTP or HTTPS request return information carries the target version number, target version upgrade file name, upgrade file size, device model information, etc., and the upgrade flag UpdateNowFlag is set to 1.

[0149] S7200 sends the target upgrade file to the device according to the target version upgrade file download request.

[0150] The second upgrade file providing method can be used to repair the device after the device version matching verification fails, solving the problem of being unable to upgrade after the device memory is abnormal, thereby improving the success rate of online upgrades and reducing the maintenance cost of after-sales personnel. At the same time, it can reduce the storage space overhead of the upgrade process and reduce the cost of equipment.

[0151] In the third aspect, the embodiment of the present application provides a device. The device may be a mobile terminal device or a non-mobile terminal device. The mobile terminal device may be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal device, a wearable device, a super mobile personal computer, a netbook, a personal digital assistant, a CPE, a UFI (wireless hotspot device), etc.; the non-mobile terminal device may be a personal computer, a television, a teller machine or a self-service machine, etc.; the embodiment of the present invention is not specifically limited.

[0152] The device comprises: a first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein when the first processor executes the program, the following is achieved:

[0153] The online upgrade method as described in the first aspect above.

[0154] In a fourth aspect, an embodiment of the present application provides a server.

[0155] The server includes: a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, wherein when the second processor executes the program, the following is achieved:

[0156] The upgrade file providing method as described in the second aspect above.

[0157] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to:

[0158] Execute the online upgrade method described in the first aspect;

[0159] or,

[0160] Execute the upgrade file providing method described in the second aspect.

[0161] In a sixth aspect, an embodiment of the present application provides an online upgrade method, which is applied to an online upgrade system. The online upgrade system includes a server and a device.

[0162] An online upgrade method includes the online upgrade method described in the first aspect and the corresponding upgrade file providing method described in the second aspect.

[0163] It should be noted that the online upgrade method applied to the online upgrade system in the embodiment mentioned in the sixth aspect, the online upgrade method applied to the device in the embodiment mentioned in the first aspect, and the upgrade file providing method applied to the server in the embodiment mentioned in the second aspect are all based on the same inventive concept, and the difference between the three is that the focus is different. For example, the focus of the online upgrade method applied to the device in the embodiment mentioned above is the device, and the focus of the upgrade file providing method applied to the server in the embodiment mentioned above is the server, and the focus of the online upgrade method applied to the online upgrade system in the embodiment mentioned above is the online upgrade system including the device and the server. Therefore, the above three have the same beneficial effect, that is, it can realize the device repair after the device version matching check fails, solve the problem that the device memory cannot be upgraded after an abnormality occurs, thereby improving the success rate of online upgrades and reducing the maintenance cost of after-sales personnel. At the same time, the storage space overhead of the upgrade process can be reduced, and the equipment cost can be reduced. In addition, since the above three have corresponding method principles, and the difference is only that the focus is different, the method principle of the online upgrade method applied to the online upgrade system in this embodiment is not described in detail here.

[0164] In a seventh aspect, an embodiment of the present application provides a system, which includes the device as described in the third aspect and the server as described in the fourth aspect, wherein the device and the server are communicatively connected.

[0165] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0167] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present application. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. An online upgrade method, comprising: Get the target version upgrade file; Using the target version upgrade file to perform version matching verification; When the version matching check fails, the number of unit storage areas that failed the check is recorded, wherein the unit storage area is a logic block; When the number of the unit storage areas that failed the verification is less than a preset threshold, the unit storage areas that failed the verification are recorded, the unit area repair files corresponding to the unit storage areas that failed the verification are downloaded, and the unit area repair files are installed; When the number of unit storage areas that failed the verification is greater than or equal to a preset threshold, prompting that the installation failed and restarting the device; The step of performing version matching verification using the target version upgrade file includes: Performing a file integrity check on the target version upgrade file; When the file integrity check passes, the target version upgrade file is used to perform a version matching check.

2. The method according to claim 1, characterized in that The unit area repair file is a source version repair file corresponding to the unit storage area that failed verification.

3. The method according to claim 1, characterized in that The obtaining of the target version upgrade file includes: downloading and obtaining the target version upgrade file from a server; the target version upgrade file is a differential upgrade file.

4. The method according to claim 1, characterized in that The installing of the unit area repair file includes: performing a file integrity check on the unit area repair file; when the file integrity check passes, installing the unit area repair file.

5. The method according to any one of claims 1 to 4, characterized in that: After installing the unit area repair file, the method further includes: The target version upgrade file is used to perform version matching verification to complete the installation of the target version upgrade file.

6. A method for providing an upgrade file, comprising: Obtaining a unit area repair file download request from a device, wherein the device sends the unit area repair file download request when a version matching check using a target version upgrade file fails and the number of unit storage areas that failed the check is less than a preset threshold, and the device prompts an installation failure and restarts the device when the number of unit storage areas that failed the check is greater than or equal to the preset threshold, the unit storage area is a logical block, and the version matching using the target version upgrade file includes performing a file integrity check on the target version upgrade file, and when the file integrity check passes, the version matching check is performed using the target version upgrade file; According to the unit area repair file download request, the corresponding unit area repair file is sent to the device.

7. The method according to claim 6, characterized in that The step of sending the corresponding unit area repair file to the device according to the unit area repair file download request includes: According to the unit area repair file download request, selecting a unit area repair file corresponding to the unit storage area to be repaired from various pre-deployed unit area repair files; A unit area repair file corresponding to the unit storage area to be repaired is sent to the device.

8. The method according to claim 6 or 7, characterized in that: Also includes: Send the target upgrade file to the device according to the target version upgrade file download request.

9. A device comprising: A first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein when the first processor executes the program, the following is achieved: The online upgrade method according to any one of claims 1 to 5.

10. A server, comprising: A second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, wherein when the second processor executes the program, the following is achieved: The upgrade file providing method according to any one of claims 6 to 8.

11. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to: Execute the online upgrade method according to any one of claims 1 to 5; or, Execute the upgrade file providing method described in any one of claims 6 to 8.