File upgrade method and device for wearable device and wearable device

By compressing and upgrading the files of wearable devices, the problem of extended file upgrade time in the existing technology is solved, more efficient file upgrades are achieved, and user experience is improved.

CN113849201BActive Publication Date: 2025-04-11ANHUI HUAMI HEALTH TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010594682.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-28
Publication Date
2025-04-11
Estimated Expiration
2040-06-28

AI Technical Summary

Technical Problem

When existing wearable devices upgrade files, as the file size increases, the upgrade time will be longer, resulting in a decrease in upgrade efficiency and affecting the user experience.

Method used

By obtaining compressed files from external devices, using compression algorithms to compress the upgraded files, directly upgrading the compressed files to obtain the target file.

Benefits of technology

It effectively improves the file upgrade efficiency of wearable devices, ensures the practicality and reliability of file upgrades, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113849201B_ABST
    Figure CN113849201B_ABST
Patent Text Reader

Abstract

The present application discloses a file upgrade method, device and wearable device for a wearable device, wherein the method comprises: obtaining a compressed file from an external device, wherein the compressed file is obtained by compressing a file to be upgraded by the external device using a compression algorithm; performing upgrade processing on the compressed file to obtain a target file, which can effectively improve the file upgrade efficiency of the wearable device and effectively ensure the practicability and reliability of the file upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of wearable devices, and in particular to a file upgrade method and device for a wearable device and a wearable device. Background Art

[0002] In current wearable devices, BLE (Bluetooth Low Energy) is often used to upgrade the functions of wearable devices, such as firmware version or UI resource updates. However, as the functions of devices increase, the files that need to be upgraded are also increasing, resulting in longer upgrade times and lower upgrade efficiency, which affects the user experience.

[0003] In the related art, the upgrade method of BLE-based wearable devices generally directly upgrades the original file. However, once the original file is too large, such as when the file is larger than 256KB, the upgrade speed is slow, affecting the user experience, which needs to be improved urgently. Summary of the invention

[0004] The present application provides a file upgrade method, device and wearable device for a wearable device. Since the compressed file of the file to be upgraded is directly upgraded, the file upgrade efficiency of the wearable device can be effectively improved, and the practicality and reliability of the file upgrade can be effectively guaranteed.

[0005] The first aspect of the present application provides a file upgrade method for a wearable device, comprising: obtaining a compressed file from an external device, wherein the compressed file is obtained by compressing the upgrade file by the external device using a compression algorithm; and performing upgrade processing on the compressed file to obtain a target file.

[0006] In this embodiment, a compressed file is obtained from an external device, where the compressed file is obtained by compressing the file to be upgraded by the external device using a compression algorithm; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0007] The second aspect of the present application provides a file upgrade device for a wearable device, including: an acquisition module, used to obtain a compressed file from an external device, wherein the compressed file is obtained by the external device using a compression algorithm to compress the upgrade file; an upgrade module, used to upgrade the compressed file to obtain a target file.

[0008] In this embodiment, a compressed file is obtained from an external device, where the compressed file is obtained by compressing the file to be upgraded by the external device using a compression algorithm; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0009] The third aspect of the present application provides a wearable device, including: the second aspect of the present application provides a file upgrade device for a wearable device.

[0010] In this embodiment, a compressed file is obtained from an external device, where the compressed file is obtained by compressing the file to be upgraded by the external device using a compression algorithm; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0011] The non-temporary computer-readable storage medium proposed in the fourth aspect embodiment of the present application has a computer program stored thereon, and is characterized in that when the program is executed by a processor, a file upgrade method for a wearable device provided in the first aspect embodiment of the present application is implemented.

[0012] The non-temporary computer-readable storage medium proposed in the fourth aspect embodiment of the present application obtains a compressed file from an external device, where the compressed file is obtained by compressing the file to be upgraded by the external device using a compression algorithm; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0013] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0015] Figure 1 A flowchart of a file upgrade method for a wearable device according to an embodiment of the present application;

[0016] Figure 2 is a flowchart of a file upgrade method for a wearable device according to another embodiment of the present application;

[0017] Figure 3 Schematic diagram of the structure of a file upgrade device for a wearable device according to an embodiment of the present application;

[0018] Figure 4 is a structural schematic diagram of a file upgrading device for a wearable device according to another embodiment of the present application;

[0019] Figure 5 The figure is a schematic diagram of the structure of a wearable device according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0021] The following describes a file upgrade method and an upgrade apparatus for a wearable device according to an embodiment of the present application with reference to the accompanying drawings.

[0022] In response to the problems mentioned in the above background technology, such as slow upgrade speed, low upgrade efficiency, poor upgrade practicality, and impact on user experience due to direct upgrading of original files, the present application provides a file upgrade method for a wearable device, which obtains a compressed file from an external device, where the compressed file is obtained by the external device using a compression algorithm to compress the upgrade file; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicality and reliability of the file upgrade can be effectively guaranteed.

[0023] Figure 1 The present invention is a flowchart of a file upgrade method for a wearable device according to an embodiment of the present application.

[0024] This embodiment is illustrated by taking the file upgrade method of a wearable device as a file upgrade apparatus for a wearable device.

[0025] In this embodiment, the file upgrade method of the wearable device can be configured in a file upgrade device of the wearable device. The file upgrade device of the wearable device is set in the wearable device, such as a smart bracelet, a smart helmet, etc., without limitation.

[0026] This embodiment takes the file upgrade method of a wearable device being configured in an electronic device as an example.

[0027] It should be noted that the execution subject of the embodiment of the present application may be, for example, a processor of a wearable device in hardware, or may be, for example, a related background service of the wearable device in software, without limitation.

[0028] like Figure 1 As shown, the file upgrade method of the wearable device includes:

[0029] S101: Obtain a compressed file from an external device, where the compressed file is obtained by compressing the upgrade file using a compression algorithm by the external device.

[0030] The above-mentioned external device may be, for example, a server or an external electronic device, which is used to perform functional upgrades on the wearable device, such as firmware version or UI resource updates.

[0031] The embodiment of the present application obtains a compressed file from an external device. The compressed file is obtained by the external device using a compression algorithm to compress the upgrade file. Therefore, compared with the related technology that directly upgrades the original file in the wearable device, the embodiment of the present application obtains a compressed file from an external device, such as a compressed file, which is obtained by the external device using an open source compression algorithm to compress the upgrade file, thereby achieving upgrade processing of the compressed file to obtain the target file, thereby realizing rapid upgrade of the files in the wearable device.

[0032] Optionally, the compression algorithm is any one of the following: QuickLZ compression algorithm, FastLZ compression algorithm, LZF compression algorithm or zlib compression algorithm, or may be any other open source compression algorithm, without limitation.

[0033] That is to say, the above-mentioned compressed file is obtained by pre-compressing the upgrade file by the external device using any of the above-mentioned compression algorithms. When the external device compresses the compressed file, a communication link can be established with the wearable device, thereby sending the compressed file to the wearable device based on the communication link. Thus, the wearable device can obtain the compressed file from the external device.

[0034] S102: Upgrade the compressed file to obtain a target file.

[0035] After obtaining the compressed file from the external device, the wearable device can directly upgrade the compressed file to obtain the target file. For example, a pre-configured script file can be called to execute the script file to upgrade the compressed file to obtain the target file.

[0036] In the present application embodiment, see Figure 2The compressed file carries a first verification code, which is obtained by encoding the upgrade file using an encoding algorithm by an external device. The compressed file is upgraded to obtain a target file, including:

[0037] S201: Upgrade the compressed file to obtain a target compressed file.

[0038] The first verification code mentioned above is used to assist in the legitimacy verification of the subsequent decompressed files, thereby effectively ensuring the security and practicality of the upgrade.

[0039] Optionally, the encoding algorithm is a CRC32 algorithm, or may be any other possible encoding algorithm, which is not limited.

[0040] After obtaining the compressed file from the external device, the wearable device can directly upgrade the compressed file to obtain a target compressed file. The file obtained by upgrading the compressed file can be called a target compressed file.

[0041] S202: Decompress the target compressed file to obtain a decompressed file.

[0042] After the upgrade, the target compressed file can be decompressed to obtain a decompressed file. That is to say, the wearable device directly upgrades the compressed file to obtain the target compressed file, and then decompresses the target compressed file. At this time, the decompression algorithm corresponding to the above-mentioned compression algorithm can be used to decompress the target compressed file to obtain a decompressed file.

[0043] After decompressing the target compressed file and obtaining the decompressed file, the file data corresponding to the decompressed file is also written into the target address, thereby realizing standardized storage of the file data corresponding to the decompressed file, assisting the sequential reading of subsequent file data to generate a corresponding second verification code, and ensuring the reliability of the application of the file upgrade method.

[0044] S203: Generate a second verification code according to the decompressed file.

[0045] In the above, the file data corresponding to the decompressed file is written into the target address, and the file data can also be read from the target address; the file data is encoded according to the encoding algorithm, so as to generate a second check code.

[0046] That is to say, after decompressing the target compressed file and obtaining the decompressed file, the present application also reads the file data from the target address; encodes the file data according to the encoding algorithm to generate a second verification code, and the second verification code is used to match the above-mentioned first verification code, so as to verify the legitimacy of the decompressed file, thereby ensuring the security of the upgrade.

[0047] It should be noted that the encoding algorithm for obtaining the second check code is the same as the encoding algorithm for obtaining the first check code.

[0048] S204: Verify the legitimacy of the decompressed file according to the first verification code and the second verification code.

[0049] In some embodiments, the legitimacy of the decompressed file is verified based on the first verification code combined with the second verification code, and it can be determined whether the matching status of the first verification code and the second verification code meets the preset matching status; if it meets the set matching status, it is determined that the legitimacy verification of the decompressed file has passed, which is simple to implement and does not consume too many computing resources.

[0050] For example, if the matching states of the first verification code and the second verification code are consistent within the error range, it is determined that the matching states of the first verification code and the second verification code meet the set matching state; otherwise, it is determined that the matching states of the first verification code and the second verification code do not meet the set matching state.

[0051] Of course, any other possible method may be selected to verify the legitimacy of the decompressed file based on the first verification code in combination with the second verification code, and there is no limitation to this.

[0052] S205: If the legality verification passes, the decompressed file is used as the target file.

[0053] The target file is the upgraded file corresponding to the file to be upgraded.

[0054] In this embodiment, a compressed file is obtained from an external device, where the compressed file is compressed by the external device using a compression algorithm to compress the file to be upgraded; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0055] This application also provides an example of an external device using a compression algorithm to compress an upgrade file to obtain a compressed file, which is specifically described as follows:

[0056] In some embodiments, the file to be upgraded includes n data segments, and the compressed file includes n compressed data segments, wherein the data volume of n-1 data segments is equal to a preset value, and the data volume of the remaining data segment is less than or equal to the preset value, and n is a positive integer greater than 1.

[0057] Among them, the compressed file obtained by the external device compressing the file to be upgraded using a compression algorithm can be that the file to be upgraded is divided into n data segments in sequence, thereby, a segment-by-segment compression method can be adopted to compress each data segment of the file to be upgraded, and the compressed file includes n compressed data segments, among which the data volume of n-1 data segments is equal to a preset value, and the data volume of the remaining data segment is less than or equal to the preset value, and n is a positive integer greater than 1.

[0058] The preset value may be, for example, 4 KB.

[0059] It should be noted that the minimum erase unit of NOR / NAND flash memory used by embedded devices is 4KB, so the compressed file is generally much larger than 4KB, otherwise there is no need to compress it.

[0060] For example, the preset algorithm may be an open source compression and decompression algorithm. The compression method of the embodiment of the present application includes:

[0061] Step S1: Determine whether the remaining data size of the current uncompressed file is greater than 4KB, wherein, if it is not less than 4KB, execute step S2, otherwise execute step S4.

[0062] Step S2: Use a compression algorithm (such as QuickLZ, FastLZ, LZF, zlib, etc.) to compress the initial 4KB data segment of the file, and write the compressed data into the compressed file.

[0063] Step S3: Subtract 4KB from the data size of the current uncompressed file, and re-execute step S1.

[0064] Step S4: Use a compression algorithm to compress the remaining data of the current file that is less than 4KB, and write it into a compressed file.

[0065] It is understandable that after compression, different compression algorithms have different compression rates (e.g. QuickLZ about 47%, FastLZ about 50%, LZF about 50%, zlib about 37%).

[0066] It should be noted that, for the compressed file, the embodiment of the present application can add an identifier for legitimacy verification, such as calculating CRC32 for the upgrade file, and recording CRC32 in the identifier for legitimacy verification to generate a first verification code.

[0067] In some other embodiments, when the file to be upgraded includes n data segments, the compressed file includes n compressed data segments, wherein the data volume of n-1 data segments is equal to the preset value, and the data volume of the remaining data segment is less than or equal to the preset value, and n is a positive integer greater than 1, the above Figure 2The step of decompressing the target compressed file to obtain the decompressed file in the embodiment can also be specifically refined as follows:

[0068] Optionally, the target compressed file includes multiple compressed data segments, and the compressed data segments correspond to the data segments one by one. Decompressing the target compressed file to obtain the decompressed file includes: decompressing each compressed data segment segment by segment to obtain the decompressed file.

[0069] Optionally, the target compressed file includes multiple compressed data segments, the compressed data segments correspond to the data segments one-to-one, the compressed data segments have corresponding serial numbers, and decompressing the target compressed file to obtain a decompressed file includes: decompressing the compressed data segments to obtain decompressed data corresponding to the compressed data segments; and combining multiple decompressed data according to the serial numbers of the compressed data segments to obtain a decompressed file.

[0070] Therefore, a flexible decompression method is provided, which effectively improves the applicability of the upgrade method, can effectively adapt to the upgrade requirements in a variety of different application scenarios, and improves the user experience.

[0071] The steps of decompressing each compressed data segment piece by piece to obtain the decompressed file can be exemplified as follows:

[0072] Step S1: Determine the identification mark of the currently undecompressed file. If the identification fails, execute step S8; otherwise, execute step S2.

[0073] Step S2: Determine the data header of the currently uncompressed file and whether the decompressed data volume is 4KB.

[0074] Step S3: If the amount of data after decompression is 4KB, use the decompression algorithm corresponding to the compression algorithm to decompress the compressed data segment specified by the current data header, and then write the decompressed 4KB data to the target address.

[0075] Step S4: If the amount of decompressed data is less than 4KB, execute step S6; otherwise, execute step S5.

[0076] Step S5: Subtract the data size of the compressed data segment from the data size of the current undecompressed file, and find the next data header, and execute step S2.

[0077] Step S6: decompress the remaining data and write the decompressed data to the target address.

[0078] Optionally, in one embodiment of the present application, the method of the embodiment of the present application further includes: verifying the legitimacy of the decompressed file based on the first verification code in combination with the second verification code; if the legitimacy verification passes, using the decompressed file as the target file.

[0079] For example, CRC32 calculation is performed on the decompressed file at the target address to obtain a second check code, which is compared with the first check code in the identification mark. If they match, the decompression is considered successful, otherwise the decompression is considered failed.

[0080] Specifically, since most resource content has a high duplication rate, the compression rate is also high on average. Taking QuickLZ as an example, the original file size is 234KB, the compressed size is 45KB, and the compression rate is about 20%. On the same MI8SE phone, the download time can be reduced from the original 26 seconds to 4 seconds. It takes 10 seconds to decompress the 45KB compressed file into the 234KB original file, and the total time is 14 seconds. The total upgrade time is saved by 12 seconds. Therefore, the upgrade efficiency is effectively improved, and the user upgrade experience for wearable devices is improved.

[0081] Figure 3 Schematic diagram of the structure of a file upgrade device for a wearable device according to an embodiment of the present application.

[0082] like Figure 3 As shown, the file upgrade device 300 of the wearable device includes:

[0083] The acquisition module 301 is used to acquire a compressed file from an external device. The compressed file is obtained by compressing the upgrade file using a compression algorithm by the external device.

[0084] The upgrade module 302 is used to upgrade the compressed file to obtain the target file.

[0085] In some embodiments of the present application, the compressed file carries a first verification code, which is obtained by encoding the upgrade file using an encoding algorithm by an external device, see Figure 4 , the upgrade module 302 includes:

[0086] The upgrade submodule 3021 is used to upgrade the compressed file and obtain the target compressed file;

[0087] The decompression submodule 3022 is used to decompress the target compressed file to obtain a decompressed file;

[0088] A generating submodule 3023, used to generate a second verification code according to the decompressed file;

[0089] The verification submodule 3024 is used to verify the legitimacy of the decompressed file according to the first verification code combined with the second verification code. If the legitimacy verification passes, the decompressed file is used as the target file.

[0090] In some embodiments of the present application, the verification submodule 3024 is specifically used to:

[0091] Determine whether the matching state of the first verification code and the second verification code meets the preset matching state;

[0092] If the set matching status is met, it is determined that the legitimacy verification of the decompressed file has passed.

[0093] In some embodiments of the present application, the upgrade module 302 further includes:

[0094] The writing submodule 3025 is used to write the file data corresponding to the decompressed file into the target address;

[0095] Generate submodule 3023, specifically used for:

[0096] Read file data from the target address;

[0097] The file data is encoded according to an encoding algorithm, thereby generating a second verification code.

[0098] In some embodiments of the present application, the file to be upgraded includes n data segments, and the compressed file includes n compressed data segments, wherein the data volume of n-1 data segments is equal to a preset value, and the data volume of the remaining data segment is less than or equal to the preset value, and n is a positive integer greater than 1.

[0099] In some embodiments of the present application, the target compressed file includes multiple compressed data segments, and the compressed data segments correspond to the data segments one by one. The decompression submodule 3022 is specifically used to:

[0100] Decompress each compressed data segment piece by piece to obtain the decompressed file.

[0101] In some embodiments of the present application, the target compressed file includes multiple compressed data segments, and the compressed data segments correspond to the data segments one by one. The decompression submodule 3022 is specifically used to:

[0102] Decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment;

[0103] According to the sequence numbers of the compressed data segments, multiple decompressed data are combined to obtain a decompressed file.

[0104] In some embodiments of the present application, the compression algorithm is any one of the following: QuickLZ compression algorithm, FastLZ compression algorithm, LZF compression algorithm or zlib compression algorithm.

[0105] In some embodiments of the present application, the encoding algorithm is a CRC32 algorithm.

[0106] It should be noted that the above explanation of the file upgrade method embodiment of the wearable device is also applicable to the file upgrade device of the wearable device of this embodiment, and will not be repeated here.

[0107] In this embodiment, a compressed file is obtained from an external device, where the compressed file is compressed by the external device using a compression algorithm to compress the file to be upgraded; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0108] In order to implement the above embodiments, the present application also proposes a wearable device, see Figure 5 , Figure 5 The figure is a schematic diagram of the structure of a wearable device according to an embodiment of the present application.

[0109] The wearable device 50 comprises:

[0110] The file upgrading apparatus 300 for a wearable device in the above embodiment.

[0111] It should be noted that the above explanation of the embodiment of the file upgrade method for a wearable device is also applicable to the wearable device 50 of this embodiment, and will not be repeated here.

[0112] In this embodiment, a compressed file is obtained from an external device, where the compressed file is compressed by the external device using a compression algorithm to compress the file to be upgraded; the compressed file is upgraded to obtain a target file. Since the compressed file of the file to be upgraded is upgraded directly, the file upgrade efficiency of the wearable device can be effectively improved, and the practicability and reliability of the file upgrade can be effectively guaranteed.

[0113] In order to implement the above-mentioned embodiments, the present application also proposes a non-temporary computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the file upgrade method of the wearable device of the above-mentioned embodiment.

[0114] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0115] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0116] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0117] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0118] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0119] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0120] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0121] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A file upgrade method for a wearable device, characterized in that: include: Acquire a compressed file from an external device, wherein the compressed file is obtained by compressing the upgrade file by the external device using a compression algorithm; The compressed file carries a first verification code, and the first verification code is obtained by encoding the file to be upgraded by the external device using a coding algorithm; The compressed file is upgraded to obtain a target file; wherein, The step of performing an upgrade process on the compressed file to obtain a target file includes: Upgrading the compressed file to obtain a target compressed file; Decompressing the target compressed file to obtain a decompressed file; Using the decompressed file as the target file; The step of using the decompressed file as the target file comprises: Generate a second verification code according to the decompressed file; Performing legitimacy verification on the decompressed file according to the first verification code combined with the second verification code; If the legality verification passes, the decompressed file is used as the target file.

2. The file upgrade method for a wearable device according to claim 1, characterized in that: The performing legality verification on the decompressed file according to the first verification code in combination with the second verification code includes: Determining whether the matching status of the first verification code and the second verification code meets the preset matching status; If the preset matching status is met, it is determined that the legitimacy verification of the decompressed file has passed.

3. The file upgrade method for a wearable device according to claim 1, characterized in that: After decompressing the target compressed file to obtain the decompressed file, the method further comprises: Write the file data corresponding to the decompressed file into the target address; The step of generating a second verification code according to the decompressed file comprises: Reading the file data from the target address; The file data is encoded according to the encoding algorithm to generate the second verification code.

4. The file upgrade method for a wearable device according to claim 3, characterized in that: The file to be upgraded includes n data segments, and the compressed file includes 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 data segment is less than or equal to the preset value, and n is a positive integer greater than 1.

5. The file upgrade method for a wearable device according to claim 4, characterized in that: The target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one by one, and the decompressing the target compressed file to obtain the decompressed file includes: Decompress each of the compressed data segments segment by segment, thereby obtaining the decompressed file.

6. The file upgrade method for a wearable device according to claim 1, characterized in that: The target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one by one, the compressed data segments have corresponding sequence numbers, and the decompressing the target compressed file to obtain the decompressed file includes: decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment; According to the sequence numbers of the compressed data segments, a plurality of decompressed data are combined to obtain the decompressed file.

7. The file upgrade method for a wearable device according to any one of claims 1 to 6, characterized in that: The compression algorithm is any one of the following: QuickLZ compression algorithm, FastLZ compression algorithm, LZF compression algorithm or zlib compression algorithm.

8. The file upgrade method for a wearable device according to any one of claims 1 to 6, characterized in that: The encoding algorithm is the CRC32 algorithm.

9. A file upgrade device for a wearable device, characterized in that: include: An acquisition module, used for acquiring a compressed file from an external device, wherein the compressed file is obtained by compressing the upgrade file by the external device using a compression algorithm; The compressed file carries a first verification code, and the first verification code is obtained by encoding the file to be upgraded by the external device using a coding algorithm; An upgrade module, used for performing upgrade processing on the compressed file to obtain a target file; The upgrade module includes: An upgrade submodule, used for upgrading the compressed file to obtain a target compressed file; A decompression submodule, used for decompressing the target compressed file to obtain a decompressed file; A generating submodule, used for generating a second verification code according to the decompressed file; The verification submodule is used to verify the legitimacy of the decompressed file according to the first verification code in combination with the second verification code, and if the legitimacy verification passes, the decompressed file is used as the target file.

10. The file upgrade device for a wearable device according to claim 9, characterized in that: The verification submodule is specifically used for: Determining whether the matching status of the first verification code and the second verification code meets the preset matching status; If the preset matching status is met, it is determined that the legitimacy verification of the decompressed file has passed.

11. The file upgrade device for a wearable device according to claim 9, characterized in that: The upgrade module further includes: The writing submodule is used to write the file data corresponding to the decompressed file into the target address; The generating submodule is specifically used for: Reading the file data from the target address; The file data is encoded according to the encoding algorithm to generate the second verification code.

12. The file upgrade device for a wearable device according to claim 11, characterized in that: The file to be upgraded includes n data segments, and the compressed file includes 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 data segment is less than or equal to the preset value, and n is a positive integer greater than 1.

13. The file upgrade device for a wearable device according to claim 12, characterized in that: The target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one by one, and the decompression submodule is specifically used for: Decompress each of the compressed data segments segment by segment, thereby obtaining the decompressed file.

14. The file upgrade device for a wearable device according to claim 9, characterized in that: The target compressed file includes a plurality of compressed data segments, the compressed data segments correspond to the data segments one by one, and the decompression submodule is specifically used for: decompressing the compressed data segment to obtain decompressed data corresponding to the compressed data segment; According to the sequence numbers of the compressed data segments, a plurality of decompressed data are combined to obtain the decompressed file.

15. The file upgrade device for a wearable device according to any one of claims 9 to 14, characterized in that: The compression algorithm is any one of the following: QuickLZ compression algorithm, FastLZ compression algorithm, LZF compression algorithm or zlib compression algorithm.

16. The file upgrade device for a wearable device according to any one of claims 9 to 14, characterized in that: The encoding algorithm is the CRC32 algorithm.

17. A wearable device, characterized in that: include: A file upgrading device as described in any one of claims 9 to 16 above.

18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the file upgrade method for the wearable device according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Methods for processing data compression and decompression

    CN102841907A

  • Method and system for updating firmware data

    CN104699494A

  • Method and device for making upgrade package and method and device for upgrading file

    CN107391145A