Network repair method and device, equipment, storage medium and program product
By detecting abnormal network events, the system automatically searches for and repairs configuration files in both static and dynamic partitions, thus resolving network failures in computer devices and improving repair efficiency.
Patent Information
- Application Number
- CN202511348810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-01-16
AI Technical Summary
In existing technologies, when a computer device experiences network failure under abnormal circumstances, the user needs to manually restore or return the configuration file to the factory for repair, which is time-consuming and results in a poor user experience.
By detecting abnormal network events, identifying configuration file identifiers, searching for corresponding configuration files in static and dynamic partitions, comparing and repairing them, and automatically repairing the target configuration file.
It enables automatic repair of computer equipment network failures, improves network repair efficiency, and reduces user intervention time.
Smart Images

Figure CN121356984A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a network repair method, apparatus, device, storage medium, and program product. Background Technology
[0002] In computer devices, configuration files, such as non-volatile (NV) files and Encrypting File System (EFS) files (e.g., IMEI, baseband configuration), are stored as copies on a static partition. The actual configuration files used during computer operation originate from a dynamic partition. When a computer device malfunctions (e.g., power outages, software vulnerabilities), experiences hardware aging, or is maliciously modified, files in the dynamic partition may become corrupted, lost, or altered. This can lead to network failures such as inability to register with networks, SIM card malfunction, and IP Multimedia Subsystem (IMS) service interruptions. Currently, fixing these network failures requires users to manually restore or return the device to the factory for repair, a time-consuming process that results in a poor user experience. Summary of the Invention
[0003] The technical problem to be solved by the embodiments of this application is to provide a network repair method, apparatus, device, storage medium and program product that can automatically repair the corresponding configuration files to solve network failure problems of computer equipment and improve network repair efficiency.
[0004] On one hand, embodiments of this application provide a network repair method, which includes:
[0005] If a network anomaly event is detected, the configuration file identifier corresponding to the network anomaly event is determined;
[0006] In the static partition, find the first configuration file corresponding to the configuration file identifier, and in the dynamic partition, find the second configuration file corresponding to the configuration file identifier.
[0007] The first configuration file and the second configuration file are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result;
[0008] Based on the first configuration file, the target configuration file is repaired.
[0009] On the other hand, embodiments of this application provide a network repair device, which includes:
[0010] The determining unit is used to determine the configuration file identifier corresponding to the network anomaly event if a network anomaly event is detected.
[0011] The lookup unit is used to find the first configuration file corresponding to the configuration file identifier in the static partition, and to find the second configuration file corresponding to the configuration file identifier in the dynamic partition;
[0012] The determining unit is further configured to compare the first configuration file and the second configuration file to obtain a comparison result, and determine the target configuration file to be repaired from the second configuration file based on the comparison result;
[0013] The repair unit is used to repair the target configuration file based on the first configuration file.
[0014] In one implementation, the determining unit compares the first configuration file and the second configuration file to obtain a comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result. This can be used for:
[0015] Obtain the first hash value of the first configuration file and the second hash value of the second configuration file;
[0016] The first hash value and the second hash value are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result.
[0017] In one implementation, the first hash value is retrieved from a preset verification table based on the configuration file identifier of the first configuration file, and the preset verification table further includes at least one of the following pieces of information:
[0018] The configuration file path of the first configuration file is used to locate the first configuration file;
[0019] The digital signature of the first configuration file is used to verify the validity of the first configuration file;
[0020] The version information of the first configuration file is used to determine the file version of the first configuration file.
[0021] In one implementation, the repair unit repairs the target configuration file based on the first configuration file, which can be used for:
[0022] If the number of the first configuration files is one, then the first configuration file will overwrite the target configuration file;
[0023] If there are multiple first configuration files, then a first configuration file that matches the target configuration file is determined from the multiple first configuration files, and the determined first configuration file overwrites the target configuration file.
[0024] In one embodiment, the method is applied to a computer device, wherein there are multiple target configuration files, and the repair unit repairs the target configuration files based on the first configuration file, which can be used for:
[0025] If the computer device supports restarting, delete the configuration file in the dynamic partition and write the configuration file in the static partition to the dynamic partition;
[0026] If the computer device does not support restarting, the target configuration file is repaired based on the first configuration file.
[0027] In one embodiment, the method is applied to a computer device, and after the repair unit repairs the target configuration file based on the first configuration file, it can also be used for:
[0028] Initialize the baseband in the computer device;
[0029] If a network anomaly is detected after the baseband initialization is completed, the configuration file in the dynamic partition is deleted, and the configuration file in the static partition is written to the dynamic partition.
[0030] On the other hand, embodiments of this application provide a computer device, which includes a memory, a communication interface, and a processor, wherein the memory, the communication interface, and the processor are interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory to implement the above-mentioned network repair method.
[0031] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned network repair method.
[0032] On the other hand, embodiments of this application provide a computer program product, which includes a computer program stored in a computer storage medium; the processor of a computer device reads the computer program from the computer storage medium and executes the computer program, causing the computer device to perform the aforementioned network repair method.
[0033] In this embodiment, if a network anomaly is detected, the configuration file identifier corresponding to the network anomaly is determined; a first configuration file corresponding to the configuration file identifier is searched in the static partition, and a second configuration file corresponding to the configuration file identifier is searched in the dynamic partition; the first and second configuration files are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result; the target configuration file is repaired based on the first configuration file. By automatically determining the configuration file identifier corresponding to the network anomaly after it is detected, the first configuration file in the static partition and the second configuration file in the dynamic partition can be determined based on the configuration file identifier. After comparing the first and second configuration files, the target configuration file to be repaired can be determined, and the target configuration file can be repaired based on the first configuration file. This enables automatic repair of the corresponding configuration file to solve network failure problems of computer devices and improve network repair efficiency. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0035] Figure 1 This is a schematic diagram of the structure of a network repair system provided in an embodiment of this application;
[0036] Figure 2 This is a flowchart illustrating a network repair method provided in an embodiment of this application;
[0037] Figure 3 This is a logical schematic diagram of a network repair method provided in an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the structure of a network repair device provided in an embodiment of this application;
[0039] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0041] Furthermore, in the description of the embodiments of this application, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0042] In the specific implementation of this application, user-related data, such as user files, are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with local laws, regulations and standards.
[0043] Research has revealed that computer devices store configuration files, such as NV files and EFS files (e.g., IMEI, baseband configuration), as copies in a static partition. However, the actual configuration files used during operation originate from a dynamic partition. When a computer device malfunctions (e.g., power outages, software vulnerabilities), experiences hardware aging, or is maliciously modified, files in the dynamic partition may become corrupted, lost, or altered. This can lead to network failures such as inability to register with networks, SIM card malfunction, and IIMS service interruptions. Currently, fixing these network failures requires users to manually restore or return the device to the factory for repair, a time-consuming process that results in a poor user experience.
[0044] Based on this, in this embodiment of the application, if a network anomaly is detected, the configuration file identifier corresponding to the network anomaly is determined; the first configuration file corresponding to the configuration file identifier is searched in the static partition, and the second configuration file corresponding to the configuration file identifier is searched in the dynamic partition; the first configuration file and the second configuration file are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result; the target configuration file is repaired based on the first configuration file. By automatically determining the configuration file identifier corresponding to the network anomaly after detecting a network anomaly, the first configuration file in the static partition and the second configuration file in the dynamic partition can be determined based on the configuration file identifier. After comparing the first configuration file and the second configuration file, the target configuration file to be repaired can be determined, and the target configuration file can be repaired based on the first configuration file. This enables automatic repair of the corresponding configuration file to solve network failure problems of computer devices and improve network repair efficiency.
[0045] In this case, the configuration files in the static partition are copies, while the configuration files in the dynamic partition are dynamically executed files when the computer device is running.
[0046] Optionally, the network repair method in this application embodiment can be applied to Android devices using Qualcomm platform chipsets. The Qualcomm platform is a series of hardware and software solutions provided by Qualcomm, applicable to various types of products (such as smartphones, wearable devices, IoT devices, smart home devices, etc.). The Qualcomm platform primarily includes the Snapdragon processor series, known for its high performance and low power consumption, supporting multiple wireless connectivity technologies such as 5G, Wi-Fi 7, and Bluetooth, and integrating an artificial intelligence processing unit, providing powerful computing capabilities and rich functionality.
[0047] In Android devices using Qualcomm platform chipsets, static partitions can include File System Goldcopy (FSG) partitions, dynamic partitions can include Modem Storage (modemst) partitions, and configuration files can include NV files and EFS files.
[0048] The FSG partition refers to the non-volatile read-only memory partition on the Qualcomm platform, which is used to provide network protocol configuration, radio frequency control parameters, and other non-volatile default data during baseband (modem) initialization. Android devices using the Qualcomm platform store NV files and EFS files in the FSG partition as a golden copy file.
[0049] The modemst partition refers to the non-volatile writable storage partition on the Qualcomm platform. It is used to store the device's unique identifiers (such as IMEI and MEID), SIM card status information, network connection history, and temporary state data required for baseband firmware operation. The configuration files actually used by Android devices running on the Qualcomm platform originate from the modemst partition.
[0050] Optionally, the modemst partition can include modemst1 and modemst2. The modemst1 partition is used to store data during modem operation, i.e., modemst1 partition is used for writing data. The modemst2 partition is a redundant backup of the modemst1 partition, i.e., modemst2 partition is used for data recovery and verification.
[0051] Specifically, if an Android device using a Qualcomm platform chipset detects a network anomaly, the configuration file identifier corresponding to the network anomaly is determined; the first configuration file corresponding to the configuration file identifier is searched in the FSG partition, and the second configuration file corresponding to the configuration file identifier is searched in the modemst partition; the first and second configuration files are compared to obtain the comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result; the target configuration file is repaired based on the first configuration file.
[0052] Optionally, the first configuration file and the second configuration file are compared to obtain a comparison result. Based on the comparison result, the target configuration file to be repaired is determined from the second configuration file. This can be achieved by comparing the first hash value of the first configuration file and the second hash value of the second configuration file to obtain a comparison result, and then determining the target configuration file to be repaired from the second configuration file based on the comparison result. Optionally, the first hash value of the first configuration file can be obtained from a preset verification table.
[0053] The network repair method in this embodiment is applied to a computer device. The computer device is provided with one or more processors, a memory, and one or more applications. The one or more applications are stored in the memory and configured to be executed by the processor to implement the network repair method. The computer device can be a smart terminal, such as a mobile phone, wearable device, in-vehicle device, tablet computer, network device, and smart computer.
[0054] This application provides a network repair system, exemplarily, such as... Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of a network repair system provided in an embodiment of this application. The network repair system may include an event detection module, a verification table management module, a difference comparison engine, and a repair execution module.
[0055] The event detection module is used to detect network anomalies. Specifically, system logs (such as dmesg), Android Telephony service events (such as SIM card status), error codes, etc., can be input into the event detection module. The event detection module can determine the network anomaly event corresponding to the input data through rule matching (such as defining a matching condition and corresponding output network anomaly event for each rule). The event detection module outputs a network anomaly event signal (such as EVENT_SIM_FAILURE) and passes it to the verification table management module.
[0056] The verification table management module determines the corresponding configuration file identifier based on the received network anomaly event signal. Specifically, the verification table can determine the corresponding configuration file identifier based on a preset mapping relationship between network anomaly events and configuration files. For example, if the network anomaly event is SIM failure, the verification table will determine that the corresponding configuration file is uim_hw_config, etc., based on the preset mapping relationship between network anomaly events and configuration files. This preset mapping relationship avoids full partition scan delays, reduces repair response time, and accurately associates network anomaly events with corrupted configuration files, avoiding false repairs and improving the repair success rate.
[0057] The verification table management module searches for the first configuration file in a static partition (such as an FSG partition) and the second configuration file in a dynamic partition (such as a modemst partition) based on the configuration file identifier. Optionally, the difference comparison engine can also search for the first configuration file in a static partition (such as an FSG partition) and the second configuration file in a dynamic partition (such as a modemst partition) based on the configuration file identifier.
[0058] The difference comparison engine compares the first configuration file and the second configuration file, obtains the comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result. Specifically, the difference comparison engine compares the first configuration file and the second configuration file, identifies the configuration file with differences between the two configuration files, and determines the target configuration file to be repaired. Optionally, the first configuration file can be parsed into a first structured configuration file, and the second configuration file can be parsed into a second structured configuration file for comparison to obtain the comparison result; or, the file fields of the first configuration file and the file fields of the second configuration file can be compared to obtain the comparison result; or, the first hash value of the first configuration file and the second hash value of the second configuration file can be compared to obtain the comparison result.
[0059] Optionally, a preset verification table can be constructed. This involves retrieving various configuration files from a static partition (such as an FSG partition) and calculating the hash value of each configuration file. The verification table can then be built based on the configuration file identifier and corresponding hash value of each configuration file. Further, optionally, the verification table management module can look up the first hash value of the first configuration file in the verification table based on its configuration file identifier. The verification table management module or the difference comparison engine can then calculate the second hash value of the second configuration file. Finally, the difference comparison engine can compare the first hash value of the first configuration file with the second hash value of the second configuration file to obtain the comparison result.
[0060] The repair execution module repairs the target configuration file based on the first configuration file. Optionally, if there is only one target configuration file, the repair execution module overwrites the target configuration file with the first configuration file, that is, the first configuration file in the static partition (such as the FSG partition) is written to the dynamic partition (such as the modemst partition) to overwrite the target configuration file. Optionally, if there is only one first configuration file, the repair execution module overwrites the target configuration file with the first configuration file; if there are multiple first configuration files, the repair execution module determines the first configuration file that matches the target configuration file from the multiple first configuration files and overwrites the target configuration file with the determined first configuration file. Optionally, if there are multiple target configuration files, if the computer device supports rebooting, the configuration file in the dynamic partition (such as the modemst partition) is deleted, and the configuration file in the static partition (such as the FSG partition) is written to the dynamic partition (such as the modemst partition); if the computer device does not support rebooting, the target configuration file is repaired based on the first configuration file. By using single-file repair and partition-level recovery, the input / output (I / O) of file data and computational load are reduced, and resource consumption is reduced.
[0061] Alternatively, the repair execution module can repair the target configuration file based on the first configuration file. After that, the repair execution module can also initialize the baseband, that is, restart the baseband and verify whether the network function has returned to normal. If a network abnormal event is detected after the baseband initialization is completed, the configuration file in the dynamic partition (such as the modemst partition) is deleted and the configuration file in the static partition (such as the FSG partition) is written to the dynamic partition.
[0062] Network anomalies in this application embodiment include, but are not limited to: SIM card status anomalies, network registration failures, and IMS registration failures. SIM card status anomalies: Corruption of `uim_hw_config` causes the baseband to be unable to recognize the SIM card status. Network registration failures refer to: incorrect configuration of files such as `mcfg_autoselect_by_uim` and `ue_usage_setting` leading to network anomalies. IMS registration failures refer to: tampering with files such as `ims_enable` causing VoLTE / VoNR service interruptions.
[0063] Based on the network repair system in this application embodiment, when a computer device experiences a network abnormality event where it cannot detect the SIM card network, the specific network repair method can be as follows: When the computer device experiences a network abnormality event where it cannot detect the SIM card network, such as after the user inserts or removes the SIM card, the event detection module detects a STATE_CARD_IO_ERROR network abnormality event. The event detection module outputs a network abnormality event (STATE_CARD_IO_ERROR) signal and transmits it to the verification table management module. The verification table management module, based on the received network abnormality event signal, determines the configuration file identifier uim_hw_config corresponding to the network abnormality event. The difference comparison engine then performs a comparison in the dynamic partition (such as modes). The system searches for the uim_hw_config file in the t1 partition and calculates its second hash value. The difference comparison engine then searches for the first hash value of the uim_hw_config file in a preset checksum table. The engine compares the first hash value with the second hash value and finds that they are inconsistent. The repair execution module then extracts a copy of the golden file (uim_hw_config file) from a static partition (such as the FSG partition) and overwrites it in a dynamic partition (such as the modemst1 partition), thereby repairing the uim_hw_config file in the dynamic partition. The repair execution module then restarts the baseband, and the SIM card function returns to normal.
[0064] Based on the network repair system in this application embodiment, when a computer device experiences a network registration failure, the specific network repair method can be as follows: When a computer device experiences a network registration failure, such as when the computer device cannot register for a 4G or 5G network after an OTA upgrade, the event detection module detects a REGISTRATION_STATE_DENIED network abnormality event. The event detection module outputs a network abnormality event (REGISTRATION_STATE_DENIED) signal and transmits it to the verification table management module. The verification table management module, based on the received network abnormality event signal, determines the configuration file identifiers modem_fs1.img and modem_fs2.img corresponding to the network abnormality event. The difference comparison engine searches for the modem_fs1.img and modem_fs2.img files in the dynamic partition (such as the modemst1 partition) and calculates the second hash value of the modem_fs1.img file and the second hash value of the modem_fs2.img file. The difference comparison engine then searches for the first hash value of the modem_fs1.img file and the second hash value of the modem_fs2.img file in the preset verification table. The difference comparison engine compares the first hash value of the odem_fs2.img file with the second hash value of the modem_fs1.img file, and then compares the second hash value of the modem_fs2.img file with the first hash value. It finds that the second hash value of the modem_fs2.img file is inconsistent with the first hash value. Therefore, the modem_fs2.img file in the dynamic partition (such as the modemst1 partition) contains a different hash value. The 2.img file is the target configuration file to be repaired. The repair execution module extracts a copy of the gold file (modem_fs2.img) from the static partition (such as the FSG partition) and overwrites it in the dynamic partition (such as the modemst1 partition), thereby repairing the modem_fs2.img file in the dynamic partition. If the repair execution module still detects network anomalies after restarting the baseband, it deletes the configuration file in the dynamic partition (such as the modemst1 / modemst2 partition) and writes the configuration file in the static partition (such as the FSG partition) to the dynamic partition.
[0065] Based on the network repair system in this application embodiment, when a computer device experiences a network anomaly event of IMS registration failure, the specific network repair method can be as follows: When IMS registration fails, the event detection module detects the IMS_REGISTRATION_FAILED network anomaly event, outputs the network anomaly event (IMS_REGISTRATION_FAILED) signal and transmits it to the verification table management module. The verification table management module, based on the received network anomaly event signal, determines the configuration file identifiers mcfg_sel_db.xml and IMS_enable corresponding to the network anomaly event. The difference comparison engine searches for the mcfg_sel_db.xml and IMS_enable files in the dynamic partition (such as the modemst1 partition) and calculates the second hash value of the mcfg_sel_db.xml file and the second hash value of the IMS_enable file. The difference comparison engine then searches for the first hash value of the mcfg_sel_db.xml file and the first hash value of the IMS_enable file in the preset verification table. The difference comparison engine then sets the mcfg_... The second hash value of the sel_db.xml file is compared with the first hash value of the mcfg_sel_db.xml file, and the second hash value of the IMS_enable file is also compared with the first hash value of the IMS_enable file. It is found that the second hash value of the mcfg_sel_db.xml file is inconsistent with the first hash value, and the second hash value of the IMS_enable file is also inconsistent with the first hash value. Therefore, the mcfg_sel_db.xml file and the IMS_enable file in the dynamic partition (such as the modemst1 partition) are the target configuration files to be repaired. The repair execution module extracts the golden file copies (modem_fs2.img, IMS_enable) from the static partition (such as the FSG partition) and overwrites them in the dynamic partition (such as the modemst1 partition), thereby repairing the mcfg_sel_db.xml file and the IMS_enable file in the dynamic partition. After the repair execution module restarts the baseband, IMS registration is successful.
[0066] Based on the above description, please refer to Figure 2 , Figure 2 This is a flowchart illustrating a network repair method provided in an embodiment of this application. This network repair method can be applied to computer devices, such as... Figure 2 The network repair method shown includes, but is not limited to, steps S201 to S204, wherein:
[0067] S201, If a network anomaly event is detected, determine the configuration file identifier corresponding to the network anomaly event.
[0068] Network anomaly events refer to network function malfunctions occurring on computer equipment. These events include, but are not limited to, SIM card status anomalies, network registration failures, and IMS registration failures.
[0069] Optionally, network anomalies on a computer device can be detected through system logs (such as dmesg), Android Telephony service events (such as SIM card status), error codes, etc.
[0070] System logs are the source of records of interactions between the operating system and hardware. When a computer device experiences network anomalies or hardware-related problems, relevant information is left in the logs. Therefore, the system logs can be used to detect whether a computer device is experiencing network anomalies. Android Telephony service events manage communication services such as voice, data, and SIM card status. When network changes occur, the Android Telephony service generates event records, which can be used to detect network anomalies. SIM card status can include: ready (SIM available), not inserted (SIM card not physically detected), locked (e.g., no Personal Identification Number (PIN) / Personal Unblocking Key (PUK) entered), and network locked (only a specific carrier's network can be used). When a computer device experiences a network anomaly, an error code is generated; therefore, the error code can be used to detect network anomalies. For example, error code "403 Forbidden" indicates that the computer device's attempt to connect to the network or IMS was rejected; error code "SIM not provisioned" indicates that the SIM card is not activated; and error code "Not registered on network" indicates that the computer device is not allowed to access the cellular network.
[0071] Optionally, network anomalies can be detected through system services. Specifically, system services such as TelephonyManager or BasebandMonitor can be used to detect network anomalies. TelephonyManager refers to the standard Android API, a standard service interface provided by Android. Network anomalies that TelephonyManager can detect include, but are not limited to: SIM card status anomalies, network registration failures, IMS registration failures, and roaming status anomalies. BasebandMonitor refers to a non-public / vendor-proprietary API. Network anomalies that TelephonyManager can detect include, but are not limited to: baseband chip errors (such as ModemCrash), network registration failures, and SIM status error codes.
[0072] After identifying a network anomaly, the computer device can determine the configuration file identifier corresponding to the network anomaly.
[0073] Optionally, a mapping relationship between network anomaly events and configuration files can be established through an association engine (e.g., SIM card failure corresponds to the uim_hw_config file, and VoLTE / Vonr anomalies correspond to the ims_enable file). The computer device can then determine the corresponding configuration file identifier for the network anomaly event based on this mapping relationship.
[0074] During operation, computer devices detect various network anomalies. Each network anomaly corresponds to one or more configuration files. Therefore, an association engine can establish a mapping relationship between network anomalies and configuration files based on the correspondence between them. Consequently, when a network anomaly occurs, the computer device can determine the corresponding configuration file identifier based on the occurrence of the network anomaly.
[0075] Optionally, a mapping table between network anomaly events and configuration files can be constructed to establish a mapping relationship between network anomaly events and configuration files. The computer device can then determine the configuration file identifier corresponding to the network anomaly event based on this mapping relationship. The mapping table can include at least one of the following: network anomaly event, configuration file identifier, and dependent service / module. The configuration file identifier can include the configuration file path and / or configuration file name. For details, please refer to Table 1.
[0076] Table 1 Mapping of Network Anomalies to Configuration Files
[0077]
[0078] The configuration files corresponding to SIM card status anomalies (such as STATE_CARD_IO_ERROR) include, but are not limited to: / nv / item_files / modem / uim / uimdrv / uim_hw_config, / nv / item_files / modem / mmode / device_mode, and uim_select_default_usim_app (NV_ID:4398). The service / module that detects the SIM card status depends on is Ui ccController. The configuration files corresponding to network registration failures (such as REGISTRATION_STATE_DENIED) include, but are not limited to: ftm_mode (NV_ID:453), net_sel_mode_pref (NV_ID:849), / nv / item_files / modem / mm ode / lte_bandpref, and / nv / item_files / mcfg / mcfg_sel_db.xml. The service / module that detects the network registration status depends on is DATA_REGISTRATION_STATE and QtiDataServiceManager. The configuration files corresponding to IMS registration failures (such as IMS_REG ISTRATION_FAILED) include, but are not limited to: / nv / item_files / mcfg / mcfg_sel_db.xml and / nv / item_files / ims / IMS_enable. The service / module that detects the IMS registration status depends on is ImsEnablementTracker.
[0079] Specifically, after detecting a network anomaly, a computer device can query a mapping table between the network anomaly and the configuration file to determine the corresponding configuration file identifier. For example, if the computer device detects a SIM card status anomaly, querying the mapping table will determine that the configuration file identifier corresponding to the SIM card status anomaly is / nv / item_files / modem / uim / uimdrv / uim_hw_config, / nv / item_files / modem / mmode / device_mode, or uim_select_default_usim_app (NV_ID:4398). For example, if a computer device detects a network anomaly event as a network registration failure, then by querying the mapping table between network anomalies and configuration files, it can be determined that the configuration file corresponding to the network registration failure is identified as ftm_mode (NV_ID:453), net_sel_mode_pref (NV_ID:849), / nv / item_files / modem / mmode / lte_bandpref, or / nv / item_files / mcfg / mcfg_sel_db.xml.
[0080] In this embodiment of the application, by constructing a preset mapping relationship between network anomaly events and configuration files, when a network anomaly event is detected, it can accurately associate the network anomaly event with the corruption of the configuration file, avoid false repairs, improve the repair success rate, and avoid full partition scan delays, thereby reducing repair response time.
[0081] S202. Locate the first configuration file corresponding to the configuration file identifier in the static partition, and locate the second configuration file corresponding to the configuration file identifier in the dynamic partition.
[0082] In this system, configuration files in static partitions are duplicate files, while configuration files in dynamic partitions are dynamically executed files used by the computer device. Therefore, you can search for the first configuration file corresponding to a configuration file identifier (such as the configuration file path and / or configuration file name) in the static partition, and the second configuration file corresponding to the configuration file identifier in the dynamic partition.
[0083] Optionally, static partitions may include FSG partitions, and dynamic partitions may include modemst partitions. FSG partitions refer to non-volatile read-only storage partitions on Qualcomm platforms, used to provide network protocol configuration, RF control parameters, and other non-volatile default data during baseband (modem) initialization. Android devices using Qualcomm platforms store NV files and EFS files in the FSG partition as golden copies. Modemst partitions refer to non-volatile writable storage partitions on Qualcomm platforms, used to store the device's unique identifiers (such as IMEI, MEID), SIM card status information, network connection history, and temporary state data required for baseband firmware operation. The configuration files actually used by Android devices using Qualcomm platforms originate from the modemst partition.
[0084] Optionally, the dynamic partition may include a first dynamic partition and a second dynamic partition. That is, the modemst partition may include a modemst1 partition and a modemst2 partition.
[0085] The modemst1 partition is used to store data during modem operation; that is, modemst1 is used for writing data. The modemst2 partition is a redundant backup of the modemst1 partition; that is, modemst2 is used for data recovery and verification. This dual-partition structure enhances stability and fault tolerance.
[0086] Optionally, a preset verification table can be constructed. The preset verification table includes the configuration file identifier of each configuration file obtained from the static partition and the corresponding hash value of the configuration file. Then, to find the first configuration file corresponding to the configuration file identifier in the static partition and the second configuration file corresponding to the configuration file identifier in the dynamic partition, the following method can be used: obtain the first hash value of the first configuration file corresponding to the configuration file identifier from the preset verification table, and find the second configuration file corresponding to the configuration file identifier in the dynamic partition and determine the second hash value of the second configuration file.
[0087] This involves retrieving various configuration files and their identifiers from static partitions (such as FSG partitions). Each configuration file includes files associated with the network functions of the computer device. The hash value of each retrieved configuration file is then determined. The configuration file identifier includes, but is not limited to, the configuration file path, configuration file name, and configuration file ID. The hash value of each configuration file can be calculated using algorithms such as SHA-256 or MD5.
[0088] Optionally, metadata for each configuration file can be generated based on the configuration files obtained from the static partition, and a preset verification table can be constructed based on the configuration file identifier, metadata, and hash value of each configuration file.
[0089] The metadata of any configuration file is used to indicate that configuration file. The metadata of any configuration file may include, for example, the configuration file path, configuration file permissions, the partition to which the configuration belongs (such as the FSG partition), the configuration file size, and the configuration file modification time.
[0090] Optionally, after constructing the preset check table, the preset check table can be stored in a preset partition.
[0091] The preset partition can include a partition with read-only permissions. Storing the preset checksum in the preset partition can prevent physical tampering, malware, and rollback attacks, ensuring the integrity and security of the preset checksum. For example, the preset partition can be a persist partition, which is an independent partition in embedded devices such as Android and has read-only permissions.
[0092] Optionally, the preset verification table can be updated when the preset update conditions are met, resulting in an updated preset verification table.
[0093] The preset update conditions may include a preset update cycle. That is, when the preset update cycle is met, the preset checksum table can be updated to obtain an updated preset checksum table. Specifically, for example, if the preset update cycle is 24 hours, the computer device can retrieve each configuration file and its identifier from the static partition (such as the FSG partition) every 24 hours, determine the hash value of each configuration file, and thus update the preset checksum table to obtain an updated preset checksum table. Alternatively, the computer device can retrieve newly added configuration files and their identifiers, as well as changed configuration files and their identifiers, from the static partition (such as the FSG partition) every 24 hours, determine the hash values of the newly added and changed configuration files, and thus update the preset checksum table to obtain an updated preset checksum table.
[0094] The preset update conditions can include preset device states. In other words, when the preset device states are met, the preset checksum table can be updated to obtain an updated preset checksum table. Specifically, the preset device state can be, for example, the computer device's initial activation state. That is, when the computer device is first activated, it can obtain each configuration file and its identifier from a static partition (such as an FSG partition), determine the hash value of each configuration file, and thus update the preset checksum table to obtain an updated preset checksum table. For example, the preset device status could be the OTA upgrade status of a computer device. That is, after an OTA upgrade, the computer device can obtain each configuration file and its configuration file identifier from a static partition (such as an FSG partition), determine the hash value of each configuration file, and update the preset verification table to obtain the updated preset verification table. Alternatively, after an OTA upgrade, the computer device can obtain newly added configuration files and their configuration file identifiers, as well as changed configuration files and their configuration file identifiers, from a static partition (such as an FSG partition), determine the hash values of the newly added and changed configuration files, and update the preset verification table to obtain the updated preset verification table.
[0095] In this embodiment, a dynamic update mechanism (updating the preset verification table when preset update conditions are met to obtain the updated preset verification table) can ensure the data accuracy of the preset verification table and improve the network repair success rate.
[0096] S203, compare the first configuration file and the second configuration file to obtain the comparison result, and determine the target configuration file to be repaired from the second configuration file based on the comparison result.
[0097] Specifically, the computer device compares the first configuration file and the second configuration file to obtain the comparison result. Based on the comparison result, it determines the configuration file that has differences and determines the target configuration file to be repaired from the second configuration file based on the configuration file that has differences.
[0098] For example, the first configuration file includes first configuration file 1, first configuration file 2, and first configuration file 3, and the second configuration file includes second configuration file 1, second configuration file 2, and second configuration file 3. First configuration file 1 is compared with the corresponding second configuration file 1, first configuration file 2 is compared with the corresponding second configuration file 2, and first configuration file 3 is compared with the corresponding second configuration file 3 to obtain the comparison results. If the comparison results indicate that there is no difference between first configuration file 1 and second configuration file 1, no difference between first configuration file 2 and second configuration file 2, and a difference between first configuration file 3 and second configuration file 3, then second configuration file 3 can be determined as the target configuration file to be repaired.
[0099] Optionally, the first configuration file can be parsed into a first structured configuration file, and the second configuration file can be parsed into a second structured configuration file for comparison to obtain a comparison result; or, the file fields of the first configuration file and the file fields of the second configuration file can be compared to obtain a comparison result; or, the first hash value of the first configuration file and the second hash value of the second configuration file can be compared to obtain a comparison result.
[0100] In one optional implementation, the first configuration file and the second configuration file are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result. This can be achieved by: obtaining the first hash value of the first configuration file and the second hash value of the second configuration file; comparing the first hash value and the second hash value to obtain a comparison result, and determining the target configuration file to be repaired from the second configuration file based on the comparison result.
[0101] Specifically, a first hash value for a first configuration file and a second hash value for a second configuration file can be calculated. The first and second hash values are then compared to obtain a comparison result. Based on the comparison result, configuration files with differing hash values are identified, and the target configuration file to be repaired is determined from the second configuration file based on these differing hash values. Optionally, if a preset verification table is constructed, the first hash value of the first configuration file can be obtained from the verification table, and the second hash value of the second configuration file can be calculated. The first and second hash values are then compared to obtain a comparison result. Based on the comparison result, configuration files with differing hash values are identified, and the target configuration file to be repaired is determined from the second configuration file based on these differing hash values.
[0102] For example, the first configuration file includes first configuration file 1, first configuration file 2, and first configuration file 3, and the second configuration file includes second configuration file 1, second configuration file 2, and second configuration file 3. The first hash value 1 of first configuration file 1, the first hash value 2 of first configuration file 2, and the first hash value 3 of first configuration file 3 are obtained from a preset verification table. The second hash value 1 of second configuration file 1, the second hash value 2 of second configuration file 2, and the second hash value 3 of second configuration file 3 are calculated. The first hash value 1 is compared with the corresponding second hash value 1, the first hash value 2 is compared with the corresponding second hash value 2, and the first hash value 3 is compared with the corresponding second hash value 3. The comparison results are obtained. If the comparison results indicate that there is no difference between the first hash value 1 and the second hash value 1, no difference between the first hash value 2 and the second hash value 2, and a difference between the first hash value 3 and the second hash value 3, then it can be determined that the second configuration file 3 corresponding to the second hash value 3 is the target configuration file to be repaired.
[0103] In one optional implementation, the first hash value is retrieved from a preset verification table based on the configuration file identifier of the first configuration file, and the preset verification table further includes at least one of the following pieces of information:
[0104] 1. The configuration file path of the first configuration file is used to locate the first configuration file.
[0105] The configuration file path of the first configuration file is used to locate the first configuration file in a static partition (such as an FSG partition).
[0106] II. Digital signature of the first configuration file. The digital signature of the first configuration file is used to verify the validity of the first configuration file.
[0107] Specifically, the digital signature of the first configuration file can be verified based on the digital signature in a preset verification table. In particular, the digital signature of the first configuration file can be verified using a public key to determine that the first configuration file has a legitimate origin and has not been tampered with.
[0108] III. Version information of the first configuration file: The version information of the first configuration file is used to determine the file version of the first configuration file.
[0109] The version information of the first configuration file can include its version number. Based on the version information of the first configuration file in the preset verification table, the corresponding version of the first configuration file can be found in the static partition. For example, if the version information of the first configuration file indicates version 2, and the static partition includes first configuration files of versions 1, 2, and 3, then the version 2 first configuration file can be found in the static partition based on its version information.
[0110] S204, based on the first configuration file, repair the target configuration file.
[0111] Specifically, the first configuration file in the static partition can be overwritten into the dynamic partition, thereby repairing the target configuration file.
[0112] Optionally, if there is only one target configuration file, the first configuration file can be overwritten to the target configuration file. That is, the first configuration file in the static partition (such as the FSG partition) is written to the dynamic partition (such as the modemst partition) to overwrite the target configuration file.
[0113] In one alternative implementation, the target configuration file is repaired based on the first configuration file in the following manner: if there is only one first configuration file, the first configuration file overwrites the target configuration file; if there are multiple first configuration files, the first configuration file that matches the target configuration file is determined from the multiple first configuration files, and the determined first configuration file overwrites the target configuration file.
[0114] If there is only one first configuration file (i.e., one configuration file represents a network anomaly), and consequently, there is only one target configuration file, then the first configuration file can overwrite the target configuration file. If there are multiple first configuration files (i.e., multiple configuration files represent network anomalies), then the first configuration file matching the target configuration file can be determined from among the multiple first configuration files, and this determined first configuration file overwrites the target configuration file. For example, if the first configuration files include first configuration file 1, first configuration file 2, and first configuration file 3, and the target configuration files include target configuration file 1 and target configuration file 3, where target configuration file 1 corresponds to first configuration file 1, and target configuration file 3 corresponds to first configuration file 3, then the first configuration file can overwrite target configuration file 1, and the second configuration file 3 can overwrite target configuration file 3.
[0115] In one alternative implementation, the network repair method is applied to a computer device. There are multiple target configuration files. Based on a first configuration file, the target configuration files are repaired in the following ways: if the computer device supports restarting, the configuration files in the dynamic partition are deleted, and the configuration files in the static partition are written to the dynamic partition; if the computer device does not support restarting, the target configuration files are repaired based on the first configuration file.
[0116] If there are multiple target configuration files and the computer supports restarting, the configuration files in the dynamic partition (such as the modemst partition) can be deleted, and the configuration files in the static partition (such as the FSG partition) can be written to the dynamic partition (such as the modemst partition), and the computer can be restarted. If the computer does not support restarting, the target configuration files can be repaired based on the first configuration file.
[0117] In this embodiment of the application, single-file repair and partition-level recovery reduce file data input / output (I / O) and computational load, thereby reducing resource consumption.
[0118] In one alternative implementation, the network repair method is applied to a computer device. Based on the first configuration file, after repairing the target configuration file, the baseband in the computer device can also be initialized. If a network anomaly is detected after the baseband initialization is completed, the configuration file in the dynamic partition is deleted, and the configuration file in the static partition is written to the dynamic partition.
[0119] After repairing the target configuration file, the baseband in the computer device can be initialized, i.e., the baseband is restarted, and the network function is verified to be restored to normal. If a network abnormal event is detected after the baseband initialization is completed, the configuration file in the dynamic partition (such as the modemst partition) is deleted, and the configuration file in the static partition (such as the FSG partition) is written to the dynamic partition.
[0120] In this embodiment, if a network anomaly is detected, the configuration file identifier corresponding to the network anomaly is determined; a first configuration file corresponding to the configuration file identifier is searched in the static partition, and a second configuration file corresponding to the configuration file identifier is searched in the dynamic partition; the first and second configuration files are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result; the target configuration file is repaired based on the first configuration file. By automatically determining the configuration file identifier corresponding to the network anomaly after it is detected, the first configuration file in the static partition and the second configuration file in the dynamic partition can be determined based on the configuration file identifier. After comparing the first and second configuration files, the target configuration file to be repaired can be determined, and the target configuration file can be repaired based on the first configuration file. This enables automatic repair of the corresponding configuration file to solve network failure problems of computer devices and improve network repair efficiency.
[0121] Based on the above description, please refer to Figure 3 , Figure 3 This is a logical schematic diagram of a network repair method provided in this application embodiment. Specifically: If a computer device detects a network anomaly, it determines the configuration file identifier corresponding to the anomaly, searches for the second configuration file corresponding to the configuration file identifier in the dynamic partition, and calculates the second hash value of the second configuration file. The computer device obtains the first hash value of the first configuration file from a preset verification table and compares it with the second hash value. If the first hash value and the second hash value match, the process ends; if the first hash value and the second hash value do not match, a repair strategy is triggered to repair the target configuration file. The target configuration file is determined from the second configuration file based on the matching result of the first hash value and the second hash value. The computer device determines whether a single file is corrupted, i.e., whether the number of target configuration files is one. If a single file is corrupted, the first configuration file is overwritten to rewrite the target configuration file; if it is not a single file corrupted, the partition (dynamic partition) is reset. If the computer device supports restarting, the configuration files in the dynamic partition are deleted, and the configuration files in the static partition are written to the dynamic partition; if the computer device does not support restarting, the target configuration file is repaired based on the first configuration file. After the repair is completed, the baseband is initialized, and the network function is verified to be restored.
[0122] This application also provides a computer storage medium storing program instructions, which, when executed, are used to implement the corresponding methods described in the above embodiments.
[0123] This application provides a computer program product, which includes a computer program stored in a computer storage medium. The processor of a computer device reads the computer program from the computer storage medium and executes the computer program, causing the computer device to perform the corresponding methods described in the above embodiments.
[0124] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a network repair device provided in an embodiment of this application.
[0125] In one implementation of the network repair device according to the embodiments of this application, the network repair device includes the following structure.
[0126] The determining unit 401 is used to determine the configuration file identifier corresponding to the network abnormal event if a network abnormal event is detected.
[0127] The lookup unit 402 is used to look up the first configuration file corresponding to the configuration file identifier in the static partition, and to look up the second configuration file corresponding to the configuration file identifier in the dynamic partition;
[0128] The determining unit 401 is further configured to compare the first configuration file and the second configuration file to obtain a comparison result, and determine the target configuration file to be repaired from the second configuration file based on the comparison result;
[0129] Repair unit 403 is used to repair the target configuration file based on the first configuration file.
[0130] In one embodiment, the determining unit 401 compares the first configuration file and the second configuration file to obtain a comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result. This can be used for:
[0131] Obtain the first hash value of the first configuration file and the second hash value of the second configuration file;
[0132] The first hash value and the second hash value are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result.
[0133] In one implementation, the first hash value is retrieved from a preset verification table based on the configuration file identifier of the first configuration file, and the preset verification table further includes at least one of the following pieces of information:
[0134] The configuration file path of the first configuration file is used to locate the first configuration file;
[0135] The digital signature of the first configuration file is used to verify the validity of the first configuration file;
[0136] The version information of the first configuration file is used to determine the file version of the first configuration file.
[0137] In one implementation, the repair unit 403 repairs the target configuration file based on the first configuration file, and can be used for:
[0138] If the number of the first configuration files is one, then the first configuration file will overwrite the target configuration file;
[0139] If there are multiple first configuration files, then a first configuration file that matches the target configuration file is determined from the multiple first configuration files, and the determined first configuration file overwrites the target configuration file.
[0140] In one embodiment, the method is applied to a computer device, wherein there are multiple target configuration files, and the repair unit 403 repairs the target configuration files based on the first configuration file, which can be used for:
[0141] If the computer device supports restarting, delete the configuration file in the dynamic partition and write the configuration file in the static partition to the dynamic partition;
[0142] If the computer device does not support restarting, the target configuration file is repaired based on the first configuration file.
[0143] In one embodiment, the method is applied to a computer device, and after the repair unit 403 repairs the target configuration file based on the first configuration file, it can also be used for:
[0144] Initialize the baseband in the computer device;
[0145] If a network anomaly is detected after the baseband initialization is completed, the configuration file in the dynamic partition is deleted, and the configuration file in the static partition is written to the dynamic partition.
[0146] In this embodiment, if the determining unit 401 detects a network anomaly, it determines the configuration file identifier corresponding to the network anomaly. The searching unit 402 searches for the first configuration file corresponding to the configuration file identifier in the static partition and the second configuration file corresponding to the configuration file identifier in the dynamic partition. The determining unit 401 compares the first and second configuration files to obtain a comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result. The repair unit 403 repairs the target configuration file based on the first configuration file. By automatically determining the configuration file identifier corresponding to the network anomaly after detecting it, the first configuration file in the static partition and the second configuration file in the dynamic partition can be determined based on the configuration file identifier. By comparing the first and second configuration files, the target configuration file to be repaired can be determined, and the target configuration file can be repaired based on the first configuration file. This enables automatic repair of the corresponding configuration file, thereby solving network failure problems of computer devices and improving network repair efficiency.
[0147] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device in this embodiment includes a power supply module and other structures, and includes a processor 501, a memory 502, and a communication interface 503. The processor 501, the memory 502, and the communication interface 503 can exchange data, and the processor 501 implements the corresponding network repair method.
[0148] Memory 502 may include volatile memory, such as random-access memory (RAM); memory 502 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; memory 502 may also include combinations of the above types of memory.
[0149] Processor 501 may be a central processing unit (CPU). Processor 501 may also be a combination of a CPU and a GPU. In a computer device, multiple CPUs and GPUs may be included as needed for corresponding network repair. In one embodiment, memory 502 is used to store program instructions. Processor 501 can invoke program instructions to implement the various methods described above in the embodiments of this application.
[0150] The communication interface 503 may include a display screen, microphone, or speaker, etc.
[0151] In one possible implementation, the processor 501 of the computer device calls program instructions stored in the memory 502 to determine the configuration file identifier corresponding to the network anomaly event if a network anomaly event is detected; search for a first configuration file corresponding to the configuration file identifier in the static partition and search for a second configuration file corresponding to the configuration file identifier in the dynamic partition; compare the first configuration file and the second configuration file to obtain a comparison result, and determine the target configuration file to be repaired from the second configuration file based on the comparison result; and repair the target configuration file based on the first configuration file.
[0152] In one embodiment, the processor 501 compares the first configuration file and the second configuration file to obtain a comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result. The processor may perform the following operations:
[0153] Obtain the first hash value of the first configuration file and the second hash value of the second configuration file;
[0154] The first hash value and the second hash value are compared to obtain a comparison result, and the target configuration file to be repaired is determined from the second configuration file based on the comparison result.
[0155] In one implementation, the first hash value is retrieved from a preset verification table based on the configuration file identifier of the first configuration file, and the preset verification table further includes at least one of the following pieces of information:
[0156] The configuration file path of the first configuration file is used to locate the first configuration file;
[0157] The digital signature of the first configuration file is used to verify the validity of the first configuration file;
[0158] The version information of the first configuration file is used to determine the file version of the first configuration file.
[0159] In one implementation, the processor 501 repairs the target configuration file based on the first configuration file by performing the following operations:
[0160] If the number of the first configuration files is one, then the first configuration file will overwrite the target configuration file;
[0161] If there are multiple first configuration files, then a first configuration file that matches the target configuration file is determined from the multiple first configuration files, and the determined first configuration file overwrites the target configuration file.
[0162] In one embodiment, the method is applied to a computer device, wherein there are multiple target configuration files, and the processor 501 repairs the target configuration files based on the first configuration file, performing the following operations:
[0163] If the computer device supports restarting, delete the configuration file in the dynamic partition and write the configuration file in the static partition to the dynamic partition;
[0164] If the computer device does not support restarting, the target configuration file is repaired based on the first configuration file.
[0165] In one embodiment, the method is applied to a computer device, and after the processor 501 repairs the target configuration file based on the first configuration file, it can also perform the following operations:
[0166] Initialize the baseband in the computer device;
[0167] If a network anomaly is detected after the baseband initialization is completed, the configuration file in the dynamic partition is deleted, and the configuration file in the static partition is written to the dynamic partition.
[0168] In this embodiment, if a network anomaly is detected, the processor 501 determines the configuration file identifier corresponding to the network anomaly; searches for the first configuration file corresponding to the configuration file identifier in the static partition and the second configuration file corresponding to the configuration file identifier in the dynamic partition; compares the first and second configuration files to obtain a comparison result, and determines the target configuration file to be repaired from the second configuration file based on the comparison result; and repairs the target configuration file based on the first configuration file. By automatically determining the configuration file identifier corresponding to the network anomaly after it is detected, the processor can determine the first configuration file in the static partition and the second configuration file in the dynamic partition based on the configuration file identifier. By comparing the first and second configuration files, the processor can determine the target configuration file to be repaired and repair the target configuration file based on the first configuration file. This allows for automatic repair of the corresponding configuration file, thereby resolving network failures in computer devices and improving network repair efficiency.
[0169] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0170] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that all or part of the processes for implementing the above embodiments, and equivalent changes made in accordance with the claims of this application, still fall within the scope of this application.
Claims
1. A network repair method characterized by, The method comprises: If a network exception event is detected, determining a configuration file identifier corresponding to the network exception event; Finding a first configuration file corresponding to the configuration file identifier in a static partition and finding a second configuration file corresponding to the configuration file identifier in a dynamic partition; Comparing the first configuration file and the second configuration file to obtain a comparison result, and determining a target configuration file to be repaired from the second configuration file according to the comparison result; Repairing the target configuration file based on the first configuration file.
2. The method of claim 1, wherein, The comparison of the first configuration file and the second configuration file to obtain a comparison result, and the determination of a target configuration file to be repaired from the second configuration file according to the comparison result, comprise: Obtaining a first hash value of the first configuration file and a second hash value of the second configuration file; Comparing the first hash value and the second hash value to obtain a comparison result, and determining a target configuration file to be repaired from the second configuration file according to the comparison result.
3. The method of claim 2, wherein, The first hash value is found from a preset check table based on the configuration file identifier of the first configuration file, and the preset check table further comprises at least one of the following information: A configuration file path of the first configuration file, which is used to find the first configuration file; A digital signature of the first configuration file, which is used to verify the legality of the first configuration file; Version information of the first configuration file, which is used to determine the file version of the first configuration file.
4. The method of claim 1, wherein, The repairing of the target configuration file based on the first configuration file comprises: If the number of the first configuration files is one, the first configuration file is used to replace the target configuration file; If the number of the first configuration files is more than one, a first configuration file matching the target configuration file is determined from the plurality of first configuration files, and the determined first configuration file is used to replace the target configuration file.
5. The method of claim 1, wherein, The method is applied to a computer device, the number of the target configuration files is more than one, and the repairing of the target configuration file based on the first configuration file comprises: If the computer device supports restart, the configuration files in the dynamic partition are deleted, and the configuration files in the static partition are written into the dynamic partition; If the computer device does not support restart, the target configuration file is repaired based on the first configuration file.
6. The method of claim 1, wherein, The method is applied to a computer device, and after the repairing of the target configuration file based on the first configuration file, the method further comprises: Initializing a baseband in the computer device; If a network exception event is detected after the baseband is initialized, the configuration files in the dynamic partition are deleted, and the configuration files in the static partition are written into the dynamic partition.
7. A network repair apparatus, characterized by comprising: The device comprises: A determination unit configured to determine a configuration file identifier corresponding to a network exception event if the network exception event is detected. The searching unit is configured to search for a first configuration file corresponding to the configuration file identifier in a static partition and search for a second configuration file corresponding to the configuration file identifier in a dynamic partition. The determining unit is further configured to compare the first configuration file and the second configuration file to obtain a comparison result, and determine a target configuration file to be repaired from the second configuration file according to the comparison result. The repairing unit is configured to repair the target configuration file based on the first configuration file.
8. A computer device, comprising: The computer device comprises a memory, a communication interface, and a processor, wherein the memory, the communication interface, and the processor are connected to each other; the memory stores a computer program; the processor invokes the computer program stored in the memory to implement the network repairing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the network repairing method according to any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program product comprises a computer program stored in a computer storage medium; the processor of the computer device reads the computer program from the computer storage medium; and the processor executes the computer program to enable the computer device to execute the network repairing method according to any one of claims 1 to 6.