CN113961151A - Fault log storage method and device, electronic equipment and storage medium - Google Patents

Fault log storage method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113961151A
CN113961151A CN202111288368.9A CN202111288368A CN113961151A CN 113961151 A CN113961151 A CN 113961151A CN 202111288368 A CN202111288368 A CN 202111288368A CN 113961151 A CN113961151 A CN 113961151A
Authority
CN
China
Prior art keywords
log
fault
storage partition
partition
target
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.)
Granted
Application number
CN202111288368.9A
Other languages
Chinese (zh)
Other versions
CN113961151B (en
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.)
Ruiling Wireless Co ltd
Original Assignee
Ruiling Wireless Communication Technology Shenzhen 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 Ruiling Wireless Communication Technology Shenzhen Co ltd filed Critical Ruiling Wireless Communication Technology Shenzhen Co ltd
Priority to CN202111288368.9A priority Critical patent/CN113961151B/en
Priority to PCT/CN2021/136304 priority patent/WO2023077607A1/en
Publication of CN113961151A publication Critical patent/CN113961151A/en
Application granted granted Critical
Publication of CN113961151B publication Critical patent/CN113961151B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a fault log storage method, which comprises the following steps: partitioning a log storage partition in a non-volatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty; judging whether the target equipment has a fault or not; and if so, writing a target fault log corresponding to the fault into the log storage partition. According to the method and the device, the influence of the file system fault on the storage of the fault log can be avoided, and the reliability of the fault log is improved. The application also discloses a storage device of the fault log, an electronic device and a storage medium, and the storage device has the beneficial effects.

Description

Fault log storage method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for storing a fault log, an electronic device, and a storage medium.
Background
The electronic equipment may have a fault in the operation process, and the maintenance personnel can debug and maintain the electronic equipment by using a fault log recorded by the electronic equipment when the fault occurs. Currently, based on the consideration of security, when designing electronic devices such as a wireless communication module and a set-top box of a vehicle, debugging interfaces of a corresponding host of the device are usually prohibited to prevent malicious intrusion by hackers. In the above case, the electronic device can only record the corresponding fault log by itself.
In the related art, the failure log is usually stored in a data partition of the nonvolatile memory, but the implementation of the log storage manner depends on an operating system and a file system, and the corresponding failure log cannot be stored when a file system failure occurs.
Therefore, how to avoid the influence of the file system failure on the storage of the failure log and improve the reliability of the failure log is a technical problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The application aims to provide a fault log storage method, a fault log storage device, electronic equipment and a storage medium, which can avoid the influence of file system faults on fault log storage and improve the reliability of fault logs.
In order to solve the above technical problem, the present application provides a method for storing a fault log, where the method for storing a fault log includes:
partitioning a log storage partition in a non-volatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty;
judging whether the target equipment has a fault or not;
and if so, writing a target fault log corresponding to the fault into the log storage partition.
Optionally, writing the target fault log corresponding to the fault into the log storage partition includes:
generating the target fault log corresponding to the fault by using an operating system of the target equipment, and storing the target fault log into a temporary storage partition of a DDR memory;
and writing the target fault log in the temporary storage partition into the log storage partition by using a log monitoring program.
Optionally, the writing, by the log monitoring program, the target fault log in the temporary storage partition into the log storage partition includes:
inquiring the log storage amount in the temporary storage partition by using the log monitoring program;
and if the log storage amount is larger than a threshold value, writing all fault logs in the temporary storage partition into the log storage partition by using the log monitoring program.
Optionally, after writing all fault logs in the temporary storage partition into the log storage partition by using the log monitoring program, the method further includes:
clearing all fault logs in the temporary storage partition.
Optionally, before the operating system is started, the method further includes:
starting a bootstrap program of the operating system, and judging whether a fault log in a temporary storage partition of the DDR memory is effective or not by using the bootstrap program;
and if the failure log is valid, writing all the failure logs in the temporary storage partition into the log storage partition.
Optionally, after storing the target fault log in the temporary storage partition of the DDR memory, the method further includes:
judging whether the operating system needs to be restarted or not according to the fault type of the fault;
and if so, restarting the operating system of the target equipment.
Optionally, after writing the target fault log corresponding to the fault into the log storage partition, the method further includes:
judging whether the residual storage space of the log storage partition is lower than a preset size or not;
and if so, dividing the free space in the nonvolatile memory into the log storage partition.
The present application also provides a storage device for a fault log, the device including:
the device comprises a partitioning module, a storage module and a processing module, wherein the partitioning module is used for partitioning a log storage partition in a nonvolatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty;
the fault judgment module is used for judging whether the target equipment has faults or not;
and the log storage module is used for writing a target fault log corresponding to the fault into the log storage partition if the target equipment has the fault.
The application also provides a storage medium, on which a computer program is stored, and the computer program realizes the steps executed by the storage method of the fault log when executed.
The application also provides an electronic device, which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the steps executed by the storage method of the fault log when calling the computer program in the memory.
The application provides a storage method of a fault log, which comprises the following steps: partitioning a log storage partition in a non-volatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty; judging whether the target equipment has a fault or not; and if so, writing a target fault log corresponding to the fault into the log storage partition.
According to the method and the device, the log storage partition is divided in the nonvolatile memory of the target device, and the target fault log is written into the log storage partition when a fault occurs. The intersection of the log storage partition and the data partition where the file system is located is empty, that is, the log storage partition and the data partition which are used for storing the fault log are mutually independent, and the fault log storage of the log storage partition cannot be influenced by the fault of the file system. Therefore, the fault log storage operation provided by the application has the advantages that the dependence on the file system is eliminated, the influence of the file system fault on the fault log storage can be avoided, and the reliability of the fault log is improved. The application also provides a storage device, an electronic device and a storage medium of the fault log, and the storage device, the electronic device and the storage medium have the beneficial effects and are not repeated.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for storing a fault log according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a memory space division of a non-volatile memory according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a method for recording a fault log by a wireless communication module according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a storage device for a fault log according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a method for storing a fault log according to an embodiment of the present application.
The specific steps may include:
s101: partitioning a log storage partition in a non-volatile memory of a target device;
the embodiment can be applied to equipment such as a wireless communication module, a mobile phone, a set-top box and an intelligent sound box. The target device is provided with a nonvolatile memory, the nonvolatile memory can comprise a code partition and a data partition, and the embodiment divides a new space in the nonvolatile memory as a log storage partition.
Please refer to fig. 2, and fig. 2 is a schematic diagram illustrating a storage space division of a nonvolatile memory provided in an embodiment of the present application, where a code partition, a data partition, and a log storage partition in the nonvolatile memory are independent from each other, and a fault in the code partition and the data partition does not affect data reading and writing of the log storage partition. Further, the log storage partition may include a head pointer and a tail pointer, the space between the head pointer and the tail pointer being the data storage partition. When the data storage partition is first divided, a space of a preset size (e.g., 64M) may be set as the data storage partition; further, when the data storage partition is first partitioned, the size of the data storage partition may also be set to 0 (at which time the head and tail pointers coincide), and a new fault log may be written by moving the tail pointer of the data storage partition backward.
S102: judging whether the target equipment has a fault or not; if yes, entering S103; if not, ending the flow;
the failure may include a file system failure, an operating system failure, a hardware failure, a network failure, and the like, and a specific failure type is not performed here. If the target device is not in fault, the process can be ended, and whether the target device is in fault or not can be judged again after the preset time is delayed.
S103: and writing the target fault log corresponding to the fault into the log storage partition.
After determining that the target device has a fault, a target fault log corresponding to the fault may be generated, and the target fault log may be written into the log storage partition. Because the log storage partition and the data partition are two independent partitions in the nonvolatile memory, the writing of the target fault log cannot be influenced by the file system fault, and the fault log of the target equipment is saved.
In the embodiment, the log storage partition is divided in the nonvolatile memory of the target device, and the target failure log is written into the log storage partition when a failure occurs. The intersection of the log storage partition and the data partition where the file system is located is empty, that is, the log storage partition for storing the fault log and the data partition are independent from each other in this embodiment, and the fault log storage of the log storage partition is not affected by the fault of the file system. Therefore, the fault log storage operation provided by the embodiment eliminates the dependence on the file system, can avoid the influence of the file system fault on the fault log storage, and improves the reliability of the fault log.
By way of further introduction to the corresponding embodiment of FIG. 1, the target fault log may be written to the log storage partition by: generating the target fault log corresponding to the fault by using an operating system of the target equipment, and storing the target fault log into a temporary storage partition of a DDR memory; and writing the target fault log in the temporary storage partition into the log storage partition by using a log monitoring program. The log monitoring program is a program for log service in an operating system.
The DDR memory refers to a double-rate synchronous dynamic random access memory, and a region can be divided into the DDR memory in advance to serve as a temporary storage partition for temporarily storing fault logs. In this embodiment, an operating system may be used to detect a fault occurring in the target device, and if a fault is detected, a target fault log corresponding to the fault may be generated and stored in the temporary storage partition. The log monitoring program is used for monitoring the log storage condition in the temporary storage partition, and then writing the target fault log in the temporary storage partition into the log storage partition when the log storage condition meets the trigger condition. Specifically, the log storage amount in the temporary storage partition may be queried by using the log monitoring program; and if the log storage amount is larger than a threshold value, writing all fault logs in the temporary storage partition into the log storage partition by using the log monitoring program.
In the above manner, the fault log is stored in the temporary storage partition of the DDR memory, and then the plurality of fault logs in the temporary storage partition are written in the log storage partition of the nonvolatile memory in batch. According to the fault log storage mode, the DDR memory is used as a temporary storage position of the fault log, the fault log in the DDR memory is accumulated to a certain scale and then written into the nonvolatile memory, the writing frequency of the nonvolatile memory can be reduced through the mode, and the service life of the nonvolatile memory is prolonged.
As a possible implementation manner, after all the fault logs in the temporary storage partition are written into the log storage partition by using the log monitoring program, the present embodiment may also clear all the fault logs in the temporary storage partition, so as to ensure that the temporary storage partition has enough space to continue storing the fault logs.
As a possible implementation manner, after the target fault log is stored in the temporary storage partition of the DDR memory, whether the operating system needs to be restarted or not may also be determined according to the fault type of the fault; if yes, restarting the operating system of the target equipment; if not, the operating system continues to run.
Specifically, if the failed operating system crashes, the operating system may be restarted. When the operating system is restarted, the log monitoring program may not write the fault log in the temporary storage partition into the non-volatile memory in time, that is, when the operating system of the target device is restarted, the fault log which is not written into the non-volatile memory may still exist in the temporary storage partition. Accordingly, since the operating system needs to run the boot program first when being started, and both the operating system and the boot program can access the temporary storage partition of the DDR memory, the embodiment can write the fault log in the temporary storage partition into the nonvolatile memory by using the boot program of the operating system. The process of writing the fault log to the non-volatile memory using the boot program is as follows: before an operating system is started, starting a bootstrap program of the operating system, and judging whether a fault log in a temporary storage partition of the DDR memory is effective or not by using the bootstrap program; and if the fault log is valid, writing all fault logs in the temporary storage partition into a log storage partition of a nonvolatile memory. Through the process, the fault log can be written into the nonvolatile memory by using the log monitoring program when the operating system normally runs, and the fault log can be written into the nonvolatile memory by using the boot program after the operating system fails, so that the effect that the fault log can be written into the nonvolatile memory at different starting stages is achieved.
By way of further introduction to the corresponding embodiment of fig. 1, after writing the target failure log corresponding to the failure into the log storage partition, it may also be determined whether the remaining storage space of the log storage partition is lower than a preset size; and if so, dividing the free space in the nonvolatile memory into the log storage partition. By the method, the space size of the log storage partition in the nonvolatile memory can be dynamically adjusted, and the flexibility of fault log storage is improved.
The flow described in the above embodiment is explained below by an embodiment in practical use.
Along with the development of the concept of the intelligent automobile and the development of the cellular wireless communication technology, the cellular wireless communication module becomes an essential part of a novel intelligent automobile or an electric automobile, so that the automobile can be accessed into a cellular wireless network, and abundant functions are provided for an automobile owner. Meanwhile, with the development and progress of microelectronic technology and wireless communication, the design complexity of the wireless communication module is greatly improved, and the probability of the wireless communication module generating faults is greatly increased, so that the problem of fault location and fault repair by recording fault logs is particularly important. Currently, based on the consideration of security, when a car manufacturer designs a host corresponding to a wireless communication module, all debugging interfaces of the host are usually prohibited to prevent malicious intrusion by hackers. In this case, the wireless communication module can only rely on itself to log the fault.
In the process of recording the fault log of the wireless communication module, the operating system of the wireless communication module records the fault log in the data partition of the nonvolatile memory flash, but the process of storing the fault log can be realized only under the condition that the operating system and the file system have complete functions. If the fault is a fault of the data partition (for example, the file system of the data partition is damaged, so that the file system cannot be mounted) or a fault of the operating system, the functions of the operating system and the file system are incomplete, and the fault log cannot be recorded at this time, so that the problem that the fault cannot be traced and located is caused.
According to the above analysis, the conventional way for the wireless communication module to record the log needs to be implemented by relying on the upper operating system and the file system in a normal working state. If the file system or the operating system itself is corrupted, a situation may arise where the fault log cannot be recorded correctly. In view of the above problems, the present embodiment provides a method for recording a fault log by a wireless communication module, which can correctly and effectively record the fault log of a system when a file system and an operating system are crashed.
Referring to fig. 3, fig. 3 is a flowchart of a method for recording a fault log by a wireless communication module according to an embodiment of the present disclosure, before the method is executed, an area may be separately divided for the fault log in a Nand flash as a log storage partition, and an area may also be separately divided for the fault log in a DDR as a temporary storage partition. The operating system can store the fault log into the temporary storage partition, and the log storage partition is used for storing the fault log in the temporary storage partition so as to avoid data loss after the equipment is powered off. In the embodiment, the original Flash read-write operation is used for accessing data, so that the fault log storage does not depend on a file system. The temporary storage partition is an area in the DDR, so that a boot program and an operating system at the bottom layer can access the temporary storage partition, and the effect that the temporary storage partition can be accessed in different starting stages is achieved. The method for recording the fault log by the wireless communication module comprises the following steps:
step 1: starting the wireless communication module.
Step 2: a boot program of the operating system is run.
And step 3: reading a temporary storage partition of the DDR, and checking whether an effective fault log exists in the temporary storage partition; if yes, entering step 4; if not, go to step 5.
Specifically, the step of judging whether the fault log is valid specifically refers to checking the integrity of the fault log, and if the fault log exists in the temporary storage partition and the fault log is complete, it can be judged that the valid fault log exists. In order to judge the effectiveness of the fault log, the embodiment may add magic words at the beginning and end of each log; if the magic word is correct, the whole log is judged to be valid. In addition, a cyclic redundancy check (CRC check) mode may be adopted to calculate a CRC value of the entire fault log, compare the CRC value with a CRC attached to the tail, and determine validity according to a comparison result.
And 4, step 4: and writing all fault logs in the temporary storage partition into a log storage partition of the Nand flash.
Specifically, if the fault log in the temporary storage partition is valid, an exclusive log partition corresponding to the Nand flash is found through inquiry, and a tail pointer of the log storage partition is moved, so that the DDR log is written into the flash, and meanwhile, the fault log in the temporary storage partition is cleared. The log storage partition comprises a head pointer and a tail pointer, and the space between the head pointer and the tail pointer is a data storage partition.
And 5: an operating system is run.
The operating system may be a high-level operating system such as Linux and modem. After step 5 is executed, the fault handling flow of step 5.11, step 5.12 and step 5.13 may be executed, and the fault log storage flow of step 5.21, step 5.22 and step 5.23 may also be executed.
Step 5.11: and detecting a fault.
Step 5.12: and writing the fault log into a temporary storage partition of the DDR.
Step 5.13: judging whether the operating system needs to be restarted or not; if yes, entering step 1 to start the operation of the wireless communication module; if not, continuing to execute the operation of running the operating system in the step 5.
Specifically, the step may determine whether the os needs to be restarted according to the importance level of the fault.
Step 5.21: and running a log monitoring program.
Step 5.22: judging whether the number of fault logs in the temporary storage partition is larger than a threshold value or not; if yes, entering step 5.23; if not, the operation of step 5.21 is continued.
Step 5.23: and writing the fault log in the temporary storage partition into a log storage partition of the Nand flash, and emptying the fault log in the log storage partition.
The embodiment uses the shared DDR memory to cache the error log, and synchronously stores the fault log in the DDR into the Nand flash at a proper time so as to be permanently stored. By the method, errors under various conditions, such as operating system crash, starting errors, other parallel operating system errors and the like can be recorded. The scheme provides a reliable fault log storage scheme, can access any fault log related to an upper operating system, can record the fault log of the system without depending on an external host, and can store the fault log under the conditions of operating system breakdown and file system breakdown.
In the running process of the automobile, the wireless communication module using the scheme can record the error of the wireless communication module by the wireless communication module without depending on external conditions. The vehicle manufacturer can determine the fault log with higher occurrence frequency by scanning the fault log in the Nand flash at irregular intervals so as to feed the fault log back to the wireless module manufacturer to repair the problem.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a storage device of a fault log according to an embodiment of the present disclosure;
the apparatus may include:
a partition module 401, configured to divide a log storage partition in a nonvolatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty;
a failure determining module 402, configured to determine whether the target device fails;
a log storage module 403, configured to, if the target device has the fault, write a target fault log corresponding to the fault into the log storage partition.
In the embodiment, the log storage partition is divided in the nonvolatile memory of the target device, and the target failure log is written into the log storage partition when a failure occurs. The intersection of the log storage partition and the data partition where the file system is located is empty, that is, the log storage partition for storing the fault log and the data partition are independent from each other in this embodiment, and the fault log storage of the log storage partition is not affected by the fault of the file system. Therefore, the fault log storage operation provided by the embodiment eliminates the dependence on the file system, can avoid the influence of the file system fault on the fault log storage, and improves the reliability of the fault log.
Further, the log storage module 403 includes:
the temporary storage module is used for generating the target fault log corresponding to the fault by utilizing an operating system of the target equipment and storing the target fault log into a temporary storage partition of a DDR memory;
and the first writing module is used for writing the target fault log in the temporary storage partition into the log storage partition by using a log monitoring program.
Further, the first writing module is used for inquiring the log storage amount in the temporary storage partition by using the log monitoring program; and the log monitoring program is further used for writing all fault logs in the temporary storage partition into the log storage partition if the log storage amount is larger than a threshold value.
Further, the method also comprises the following steps:
and the log clearing module is used for clearing all fault logs in the temporary storage partition after all fault logs in the temporary storage partition are written into the log storage partition by using the log monitoring program.
Further, the method also comprises the following steps:
the second writing module is used for starting a bootstrap program of the operating system before the operating system is started, and judging whether a fault log in a temporary storage partition of the DDR memory is valid or not by using the bootstrap program; and if the failure log is valid, writing all the failure logs in the temporary storage partition into the log storage partition.
Further, the method also comprises the following steps:
the restarting module is used for judging whether the operating system needs to be restarted or not according to the fault type of the fault after the target fault log is stored in the temporary storage partition of the DDR memory; and if so, restarting the operating system of the target equipment.
Further, the method also comprises the following steps:
the space expansion module is used for judging whether the residual storage space of the log storage partition is lower than a preset size or not after the target fault log corresponding to the fault is written into the log storage partition; and if so, dividing the free space in the nonvolatile memory into the log storage partition.
Since the embodiment of the apparatus portion and the embodiment of the method portion correspond to each other, please refer to the description of the embodiment of the method portion for the embodiment of the system portion, which is not repeated here.
The present application also provides a storage medium having a computer program stored thereon, which when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method for storing a fault log, comprising:
partitioning a log storage partition in a non-volatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty;
judging whether the target equipment has a fault or not;
and if so, writing a target fault log corresponding to the fault into the log storage partition.
2. The method for storing the fault log according to claim 1, wherein writing the target fault log corresponding to the fault into the log storage partition comprises:
generating the target fault log corresponding to the fault by using an operating system of the target equipment, and storing the target fault log into a temporary storage partition of a DDR memory;
and writing the target fault log in the temporary storage partition into the log storage partition by using a log monitoring program.
3. The method for storing the fault log according to claim 2, wherein the writing the target fault log in the temporary storage partition into the log storage partition by using the log monitoring program comprises:
inquiring the log storage amount in the temporary storage partition by using the log monitoring program;
and if the log storage amount is larger than a threshold value, writing all fault logs in the temporary storage partition into the log storage partition by using the log monitoring program.
4. The method for storing the fault log according to claim 3, wherein after writing all fault logs in the temporary storage partition into the log storage partition by the log monitoring program, the method further comprises:
clearing all fault logs in the temporary storage partition.
5. The method for storing the fault log according to claim 2, further comprising, before the operating system is started:
starting a bootstrap program of the operating system, and judging whether a fault log in a temporary storage partition of the DDR memory is effective or not by using the bootstrap program;
and if the failure log is valid, writing all the failure logs in the temporary storage partition into the log storage partition.
6. The method for storing the fault log according to claim 2, wherein after storing the target fault log in the temporary storage partition of the DDR memory, the method further comprises:
judging whether the operating system needs to be restarted or not according to the fault type of the fault;
and if so, restarting the operating system of the target equipment.
7. The method for storing the fault log according to any one of claims 1 to 6, further comprising, after writing the target fault log corresponding to the fault into the log storage partition:
judging whether the residual storage space of the log storage partition is lower than a preset size or not;
and if so, dividing the free space in the nonvolatile memory into the log storage partition.
8. A fault log storage device, comprising:
the device comprises a partitioning module, a storage module and a processing module, wherein the partitioning module is used for partitioning a log storage partition in a nonvolatile memory of a target device; the nonvolatile memory further comprises a data partition where a file system is located, and the intersection between the log storage partition and the data partition is empty;
the fault judgment module is used for judging whether the target equipment has faults or not;
and the log storage module is used for writing a target fault log corresponding to the fault into the log storage partition if the target equipment has the fault.
9. An electronic device, comprising a non-volatile memory in which a computer program is stored, and a processor that implements the steps of the method for storing a fault log according to any one of claims 1 to 7 when calling the computer program in the non-volatile memory.
10. A storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, carry out the steps of a method of storing a fault log according to any one of claims 1 to 7.
CN202111288368.9A 2021-11-02 2021-11-02 Storage method and device of fault log, electronic equipment and storage medium Active CN113961151B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111288368.9A CN113961151B (en) 2021-11-02 2021-11-02 Storage method and device of fault log, electronic equipment and storage medium
PCT/CN2021/136304 WO2023077607A1 (en) 2021-11-02 2021-12-08 Fault log storage method and apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111288368.9A CN113961151B (en) 2021-11-02 2021-11-02 Storage method and device of fault log, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113961151A true CN113961151A (en) 2022-01-21
CN113961151B CN113961151B (en) 2024-04-02

Family

ID=79468780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111288368.9A Active CN113961151B (en) 2021-11-02 2021-11-02 Storage method and device of fault log, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113961151B (en)
WO (1) WO2023077607A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454954A (en) * 2022-08-31 2022-12-09 上海移柯通信技术股份有限公司 Data processing method, system and device and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070776A1 (en) * 2008-09-17 2010-03-18 Shankar Raman Logging system events
US20150153766A1 (en) * 2013-11-29 2015-06-04 Avigilon Corporation Camera supporting removable storage divided into multiple partitions
CN105900414A (en) * 2013-11-29 2016-08-24 威智伦公司 Camera supporting removable storage divided into multiple partitions
CN106371949A (en) * 2016-10-26 2017-02-01 北京四方继保自动化股份有限公司 Method for improving file processing speed of fault information processing device
CN107276789A (en) * 2017-05-19 2017-10-20 努比亚技术有限公司 Daily record method for uploading, device and computer-readable recording medium
CN110618892A (en) * 2019-09-19 2019-12-27 苏州浪潮智能科技有限公司 Bug positioning method and device for solid state disk, electronic equipment and medium
CN111858531A (en) * 2020-07-14 2020-10-30 苏州浪潮智能科技有限公司 Log storage method and system based on multi-core hard disk and related components
CN112000291A (en) * 2020-08-21 2020-11-27 苏州浪潮智能科技有限公司 System disk partitioning method and related device
CN113505014A (en) * 2021-06-09 2021-10-15 荣耀终端有限公司 Fault diagnosis file acquisition method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346265B (en) * 2013-07-29 2018-03-27 比亚迪股份有限公司 The acquisition methods and device of terminal device and its log information
US10705902B2 (en) * 2018-05-03 2020-07-07 Western Digital Technologies, Inc. Crash log storage and retrieval using boot partitions in solid state systems

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070776A1 (en) * 2008-09-17 2010-03-18 Shankar Raman Logging system events
US20150153766A1 (en) * 2013-11-29 2015-06-04 Avigilon Corporation Camera supporting removable storage divided into multiple partitions
CN105900414A (en) * 2013-11-29 2016-08-24 威智伦公司 Camera supporting removable storage divided into multiple partitions
CN106371949A (en) * 2016-10-26 2017-02-01 北京四方继保自动化股份有限公司 Method for improving file processing speed of fault information processing device
CN107276789A (en) * 2017-05-19 2017-10-20 努比亚技术有限公司 Daily record method for uploading, device and computer-readable recording medium
CN110618892A (en) * 2019-09-19 2019-12-27 苏州浪潮智能科技有限公司 Bug positioning method and device for solid state disk, electronic equipment and medium
CN111858531A (en) * 2020-07-14 2020-10-30 苏州浪潮智能科技有限公司 Log storage method and system based on multi-core hard disk and related components
CN112000291A (en) * 2020-08-21 2020-11-27 苏州浪潮智能科技有限公司 System disk partitioning method and related device
CN113505014A (en) * 2021-06-09 2021-10-15 荣耀终端有限公司 Fault diagnosis file acquisition method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454954A (en) * 2022-08-31 2022-12-09 上海移柯通信技术股份有限公司 Data processing method, system and device and electronic equipment

Also Published As

Publication number Publication date
WO2023077607A1 (en) 2023-05-11
CN113961151B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
US8539313B2 (en) System and method of data encoding
CN107943414B (en) File system partition and data read-write method of embedded Linux
EP1918939B1 (en) Semiconductor memory system for flash memory
KR101447786B1 (en) Power interrupt management
US8904244B2 (en) Heuristic approach for faster consistency check in a redundant storage system
US9690642B2 (en) Salvaging event trace information in power loss interruption scenarios
CN103678030A (en) Multi-system equipment start system and method thereof
CN102968353B (en) A kind of fail address disposal route and device
CN102890657A (en) Method for reducing data read-write errors of EEPROM (electrically erasable programmable read-only memory)
US10642731B2 (en) Memory management method and storage controller
WO2009156870A1 (en) Method and apparatus for error correction
US20210382660A1 (en) Apparatus and method for performing recovery operation of memory system
US9373347B2 (en) Data write management
CN113961151A (en) Fault log storage method and device, electronic equipment and storage medium
CN113641390B (en) System upgrading method, device, equipment and storage medium
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
US9785362B2 (en) Method and apparatus for managing corruption of flash memory contents
CN110222035A (en) A kind of efficient fault-tolerance approach of database page based on exclusive or check and journal recovery
CN113190182A (en) Management method for data storage in Flash
CN110348245B (en) Data integrity protection method, system and device based on NVM and storage medium
US9880926B1 (en) Log structured reserved zone for a data storage device
CN114356653A (en) Power-down protection method and device for industrial control firewall
TWI748214B (en) Flash memory controller, storage device and reading method thereof
CN112052112A (en) Bit flipping error detection method and device based on NOR Flash storage and storage medium
CN109683803B (en) Data processing method and device

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
TA01 Transfer of patent application right

Effective date of registration: 20220412

Address after: Edward of Luxembourg 15 Stephen Street

Applicant after: Ruiling wireless Co.,Ltd.

Address before: 518000 Room 102, block D, building 7, Shenzhen International Innovation Valley, Dashi 1st Road, Xili community, Xili street, Nanshan District, Shenzhen, Guangdong

Applicant before: Ruiling wireless communication technology (Shenzhen) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant