[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113849201A - File upgrading method and device of wearable device and wearable device - Google Patents

File upgrading method and device of wearable device and wearable device Download PDF

Info

Publication number
CN113849201A
CN113849201A CN202010594682.9A CN202010594682A CN113849201A CN 113849201 A CN113849201 A CN 113849201A CN 202010594682 A CN202010594682 A CN 202010594682A CN 113849201 A CN113849201 A CN 113849201A
Authority
CN
China
Prior art keywords
file
compressed
decompressed
upgrading
wearable device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010594682.9A
Other languages
Chinese (zh)
Inventor
张心
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Huami Information Technology Co Ltd
Original Assignee
Anhui Huami Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Huami Information Technology Co Ltd filed Critical Anhui Huami Information Technology Co Ltd
Priority to CN202010594682.9A priority Critical patent/CN113849201A/en
Publication of CN113849201A publication Critical patent/CN113849201A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file upgrading method and device of wearable equipment and the wearable equipment, wherein the method comprises the following steps: acquiring a compressed file from external equipment, wherein the compressed file is obtained by compressing a file to be upgraded by the external equipment by adopting a compression algorithm; and upgrading the compressed file to obtain a target file, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed.

Description

File upgrading method and device of wearable device and wearable device
Technical Field
The application relates to the technical field of wearable equipment, in particular to a file upgrading method and device of wearable equipment and the wearable equipment.
Background
In present wearable equipment, function upgrading is often carried out to wearable equipment through BLE (Bluetooth Low Energy, Bluetooth Low Energy consumption), for example firmware version or UI resource update, but along with the equipment function is more and more, the file that needs the upgrading is also bigger and bigger, and the time that leads to the upgrading needs is just longer, and upgrading efficiency reduces, influences user's use experience.
In the related art, the upgrade method of the wearable device based on BLE generally directly upgrades the original file, but once the original file is too large, for example, when the file is larger than 256KB, the upgrade speed is slow, which affects the user experience, and improvement is urgently needed.
Disclosure of Invention
The application provides a file upgrading method and device for wearable equipment and the wearable equipment, and the file upgrading method and device are used for directly upgrading a compressed file of a file to be upgraded, so that the file upgrading efficiency of the wearable equipment can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed
An embodiment of a first aspect of the present application provides a file upgrade method for a wearable device, including: acquiring a compressed file from external equipment, wherein the compressed file is obtained by compressing a file to be upgraded by the external equipment by adopting a compression algorithm; and upgrading the compressed file to obtain a target file.
In the embodiment, a compressed file is obtained from an external device, and the compressed file is obtained by compressing a file to be upgraded by the external device by using a compression algorithm; the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed.
An embodiment of a second aspect of the present application provides a file upgrading apparatus for a wearable device, including: the acquisition module is used for acquiring a compressed file from external equipment, wherein the compressed file is obtained by compressing a file to be upgraded by the external equipment by adopting a compression algorithm; and the upgrading module is used for upgrading the compressed file to obtain a target file.
In the embodiment, a compressed file is obtained from an external device, and the compressed file is obtained by compressing a file to be upgraded by the external device by using a compression algorithm; the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed.
An embodiment of a third aspect of the present application provides a wearable device, including: the embodiment of the second aspect of the application provides a file upgrading device of a wearable device.
In the embodiment, a compressed file is obtained from an external device, and the compressed file is obtained by compressing a file to be upgraded by the external device by using a compression algorithm; the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed.
A non-transitory computer-readable storage medium is provided in an embodiment of a fourth aspect of the present application, and has a computer program stored thereon, where the computer program is implemented, when executed by a processor, to implement a file upgrade method for a wearable device provided in an embodiment of the first aspect of the present application.
In a non-transitory computer-readable storage medium provided in an embodiment of a fourth aspect of the present application, a compressed file is obtained by obtaining a compressed file from an external device, where the compressed file is obtained by compressing a file to be upgraded by the external device using a compression algorithm; the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and reliability of file upgrading are effectively guaranteed.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a file upgrade method of a wearable device according to an embodiment of the present application;
fig. 2 is a flowchart of a file upgrade method of a wearable device according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of a file upgrading apparatus of a wearable device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a file upgrading apparatus of a wearable device according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a wearable device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The following describes a file upgrade method and an upgrade apparatus of a wearable device according to an embodiment of the present application with reference to the drawings.
Aiming at the problems of low upgrading speed, low upgrading efficiency, poor upgrading practicability, influence on the use experience of a user and the like caused by directly upgrading an original file in the background art, the application provides a file upgrading method of wearable equipment, wherein compressed files are obtained by compressing files to be upgraded by external equipment by adopting a compression algorithm; the method has the advantages that the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and the reliability of file upgrading are effectively guaranteed.
Fig. 1 is a flowchart of a file upgrade method of a wearable device according to an embodiment of the present application.
The present embodiment is exemplified in that the file upgrade method of the wearable device is configured as a file upgrade apparatus of the wearable device.
The file upgrading method for the wearable device in this embodiment may be configured in a file upgrading apparatus of the wearable device, the file upgrading apparatus of the wearable device is disposed in the wearable device, and the wearable device is, for example, a smart band, a smart helmet, and the like, which is not limited thereto.
The present embodiment takes the configuration of the file upgrade method of the wearable device in the electronic device as an example.
It should be noted that, the execution subject in the embodiment of the present application may be, for example, a processor of the wearable device in hardware, and may be, for example, an associated background service of the wearable device in software, which is not limited to this.
As shown in fig. 1, the file upgrade method of the wearable device includes:
s101: and obtaining a compressed file from the external equipment, wherein the compressed file is obtained by compressing the file to be upgraded by the external equipment by adopting a compression algorithm.
The external device may be, for example, a server or an external electronic device, and the external device is used to upgrade functions of the wearable device, such as firmware version or UI resource update.
The embodiment of the application obtains the compressed file from the external device, and the compressed file is obtained by compressing the file to be upgraded by the external device through the compression algorithm, so that compared with the prior art that the original file in the wearable device is directly upgraded, the embodiment of the application obtains the compressed file from the external device, such as the compressed file, by compressing the file to be upgraded by the external device through the open-source compression algorithm, so that the compressed file can be upgraded to obtain the target file, and the file in the wearable device can be upgraded quickly.
Optionally, the compression algorithm is any one of: the other compression algorithms may be, but not limited to, a QuickLZ compression algorithm, a FastLZ compression algorithm, an LZF compression algorithm, or a zlib compression algorithm, or may be any other compression algorithms with any open sources.
That is to say, the compressed file is obtained by compressing the file to be upgraded in advance by the external device using any one of the compression algorithms, and when the external device compresses the compressed file, a communication link with the wearable device may be established, so that the compressed file is sent to the wearable device based on the communication link, and thus, the wearable device may obtain the compressed file from the external device.
S102: and upgrading the compressed file to obtain a target file.
The wearable device may directly upgrade the compressed file after acquiring the compressed file from the external device, to obtain the target file, for example, the target file may be obtained by calling a pre-configured script file, and executing the script file to upgrade the compressed file.
In this embodiment, referring to fig. 2, the step of obtaining a target file by encoding a file to be upgraded by an external device using an encoding algorithm, where the compressed file carries a first check code, and the first check code is obtained by upgrading the compressed file, includes:
s201: and upgrading the compressed file to obtain a target compressed file.
The first check code is used for assisting in verifying the legitimacy of the subsequent decompressed file, and therefore the safety and the practicability of upgrading can be effectively guaranteed.
Optionally, the encoding algorithm is a CRC32 algorithm, or may be any other possible encoding algorithm, which is not limited in this respect.
The wearable device can directly upgrade the compressed file after acquiring the compressed file from the external device to obtain a target compressed file, and the file obtained by upgrading the compressed file can be called as the target compressed file.
S202: and decompressing the target compressed file to obtain a decompressed file.
After the update, the target compressed file may be decompressed to obtain a decompressed file, that is, the wearable device may directly update the compressed file to obtain the target compressed file, and then decompress the target compressed file, at this time, the target compressed file may be decompressed by using a decompression algorithm corresponding to the compression algorithm described above to obtain the decompressed file.
After the target compressed file is decompressed to obtain the decompressed file, the file data corresponding to the decompressed file is written into the target address, so that the file data corresponding to the decompressed file is stored in a standardized manner, the sequential reading of the subsequent file data is assisted to generate a corresponding second check code, and the application reliability of the file upgrading method is guaranteed.
S203: and generating a second check code according to the decompressed file.
The file data corresponding to the decompressed file is written into the target address, and the file data can be read from the target address; the file data is encoded according to an encoding algorithm, thereby generating a second parity.
That is, the file data is read from the target address after the target compressed file is decompressed and the decompressed file is obtained; and coding the file data according to a coding algorithm so as to generate a second check code, wherein the second check code is used for matching with the first check code so as to verify the legality of the decompressed file, thereby ensuring the upgrading safety.
The encoding algorithm for obtaining the second check code is the same as the encoding algorithm for obtaining the first check code.
S204: and carrying out validity verification on the decompressed file according to the first check code and the second check code.
In some embodiments, the validity verification of the decompressed file is performed according to the combination of the first check code and the second check code, which may be to judge whether the matching state of the first check code and the second check code conforms to a preset matching state; if the verification result accords with the set matching state, the verification of the legality of the decompressed file is determined to be passed, the method is simple and convenient to implement, and excessive computing resources cannot be consumed.
For example, if the matching states of the first check code and the second check code are consistent within the error range, it is determined that the matching states of the first check code and the second check code are in accordance with the set matching state, otherwise, it is determined that the matching states of the first check code and the second check code are not in accordance with the set matching state.
Of course, any other possible manner may be selected to perform validity verification on the decompressed file according to the first check code and the second check code, which is not limited herein.
S205: and if the validity verification is passed, taking the decompressed file as a target file.
The target file is the upgraded file corresponding to the file to be upgraded.
In the embodiment, the compressed file is obtained by obtaining the compressed file from the external equipment, wherein the compressed file is obtained by compressing the file to be upgraded by the external equipment by adopting a compression algorithm; the method has the advantages that the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and the reliability of file upgrading are effectively guaranteed.
The application further provides an example that the external device compresses the file to be upgraded by using a compression algorithm to obtain a compressed file, and the specific description is as follows:
in some embodiments, the file to be upgraded includes n data segments, and the compressed file includes n compressed data segments, where the data amount of n-1 data segments is equal to the preset value, the data amount of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1.
The external device compresses a file to be upgraded by using a compression algorithm to obtain a compressed file, which may be obtained by sequentially dividing the file to be upgraded into n data segments, so that each data segment of the file to be upgraded may be compressed by using a segment-by-segment compression method, where the compressed file includes n compressed data segments, the data amount of n-1 data segments is equal to a preset value, the data amount of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1.
The preset value may be, for example, 4 KB.
It should be noted that the minimum erase unit of the storage NOR/NAND flash memory used by the embedded device is 4KB, so the compressed file is generally much larger than 4KB, otherwise no compression is necessary.
For example, the preset algorithm may be an open source compression and decompression algorithm, and the compression method according to the embodiment of the present application includes:
step S1: it is determined whether the remaining data amount of the current uncompressed file is greater than 4KB, wherein if not less than 4KB, step S2 is performed, otherwise step S4 is performed.
Step S2: the first 4KB data segment of the file is compressed using a compression algorithm (e.g., QuickLZ, FastLZ, LZF, zlib, etc.) and the compressed data is written to the compressed file.
Step S3: the data amount of the current uncompressed file is subtracted by 4KB, and step S1 is re-executed.
Step S4: the remaining less than 4KB of data of the current file is compressed using a compression algorithm and the compressed file is written.
It will be appreciated that the compression is complete and that the compression rates for the different compression algorithms are different (e.g., about QuickLZ 47%, about FastLZ 50%, about LZF 50%, about zlib 37%).
It should be noted that, for the compressed file, an identifier for performing validity verification may be added in the embodiment of the present application, for example, the CRC32 is calculated for the file to be upgraded, and the CRC32 is recorded in the identifier for performing validity verification, so as to generate the first verification code.
In some other embodiments, when the file to be upgraded includes n data segments, and the compressed file includes n compressed data segments, where the data amount of n-1 data segments is equal to the preset value, the data amount of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1, the step of decompressing the target compressed file to obtain the decompressed file in the embodiment shown in fig. 2 may be further specifically detailed as:
optionally, the target compressed file includes a plurality of compressed data segments, where the compressed data segments correspond to the data segments one to one, and the decompressing the target compressed file to obtain a decompressed file includes: and decompressing each compressed data segment by segment to obtain a decompressed file.
Optionally, the target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one to one, the compressed data segments have corresponding sequence numbers, and the target compressed file is decompressed to obtain a decompressed file, including: decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment; and combining the plurality of decompressed data according to the sequence number of the compressed data segment to obtain the decompressed file.
Therefore, a flexible decompression method is provided, the applicability of the upgrading method is effectively improved, the upgrading requirements under various different application scenes can be effectively adapted, and the use experience of a user is improved.
The step of decompressing each compressed data segment by segment to obtain a decompressed file may be as follows:
step S1: judging the identification of the file which is not decompressed currently, if the identification fails, executing the step S8, otherwise executing the step S2.
Step S2: and judging whether the data volume of the data header of the file which is not decompressed currently is 4KB or not.
Step S3: and if the decompressed data size is 4KB, decompressing the compressed data segment specified by the current data header by using a decompression algorithm corresponding to the compression algorithm, and then writing the decompressed 4KB data into the target address.
Step S4: if the decompressed data amount is less than 4KB, step S6 is performed, otherwise step S5 is performed.
Step S5: the data amount of the compressed data segment is subtracted from the data amount of the file that is not currently decompressed, and the next header is found, and step S2 is performed.
Step S6: decompressing the residual data volume, and writing the decompressed data into the target address.
Optionally, in an embodiment of the present application, the method of the embodiment of the present application further includes: verifying the legality of the decompressed file according to the combination of the first check code and the second check code; and if the validity verification is passed, taking the decompressed file as a target file.
For example, the CRC32 calculation is performed on the decompressed file of the target address to obtain the second check code, and the second check code is compared with the first check code in the identification mark, if the second check code matches with the first check code, the decompression is considered to be successful, otherwise, the decompression is considered to be failed.
Specifically, since most resource contents have a high repetition rate and a high compression rate on average, the original file size is 234KB, the compressed size is 45KB, and the compression rate is about 20% in the QuickLZ example. On the same MI8SE mobile phone, the downloading time can be increased to 4 seconds from the original 26 seconds, the compression file of 45KB needs 10 seconds to be decompressed into the original file of 234KB, the total time consumption is 14 seconds, and the total time of upgrading is saved by 12 seconds, so that the upgrading efficiency is effectively increased, and the upgrading experience of a user for wearable equipment is improved.
Fig. 3 is a schematic structural diagram of a file upgrading apparatus of a wearable device according to an embodiment of the present application.
As shown in fig. 3, the file upgrading apparatus 300 of the wearable device includes:
the obtaining module 301 is configured to obtain a compressed file from an external device, where the compressed file is obtained by compressing a file to be upgraded by the external device using a compression algorithm.
And the upgrading module 302 is configured to upgrade the compressed file to obtain a target file.
In some embodiments of the present application, the compressed file carries a first check code, where the first check code is obtained by encoding, by an external device, a file to be upgraded by using an encoding algorithm, referring to fig. 4, the upgrading module 302 includes:
the upgrading submodule 3021 is configured to upgrade the compressed file to obtain a target compressed file;
a decompression submodule 3022 configured to decompress the target compressed file to obtain a decompressed file;
the generating submodule 3023 is configured to generate a second check code according to the decompressed file;
the verification sub-module 3024 is configured to perform validity verification on the decompressed file according to the first check code and the second check code, and if the validity verification passes, take the decompressed file as a target file.
In some embodiments of the present application, the verification sub-module 3024 is specifically configured to:
judging whether the matching state of the first check code and the second check code accords with a preset matching state or not;
and if the verification accords with the set matching state, determining that the validity verification of the decompressed file is passed.
In some embodiments of the present application, the upgrade module 302 further includes:
the write-in submodule 3025 is configured to write file data corresponding to the decompressed file into the target address;
generating submodule 3023, specifically for:
reading file data from the target address;
the file data is encoded according to an encoding algorithm, thereby generating a second parity.
In some embodiments of the present application, a file to be upgraded includes n data segments, and a compressed file includes n compressed data segments, where a data amount of n-1 data segments is equal to a preset value, a data amount of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1.
In some embodiments of the present application, the target compressed file includes a plurality of compressed data segments, where the compressed data segments correspond to the data segments one to one, and the decompression sub-module 3022 is specifically configured to:
and decompressing each compressed data segment by segment to obtain a decompressed file.
In some embodiments of the present application, the target compressed file includes a plurality of compressed data segments, where the compressed data segments correspond to the data segments one to one, and the decompression sub-module 3022 is specifically configured to:
decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment;
and combining the plurality of decompressed data according to the sequence number of the compressed data segment to obtain the decompressed file.
In some embodiments of the present application, the compression algorithm is any one of: a QuickLZ compression algorithm, a FastLZ compression algorithm, an LZF compression algorithm, or a zlib compression algorithm.
In some embodiments of the present application, the encoding algorithm is the CRC32 algorithm.
It should be noted that the foregoing explanation on the embodiment of the file upgrading method for the wearable device is also applicable to the file upgrading apparatus for the wearable device in this embodiment, and details are not repeated here.
In the embodiment, the compressed file is obtained by obtaining the compressed file from the external equipment, wherein the compressed file is obtained by compressing the file to be upgraded by the external equipment by adopting a compression algorithm; the method has the advantages that the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and the reliability of file upgrading are effectively guaranteed.
In order to implement the above embodiments, the present application further provides a wearable device, and referring to fig. 5, fig. 5 is a schematic structural diagram of the wearable device according to an embodiment of the present application.
The wearable device 50 includes:
the file upgrade apparatus 300 of the wearable device in the above embodiment.
It should be noted that the foregoing explanation on the embodiment of the file upgrade method of the wearable device is also applicable to the wearable device 50 of this embodiment, and is not repeated herein.
In the embodiment, the compressed file is obtained by obtaining the compressed file from the external equipment, wherein the compressed file is obtained by compressing the file to be upgraded by the external equipment by adopting a compression algorithm; the method has the advantages that the compressed file is upgraded to obtain the target file, and the compressed file to be upgraded is directly upgraded, so that the file upgrading efficiency of the wearable device can be effectively improved, and the practicability and the reliability of file upgrading are effectively guaranteed.
In order to implement the above embodiments, the present application also proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the file upgrade method of the wearable device of the above embodiments.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or N embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "N" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more N executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of implementing the embodiments of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or N wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (20)

1. A file upgrading method of a wearable device is characterized by comprising the following steps:
acquiring a compressed file from external equipment, wherein the compressed file is obtained by compressing a file to be upgraded by the external equipment by adopting a compression algorithm;
and upgrading the compressed file to obtain a target file.
2. The file upgrading method of the wearable device according to claim 1, wherein the compressed file carries a first check code, the first check code is obtained by encoding the file to be upgraded by the external device using an encoding algorithm, and the upgrading of the compressed file to obtain the target file comprises:
upgrading the compressed file to obtain a target compressed file;
decompressing the target compressed file to obtain a decompressed file;
generating a second check code according to the decompressed file;
according to the first check code and the second check code, validity verification is conducted on the decompressed file;
and if the validity verification is passed, taking the decompressed file as the target file.
3. The method for upgrading files of wearable equipment according to claim 2, wherein the verifying the validity of the decompressed files according to the first check code and the second check code comprises:
judging whether the matching state of the first check code and the second check code accords with a preset matching state or not;
and if the set matching state is met, determining that the validity of the decompressed file is verified to be passed.
4. The file upgrading method for the wearable device according to claim 2, wherein the decompressing the target compressed file to obtain a decompressed file further comprises:
writing file data corresponding to the decompressed file into a target address;
the generating of the second check code according to the decompressed file comprises:
reading the file data from the target address;
and encoding the file data according to the encoding algorithm, thereby generating the second check code.
5. The file upgrading method of the wearable device according to claim 4, wherein the file to be upgraded comprises n data segments, the compressed file comprises n compressed data segments, wherein the data volume of n-1 data segments is equal to a preset value, the data volume of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1.
6. The file upgrading method for the wearable device according to claim 5, wherein the target compressed file comprises a plurality of compressed data segments, the compressed data segments correspond to the data segments one to one, and the decompressing the target compressed file to obtain a decompressed file comprises:
decompressing each compressed data segment by segment to obtain the decompressed file.
7. The file upgrading method for the wearable device according to claim 5, wherein the target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one to one, the compressed data segments have corresponding sequence numbers, and the decompressing the target compressed file to obtain a decompressed file includes:
decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment;
and combining the plurality of decompressed data according to the sequence number of the compressed data segment, thereby obtaining the decompressed file.
8. The file upgrade method for the wearable device according to any one of claims 1 to 7, wherein the compression algorithm is any one of: a QuickLZ compression algorithm, a FastLZ compression algorithm, an LZF compression algorithm, or a zlib compression algorithm.
9. The file upgrade method for the wearable device according to any one of claims 2 to 8, wherein the encoding algorithm is a CRC32 algorithm.
10. A file upgrading device of wearable equipment is characterized by comprising:
the acquisition module is used for acquiring a compressed file from external equipment, wherein the compressed file is obtained by compressing a file to be upgraded by the external equipment by adopting a compression algorithm;
and the upgrading module is used for upgrading the compressed file to obtain a target file.
11. The file upgrading device of the wearable device according to claim 10, wherein the compressed file carries a first check code, the first check code is obtained by encoding the file to be upgraded by the external device using an encoding algorithm, and the upgrading module includes:
the upgrading submodule is used for upgrading the compressed file to obtain a target compressed file;
the decompression submodule is used for decompressing the target compressed file to obtain a decompressed file;
the generating submodule is used for generating a second check code according to the decompressed file;
and the verification sub-module is used for performing validity verification on the decompressed file according to the first check code and the second check code, and if the validity verification is passed, the decompressed file is used as the target file.
12. The file upgrade apparatus of a wearable device according to claim 11, wherein the verification sub-module is specifically configured to:
judging whether the matching state of the first check code and the second check code accords with a preset matching state or not;
and if the set matching state is met, determining that the validity of the decompressed file is verified to be passed.
13. The file upgrade apparatus of a wearable device according to claim 11, wherein the upgrade module further comprises:
the writing submodule is used for writing the file data corresponding to the decompressed file into the target address;
the generation submodule is specifically configured to:
reading the file data from the target address;
and encoding the file data according to the encoding algorithm, thereby generating the second check code.
14. The file upgrading device of the wearable device according to claim 13, wherein the file to be upgraded includes n data segments, the compressed file includes n compressed data segments, a data amount of n-1 data segments is equal to a preset value, a data amount of the remaining one data segment is less than or equal to the preset value, and n is a positive integer greater than 1.
15. The file upgrading apparatus for a wearable device according to claim 14, wherein the target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one to one, and the decompression sub-module is specifically configured to:
decompressing each compressed data segment by segment to obtain the decompressed file.
16. The file upgrading apparatus for a wearable device according to claim 14, wherein the target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one to one, and the decompression sub-module is specifically configured to:
decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment;
and combining the plurality of decompressed data according to the sequence number of the compressed data segment, thereby obtaining the decompressed file.
17. The file upgrading device of the wearable device according to any one of claims 10 to 16, wherein the compression algorithm is any one of the following: a QuickLZ compression algorithm, a FastLZ compression algorithm, an LZF compression algorithm, or a zlib compression algorithm.
18. The file upgrading device of the wearable device of any one of claims 11-17, characterized in that the encoding algorithm is a CRC32 algorithm.
19. A wearable device, comprising:
a file upgrade apparatus for a wearable device as claimed in any one of claims 10 to 18.
20. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements a file upgrade method for a wearable device according to any of claims 1-9.
CN202010594682.9A 2020-06-28 2020-06-28 File upgrading method and device of wearable device and wearable device Pending CN113849201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010594682.9A CN113849201A (en) 2020-06-28 2020-06-28 File upgrading method and device of wearable device and wearable device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010594682.9A CN113849201A (en) 2020-06-28 2020-06-28 File upgrading method and device of wearable device and wearable device

Publications (1)

Publication Number Publication Date
CN113849201A true CN113849201A (en) 2021-12-28

Family

ID=78972333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010594682.9A Pending CN113849201A (en) 2020-06-28 2020-06-28 File upgrading method and device of wearable device and wearable device

Country Status (1)

Country Link
CN (1) CN113849201A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043634A (en) * 2009-10-23 2011-05-04 康佳集团股份有限公司 Embedded system and embedded software upgrading method
CN102841907A (en) * 2011-06-24 2012-12-26 环达电脑(上海)有限公司 Methods for processing data compression and decompression
CN103051723A (en) * 2012-12-27 2013-04-17 广州市动景计算机科技有限公司 Increment updating method as well as server and terminal
US20130167133A1 (en) * 2010-10-11 2013-06-27 Zte Corporation Method, terminal and system for upgrading software version
CN104699494A (en) * 2013-12-10 2015-06-10 北京四达时代软件技术股份有限公司 Method and system for updating firmware data
CN106406935A (en) * 2016-08-29 2017-02-15 青岛海信电器股份有限公司 OTA upgrading method for Bluetooth chip and Bluetooth chip
CN107391145A (en) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 AKU preparation method and device, the method and device of upgrade file
CN109254817A (en) * 2018-08-28 2019-01-22 广东小天才科技有限公司 Dial plate replacing method and system of wearable device and wearable device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043634A (en) * 2009-10-23 2011-05-04 康佳集团股份有限公司 Embedded system and embedded software upgrading method
US20130167133A1 (en) * 2010-10-11 2013-06-27 Zte Corporation Method, terminal and system for upgrading software version
CN102841907A (en) * 2011-06-24 2012-12-26 环达电脑(上海)有限公司 Methods for processing data compression and decompression
CN103051723A (en) * 2012-12-27 2013-04-17 广州市动景计算机科技有限公司 Increment updating method as well as server and terminal
CN104699494A (en) * 2013-12-10 2015-06-10 北京四达时代软件技术股份有限公司 Method and system for updating firmware data
CN106406935A (en) * 2016-08-29 2017-02-15 青岛海信电器股份有限公司 OTA upgrading method for Bluetooth chip and Bluetooth chip
CN107391145A (en) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 AKU preparation method and device, the method and device of upgrade file
CN109254817A (en) * 2018-08-28 2019-01-22 广东小天才科技有限公司 Dial plate replacing method and system of wearable device and wearable device

Similar Documents

Publication Publication Date Title
CN112947983B (en) Application program updating method and device, electronic equipment and storage medium
CN105740088B (en) Flash memory data error correction method and device
CN108241498B (en) Vehicle-mounted equipment upgrading method and device and vehicle
KR100847560B1 (en) Circuits and methods for correcting errors in downloading firmware
CN109471642A (en) Firmware generates storage method and device, firmware start method and device
KR20080019454A (en) Firmware generating method and deltafile and firmware updating method for cell phone
CN105095003A (en) Method and apparatus for restoring system software of intelligent terminal
CN114741231B (en) Data reading and writing method, device, equipment and storage medium based on memory
CN105045671A (en) Method and device for upgrading systems of intelligent terminals
CN106293621B (en) A kind of firmware upgrade method and device
CN111176685A (en) Upgrading method and device
CN112235422B (en) Data processing method and device, computer readable storage medium and electronic device
CN113849201A (en) File upgrading method and device of wearable device and wearable device
CN115421745A (en) Equipment remote upgrading method, device, terminal and storage medium
CN110874284A (en) Data processing method and device
CN111143240B (en) Image storage method, system and terminal equipment
CN114402286A (en) File processing method, file processing device and terminal equipment
CN112445769A (en) Block chain-based on-chain storage method and device, terminal equipment and medium
CN111752797A (en) Terminal log processing method and device, terminal and storage medium
CN111046389A (en) Method for securely updating firmware components and portable computer station for implementation
CN110069272A (en) The method and electronic equipment of logical file upgrading
CN109408098A (en) Dynamic updating method, system, electronic equipment and the storage medium of application
CN112600848B (en) Software upgrading package encapsulation method and device and software upgrading package decapsulation method and device
CN103984541A (en) Method and system for generating application procedure based on terminal source codes
CN109407974B (en) Electronic device, picture deleting method based on mixed binary code and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination