A Fast Firmware Cache Verification Method, System and Related Components
By parsing the repair files and building manifest files, matching IOS device information, and detecting checkpoint files, the problem that IOS devices cannot quickly verify firmware cache, and an efficient firmware cache checksum system repair process is achieved.
Patent Information
- Application Number
- CN202210412221.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In the prior art, IOS devices cannot quickly verify firmware cache, resulting in a long time-consuming and prone to errors or data loss.
By parsing the repair files and building manifest files in the firmware cache, matching the device information of the IOS device to confirm the supportability and integrity of the firmware cache, and determining the verification is passed by checking whether the checkpoint file has changed.
A method of quickly verifying firmware cache is implemented, which reduces the waiting time and error probability during the system repair process and improves the repair efficiency.
Smart Images

Figure CN114721875B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of firmware caching, and in particular, to a method and system for quickly verifying firmware caching and related components thereof. Background Art
[0002] During the user's use of IOS devices, abnormal operations or misoperations often cause system anomalies and system damage problems. Therefore, various IOS system repair software has emerged on the market. Related Apple system repair software also has some situations of repair failure and repair error in the actual user environment. Among them, system repair error code 11 is a common error during the repair process.
[0003] During the Apple system repair process, it is necessary to decompress the system firmware package. Since the firmware package is quite large, decompressing the firmware takes a lot of time and also increases the probability of errors during decompression or firmware data loss after decompression.
[0004] Due to the complexity of verifying the cache directory after firmware decompression and the long time-consuming verification, as well as the closure of Apple's system repair process, it has not been possible to quickly verify the firmware cache directory at present, and one can only wait for the repair result. If the repair fails, it is necessary to decompress the firmware multiple times to rule out error interference. Summary of the Invention
[0005] Embodiments of the present invention provide a method and system for quickly verifying firmware caching and related components thereof, aiming to solve the problem that IOS devices in the prior art cannot quickly verify firmware caching.
[0006] In a first aspect, embodiments of the present invention provide a method for quickly verifying firmware caching, including:
[0007] Parsing the repair files in the firmware cache to obtain a first parsing result, and matching the device information of the IOS device to be repaired with the first parsing result one by one, and confirming whether the firmware cache supports the repair of the IOS device according to the matching result;
[0008] If the firmware cache supports the repair of the IOS device, parsing the build manifest file in the firmware cache to obtain a second parsing result, matching the device information of the IOS device with the second parsing result, and confirming whether the firmware cache is complete according to the matching result and the second parsing result;
[0009] If the firmware cache is complete, obtaining a checkpoint file and detecting whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification passes.
[0010] In a second aspect, an embodiment of the present invention provides a fast verification firmware cache system, which includes:
[0011] A first parsing result matching unit, configured to parse the repair file in the firmware cache to obtain a first parsing result, and match the device information of the IOS device to be repaired with the first parsing result one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result;
[0012] A second parsing result matching unit, configured to, if the firmware cache supports the repair of the IOS device, parse the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result;
[0013] A firmware cache verification determination unit, configured to, if the firmware cache is complete, obtain a checkpoint file, and detect whether the checkpoint file has changed. If it has not changed, determine that the firmware cache verification has passed.
[0014] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the fast verification firmware cache method described in the first aspect above.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the fast verification firmware cache method described in the first aspect above.
[0016] An embodiment of the present invention provides a method and system for quickly verifying a firmware cache and related components. The method includes: parsing a repair file in the firmware cache to obtain a first parsing result, and matching the device information of the IOS device to be repaired with the first parsing result one by one, and confirming whether the firmware cache supports the repair of the IOS device according to the matching result; if the firmware cache supports the repair of the IOS device, parsing the build manifest file in the firmware cache to obtain a second parsing result, matching the device information of the IOS device with the second parsing result, and confirming whether the firmware cache is complete according to the matching result and the second parsing result; if the firmware cache is complete, obtaining a checkpoint file, and detecting whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification passes. By parsing the repair file and the build manifest file, the embodiment of the present invention determines whether the firmware cache supports repairing the IOS device, and at the same time determines the firmware cache verification status by comparing whether the checkpoint file has changed, so as to achieve the effect of efficiently verifying the firmware cache. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0019] Figure 2 It is a schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0020] Figure 3 It is another schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0021] Figure 4 It is another schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0022] Figure 5 It is another schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0023] Figure 6 It is another schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0024] Figure 7 It is another schematic sub-flow chart of the method for quickly verifying a firmware cache provided by an embodiment of the present invention;
[0025] Figure 8 Schematic diagram of the application process of the fast verification firmware caching method provided by the embodiment of the present invention;
[0026] Figure 9 Schematic block diagram of the fast verification firmware caching system provided by the embodiment of the present invention;
[0027] Figure 10 Schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention;
[0028] Figure 11 Another schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention;
[0029] Figure 12 Another schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention;
[0030] Figure 13 Another schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention;
[0031] Figure 14 Another schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention;
[0032] Figure 15 Another schematic block diagram of the sub-units of the fast verification firmware caching system provided by the embodiment of the present invention. Detailed implementation manners
[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0034] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0035] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0036] It should also be further understood that the term "and / or" used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0037] Please refer to Figure 1 , Figure 1 which is a schematic flow chart of a method for quickly verifying a firmware cache provided by an embodiment of the present invention. The method includes steps S101 to S103.
[0038] S101. Parse the repair file in the firmware cache to obtain a first parsing result, and match the device information of the IOS device to be repaired with the first parsing result one by one. According to the matching result, confirm whether the firmware cache supports the repair of the IOS device;
[0039] S102. If the firmware cache supports the repair of the IOS device, then parse the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result;
[0040] S103. If the firmware cache is complete, then obtain the checkpoint file and detect whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification has passed.
[0041] In this embodiment, parse the repair file in the firmware cache to determine whether the firmware cache supports the repair of the current model of IOS device. If the current model of IOS device is a supported model of the firmware cache, then parse the build manifest file in the firmware cache to determine whether the firmware cache is complete. If the firmware cache is complete, then obtain the checkpoint file and detect whether the checkpoint file has changed. If it is detected that the checkpoint file has not changed, it is determined that the firmware cache verification has passed. If it is detected that the checkpoint file has changed, it is determined that the firmware cache verification has failed.
[0042] In one embodiment, please refer to Figure 2 , the step S101 includes:
[0043] S201. Determine whether there is a repair file in the firmware cache;
[0044] S202. If not, the firmware cache verification fails;
[0045] S203. If it exists, parse the repair file to obtain a first parsing result, search for the support model key value of the device support model in the first parsing result, and obtain the item corresponding to the support model key value;
[0046] S204. Compare the device model in the device information of the IOS device with the items corresponding to the support model key values one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the comparison result.
[0047] In this embodiment, first determine whether there is a repair file in the firmware cache. If not, it is determined that the firmware cache verification fails. If so, parse the repair file to obtain a first parsing result; search for the key value of the device support model according to the first parsing result, and obtain the item corresponding to the key value. Compare the device information of the IOS device with the items corresponding to the key values of the device support model in the firmware cache one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the comparison result.
[0048] Specifically, confirm whether there is a necessary repair file Restore.plist in the firmware cache during the system repair process. If not, it should be determined that the firmware cache verification fails. If so, parse the repair file Restore.plist, search for and obtain the support model key value SupportedProductTypes of the device support model, and obtain the item corresponding to the support model key value. The item of the support model key value SupportedProductTypes is of the type of a string array, and the sub-item is the device model string supported by the firmware cache for repair; obtain the corresponding device model according to the device information of the IOS device, and compare the device signal of the IOS device with the items of the support model key value SupportedProductTypes one by one to confirm whether the firmware cache supports the repair of the IOS device of this device model.
[0049] In one embodiment, please refer to Figure 3 , step S102 includes:
[0050] S301. If the firmware cache supports the repair of the IOS device, obtain the repair method selected by the user;
[0051] S302. Parse the build manifest file in the firmware cache to obtain a second parsing result, search for the firmware identification keys corresponding to the firmware identifications of each device and each mode supported in the second parsing result, and obtain the items corresponding to the firmware identification keys;
[0052] S303. Search for the device hardware model key and the repair method key in each build identifier sub-item in the item corresponding to the firmware identifier key, and determine whether the key value corresponding to the device hardware model key matches the device hardware model of the IOS device, and determine whether the key value corresponding to the repair method key matches the repair method selected by the user;
[0053] S304. If both match, search for the required manifest key indicating the build in each build identifier sub-item, and determine whether the data in the item corresponding to each manifest key is complete. If it is incomplete, it is determined that the firmware cache verification fails. If it is complete, continue with the subsequent firmware cache verification steps.
[0054] In this embodiment, if the device type of the IOS device is the device support model of the firmware cache, it is determined that the firmware cache supports the repair of the IOS device, and the repair method selected by the user is obtained. Parse the component manifest file in the firmware cache, search for the firmware identifier keys corresponding to the firmware identifiers of each device in each mode supported, obtain the item corresponding to the firmware identifier key, and match the device hardware model key and the repair method key in each build identifier sub-item in the item corresponding to the firmware identifier key, and determine whether the device hardware model key and the repair method key match the device hardware model of the IOS device and the repair method selected by the user respectively; if both match, search for the required manifest key indicating the build in each build identifier sub-item, compare whether the data in the item corresponding to each manifest key is complete. If it is incomplete, it is determined that the firmware cache verification fails. If it is complete, continue with the subsequent firmware cache verification steps.
[0055] Specifically, the repair methods are generally divided into two types: one is the Update mode that retains user data, and the other is the Erase mode that will erase the data. According to the repair mode requirements selected by the user, select the corresponding mode and convert the mode selection into the corresponding string form.
[0056] Confirm whether there is a necessary build manifest file BuildManifest.plist in the firmware cache during the repair process. If it does not exist, it is determined that the firmware cache verification fails. If it exists, parse the build manifest file BuildMainfest.plist in the firmware cache, search for the firmware identifier keys BuildIdentities corresponding to the firmware identifiers of each device in each mode supported, obtain the item corresponding to the firmware identifier key, and the item corresponding to the firmware identifier key is an array type storing each build identifier.
[0057] Match the DeviceClass key (i.e., the device hardware model key) and the RestoreBehavior key (i.e., the repair method key) in the Info key of each build identification sub-item in the item corresponding to the firmware identification key. If the key value of the DeviceClass key matches the device hardware model and the key value of the RestoreBehavior key matches the repair method, the sub-items in the item corresponding to the firmware identification key are the build identifications required for the IOS device to be repaired in the repair method. In the build identification, find the required manifest key Manifest for the build; compare whether the data of the firmware cache required by each sub-item in the manifest key is complete. If it is incomplete, it is determined that the firmware cache verification fails. If it is complete, continue with the subsequent firmware cache verification steps.
[0058] In one embodiment, please refer to FIG. 4. The step S103 includes:
[0059] S401. If the firmware cache is complete, determine whether there is a checkpoint file.
[0060] S402. If the checkpoint file exists, determine whether there is a device repair key value formed by combining the device hardware model and the repair method in the key value of the checkpoint file. If the device repair key value exists, detect whether the checkpoint file has changed.
[0061] S403. If the checkpoint file does not exist, or the device repair key value does not exist, set the checkpoint file.
[0062] In this embodiment, if the firmware cache has a complete repair file, determine whether there is a checkpoint file. If the checkpoint file exists, determine whether there is a key value formed by combining the device hardware model and the repair method in the key value of the checkpoint file. If it exists, parse the checkpoint file and determine whether the checkpoint file has changed; if the checkpoint file does not exist, or the key value of the checkpoint file does not contain the key value formed by combining the device hardware model and the repair method, set the corresponding checkpoint file.
[0063] The checkpoint file is used to compare whether the firmware has changed between two time points or whether the file has changed, so as to take corresponding measures according to the comparison result, reduce the loss of repeatedly decompressing the system firmware, and avoid system repair failures caused by differences during the system repair process.
[0064] Specifically, confirm whether there is a checkpoint file CheckPoint.plist. If the checkpoint file does not exist, set the corresponding checkpoint file; if the checkpoint file exists, confirm whether there is a key value formed by concatenating the device hardware model and the repair method with a symbol (-) in the key values of the checkpoint file. If it exists, parse the checkpoint file and determine whether the checkpoint file has changed. If it does not exist, set the corresponding checkpoint file.
[0065] In one embodiment, please refer to Figure 5 , the setting of the checkpoint file includes:
[0066] S501. Build a corresponding repair file list through the build manifest file;
[0067] S502. Obtain the feature points of the repair files through the repair file list, set the basic feature attributes of each repair file according to the feature points, and store them in the repair file list;
[0068] S503. Obtain the current time, and set the current time and the repair file list together in the key name composed of the device hardware model and the repair method to obtain the checkpoint file.
[0069] In this embodiment, a corresponding repair file list is built through the repair file information in the build manifest file, the feature points of the repair files are obtained according to the repair file list, the basic feature attributes of each repair file are set and stored in the repair file list; the current time is obtained, and the current time and the repair file list are set together in the key name composed of the device hardware model and the repair method to obtain the checkpoint file.
[0070] Specifically, after confirming that there is no checkpoint file CheckPoint.plist in the firmware cache, set the corresponding firmware package cache checkpoint. The detailed steps are as follows: Build a corresponding repair file list through the repair files in the build manifest file; Obtain the feature points of the repair files through the repair file list. In this embodiment, the size of the repair file and the last modification time of the repair file are selected as the standard logic for the detection system of the checkpoint to detect differences; Use the file name of the repair file as the key name of the repair file (its sub-items include last-time), and the size key as the attribute feature of the repair file. Set the basic feature attributes of each repair file and store them in the repair file list with the file name of the repair file as the key name; Obtain the current time and set it together with the repair file list in the key name composed of the device hardware model, repair method, and symbol (-) to achieve efficient checkpoint parsing and obtain the corresponding checkpoint; Save the checkpoint in the checkpoint file CheckPoint.plist to obtain the corresponding checkpoint file.
[0071] In one embodiment, please refer to Figure 6 , The method for detecting whether the checkpoint file has changed includes:
[0072] S601. Obtain the corresponding repair file list through the device repair key value, and determine whether each repair file in the repair file list exists in the firmware cache;
[0073] S602. If not, determine that the firmware cache verification fails;
[0074] S603. If all exist, determine whether the basic feature attributes of each repair file have changed compared with the repair files in the firmware cache. If any repair file has changed, determine that the firmware cache verification fails. If none have changed, determine that the firmware cache verification passes.
[0075] In this embodiment, obtain the repair file list corresponding to the checkpoint in the checkpoint file through the device repair key value, and determine whether each repair file corresponding to the key value in the repair file list exists in the firmware cache. If not, determine that the firmware cache verification fails. If it exists, determine whether the basic feature attributes of each repair file in the checkpoint have changed compared with the repair files in the firmware cache; If not, determine that the firmware cache verification passes. If it has changed, determine that the firmware cache verification fails.
[0076] Specifically, if there is the device repair key value, obtain the repair file list corresponding to the checkpoint through the device repair key value, compare whether the repair files corresponding to each key value exist in the firmware cache. If not, it is determined that the firmware cache verification fails and enters the firmware cache verification failure handling process; if the files corresponding to the key names in the repair file list all exist, compare whether there are differences in the basic characteristic attributes of each repair file in the checkpoint and the repair files in the firmware cache. If there are differences, it is determined that the firmware cache verification fails and enters the firmware cache verification failure handling process; if there are no differences, it is determined that the firmware cache verification passes and enters the corresponding IOS device repair process.
[0077] In one embodiment, please refer to Figure 7 , before the step S101, it further includes:
[0078] S701. Determine whether the current system is installed with an IOS device connection driver;
[0079] S702. If the IOS device connection driver is not installed, confirm the latest version of the IOS device connection driver and install it;
[0080] S703. When the user's IOS device is connected, obtain the connection mode of the device status;
[0081] S704. If the IOS device is in the normal mode, determine whether the IOS device is in the unlocked and trusted state. If it is in the unlocked and trusted state, obtain the device model and device hardware model of the IOS device, and put the device into the recovery mode;
[0082] S705. If the device is in the recovery mode or the DFU mode, first obtain the chip ID and motherboard ID of the IOS device, and obtain the device model and device hardware model through the chip ID and motherboard ID.
[0083] In this embodiment, it is determined whether the current system is installed with an IOS device connection driver; if the IOS device connection driver is not installed, the latest version of the IOS device connection driver is obtained and installed; if the IOS device connection driver is already installed, it waits for the user's IOS device to be connected; when the user's IOS device is connected, the connection mode of the device status of the IOS device is obtained; if the IOS device is in the normal mode, it is determined whether the IOS device is in the unlocked and trusted state. If it is in the un-unlocked and untrusted state, it waits for the user to unlock the IOS device and trust the current system, so that the IOS device is in the unlocked and trusted state, thereby obtaining the device model and device hardware model of the IOS device, and putting the IOS device into the recovery mode; if the IOS device is in the recovery mode or the DFU mode, the chip ID and motherboard ID of the IOS device are obtained, and through the correspondence between the chip ID and motherboard ID and the device model, the device model and device hardware model of the IOS device are obtained.
[0084] Specifically, it is determined whether the current system is installed with an IOS device connection driver. If the IOS device connection driver is not installed, the latest version of the IOS device connection driver is installed, and it is confirmed that the relevant driver is installed normally to prepare for identifying the IOS device and IOS device communication; when the user's IOS device is connected, the current device status of the IOS device is obtained to determine what connection mode it is in. If the IOS device is in the normal mode, it is determined whether the IOS device is in the unlocked and trusted state. If it is not unlocked and trusted, it waits for the user to perform the unlock lock screen password operation and trust operation; if it is already unlocked and trusted, the device model and device hardware model of the IOS device are obtained, and the IOS device is put into the recovery mode and waits for repair; if the IOS device is in the recovery mode or the DFU mode, the chip ID and motherboard ID of the IOS device are obtained, and through the correspondence between the chip ID and motherboard ID and the device model, the device model and device hardware model of the IOS device are obtained.
[0085] In a specific application scenario, such as Figure 8 shown, the repair process of the IOS device includes steps S10 to S90.
[0086] Step S10: Connect and identify the device to obtain the basic information of the device; in this step, the IOS device to be repaired is connected, and the basic information of the IOS device is obtained, where the basic information includes the device model and device hardware model.
[0087] Step S20: Analyze the firmware cache to obtain the supported device types; in this step, analyze the repair file in the firmware cache, and determine whether the firmware cache supports the repair of the IOS device according to the analysis result. If it supports, execute step S30; if it does not support, determine that the firmware cache verification fails, and execute step S90.
[0088] Step S30: Obtain the system repair method; in this step, there are two repair methods for the IOS device. One is the Update mode that retains user data, and the other is the Erase mode that erases the data. Select the corresponding mode for repair according to user needs.
[0089] Step S40: Analyze the firmware cache to obtain the files required for repair; in this step, analyze the component list in the firmware cache, match the analysis result with the device information and repair method of the IOS device to obtain the build identifier, find the list key according to the build identifier, and compare whether the data in the firmware cache is complete according to the list key. If the firmware cache data is complete, execute step S50; if the firmware cache data is incomplete, execute step S90.
[0090] Step S50: Obtain the checkpoint file; in this step, confirm whether there is a checkpoint file in the firmware cache. If not, execute step S60; if so, determine whether the key value in the checkpoint file exists the key value formed by the device hardware model and the repair method. If it exists, execute step S70; if not, execute step S60.
[0091] Step S60: Set the firmware cache checkpoint; in this step, build the corresponding repair file list according to the repair file information obtained in step S40, set the basic characteristic attributes for the repair file list, and set the current time and the repair file list together in the key value formed by the device hardware model and the repair method to obtain the checkpoint, and then save the checkpoint to the checkpoint file.
[0092] Step S70: Analyze the checkpoint file; in this step, analyze the checkpoint file, and determine whether there is a difference between the repair file list in the checkpoint file and the firmware cache. If there is no difference, execute step S80; if there is a difference, execute step S90.
[0093] Step S80: Start the device repair process;
[0094] Step S90: Firmware verification failure handling process.
[0095] Please refer to Figure 9 , Figure 9 which is a schematic block diagram of a fast verification firmware cache system provided by an embodiment of the present invention. The fast verification firmware cache system 200 includes:
[0096] The first parsing result matching unit 201 is configured to parse the repair file in the firmware cache to obtain a first parsing result, and match the device information of the IOS device to be repaired with the first parsing result one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result;
[0097] The second parsing result matching unit 202 is configured to, if the firmware cache supports the repair of the IOS device, parse the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result;
[0098] The firmware cache verification determination unit 203 is configured to, if the firmware cache is complete, obtain the checkpoint file, and detect whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification has passed.
[0099] In one embodiment, please refer to Figure 10 The first parsing result matching unit 201 includes:
[0100] The repair file judgment unit 301 is configured to judge whether there is a repair file in the firmware cache;
[0101] The first verification unit 302 is configured to, if not, the firmware cache verification fails;
[0102] The repair file parsing unit 303 is configured to, if it exists, parse the repair file to obtain a first parsing result, and find the support model key value of the device support model in the first parsing result, and obtain the item corresponding to the support model key value;
[0103] The device repair matching unit 304 is configured to match the device model in the device information of the IOS device with the item corresponding to the support model key value one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result.
[0104] In one embodiment, please refer to Figure 11 The second parsing result matching unit 202 includes:
[0105] The repair method obtaining unit 401 is configured to, if the firmware cache supports the repair of the IOS device, obtain the repair method selected by the user;
[0106] The firmware identification key searching unit 402 is configured to parse the build manifest file in the firmware cache to obtain a second parsing result, and find the firmware identification key corresponding to the firmware identification of each device in each mode supported in the second parsing result, and obtain the item corresponding to the firmware identification key;
[0107] Construct an identification sub-item key-value matching unit 403 for finding the device hardware model key and repair method key in each construction identification sub-item in the item corresponding to the firmware identification key, and determining whether the key value corresponding to the device hardware model key matches the device hardware model of the IOS device, and determining whether the key value corresponding to the repair method key matches the repair method selected by the user;
[0108] The manifest key data judgment unit 404 is used to, if both match, find the required manifest keys for construction in each construction identification sub-item, judge whether the data in the items corresponding to the manifest keys is complete, and if it is incomplete, determine that the firmware cache verification fails, and if it is complete, continue with the subsequent firmware cache verification steps.
[0109] In one embodiment, please refer to Figure 12 , the firmware cache verification determination unit 203 includes:
[0110] The checkpoint file judgment unit 501 is used to judge whether there is a checkpoint file if the firmware cache is complete;
[0111] The checkpoint file detection unit 502 is used to, if the checkpoint file exists, judge whether there is a device repair key value formed by combining the device hardware model and the repair method in the key value of the checkpoint file, and if there is the device repair key value, detect whether the checkpoint file has changed;
[0112] The checkpoint file setting unit 503 is used to set the checkpoint file if there is no checkpoint file or there is no such device repair key value.
[0113] In one embodiment, please refer to Figure 13 , the checkpoint file setting unit 503 includes:
[0114] The repair file list building unit 601 is used to build a corresponding repair file list through the build manifest file;
[0115] The basic feature attribute setting unit 602 is used to obtain the feature points of the repair files through the repair file list, set the basic feature attributes of each repair file according to the feature points, and store them in the repair file list;
[0116] The checkpoint file obtaining unit 603 is used to obtain the current time, and set the current time and the repair file list together in the key name composed of the device hardware model and the repair method to obtain the checkpoint file.
[0117] In one embodiment, please refer to Figure 14 , the checkpoint file detection unit 502 includes:
[0118] A repair file list acquisition unit 701, configured to obtain a corresponding repair file list through the device repair key value, and determine whether each repair file in the repair file list exists in the firmware cache;
[0119] A second verification unit 702, configured to determine that the firmware cache verification fails if it does not exist;
[0120] A third verification unit 703, configured to, if all exist, determine whether the basic characteristic attributes of each repair file have changed compared with the repair files in the firmware cache. If any repair file has changed, determine that the firmware cache verification fails. If none have changed, determine that the firmware cache verification passes.
[0121] In one embodiment, please refer to Figure 15 , the first parsing result matching unit 201 further includes:
[0122] A driver program judgment unit 801, configured to judge whether an IOS device connection driver program is installed in the current system;
[0123] A driver program installation unit 802, configured to, if the IOS device connection driver program is not installed, confirm the latest version of the IOS device connection driver program and install it;
[0124] A connection mode acquisition unit 803, configured to acquire the connection mode of the device status when the user's IOS device is connected;
[0125] A first device information acquisition unit 804, configured to, if the IOS device is in the normal mode, judge whether the IOS device is in the unlocked and trusted state. If it is in the unlocked and trusted state, acquire the device model and device hardware model of the IOS device, and put the device into the recovery mode;
[0126] A second device information acquisition unit 805, configured to, if the device is in the recovery mode or the DFU mode, first acquire the chip ID and main board ID of the IOS device, and acquire the device model and device hardware model through the chip ID and main board ID.
[0127] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method for quickly verifying the firmware cache as described above is implemented.
[0128] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for quickly verifying the firmware cache as described above is implemented.
[0129] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method section. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0130] It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
Claims
1. A method for quickly verifying a firmware cache, characterized in that, it includes: Analyze the repair file in the firmware cache to obtain a first parsing result, and match the device information of the IOS device to be repaired with the first parsing result one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result; If the firmware cache supports the repair of the IOS device, analyze the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result; If the firmware cache is complete, obtain the checkpoint file and detect whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification has passed.
2. The method for quickly verifying a firmware cache according to claim 1, characterized in that, The step of analyzing the repair file in the firmware cache to obtain a first parsing result, and matching the device information of the IOS device to be repaired with the first parsing result one by one, and confirming whether the firmware cache supports the repair of the IOS device according to the matching result, includes: Judge whether there is a repair file in the firmware cache; If not, the firmware cache verification fails; If it exists, analyze the repair file to obtain a first parsing result, find the support model key value of the device support model in the first parsing result, and obtain the item corresponding to the support model key value; Match the device model in the device information of the IOS device with the item corresponding to the support model key value one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result.
3. The method for quickly verifying a firmware cache according to claim 1, characterized in that, The step that if the firmware cache supports the repair of the IOS device, analyze the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result, includes: If the firmware cache supports the repair of the IOS device, obtain the repair method selected by the user; Analyze the build manifest file in the firmware cache to obtain a second parsing result, and find the firmware identification key corresponding to the firmware identification of each device and each mode supported in the second parsing result, and obtain the item corresponding to the firmware identification key; Find the device hardware model key and the repair method key in each build identification sub-item corresponding to the firmware identification key, and judge whether the key value corresponding to the device hardware model key matches the device hardware model of the IOS device, and judge whether the key value corresponding to the repair method key matches the repair method selected by the user; If both match, find the required manifest key indicating the build in each build identification sub-item, and judge whether the data in the item corresponding to each manifest key is complete. If it is not complete, it is determined that the firmware cache verification fails. If it is complete, continue with the subsequent firmware cache verification steps.
4. The method for quickly verifying a firmware cache according to claim 1, It is characterized in that if the firmware cache is complete, obtain the checkpoint file and detect whether the checkpoint file has changed. If it has not changed, determine that the firmware cache verification has passed, including: if the firmware cache is complete, determine whether there is a checkpoint file; if the checkpoint file exists, and determine whether there is a device repair key value formed by combining the device hardware model and the repair method in the key value of the checkpoint file. If the device repair key value exists, detect whether the checkpoint file has changed; if the checkpoint file does not exist, or the device repair key value does not exist, set the checkpoint file.
5. The method for quickly verifying the firmware cache according to claim 4, It is characterized in that the setting of the checkpoint file includes: build a corresponding repair file list through the build manifest file; obtain the feature points of the repair files through the repair file list, and set the basic feature attributes of each repair file according to the feature points, and store them in the repair file list; obtain the current time, and set the current time and the repair file list together in the key name composed of the device hardware model and the repair method to obtain the checkpoint file.
6. The method for quickly verifying the firmware cache according to claim 4, It is characterized in that the detection of whether the checkpoint file has changed includes: obtain the corresponding repair file list through the device repair key value, and determine whether each repair file in the repair file list exists in the firmware cache; if not, determine that the firmware cache verification fails; if all exist, determine whether the basic feature attributes of each repair file have changed compared with the repair files in the firmware cache. If any repair file has changed, determine that the firmware cache verification fails. If none have changed, determine that the firmware cache verification passes.
7. The method for quickly verifying the firmware cache according to claim 1, It is characterized in that before the step of parsing the repair files in the firmware cache to obtain a first parsing result and matching the device information of the IOS device to be repaired with the first parsing result one by one, and confirming whether the firmware cache supports the repair of the IOS device according to the matching result, further includes: determine whether the IOS device connection driver is installed in the current system; if the IOS device connection driver is not installed, confirm the latest version of the IOS device connection driver and install it; when the user's IOS device is connected, obtain the connection mode of the device status; if the IOS device is in the normal mode, determine whether the IOS device is in the unlocked and trusted state. If it is in the unlocked and trusted state, obtain the device model and device hardware model of the IOS device, and put the device into the recovery mode; if the device is in the recovery mode or DFU mode, first obtain the chip ID and main board ID of the IOS device, and obtain the device model and device hardware model through the chip ID and main board ID.
8. A system for quickly verifying the firmware cache, It is characterized in that including: The first parsing result matching unit is used to parse the repair file in the firmware cache to obtain a first parsing result, and match the device information of the IOS device to be repaired with the first parsing result one by one, and confirm whether the firmware cache supports the repair of the IOS device according to the matching result; The second parsing result matching unit is used to, if the firmware cache supports the repair of the IOS device, parse the build manifest file in the firmware cache to obtain a second parsing result, match the device information of the IOS device with the second parsing result, and confirm whether the firmware cache is complete according to the matching result and the second parsing result; The firmware cache verification determination unit is used to, if the firmware cache is complete, obtain a checkpoint file, and detect whether the checkpoint file has changed. If it has not changed, it is determined that the firmware cache verification has passed.
9. A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the computer program, the method for quickly verifying a firmware cache according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the method for quickly verifying a firmware cache according to any one of claims 1 to 7.
Citation Information
Patent Citations
System and method for serial port transparent transmission and program updating in internet range
CN108062230A
Security analysis method for firmware of embedded equipment
CN111428233A