Disclosure of Invention
The invention mainly solves the technical problem of providing a method and a system for upgrading intelligent equipment software, which can reduce the software upgrading time in a recovery mode and solve the problem that a user cannot normally use the intelligent equipment for a long time in the software upgrading process of the intelligent equipment.
In order to solve the technical problems, the invention adopts a technical scheme that: a method for upgrading intelligent device software is provided, and the method comprises the following steps: acquiring a first file for upgrading the intelligent equipment; reading old version file data in the intelligent equipment based on the first file; calculating the old version file data and the first file under a user use mode of the intelligent equipment to obtain a second file; and installing the second file in a recovery mode of the intelligent equipment.
Wherein, the obtaining of the first file for upgrading the smart device includes: establishing an appointed folder; and storing the first file into the specified folder.
Wherein the second file is saved in the designated folder.
Wherein, further include: judging whether the remaining available storage space of the intelligent equipment is smaller than a threshold value; and if the second file is smaller than the threshold value, the action of installing the second file in the recovery mode of the intelligent equipment is not executed.
Wherein the reading of old version file data in the smart device based on the first file comprises: reading a script statement from a script of the first file; and obtaining a system firmware partition storage range corresponding to the script statement, and further reading the old version file data.
In order to solve the technical problem, the invention adopts another technical scheme that: a system for upgrading intelligent device software is provided, which comprises: the acquisition module acquires a first file for upgrading the intelligent equipment; the reading module is used for reading old version file data in the intelligent equipment based on the first file; the operation module is used for operating the old version file data and the first file under the user use mode of the intelligent equipment to obtain a second file; and the installation module is used for installing the second file in the recovery mode of the intelligent equipment.
Wherein the acquisition module comprises: the new building unit is used for building a specified folder; and the first storage unit is used for storing the first file into the specified folder.
Wherein, the acquisition module further comprises: and the second storage unit is used for saving the second file in the specified folder.
Wherein the system further comprises: and the judging module is used for judging whether the residual available storage space of the intelligent equipment is smaller than a threshold value, and if so, the action of installing the second file in the recovery mode of the intelligent equipment is not executed.
Wherein the reading module comprises: a first reading unit, configured to read a script statement from a script of the first file; and the second reading unit obtains the system firmware partition storage range corresponding to the script statement, and further reads the old version file data.
The invention has the beneficial effects that: by acquiring the second file for installation in the user use mode, the software upgrading time in the recovery mode is further shortened, and the problem that a user cannot normally use the intelligent equipment for a long time in the intelligent equipment software upgrading process is solved.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an upgrading method for an intelligent device according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 1 if the results are substantially the same. As shown in fig. 1, the method comprises the steps of:
s101: a first file for upgrading of the intelligent device is obtained.
Wherein, The user can use FOTA (Firmware Over-The-Air, Over-The-Air software upgrade) to provide The intelligent device with The networking function: for example, a mobile phone, a tablet computer, a portable media player, a mobile internet device, etc., downloads a first file for upgrading the smart device from the cloud server. The user can also copy the first file for upgrading the intelligent device from other servers or related intelligent devices through data transmission tools such as a data line, Bluetooth and the like.
The first file may be a differential upgrade package for version-oriented upgrade. In general, files for smart device upgrades have two forms: the system comprises a complete upgrade package and a differential upgrade package, wherein the differential upgrade package is formed by extracting a differential part to be upgraded by adopting algorithms such as differential processing and the like according to the difference between a detected new version upgrade file and a previous version upgrade file, so that the differential upgrade package is only suitable for upgrading the previous version file. For example, the differential upgrade package of version V4.4 can only be used for upgrading smart devices of the current version V4.3.
S102: and reading the old version file data in the intelligent equipment based on the first file.
The first file upgrading package comprises a range of data storage of the old version file of the intelligent device. And reading the script statement of the first file upgrading packet to obtain a system firmware partition storage range corresponding to the statement, and reading the old version file data of the intelligent equipment from the system firmware partition according to the storage range.
S103: and operating the old version file data and the first file under the user use mode of the intelligent equipment to obtain a second file.
In step S101, the first file obtained for upgrading the intelligent device may be a differential upgrade package for version-oriented upgrade, and the differential upgrade package and the old version file data are calculated to obtain a complete upgrade file, i.e., a second file. The operation method for acquiring the second file may be a bspatch algorithm or other algorithms. In the invention, in the user use mode, the user can normally use all APP software or other application programs in the intelligent equipment.
S104: and installing the second file in the recovery mode of the intelligent device.
The Recovery Mode (Recovery Mode) of the smart device refers to a Mode in which data or a system inside the smart device can be modified, and in this Mode, a user can upgrade system software of the smart device. However, in the recovery mode, the user may not use any APP software or other application.
By the method, the second file for installation is obtained in the user use mode, software upgrading time in the recovery mode can be shortened, and the problem that a user cannot normally use the intelligent equipment for a long time in the intelligent equipment software upgrading process is solved.
Fig. 2 is a flowchart illustrating a second embodiment of the method for upgrading an intelligent device according to the present invention. The present embodiment is based on the first embodiment of the intelligent device upgrading method, and further includes step S204.
S204: and judging whether the remaining available storage space of the intelligent device is smaller than a threshold value.
S205: and installing the second file in the recovery mode of the intelligent device.
And when the remaining available storage space of the intelligent device is greater than or equal to the threshold, executing step S205, and when the remaining available storage space of the intelligent device is less than the threshold, skipping step S205 to directly end the upgrading of the intelligent device. For example, when the remaining available storage space of the smart device is greater than or equal to 15%, the smart device automatically restarts and enters a recovery mode to install a second file; and when the remaining available storage space of the intelligent device is less than 15%, finishing upgrading the intelligent device.
By the method, whether the intelligent device has enough remaining available storage space for storing the second file or the data information generated in the upgrading process can be judged, and the problem caused by insufficient space when the second file is installed in the recovery mode is solved.
For a better understanding of the present invention, the following describes logic flow diagrams for user usage mode and recovery mode, respectively.
As shown in FIG. 3, FIG. 3 is a logic flow diagram of a next embodiment of the user usage pattern of the present invention. In this embodiment, the following steps are sequentially executed in the usage mode of the invention user:
s301: and starting.
S302: a designated folder is established.
If the specified folder already exists, all files in the folder are cleared.
S303: a first file for upgrading of the intelligent device is obtained.
S304: and storing the first file into the specified folder.
S305: a script statement is read from a script of a first file.
S306: and obtaining a system firmware partition storage range corresponding to the script statement, and further reading old version file data.
S307: and operating the old version file data and the first file under the user using mode to obtain a second file.
S308: and saving the second file in the specified folder. The second file can be named as a 'system firmware partition storage range', so that the file can be correctly identified in a recovery mode. Such as "1000-.
S309: and judging whether the remaining available storage space of the intelligent device is smaller than a threshold value. If the value is less than the threshold value, executing step S311, and finishing the installation; if greater than or equal to the threshold, step S310 is performed.
S310: and judging whether the script statement of the first file is processed. If the processing is completed, step S311 is executed, and if the script statement of the first file is not completed, the process returns to continue to step S305.
S311: and (6) ending.
In this embodiment, when it is determined in step S309 that the remaining available storage space of the smart device is smaller than the threshold, for example: 15%, the step S311 is executed to finish the upgrade of the smart device, and meanwhile, the user can be reminded to clear the storage space in different ways, so as to facilitate the process of continuously completing the upgrade of the smart device. For example, to remind the user in a dialog box. When it is determined in step 310 that the processing of the script statement of the first file is completed, step S311 is executed, the intelligent device is automatically restarted and enters a recovery mode, and the upgrade of the intelligent device is continuously completed, or an optional interface is provided for the user, and the user may select to restart immediately and enter the recovery mode, or temporarily not restart the intelligent device, and end the device upgrade.
FIG. 4 is a logic flow diagram of a next embodiment of the present invention in recovery mode.
S401: and starting.
S402: a script statement is read from a script of a first file.
S403: and obtaining a system firmware partition storage range corresponding to the script statement.
S404: and judging whether a second file named by the storage range of the system firmware partition exists in the designated folder. If the file exists, step S405 is executed, otherwise, step S410 is executed, and the installation is ended.
S405: and reading the corresponding second file in the appointed folder, and calculating a check value.
S406: and judging whether the check value is correct or not. If the check value is correct, step S407 is executed, otherwise step S410 is executed, and the installation is ended.
S407: the second file is installed.
S408: and storing the second file to a position corresponding to the system firmware partition.
S409: and judging whether the script statement of the first file is processed. If the processing is completed, step S410 is executed, and if the script statement of the first file is not completed, the process returns to continue to step S402.
S410: and (6) ending.
In this embodiment, if the second file for upgrading the smart device is not found in step S404, the user may select to end the installation or perform steps S303 to S307 in the user usage mode in fig. 3 to obtain the second file again to continue to complete upgrading of the smart device.
Fig. 5 is a schematic structural diagram of a first embodiment of the intelligent device upgrade system of the present invention. The system comprises: the device comprises an acquisition module 11, a reading module 12, an operation module 13 and an installation module 14. Wherein,
the obtaining module 11 obtains a first file for upgrading the intelligent device.
And the reading module 12 reads the old version file data in the intelligent device based on the first file.
And the operation module 13 is used for operating the old version file data and the first file in the user use mode of the intelligent device to obtain a second file.
And the installation module 14 is used for installing the second file in the recovery mode of the intelligent device.
As shown in fig. 6, the obtaining module 11 further includes: a new creating unit 111, configured to create a specified folder; a first storage unit 112, configured to store the first file into the specified folder; a second storage unit 113, configured to store the second file in the designated folder. The reading module 12 further includes: a first reading unit 121, configured to read a script statement from a script of the first file; the second reading unit 122 obtains the system firmware partition storage range corresponding to the script statement, and further reads the old version file data.
The intelligent equipment upgrading system can execute the executing steps of the intelligent equipment upgrading in the method. For a detailed description of the above method, please refer to the above method, which is not repeated herein.
Fig. 7 is a schematic structural diagram of a second embodiment of the intelligent device upgrading system of the present invention. The embodiment is based on the first embodiment of the intelligent device upgrading system, and further includes a judging module 24. The determining module 24 is configured to determine whether the remaining available storage space of the smart device is smaller than a threshold, and if the remaining available storage space of the smart device is smaller than the threshold, the step of installing the second file in the recovery mode of the smart device is not performed.
As shown in fig. 8, in the present embodiment, the processing apparatus includes: the receiver 110, the memory 120 and the processor 130, wherein the receiver 110 and the memory 120 are connected to the processor 130 through a bus.
The receiver 110 is used to receive data or files for the intelligent device to upgrade, such as the first file referred to in the above embodiments.
The memory 120 is used for processing instructions or data required for the operation of the storage processor 130, and may also be used for storing data or files received by the receiver 110, such as the first file, the second file, etc. referred to in the above embodiments.
The processor 130 is configured to perform an operation on the old version file data and the first file in the user mode to obtain a second file; and installing the second file in the recovery mode of the intelligent device. The acts performed by the processor 130 may further include any of the embodiments of the smart device software upgrade method described above.
In the embodiments provided in the present invention, it should be understood that the disclosed method or system can be implemented in other ways. For example, the smart device upgrade system may be a visual APP or application installed in the smart device and operable by a user, or may be an independent program running in the background.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.