Configuration file repairing method, device and computer readable storage medium

By downloading patch files from the cloud and repairing configuration files when the terminal boots up, the problem of low efficiency in configuration file repair in existing technologies is solved, and fast and secure configuration file repair is achieved.

CN111427607BActive Publication Date: 2025-11-21SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010200225.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-19
Publication Date
2025-11-21
Estimated Expiration
2040-03-19

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in repairing configuration files, large data consumption and slow repair processes in whole-device upgrades, and require a reboot to take effect when replacing via APK.

Method used

When the terminal boots up, it downloads the target patch file from the cloud server, reads the configuration file information and the fields to be repaired, repairs the target configuration file based on this information, loads the repaired file, and generates a configuration file repair record to ensure successful repair or revert to the original state.

Benefits of technology

It enables quick configuration file repair without restarting the system, improving repair efficiency, reducing data transfer volume and repair time, and ensuring the security and reliability of the repair process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111427607B_ABST
    Figure CN111427607B_ABST
Patent Text Reader

Abstract

The application provides a configuration file repairing method, which comprises the following steps: downloading a target patch file from a cloud server when it is detected that a terminal is powered on; reading the target patch file to obtain configuration file information and to-be-repaired field information; determining a target configuration file according to the configuration file information; repairing the target configuration file based on the to-be-repaired field information, and loading the repaired target configuration file. The application also provides a configuration file repairing device and a computer readable storage medium. The application can solve the problem of low configuration file repairing efficiency in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, and in particular to a configuration file repairing method, device and computer readable storage medium. BACKGROUND

[0002] With the progress of science and technology, various smart terminals have emerged, such as smart televisions, smart phones, tablet computers and the like. When starting, the smart device will start the system software and load the configuration file to provide corresponding function services for the user. With the upgrading of the terminal system, it is often necessary to repair and update the configuration file. At present, the repairing method of the configuration file generally includes the following two kinds: 1) upgrading the whole machine of the terminal, 2) installing an apk (Android application package) on the terminal to replace the corresponding configuration file. For the above-mentioned first method, since the whole machine upgrade file is large, it will consume more traffic, and the repair process is slow; and for the second method, although the apk file is smaller than the whole machine upgrade file, the user needs to restart the machine after the repair is completed to take effect. Therefore, there is a problem of low configuration file repair efficiency in the prior art. SUMMARY

[0003] The main purpose of the present application is to provide a configuration file repairing method, device and computer readable storage medium, which aims to solve the problem of low configuration file repair efficiency in the prior art.

[0004] To achieve the above-mentioned purpose, the present application provides a configuration file repairing method, which comprises:

[0005] When detecting that the terminal is powered on, downloading a target patch file from a cloud server;

[0006] Reading the target patch file to obtain configuration file information and to-be-repaired field information;

[0007] Determining a target configuration file according to the configuration file information;

[0008] Repairing the target configuration file based on the to-be-repaired field information, and loading the repaired target configuration file.

[0009] Optionally, the to-be-repaired field information includes a to-be-repaired field and a target repair value, and before the step of repairing the target configuration file based on the to-be-repaired field information and loading the repaired target configuration file, the method further comprises:

[0010] Finding a current field value of the to-be-repaired field in the target configuration file;

[0011] According to the current field value, the target repair value and the target patch file, a corresponding configuration file repair record is generated.

[0012] Optionally, the configuration file repair method further comprises:

[0013] When the target configuration file repair is detected to fail, the configuration file repair record is obtained;

[0014] According to the configuration file repair record, a rollback operation is performed on the target configuration file.

[0015] Optionally, the step of downloading the target patch file from the cloud server when the terminal is detected to be powered on comprises:

[0016] When the terminal is detected to be powered on, a local configuration file patch list is obtained, and a cloud configuration file patch list is obtained from a cloud server;

[0017] The local configuration file patch list is compared with the cloud configuration file patch list to obtain to-be-updated patch information;

[0018] The target patch file corresponding to the to-be-updated patch information is downloaded from the cloud server.

[0019] Optionally, before the step of downloading the target patch file corresponding to the to-be-updated patch information from the cloud server, the method further comprises:

[0020] A corresponding prompt window is generated to prompt a user whether to perform repair;

[0021] When a repair confirmation instruction triggered by the user based on the prompt window is received, the step of downloading the target patch file corresponding to the to-be-updated patch information from the cloud server is performed.

[0022] Optionally, before the step of reading the target patch file to obtain configuration file information and to-be-repaired field information, the method further comprises:

[0023] It is detected whether the target patch file is a valid patch file;

[0024] If yes, the step of reading the target patch file to obtain configuration file information and to-be-repaired field information is performed.

[0025] Optionally, the step of detecting whether the target patch file is a valid patch file comprises:

[0026] It is detected whether the target patch file has been tampered with;

[0027] If it is detected that the target patch file has been tampered with, it is determined that the target patch file is not a valid patch file.

[0028] If the target patch file is detected to be unaltered, then check if the target patch file exists in the local database;

[0029] If it does not exist, then the target patch file is determined to be a valid patch file.

[0030] Optionally, the configuration file repair method further includes:

[0031] When the target configuration file repair fails, the reason for the repair failure is obtained, and the parameter information of the terminal is obtained according to the preset parameter items;

[0032] Based on the cause of the repair failure, the parameter information, and the target patch file, corresponding exception reporting information is generated and uploaded to the cloud server.

[0033] In addition, to achieve the above objectives, the present invention also provides a configuration file repair device, the configuration file repair device including a memory, a processor, and a configuration file repair program stored in the memory and executable by the processor, wherein when the configuration file repair program is executed by the processor, it implements the steps of the configuration file repair method as described above.

[0034] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a configuration file repair program, wherein when the configuration file repair program is executed by a processor, it implements the steps of the configuration file repair method as described above.

[0035] This invention provides a configuration file repair method, device, and computer-readable storage medium. Upon detecting that a terminal is powered on, a target patch file is downloaded from a cloud server. Then, the target patch file is read to obtain configuration file information and fields to be repaired, and the target configuration file is determined based on the configuration file information. Subsequently, the target configuration file is repaired based on the fields to be repaired, and the repaired target configuration file is loaded. In this invention, after downloading the target patch file, loading the target patch file allows direct repair of the fields to be repaired in the target configuration file, thereby loading the repaired target configuration file and achieving configuration file repair without requiring the user to restart the device, saving repair time and improving configuration file repair efficiency. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention;

[0037] Figure 2 This is a flowchart illustrating the first embodiment of the configuration file repair method of the present invention;

[0038] Figure 3 This is a detailed flowchart of step S10 in the first embodiment of the present invention;

[0039] Figure 4 This is a schematic diagram of the functional modules of the first embodiment of the configuration file repair device of the present invention.

[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0041] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0042] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.

[0043] The configuration file repair method described in this invention is mainly applied to configuration file repair devices. These devices can be smart TVs, or Android smartphones, tablets, and other terminal devices.

[0044] like Figure 1 As shown, the configuration file repair device may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to establish communication between these components; the user interface 1003 may include a display screen or an input unit such as a keyboard, and optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as Wireless-Fidelity, Wi-Fi); the memory 1005 may be high-speed random access memory (RAM) or stable memory (non-volatile memory), such as a disk storage device, and optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that... Figure 1 The configuration file repair device structure shown does not constitute a limitation on the configuration file repair device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0045] Continue to refer to Figure 1 , Figure 1The memory 1005, used as a computer storage medium, may include an operating system, a network communication module, and a configuration file repair program. Figure 1 In this context, the network communication module can be used to connect to the server and communicate data with it; while the processor 1001 can be used to call the configuration file repair program stored in the memory 1005 and execute the following steps:

[0046] When the terminal is detected to be powered on, the target patch file is downloaded from the cloud server;

[0047] Read the target patch file to obtain configuration file information and fields to be repaired;

[0048] The target configuration file is determined based on the configuration file information;

[0049] The target configuration file is repaired based on the information of the fields to be repaired, and the repaired target configuration file is loaded.

[0050] Furthermore, the field information to be repaired includes the field to be repaired and the target repair value. The processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0051] Locate the current value of the field to be repaired in the target configuration file;

[0052] Based on the current field value, the target repair value, and the target patch file, a corresponding configuration file repair record is generated.

[0053] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0054] When the failure to repair the target configuration file is detected, the repair record of the configuration file is obtained;

[0055] A rollback operation is performed on the target configuration file based on the configuration file repair record.

[0056] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0057] When the terminal is detected to be powered on, the local configuration file patch list is obtained, and the cloud configuration file patch list is obtained from the cloud server.

[0058] The local configuration file patch list is compared with the cloud configuration file patch list to obtain the patch information to be updated;

[0059] Download the target patch file corresponding to the patch information to be updated from the cloud server.

[0060] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0061] Generate a corresponding prompt window to ask the user whether to perform the repair;

[0062] Upon receiving a repair confirmation instruction triggered by the user based on the prompt window, the target patch file corresponding to the patch information to be updated is downloaded from the cloud server.

[0063] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0064] Check whether the target patch file is a valid patch file;

[0065] If so, the target patch file is read to obtain configuration file information and fields to be repaired.

[0066] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0067] Detect whether the target patch file has been tampered with;

[0068] If the target patch file is detected to have been tampered with, then the target patch file is determined to be a invalid patch file.

[0069] If the target patch file is detected to be unaltered, then check if the target patch file exists in the local database;

[0070] If it does not exist, then the target patch file is determined to be a valid patch file.

[0071] Furthermore, the processor 1001 can call the configuration file repair program stored in the memory 1005 and also perform the following operations:

[0072] When the target configuration file repair fails, the reason for the repair failure is obtained, and the parameter information of the terminal is obtained according to the preset parameter items;

[0073] Based on the cause of the repair failure, the parameter information, and the target patch file, corresponding exception reporting information is generated and uploaded to the cloud server.

[0074] Based on the above hardware structure, various embodiments of the configuration file repair method of the present invention are proposed.

[0075] This invention provides a method for repairing configuration files.

[0076] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the configuration file repair method of the present invention.

[0077] In this embodiment, the configuration file repair method includes:

[0078] Step S10: When the terminal is detected to be powered on, download the target patch file from the cloud server;

[0079] In this embodiment, the configuration file repair method is implemented by a configuration file repair device, which can be a smart TV, or a terminal device such as an Android smartphone or tablet. For ease of explanation, this embodiment uses a smart TV as an example. This configuration file repair method is applicable to micro-repair scenarios of configuration files. The smart TV has a micro-repair APK (Android application package) installed, used for data interaction with the cloud server, such as downloading target patch files and uploading anomaly reporting information. In addition, the smart TV also has a micro-repair service (server) for data interaction with the micro-repair APK, such as receiving target patch files sent by the micro-repair APK, sending anomaly reporting information to the micro-repair APK, and performing operations such as repairing and rolling back the target configuration file. The execution subject of this embodiment is a smart TV.

[0080] In this embodiment, when the terminal is detected to be powered on, the target patch file is downloaded from the cloud server.

[0081] Specifically, refer to Figure 3 Step S10 includes:

[0082] Step S11: When the terminal is detected to be powered on, obtain the local configuration file patch list and obtain the cloud configuration file patch list from the cloud server.

[0083] Step S12: Compare the local configuration file patch list with the cloud configuration file patch list to obtain the patch information to be updated;

[0084] Step S13: Download the target patch file corresponding to the patch information to be updated from the cloud server.

[0085] When the terminal is detected to be powered on, a local configuration file patch list is retrieved, and a cloud configuration file patch list is also retrieved from the cloud server. It's understandable that different smart TV models may have different configuration files; therefore, the cloud configuration file patch list can be retrieved based on the terminal model.

[0086] Then, the local configuration file patch list is compared with the cloud configuration file patch list to obtain the patch information to be updated. The patch information to be updated may include, but is not limited to, the patch number and download path. Then, the target patch file corresponding to the patch information to be updated is downloaded from the cloud server.

[0087] It should be noted that before step S13, the process includes generating a corresponding prompt window to ask the user whether to proceed with the repair. This prompt window may include confirmation information for the patch upgrade, explanations of the repair function, etc. Upon receiving a repair confirmation command triggered by the user based on the prompt window, step S13 is executed: downloading the target patch file corresponding to the patch information to be updated from the cloud server.

[0088] Step S20: Read the target patch file to obtain configuration file information and fields to be repaired;

[0089] After downloading the target patch file, read the file to obtain configuration file information and fields to be repaired. The configuration file information can be the filename, number, or address of the configuration file, etc., while the fields to be repaired include the fields to be repaired and the target repair values.

[0090] To improve the loading and activation speed of patch files, the format of the patch file corresponding to the configuration file can be set as follows:

[0091] Path (name of the configuration file to be repaired): xxxxx

[0092] Key (the configuration key field to be fixed): xxxx: value

[0093] For example, to fix the audio quality configuration file, you can set the corresponding patch file as follows:

[0094] Path: audio / config / pictureve.ini

[0095] Key: low_key_filter:10.120.11.0.1.22.

[0096] By setting the patch file corresponding to the configuration file in the above manner, the resulting patch file is very small, and its data volume can be almost represented by bits. Therefore, when repairing the configuration file, it loads very quickly and takes effect very quickly, thereby improving the repair efficiency of the configuration file.

[0097] Step S30: Determine the target configuration file based on the configuration file information;

[0098] Step S40: Repair the target configuration file based on the field information to be repaired, and load the repaired target configuration file.

[0099] Then, the target configuration file is determined based on the configuration file information. The target configuration file is then repaired based on the fields to be repaired, and the repaired target configuration file is loaded. The fields to be repaired include the fields to be repaired and the target repair value. When repairing the target configuration file, the field to be repaired is first located in the target configuration file, and its current value is updated to the target repair value. After repairing the target configuration file based on the fields to be repaired, a preliminary check is performed to see if the patch file has overwritten the original file. This check checks if the latest value of the field to be repaired in the target configuration file matches the target repair value. If the latest value of the field to be repaired in the target configuration file matches the target repair value, the preliminary repair is successful. At this point, the system reloads the repaired target configuration file to activate it. After loading the repaired target configuration file, a second check is performed to see if the target configuration file is repaired successfully. This check reads the latest value of the field to be repaired in the loaded target configuration file and checks if it matches the target repair value. If the latest value of the field to be repaired in the loaded target configuration file matches the target repair value, the repair is successful.

[0100] Furthermore, after a successful repair, the local configuration file patch list can be updated to prevent duplicate repairs in the future. Additionally, the target patch file can be stored in a local database.

[0101] This invention provides a configuration file repair method. Upon detecting that a terminal is powered on, a target patch file is downloaded from a cloud server. Then, the target patch file is read to obtain configuration file information and fields to be repaired. The target configuration file is determined based on the configuration file information. Subsequently, the target configuration file is repaired based on the fields to be repaired, and the repaired target configuration file is loaded. In this invention, after downloading the target patch file, loading the target patch file allows direct repair of the fields to be repaired in the target configuration file, thereby loading the repaired target configuration file and achieving configuration file repair without requiring the user to restart the device, saving repair time and improving configuration file repair efficiency. Furthermore, the target patch file in this invention only includes configuration file information and fields to be repaired. Compared to the full-device upgrade files and APK files in the prior art, the target patch file is much smaller, resulting in faster download and loading speeds, further improving configuration file repair efficiency.

[0102] Furthermore, based on the first embodiment described above, a second embodiment of the configuration file repair method of the present invention is proposed.

[0103] In this embodiment, the field information to be repaired includes the field to be repaired and the target repair value. Before step S40, the configuration file repair method further includes:

[0104] Step A: Locate the current field value of the field to be repaired in the target configuration file;

[0105] In this embodiment, the field information to be repaired includes the field to be repaired and the target repair value. After obtaining the configuration file information and the field information to be repaired, and determining the target configuration file based on the configuration file information, the current field value of the field to be repaired is searched in the target configuration file.

[0106] Step B: Generate the corresponding configuration file repair record based on the current field value, the target repair value, and the target patch file.

[0107] Then, based on the current field value, the target repair value, and the target patch file, a corresponding configuration file repair record is generated. This record records the values ​​of the fields to be repaired in the target configuration file before and after the repair (current field value and target repair value). This allows for a rollback operation when the target configuration file repair fails to be detected, so that the target configuration file can be restored to its state before the repair, thereby avoiding the impact on the user experience due to repair anomalies.

[0108] Furthermore, the configuration file repair method also includes:

[0109] Step C: When the target configuration file repair failure is detected, obtain the configuration file repair record;

[0110] Step D: Perform a rollback operation on the target configuration file based on the configuration file repair record.

[0111] In this embodiment, when a target configuration file repair failure is detected, the configuration file repair record is obtained. It should be noted that the detection of target configuration file repair failure occurs twice. The first time is after repairing the target configuration file based on the fields to be repaired, a preliminary check is performed to determine if the repair was successful. This involves checking whether the patch file overwrites the original file, i.e., checking if the latest value of the fields to be repaired in the target configuration file matches the target repair value. If the latest value of the fields to be repaired in the target configuration file matches the target repair value, the preliminary repair is successful; otherwise, the preliminary repair has failed. The second time is after loading the repaired target configuration file, a second check is performed to determine if the repair was successful. This involves reading whether the latest value of the fields to be repaired in the loaded target configuration file matches the target repair value. If the latest value of the fields to be repaired in the loaded target configuration file matches the target repair value, the repair is successful; otherwise, the repair has failed.

[0112] Correspondingly, step C is executed after step "Repair the target configuration file based on the field information to be repaired" or after step "Load the repaired target configuration file".

[0113] After obtaining the configuration file repair record, a rollback operation is performed on the target configuration file according to the configuration file repair record to revert the target configuration file to its state before repair, that is, to modify the field to be repaired in the target configuration file to the previous field value (i.e., the current field value in the above configuration file repair record).

[0114] Using the above method, a configuration file repair record can be generated before the repair. Then, if the configuration file repair fails, a rollback operation can be performed on the target configuration file based on the configuration file repair record, that is, the target configuration file can be rolled back to the state before the repair, thereby avoiding the impact on the user experience due to repair failure.

[0115] Furthermore, based on the first embodiment described above, a third embodiment of the configuration file repair method of the present invention is proposed.

[0116] In this embodiment, before step S20, the configuration file repair method further includes:

[0117] Step E: Detect whether the target patch file is a valid patch file;

[0118] In this embodiment, after the target patch file is downloaded, it is checked whether the target patch file is a valid patch file.

[0119] Specifically, step E includes:

[0120] Step E1: Detect whether the target patch file has been tampered with;

[0121] Step E2: If the target patch file is detected to have been tampered with, then the target patch file is determined to be a invalid patch file.

[0122] Step E3: If the target patch file is detected to be unaltered, then check if the target patch file exists in the local database;

[0123] Step E4: If it does not exist, then the target patch file is determined to be a valid patch file.

[0124] The specific detection process is as follows: First, it checks whether the target patch file has been tampered with. Tampering detection methods may include, but are not limited to: 1) checking if the digital signature is correct; 2) checking if the content of the target patch file has been tampered with. Specifically, the patch file released by the cloud server can be encrypted using a hash function (such as MD5, Message-DigestAlgorithm) to generate a corresponding digest. Then, the digest is encrypted using the cloud server's private key to generate a digital signature. Correspondingly, after downloading the target patch file, the smart TV can decrypt the digital signature using the cloud server's public key to obtain the digest. It then uses a hash function to encrypt the target patch file to obtain the target digest. The target digest is then compared with the decrypted digest to see if they are the same, thus determining whether the target patch file has been tampered with. If decryption fails, meaning the digital signature is incorrect, and / or the target digest is different from the decrypted digest, it indicates that the target patch file has been tampered with; if decryption fails, meaning the digital signature is correct, and the target digest is the same as the decrypted digest, it indicates that the target patch file has not been tampered with. Of course, it is understandable that either of the two methods of tampering detection mentioned above can be used for detection and judgment.

[0125] If the target patch file is detected to have been tampered with, it is determined that the target patch file is not a valid patch file. The target patch file can then be deleted, and the corresponding tampering information can be reported to the cloud server.

[0126] If the target patch file is found to be unmodified, the system can continue checking if it exists in the local database. If it doesn't exist, it means the target patch file was never downloaded before, and in this case, it's considered a valid patch file. If it exists, it means the target patch file was downloaded before, but the repair process may have been interrupted, resulting in the target configuration file not being repaired successfully, and the local configuration file patch list not being updated. In this case, one of the target patch files can be deleted, and the system can check if the fields to be repaired in the target configuration file have been repaired. If the fields to be repaired in the target configuration file have been repaired, the target patch file is considered a valid patch file.

[0127] If so, proceed to step S20: read the target patch file to obtain configuration file information and field information to be repaired.

[0128] If the target patch file is detected as a valid patch file, the target patch file is read to obtain the configuration file information and the field information to be repaired, and then the subsequent steps are executed. The specific execution process can be referred to the first embodiment above, and will not be repeated here.

[0129] In this embodiment, the target configuration file is repaired only when the target patch file is detected as a valid patch file, thereby ensuring the security of the configuration file repair.

[0130] Furthermore, based on the above embodiments, a fourth embodiment of the configuration file repair method of the present invention is proposed.

[0131] In this embodiment, after step S40, the configuration file repair method further includes:

[0132] Step F: When the target configuration file repair failure is detected, obtain the reason for the repair failure, and obtain the parameter information of the terminal according to the preset parameter items;

[0133] In this embodiment, when the failure to repair the target configuration file is detected, the reason for the failure is obtained. The reason for the failure includes the failure to load the patch file, the failure to load the system, etc. Then, the parameter information of the terminal is obtained according to the preset parameter items. The preset parameter items may include, but are not limited to, parameters such as terminal brand and model.

[0134] Step G: Based on the cause of the repair failure, the parameter information, and the target patch file, generate corresponding exception reporting information and upload it to the cloud server.

[0135] Then, based on the cause of the repair failure, parameter information, and target patch file, corresponding exception reporting information is generated. The format of the exception reporting information can be set according to the actual situation and is not limited here. Then, the exception reporting information is uploaded to the cloud server, so that the development engineers can obtain the exception reporting information from the cloud server and take timely countermeasures.

[0136] The present invention also provides a configuration file repair device.

[0137] Reference Figure 4 , Figure 4 This is a schematic diagram of the functional modules of the first embodiment of the configuration file repair device of the present invention.

[0138] In this embodiment, the configuration file repair device includes:

[0139] Download module 10 is used to download the target patch file from the cloud server when the terminal is detected to be powered on;

[0140] Reading module 20 is used to read the target patch file and obtain configuration file information and fields to be repaired;

[0141] The determination module 30 is used to determine the target configuration file based on the configuration file information;

[0142] Repair module 40 is used to repair the target configuration file based on the field information to be repaired, and load the repaired target configuration file.

[0143] Furthermore, the information about the field to be repaired includes the field to be repaired and the target repair value, and the configuration file repair device further includes:

[0144] The lookup module is used to find the current field value of the field to be repaired in the target configuration file;

[0145] The first generation module is used to generate a corresponding configuration file repair record based on the current field value, the target repair value, and the target patch file.

[0146] Furthermore, the configuration file repair device also includes:

[0147] The first acquisition module is used to acquire the configuration file repair record when the target configuration file repair failure is detected;

[0148] The rollback module is used to perform a rollback operation on the target configuration file based on the configuration file repair record.

[0149] Furthermore, the download module 10 includes:

[0150] The acquisition unit is used to acquire a local configuration file patch list and a cloud configuration file patch list from the cloud server when the terminal is detected to be powered on.

[0151] The comparison unit is used to compare the local configuration file patch list with the cloud configuration file patch list to obtain the patch information to be updated;

[0152] The download unit is used to download the target patch file corresponding to the patch information to be updated from the cloud server.

[0153] Furthermore, the download module 10 also includes:

[0154] The prompt unit is used to generate a corresponding prompt window to prompt the user whether to perform the repair;

[0155] The download unit is specifically used to download the target patch file corresponding to the patch information to be updated from the cloud server when it receives a repair confirmation instruction triggered by the user based on the prompt window.

[0156] Furthermore, the configuration file repair device also includes:

[0157] The detection module is used to detect whether the target patch file is a valid patch file;

[0158] The reading module 20 is specifically used to read the target patch file if the target patch file is a valid patch file, and obtain configuration file information and field information to be repaired.

[0159] Furthermore, the detection module is specifically used for:

[0160] Detect whether the target patch file has been tampered with;

[0161] If the target patch file is detected to have been tampered with, then the target patch file is determined to be a invalid patch file.

[0162] If the target patch file is detected to be unaltered, then check if the target patch file exists in the local database;

[0163] If it does not exist, then the target patch file is determined to be a valid patch file.

[0164] Furthermore, the configuration file repair device also includes:

[0165] The second acquisition module is used to acquire the reason for the failure of the repair when the target configuration file repair is detected to fail, and to acquire the parameter information of the terminal according to the preset parameter items.

[0166] The second generation module is used to generate corresponding abnormal reporting information based on the cause of the repair failure, the parameter information, and the target patch file, and upload it to the cloud server.

[0167] The functions of each module in the above-mentioned configuration file repair device correspond to the steps in the above-mentioned configuration file repair method embodiment, and their functions and implementation processes will not be described in detail here.

[0168] The present invention also provides a computer-readable storage medium storing a configuration file repair program, which, when executed by a processor, implements the steps of the configuration file repair method as described in any of the above embodiments.

[0169] The specific embodiments of the computer-readable storage medium of the present invention are basically the same as the embodiments of the above-described configuration file repair method, and will not be described in detail here.

[0170] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0171] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0173] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A configuration file repair method, characterized in that, The configuration file repair method includes the following steps: When the terminal is detected to be powered on, the target patch file is downloaded from the cloud server; Read the target patch file to obtain configuration file information and fields to be repaired, wherein the fields to be repaired include fields to be repaired and target repair values; The target configuration file is determined based on the configuration file information; The target configuration file is repaired based on the information of the fields to be repaired, and the repaired target configuration file is loaded. The step of repairing the target configuration file based on the field information to be repaired and loading the repaired target configuration file includes, before: Locate the current value of the field to be repaired in the target configuration file; Based on the current field value, the target repair value, and the target patch file, generate the corresponding configuration file repair record; The method further includes: If the latest value of the field to be repaired in the target configuration file is not the target repair value, or if the latest value of the field to be repaired in the target configuration file after system loading is not the target repair value, then the repair is determined to have failed. Obtain the configuration file repair record, and perform a rollback operation on the target configuration file based on the configuration file repair record; Prior to the step of reading the target patch file to obtain configuration file information and fields to be repaired, the method further includes: Detect whether the target patch file has been tampered with; If the target patch file is detected to be unaltered, then check if the target patch file exists in the local database; If it does not exist, the target patch file is determined to be a valid patch file, and the following steps are performed: read the target patch file to obtain configuration file information and fields to be repaired.

2. The configuration file repair method as described in claim 1, characterized in that, The step of downloading the target patch file from the cloud server when the terminal is detected to be powered on includes: When the terminal is detected to be powered on, the local configuration file patch list is obtained, and the cloud configuration file patch list is obtained from the cloud server. The local configuration file patch list is compared with the cloud configuration file patch list to obtain the patch information to be updated; Download the target patch file corresponding to the patch information to be updated from the cloud server.

3. The configuration file repair method as described in claim 2, characterized in that, Before the step of downloading the target patch file corresponding to the patch information to be updated from the cloud server, the method further includes: Generate a corresponding prompt window to ask the user whether to perform the repair; Upon receiving a repair confirmation instruction triggered by the user based on the prompt window, the following steps are executed: download the target patch file corresponding to the patch information to be updated from the cloud server.

4. The configuration file repair method as described in claim 3, characterized in that, After the step of detecting whether the target patch file is a valid patch file, the method further includes: If the target patch file is detected to have been tampered with, then the target patch file is determined to be a invalid patch file.

5. The configuration file repair method as described in any one of claims 1 to 4, characterized in that, The configuration file repair method also includes: When the target configuration file repair fails, the reason for the repair failure is obtained, and the parameter information of the terminal is obtained according to the preset parameter items; Based on the cause of the repair failure, the parameter information, and the target patch file, corresponding exception reporting information is generated and uploaded to the cloud server.

6. A configuration file repair device, characterized in that, The configuration file repair device includes a memory, a processor, and a configuration file repair program stored in the memory and executable by the processor, wherein when the configuration file repair program is executed by the processor, it implements the steps of the configuration file repair method as described in any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a configuration file repair program, wherein when the configuration file repair program is executed by a processor, it implements the steps of the configuration file repair method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method for restoring allocation of distributed equipment and distributed equipment

    CN102098182A

  • Method and device for realizing system hot patching

    CN103942073A

  • Configuration information restoration method and apparatus

    CN108319466A