CN114385418A - Protection method, device, equipment and storage medium for communication equipment - Google Patents

Protection method, device, equipment and storage medium for communication equipment Download PDF

Info

Publication number
CN114385418A
CN114385418A CN202111651764.3A CN202111651764A CN114385418A CN 114385418 A CN114385418 A CN 114385418A CN 202111651764 A CN202111651764 A CN 202111651764A CN 114385418 A CN114385418 A CN 114385418A
Authority
CN
China
Prior art keywords
communication equipment
fault
file
fault code
storage partition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111651764.3A
Other languages
Chinese (zh)
Inventor
徐廷松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Longsung Technology Shanghai Co ltd
Original Assignee
Longsung Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Longsung Technology Shanghai Co ltd filed Critical Longsung Technology Shanghai Co ltd
Priority to CN202111651764.3A priority Critical patent/CN114385418A/en
Publication of CN114385418A publication Critical patent/CN114385418A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The application relates to a protection method, a protection device, a protection equipment and a storage medium of communication equipment. The method comprises the following steps: after the communication equipment is restarted due to a fault, reading information in a first storage partition of the communication equipment; when the information contains the fault code, a backup file corresponding to the fault code is obtained from a second storage partition of the communication equipment; and repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file. The method realizes the purpose of timely repairing the fault after the fault occurs in the communication equipment, reduces the restarting times of the communication equipment, protects the storage hardware of the communication equipment, effectively reduces the deterioration degree of the storage hardware of the communication equipment, and improves the reliability and the robustness of the communication equipment. Moreover, when a fault occurs, the fault can be automatically recovered without manual intervention, and the maintenance cost of the communication equipment is reduced.

Description

Protection method, device, equipment and storage medium for communication equipment
Technical Field
The present application relates to the field of communications, and in particular, to a method, an apparatus, a device, and a storage medium for protecting a communication device.
Background
Due to the particularity of the use environment of the communication equipment, such as frequent power failure and unstable power supply in the use process, an unrepairable fault is easy to occur, and the communication equipment is repeatedly restarted. Furthermore, repeated restarts may cause irreversible physical loss of multi-Chip Package (MCP) hardware in the communication device as the failure deteriorates, until the MCP external memory is damaged, thereby reducing the lifetime of the communication device. Therefore, how to improve the service life of the communication device is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The application provides a protection method, a protection device and a storage medium of communication equipment.
In a first aspect, an embodiment of the present application provides a method for protecting a communication device, including:
reading information in a first storage partition of the communication equipment after the communication equipment is restarted due to a fault;
when the information contains a fault code, acquiring a backup file corresponding to the fault code from a second storage partition of the communication equipment;
and repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
In a second aspect, an embodiment of the present application provides a protection device for a communication device, including:
the reading module is used for reading the information in the first storage partition of the communication equipment after the communication equipment is failed and restarted;
the acquisition module is used for acquiring a corresponding backup file from a second storage partition of the communication equipment according to the fault code when the information contains the fault code;
and the first processing module is used for repairing an original file corresponding to the fault code in a third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
In a third aspect, an embodiment of the present application provides a communication device, including a memory and a processor, where the memory stores a computer program, and the processor implements, when executing the computer program, the steps of the protection method for a communication device provided in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the protection method for a communication device provided in the first aspect of the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, after the communication equipment is restarted due to a fault, the information in the first storage partition of the communication equipment is read, when the information contains a fault code, the backup file corresponding to the fault code is obtained from the second storage partition of the communication equipment, the backup file is used for modifying the original file corresponding to the fault code in the third storage partition of the communication equipment, and corresponding operation is continuously executed on the communication equipment according to the repaired original file, so that the purpose of timely repairing the fault after the communication equipment fails is achieved, the restarting frequency of the communication equipment is reduced, the storage hardware of the communication equipment is protected, the deterioration degree of the storage hardware of the communication equipment is effectively reduced, and the reliability and the robustness of the communication equipment are improved. Moreover, when a fault occurs, the fault can be automatically recovered without manual intervention, and the maintenance cost of the communication equipment is reduced.
Drawings
Fig. 1 is a schematic flowchart of a protection method for a communication device according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a fault diagnosis process of a communication device according to an embodiment of the present application;
fig. 3 is another schematic flow chart of a fault diagnosis process of a communication device according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a fault diagnosis process of a communication device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a protection device of a communication apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a communication device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application are further described in detail by the following embodiments in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that the execution subject of the method embodiments described below may be a protection apparatus of a communication device, and the apparatus may be implemented as part or all of the communication device by software, hardware, or a combination of software and hardware. Optionally, the communication device may be a Long Term Evolution (LTE) communication module, and certainly, may also be a communication module of other network systems, which is not limited in this embodiment of the present application. The following method embodiments are described taking as an example that the executing entity is a communication device.
Fig. 1 is a schematic flowchart of a protection method for a communication device according to an embodiment of the present application. As shown in fig. 1, the method may include:
s101, after the communication equipment is restarted due to faults, reading information in a first storage partition of the communication equipment.
In order to repair a failure in time after the communication device fails, the storage partition of the communication device may be divided into a plurality of partitions, for example, a first storage partition, a second storage partition, and a third storage partition. The first storage partition may be used to store fault information of various faults generated during startup and operation of the communication device, including fault codes, fault flag bits, detailed information of the faults, and operation logs related to the faults, etc. The second storage partition corresponds to the third storage partition, and the second storage partition may store backup files of the original files in the third storage partition in advance. The third storage partition may be understood as a default access partition configured when the communication device operates, and the communication device needs to read an original file of the default access partition to perform loading operation, so as to ensure normal operation of the communication device. The second storage partition may be understood as a backup partition of the default access partition for storing backup files of the original files within the default access partition.
For example, assuming that the third storage partition can be divided into a first sub-partition corresponding to the boot program, a second sub-partition corresponding to the operating system, and a third sub-partition corresponding to the file system according to the system function, the first sub-partition stores therein an original file related to the boot process of the boot program, the second sub-partition stores therein an original file related to the operating system, and the third sub-partition stores therein an original file related to the file system. Similarly, the second storage partition is used as a backup partition of the third storage partition, and may also be divided into a fourth sub-partition corresponding to the boot program, a fifth sub-partition corresponding to the operating system, and a sixth sub-partition corresponding to the file system according to the system function, where the fourth sub-partition stores the backup file matched with the first sub-partition, the fifth sub-partition stores the backup file matched with the second sub-partition, and the sixth sub-partition stores the backup file matched with the third sub-partition. And the files in each sub-partition of the second storage partition and the third storage partition are associated through corresponding fault codes.
In this way, after the communication device is restarted due to a failure, the information recorded in the first storage partition of the communication device may be directly read to determine whether the information contains a failure code, if the information contains the failure code, the following S102 is executed, and if the information does not contain the failure code, the communication device is guided to continue to operate.
And S102, when the information contains the fault code, acquiring a backup file corresponding to the fault code from a second storage partition of the communication equipment.
When the information is determined to contain the fault code, the backup file corresponding to the fault code can be acquired from the second storage partition of the communication equipment based on the fault code. Optionally, the fault code may be a fault code of an object to be detected or a fault code for upgrading an image file, where the object to be detected may include any one of a boot program, an operating system, a file system, and a target program.
The fault code of the boot program is used for indicating that the boot program has a fault in the boot process, and mainly shows that an original file cannot be normally read and loaded from a third storage partition of the communication device, and mainly comprises: original files are damaged, erased, maliciously tampered and the like. Wherein, the original file may be an image file.
The fault code of the operating system is used to indicate that the operating system has not successfully run.
The fault code of the target program is used to indicate that the target program has not successfully run. The target program may be configured in advance, and one or more target programs may be used.
The fault code of the file system is used to indicate that the file system is not booted successfully, a mount file system error, a file system load file error, and the like. The unsuccessful booting of the file system is mainly characterized by: reading an image file error of the file system from the third storage partition of the communication device, wherein the error may comprise that the whole file system is lost, erased, tampered with maliciously and the like. The mounted file system errors mainly include file system index loss or disorder, MCP Flash bit flipping, Error Checking and Correcting (ECC) Error correction exception, file system repair function exception and the like. The file system loads a file error, which may include single or multiple file losses, etc. Of course, for such cases where there are multiple types of error information, different fault codes may be associated to indicate faults occurring at different stages of operation.
In some cases, the mirror image file needs to be upgraded, or a corresponding fault code may be written in the first storage partition of the communication device in advance to indicate that the original file corresponding to the fault code is upgraded.
S103, repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuing to execute corresponding operation on the communication equipment according to the repaired original file.
After the backup file corresponding to the fault code is acquired, the original file corresponding to the fault code in the third storage partition of the communication device may be repaired by using the backup file, so that the repaired original file performs a corresponding operation on the communication device. The repair operation may be to modify the original file, to copy the backup file from the second storage partition to replace the original file in the third storage partition, to configure and jump to boot from the second storage partition, or the like.
For example, assuming that the fault code includes a fault code of the boot program, the boot program may acquire a backup image file related to the boot program from the first sub-partition of the second storage partition of the communication device based on the fault code, replace the original image file in the fourth sub-partition of the third storage partition with the backup image file, and control the boot program to read the corresponding image file from the fourth sub-partition of the third storage partition again, thereby successfully booting the communication device. The original image file may be a secondary boot program, or may be various types of operating systems.
For the fault recovery of the operating system, the file system, and the target program, the fault recovery process of the boot program may be referred to, and this embodiment is not described herein again.
If the fault code comprises a fault code for upgrading the image file, a fault recovery function can be simulated, an image file upgrading package corresponding to the fault code is obtained from the second storage partition, and the image file upgrading package is used for upgrading the original image file corresponding to the fault code in the third storage partition. Therefore, the system can be upgraded on the basis of small-scale code modification in the operation process of the communication equipment.
Optionally, after the failure recovery corresponding to the failure code is successful, the failure code may also be deleted from the first storage partition.
According to the protection method for the communication equipment, after the communication equipment is restarted due to a fault, the information in the first storage partition of the communication equipment is read, when the information contains the fault code, the backup file corresponding to the fault code is obtained from the second storage partition of the communication equipment, the backup file is used for repairing the original file corresponding to the fault code in the third storage partition of the communication equipment, and corresponding operation is continuously executed on the communication equipment according to the repaired original file, so that the purpose of timely repairing the fault after the communication equipment is in fault is achieved, the restarting frequency of the communication equipment is reduced, the storage hardware of the communication equipment is protected, the deterioration degree of the storage hardware of the communication equipment is effectively reduced, and the reliability and the robustness of the communication equipment are improved. Moreover, when a fault occurs, the fault can be automatically recovered without manual intervention, and the maintenance cost of the communication equipment is reduced.
Next, the following embodiments describe a fault diagnosis process of the communication apparatus. As can be seen from the foregoing embodiment, the failure of the communication device mainly includes a failure of the boot program in the boot process, a failure of the operating system in the operating process, a failure related to the file system, a failure of the target program in the operating process, and the like, then, the failure of the boot program in the boot process is described first, that is, when the object to be detected is the boot program, on the basis of the foregoing embodiment, optionally before S101, the method may further include:
s201, when the bootstrap program reads a first original file from a third storage partition in the communication equipment, detecting the first original file.
The first original file may be various types of image files, for example, an image file of a secondary boot program and image files of various types of operating systems, such as an image file of a Linux operating system. Of course, the boot program may also refer to a program for booting a secondary boot program and a program for booting various types of operating systems.
In practical application, optionally, the failure of the boot program in the boot process may be captured by a failure capturer of the boot program. Before the above S201, configuration information of the fault trap of the boot program may also be initialized. The configuration information may include content to be diagnosed, initialization and search range of the fault code, recording mode of the fault information, processing mode of the fault, flag bit information, and the like.
In this way, when the boot program reads the first original file from the corresponding sub-partition in the third storage partition in the communication device, the first original file may be detected based on the above configuration information. For example, the size length, file type format, and summary information of the first original file are detected. The detection of the summary information may be hash verification of the content of the first original file, or cryptographic signature verification of the content of the first original file.
If it is detected that the first original file has a failure, the following S202 is performed, and if it is detected that the first original file has no failure, the following S203 is performed.
S202, generating a fault code of the bootstrap program, and writing the fault code into a first storage partition of the communication equipment.
When detecting that the first original file has a fault, generating a fault code of the bootstrap program, and writing the generated fault code into a first storage partition of the communication equipment. In addition, the stage, type, reason and the like of the fault occurrence can be determined based on the detailed information of the fault, and the stage, type and reason of the fault occurrence can be written into the first storage partition, so that the subsequent more detailed fault analysis can be facilitated.
S203, loading and executing the first original file, and when a fault exists in the executing process of the first original file, generating a fault code of the boot program, and writing the fault code into a first storage partition of the communication equipment.
And if the first original file fails in the execution process, generating a fault code of the boot program, and writing the fault code into the first storage partition of the communication equipment. And if the first original file is executed normally, entering a system running state.
In this embodiment, when the boot program reads the first original file, the fault detection is performed on the first original file, and the fault detection is performed in the execution process of the first original file, that is, by performing the fault detection on multiple stages in the boot process of the boot program, a fault existing in the boot process can be detected in time and a fault code is generated, so that the accuracy of the fault detection is improved. Meanwhile, a data base is provided for the fault recovery of the subsequent bootstrap process.
Next, continuing to describe how to diagnose the fault in the operating system operation process, on the basis of the foregoing embodiment, optionally, as shown in fig. 3, before the foregoing S101, the method further includes:
s301, registering the first function to the kernel of the operating system.
S302, monitoring the running state of the operating system by calling the first function.
Wherein the first function may be an exception callback function. And monitoring the running state of the operating system through an abnormal callback function registered in the kernel of the operating system.
And S303, when the operating system is abnormal in running state, generating a fault code of the operating system, and writing the fault code into a first storage partition of the communication equipment.
When the operating state of the operating system is monitored to be abnormal, a fault code of the operating system can be generated and written into the first storage partition of the communication equipment. In addition, the running log related to the fault code can be written into the first storage partition of the communication equipment, so that detailed analysis of subsequent faults is facilitated.
In this embodiment, the operating state of the operating system can be monitored through a first function built in the operating system, and when the operating state of the operating system is monitored to be abnormal, a fault code of the operating system is generated and written into a first storage partition of the communication device, so that a data basis is provided for fault recovery in a subsequent operating process of the operating system.
Furthermore, the running state of the target program can be monitored, when the running state of the target program is monitored to be abnormal, a fault code corresponding to the target program is generated and written into the first storage partition of the communication equipment, and a data basis is provided for fault recovery in the running process of the subsequent target program.
Further, continuing with how to diagnose file system related failures, on the basis of the foregoing embodiment, optionally, as shown in fig. 4, before the foregoing S101, the method further includes:
s401, when an operating system reads a second original file of a file system from a third storage partition in the communication equipment, detecting the second original file.
Wherein the second original file can be packaged by using different file system tools, and can be an image file of the file system. In practical applications, the file system related failure may optionally be captured by a failure capturer of the file system. Before S401 described above, configuration information of a fault capturer of the file system may also be initialized. The configuration information may include content to be diagnosed, initialization and search range of the fault code, recording mode of the fault information, processing mode of the fault, flag bit information, and the like.
In this way, when the operating system reads the second original file from the corresponding sub-partition in the third storage partition in the communication device, the second original file may be detected based on the above configuration information. If it is detected that the second original file has a failure, the following S402 is performed, and if it is detected that the second original file has no failure, the following S403 is performed.
S402, generating a fault code of the file system, and writing the fault code into a first storage partition of the communication equipment.
And when detecting that the second original file has a fault, generating a fault code of the file system, and writing the generated fault code into the first storage partition of the communication equipment. In addition, the stage, type, reason and the like of the fault occurrence can be determined based on the detailed information of the fault, and the stage, type and reason of the fault occurrence can be written into the first storage partition, so that the subsequent more detailed fault analysis can be facilitated.
And S403, operating the second original file, monitoring the operating state of the file system through a second function inserted in the second original file in advance, generating a fault code of the file system when the operating state of the file system is abnormal, and writing the fault code into a first storage partition of the communication equipment.
And if the fault exists, generating a fault code corresponding to the mounting stage of the file system, and writing the fault code into a first storage partition of the communication equipment. And if the fault does not exist, operating the second original file, wherein the file system is in a normal operation state.
And then, starting a dynamic monitoring function, inserting a second function into the second original file in advance, and monitoring the running state of the file system by calling the second function. Wherein the second function may be a hook function. And when the abnormal operation state of the file system is monitored through the hook function, generating a fault code of the file system corresponding to the stage, and writing the fault code into a first storage partition of the communication equipment.
In this embodiment, when the operating system reads the second original file, the second original file is subjected to fault detection, and the second original file is subjected to fault detection in the operating process, that is, by performing fault detection on the file system mirror image file reading, the file system mounting and multiple stages in the file system operating process, a fault related to the file system can be detected in time and a fault code of a corresponding stage is generated, so that the accuracy of fault detection is improved. Meanwhile, a data base is provided for the subsequent fault recovery related to the file system.
Fig. 5 is a schematic structural diagram of a protection device of a communication device according to an embodiment of the present application. As shown in fig. 5, the apparatus may include: a reading module 501, an obtaining module 502 and a first processing module 503.
Specifically, the reading module 501 is configured to read information in a first storage partition of a communication device after the communication device is restarted due to a failure;
the obtaining module 502 is configured to, when the information includes a fault code, obtain a corresponding backup file from a second storage partition of the communication device according to the fault code;
the first processing module 503 is configured to repair the original file corresponding to the fault code in the third storage partition of the communication device by using the backup file, and continue to perform corresponding operations on the communication device according to the repaired original file.
According to the protection device for the communication equipment, after the communication equipment is restarted due to a fault, the information in the first storage partition of the communication equipment is read, when the information contains the fault code, the backup file corresponding to the fault code is obtained from the second storage partition of the communication equipment, the backup file is used for repairing the original file corresponding to the fault code in the third storage partition of the communication equipment, and corresponding operation is continuously executed on the communication equipment according to the repaired original file, so that the purpose that the fault can be timely repaired after the communication equipment is in fault is achieved, the restarting frequency of the communication equipment is reduced, the storage hardware of the communication equipment is protected, the deterioration degree of the storage hardware of the communication equipment is effectively reduced, and the reliability and the robustness of the communication equipment are improved. Moreover, when a fault occurs, the fault can be automatically recovered without manual intervention, and the maintenance cost of the communication equipment is reduced.
Optionally, the fault code includes a fault code of an object to be detected or a fault code for upgrading an image file, and the object to be detected includes any one of a boot program, an operating system, a file system, and a target program.
On the basis of the above embodiment, optionally, when the object to be detected is a bootstrap program, the apparatus further includes: the device comprises a first detection module and a second processing module.
Specifically, the first detecting module is configured to detect a first original file when the boot program reads the first original file from a third storage partition in the communication device before the reading module 501 reads information in the first storage partition of the communication device after the communication device is restarted due to a failure;
and the second processing module is used for generating a fault code of the boot program when the first original file has a fault, and writing the fault code into the first storage partition of the communication equipment.
On the basis of the foregoing embodiment, optionally, the second processing module is further configured to load and execute the first original file when the first original file has no failure, and generate a failure code of the boot program when a failure exists in the execution process of the first original file, and write the failure code into the first storage partition of the communication device.
On the basis of the above embodiment, optionally, when the object to be detected is an operating system, the apparatus further includes: the device comprises a registration module, a monitoring module and a third processing module.
Specifically, the registering module is configured to register a first function with an operating system kernel before the reading module 501 reads information in a first storage partition of the communication device after the communication device fails and is restarted;
the monitoring module is used for calling the first function through an operating system and monitoring the running state of the operating system;
and the third processing module is used for generating a fault code of the operating system when the operating system is abnormal in running state, and writing the fault code into the first storage partition of the communication equipment.
On the basis of the foregoing embodiment, optionally, when the object to be detected is a file system, the apparatus further includes: the second detection module and the fourth processing module.
Specifically, the second detecting module is configured to detect a second original file of the file system when the operating system reads the second original file from a third storage partition in the communication device before the reading module 501 reads information in the first storage partition of the communication device after the communication device is restarted due to a failure;
and the fourth processing module is used for generating a fault code of the file system when the second original file has a fault, and writing the fault code into the first storage partition of the communication equipment.
On the basis of the foregoing embodiment, optionally, the fourth processing module is further configured to run the second original file when the second original file has no fault, monitor an operating state of the file system through a second function pre-inserted in the second original file, generate a fault code of the file system when the operating state of the file system is monitored to be abnormal, and write the fault code into the first storage partition of the communication device.
In one embodiment, a communication device is provided, the internal structure of which may be as shown in fig. 6. The communication device includes a processor and a memory connected by a system bus. Wherein the processor of the communication device is configured to provide computing and control capabilities. The memory of the communication device stores a computer program which, when executed by the processor, implements a method of protection of the communication device.
Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation on the communication device to which the present application applies, and that a particular communication device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In one embodiment, a communication device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
reading information in a first storage partition of the communication equipment after the communication equipment is restarted due to a fault;
when the information contains a fault code, acquiring a backup file corresponding to the fault code from a second storage partition of the communication equipment;
and repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
Optionally, the fault code includes a fault code of an object to be detected or a fault code for upgrading an image file, and the object to be detected includes any one of a boot program, an operating system, a file system, and a target program.
In one embodiment, when the object to be detected is a bootstrap program, the processor executes the computer program to further implement the following steps: when the bootstrap program reads a first original file from a third storage partition in the communication equipment, detecting the first original file; and if the first original file has a fault, generating a fault code of the bootstrap program, and writing the fault code into a first storage partition of the communication equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the first original file has no fault, loading and executing the first original file, and when the first original file has a fault in the executing process, generating a fault code of the bootstrap program and writing the fault code into a first storage partition of the communication equipment.
In one embodiment, when the object to be detected is an operating system, the processor executes the computer program to further implement the following steps: registering a first function with an operating system kernel; monitoring the running state of the operating system by calling the first function; and when the operating system is abnormal in running state, generating a fault code of the operating system, and writing the fault code into a first storage partition of the communication equipment.
In one embodiment, when the object to be detected is a file system, the processor executes the computer program to further implement the following steps: when an operating system reads a second original file of a file system from a third storage partition in the communication equipment, detecting the second original file; and if the second original file has a fault, generating a fault code of the file system, and writing the fault code into a first storage partition of the communication equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the second original file has no fault, the second original file is operated, the operating state of the file system is monitored through a second function inserted in the second original file in advance, and when the operating state of the file system is abnormal, a fault code of the file system is generated and written into a first storage partition of the communication equipment.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
reading information in a first storage partition of the communication equipment after the communication equipment is restarted due to a fault;
when the information contains a fault code, acquiring a backup file corresponding to the fault code from a second storage partition of the communication equipment;
and repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
The protection device, the apparatus, and the storage medium of the communication apparatus provided in the above embodiments may execute the protection method of the communication apparatus provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a method for protecting a communication device provided in any embodiment of the present application.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for protecting a communication device, comprising:
reading information in a first storage partition of the communication equipment after the communication equipment is restarted due to a fault;
when the information contains a fault code, acquiring a backup file corresponding to the fault code from a second storage partition of the communication equipment;
and repairing the original file corresponding to the fault code in the third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
2. The method according to claim 1, wherein the fault code comprises a fault code of an object to be detected or a fault code for upgrading an image file, and the object to be detected comprises any one of a boot program, an operating system, a file system and a target program.
3. The method according to claim 2, wherein when the object to be detected is a boot program, before the reading of the information in the first storage partition of the communication device after the communication device is restarted due to a failure, the method further comprises:
when the bootstrap program reads a first original file from a third storage partition in the communication equipment, detecting the first original file;
and if the first original file has a fault, generating a fault code of the bootstrap program, and writing the fault code into a first storage partition of the communication equipment.
4. The method of claim 3, further comprising:
and if the first original file has no fault, loading and executing the first original file, and when the first original file has a fault in the executing process, generating a fault code of the bootstrap program and writing the fault code into a first storage partition of the communication equipment.
5. The method according to claim 2, wherein when the object to be detected is an operating system, before the reading of the information in the first storage partition of the communication device after the communication device is restarted due to a failure, the method further comprises:
registering a first function with an operating system kernel;
monitoring the running state of the operating system by calling the first function;
and when the operating system is abnormal in running state, generating a fault code of the operating system, and writing the fault code into a first storage partition of the communication equipment.
6. The method according to claim 2, wherein when the object to be detected is a file system, before the reading of the information in the first storage partition of the communication device after the communication device is restarted due to a failure, the method further comprises:
when an operating system reads a second original file of a file system from a third storage partition in the communication equipment, detecting the second original file;
and if the second original file has a fault, generating a fault code of the file system, and writing the fault code into a first storage partition of the communication equipment.
7. The method of claim 6, further comprising:
if the second original file has no fault, the second original file is operated, the operating state of the file system is monitored through a second function inserted in the second original file in advance, and when the operating state of the file system is abnormal, a fault code of the file system is generated and written into a first storage partition of the communication equipment.
8. A protection device for a communication apparatus, comprising:
the reading module is used for reading the information in the first storage partition of the communication equipment after the communication equipment is failed and restarted;
the acquisition module is used for acquiring a corresponding backup file from a second storage partition of the communication equipment according to the fault code when the information contains the fault code;
and the first processing module is used for repairing an original file corresponding to the fault code in a third storage partition of the communication equipment by using the backup file, and continuously executing corresponding operation on the communication equipment according to the repaired original file.
9. A communication device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202111651764.3A 2021-12-30 2021-12-30 Protection method, device, equipment and storage medium for communication equipment Pending CN114385418A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111651764.3A CN114385418A (en) 2021-12-30 2021-12-30 Protection method, device, equipment and storage medium for communication equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111651764.3A CN114385418A (en) 2021-12-30 2021-12-30 Protection method, device, equipment and storage medium for communication equipment

Publications (1)

Publication Number Publication Date
CN114385418A true CN114385418A (en) 2022-04-22

Family

ID=81200625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111651764.3A Pending CN114385418A (en) 2021-12-30 2021-12-30 Protection method, device, equipment and storage medium for communication equipment

Country Status (1)

Country Link
CN (1) CN114385418A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319269A (en) * 2023-05-19 2023-06-23 南方电网数字电网研究院有限公司 New energy edge side communication module with communication fault self-detection and quick isolation functions
CN117130825A (en) * 2023-01-30 2023-11-28 荣耀终端有限公司 Method for preventing abnormal operation of electronic equipment and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117130825A (en) * 2023-01-30 2023-11-28 荣耀终端有限公司 Method for preventing abnormal operation of electronic equipment and electronic equipment
CN117130825B (en) * 2023-01-30 2024-06-28 荣耀终端有限公司 Method for preventing abnormal operation of electronic equipment and electronic equipment
CN116319269A (en) * 2023-05-19 2023-06-23 南方电网数字电网研究院有限公司 New energy edge side communication module with communication fault self-detection and quick isolation functions
CN116319269B (en) * 2023-05-19 2023-09-15 南方电网数字电网研究院有限公司 New energy edge side communication module with communication fault self-detection and quick isolation functions

Similar Documents

Publication Publication Date Title
US9286164B2 (en) Electronic device to restore MBR, method thereof, and computer-readable medium
US10146604B2 (en) Bad block detection and predictive analytics in NAND flash storage devices
US20090199056A1 (en) Memory diagnosis method
US8812910B2 (en) Pilot process method for system boot and associated apparatus
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
CN108874582A (en) A kind of system recovery method, device and terminal
US11726879B2 (en) Multiple block error correction in an information handling system
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN115705261A (en) Memory fault repairing method, CPU, OS, BIOS and server
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
CN109086162B (en) Memory diagnosis method and device
WO2023077607A1 (en) Fault log storage method and apparatus, and electronic device and storage medium
CN115421960A (en) UE memory fault recovery method, device, electronic equipment and medium
CN113094221B (en) Fault injection method, device, computer equipment and readable storage medium
CN114780208A (en) Method, system, device and storage medium for verifying backup validity of multi-platform virtual machine
CN102831032A (en) Repair system and method for master boot record of hard disc
US11853151B1 (en) Task abnormality detection system and embedded device detection method
CN110544504A (en) test method, system and equipment for memory ADDDC function
US11367499B2 (en) Mitigating single-event upsets using containerization
CN112562774B (en) Storage device mounting method and device, computer device and storage medium
CN117472291B (en) Data block verification method and device, storage medium and electronic equipment
US11645156B1 (en) Updating error policy
CN102549550B (en) Method and system for data access
US20240070264A1 (en) Data storage device performing data protection and host device supporting a data protection function using a program context
CN113050887A (en) Flash partition data processing method and device, computer equipment and storage medium

Legal Events

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