CN111124727A - Log processing method, device, equipment and storage medium - Google Patents

Log processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111124727A
CN111124727A CN201911273418.9A CN201911273418A CN111124727A CN 111124727 A CN111124727 A CN 111124727A CN 201911273418 A CN201911273418 A CN 201911273418A CN 111124727 A CN111124727 A CN 111124727A
Authority
CN
China
Prior art keywords
starting
log
state
equipment
software module
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
CN201911273418.9A
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.)
Comba Network Systems Co Ltd
Original Assignee
Comba Telecom Systems China 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 Comba Telecom Systems China Ltd filed Critical Comba Telecom Systems China Ltd
Priority to CN201911273418.9A priority Critical patent/CN111124727A/en
Publication of CN111124727A publication Critical patent/CN111124727A/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/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/0766Error or fault reporting or storing
    • G06F11/0787Storage of error reports, e.g. persistent data storage, storage using memory protection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a log processing method, a log processing device, equipment and a storage medium, wherein the equipment acquires the starting state of the equipment; the starting state comprises a normal starting completion state and an abnormal starting state; then, according to the starting state of the equipment, selecting and storing the logs of corresponding types; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state. By adopting the method, the requirement on the storage capacity of the equipment can be reduced, and the cost performance of log storage is improved; further, the device can analyze the abnormal starting of the device according to the log with higher content integrity, and obtain a more accurate analysis result.

Description

Log processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a log processing method, apparatus, device, and storage medium.
Background
In the field of embedded technology, information during operation is generally recorded by a logging device. The log level is generally divided into debugging, information, alarm, error and other levels from low to high. When the log information level of the equipment is set to a Debugging (DEBUG) level, the system outputs the log information of the debugging level and above; when the log information level is set as the alarm level, the system outputs the alarm level and the log information above. By analogy, the higher the log information level of the equipment is set, the less the output log information content is; when the log information level of the device is a debugging level, the output log information content is more complete. In the field of embedded technology, it is a common abnormal situation that an abnormality occurs in the device start-up stage. In order to locate the abnormal starting problem, more and more complete log information is generally needed for diagnosis and location.
In the conventional technology, there are two main log processing modes for the device, one of which is to record whether each module is successfully started and then report the start result, so that there is not enough log information for diagnosing the abnormal location condition when the device is abnormally restarted. The other is that when the device is started, the logs are all stored in a designated file or log collection system, so that the device needs enough log storage space or additional log storage devices are added, and the device cost is increased.
Therefore, a log processing method is needed, which can not only improve the cost performance of log storage of the device, but also ensure that more log information can be used for diagnosing problems when the device is abnormally started.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a log processing method, apparatus, device and storage medium for solving the above technical problems.
A log processing method, the method comprising:
acquiring a starting state of equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
selecting and storing logs of corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
In one embodiment, the device comprises a temporary log storage area and a formal log storage area; the temporary log storage area is used for storing all logs generated when the equipment is started; the method comprises the following steps of selecting and storing logs of corresponding types according to the starting state of the equipment, wherein the steps comprise:
transferring the corresponding type of logs in the temporary log storage area to a formal log storage area;
and clearing the temporary log storage area.
In one embodiment, the log comprises a debug log and a non-debug log; the step of selecting and storing the log of the corresponding type according to the starting state of the equipment comprises the following steps:
when the equipment is in a normal starting completion state, storing the non-debugging log;
and when the equipment is in an abnormal starting completion state, storing all logs.
In one embodiment, the boot process of the device includes sequential booting of a plurality of software modules; acquiring the starting state of the equipment, comprising the following steps:
and respectively acquiring the starting state of each software module in the equipment.
In one embodiment, selecting and storing logs of corresponding level types according to the starting state of the device includes:
and selecting and storing the logs of the types corresponding to the starting states of the software modules according to the starting states of the software modules in the equipment.
In one embodiment, acquiring the starting state of each software module in the device includes:
and for each software module, determining the starting state of the software module according to the starting time length of the software module.
In one embodiment, determining the starting state of the software module according to the starting duration of the software module includes:
when the software module is started, controlling the starting time length of the software module to start timing;
before the starting time exceeds a preset normal starting time threshold, judging whether a software module starting completion message is received or not;
if so, determining the starting state of the software module as a normal starting completion state;
if not, determining that the starting state of the software module is an abnormal starting state.
In one embodiment, the abnormal start comprises an abnormal start completion state and an abnormal start state; determining the starting state of the software module according to the starting duration of the software module, wherein the determining comprises the following steps:
before the starting time length exceeds a preset reset processing time threshold value, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal starting time threshold;
if so, determining the starting state of the software module as an abnormal starting completion state;
if not, restarting the equipment, and determining the starting state of each software module of the equipment as the non-starting state.
In one embodiment, controlling the start time duration of the software module to start timing when the software module starts includes:
receiving a message that a software module starts to be started;
setting the starting state of the software module to be not started;
and resetting the timer and controlling the starting time length of the software module to start timing.
A log processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring the starting state of the equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
the storage module is used for selecting and storing the logs of the corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
An apparatus comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the log processing method when executing the computer program.
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 above-mentioned log processing method
The log processing method, the log processing device, the log processing equipment and the log processing storage medium acquire the starting state of the log processing equipment; the starting state comprises a normal starting completion state and an abnormal starting state; then, according to the starting state of the equipment, selecting and storing the logs of corresponding types; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state. The equipment acquires the starting state, so that the corresponding type of logs can be stored according to the starting state, and when the equipment is in a normal starting completion state, the logs with lower content integrity can be stored, the requirement on the storage capacity of the equipment is reduced, and the cost performance of log storage is improved; and when the equipment is in the abnormal starting state, the equipment can store the log with higher content integrity, so that the equipment can analyze the abnormal starting of the equipment according to the stored log, and obtain a more accurate analysis result.
Drawings
FIG. 1 is a flow diagram that illustrates a method for log processing, according to one embodiment;
FIG. 2 is a flowchart illustrating a log processing method according to another embodiment;
FIG. 3 is a flowchart illustrating a log processing method according to another embodiment;
FIG. 4 is a schematic diagram of an apparatus in another embodiment;
FIG. 5 is a flowchart illustrating a log processing method according to another embodiment;
FIG. 6 is a flowchart illustrating a log processing method according to another embodiment;
FIG. 7 is a block diagram showing the structure of a log processing apparatus according to an embodiment;
FIG. 8 is a block diagram showing the construction of a log processing apparatus according to another embodiment;
FIG. 9 is a block diagram showing the construction of a log processing apparatus according to another embodiment;
fig. 10 is an internal structural view of the apparatus in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. 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.
The log processing method provided by the application can be applied to communication equipment and can also be applied to other equipment which can generate logs in operation. The communication device may be a base station device, a core network device, or the like; the Base Station device may be, but not limited to, a macro Base Station, a micro Base Station, a small Base Station, and other types of Base Station devices, and may be a Base Station (BTS) in global system for Mobile communication (GSM) or Code Division Multiple Access (CDMA), a Base Station (NodeB) in Wideband Code Division Multiple Access (WCDMA), an evolved Node B (eNB) or eNodeB) in LTE, a relay Station or an Access point, a Base Station in a future 5G network, a Customer Premise Equipment (CPE), and the like, without limitation.
In one embodiment, as shown in fig. 1, there is provided a log processing method including:
s101, acquiring a starting state of equipment; the startup state includes a normal startup completion state and an abnormal startup state.
The device may be a communication device, or may be other devices that can generate logs during operation, such as a computer device or an automation device. The communication device may be a base station device, a core network device, or a terminal user device; the base station device may be a baseband processing unit in a base station system, or may be a radio remote unit; the type of the above-mentioned apparatus is not limited herein.
The start-up state may be an operation state of a start-up program of the device after the device is powered on. The start-up state may be a state after the start-up program of the device runs once, or may be a state after the start-up program of the device runs for multiple times continuously, for example, after the start-up program of the device runs once and is not started successfully, the device may be automatically reset to restart, and the start-up state may be an operation state after the reset to restart.
The starting state may include a normal starting completion state and an abnormal starting state, and may also include a starting state, which is not limited herein.
When the device obtains the starting state, the device can judge according to the running time of the starting program, can judge according to the identification of the log file generated by the device, and can judge according to the physical parameters of the device during and after the running of the starting program; the manner of acquiring the activation state is not limited herein.
For example, the device may consider that the starting state of the device is an abnormal starting state when the running time of the starting program is too long; the equipment can also respectively output log files carrying different marks when the operation of the starting program is finished and the operation is abnormal, and then judge the starting state of the equipment according to the marks of the log files. In addition, the physical parameters of the device may change with the operation of the start-up program, for example, the normal current value when the base station device is powered on is a, the normal current value in the operation stage of the start-up program is B, when the operation of the start-up program is completed, the normal current value after the device is normally started may be C, and if the actual current value of the device does not match the current value, or the actual current value of the device is not changed from B to C, the device may be considered as being abnormally started.
S102, selecting and storing logs of corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
After the device obtains the starting state, the log of the corresponding type can be selected to be stored according to the starting state. The log refers to information generated in the operation process of the equipment, and plays an important role in maintaining the normal operation of the equipment.
The types of the logs can comprise debugging logs of the equipment, information logs of the equipment, alarm logs and error logs of the equipment and the like; for example, the device may obtain the startup state of the device, and then generate an information log or an error log as a result of the startup state to store. The various types of logs can be divided into log levels according to the called probability, and the log levels are sequentially from low to high: the debugging log, the information log, the alarm log and the error log are used, namely the debugging log has the lowest calling probability and the error log has the highest calling probability. When the equipment is in an abnormal starting state and the reason of the equipment abnormality cannot be diagnosed according to the information log or the error log, the reason of the abnormality can be analyzed by combining the logs with larger information amount and more complete content, such as a debugging log and the like.
Specifically, when the device selects the log of the corresponding type according to the starting state, the log with complete content can be selected under the abnormal starting state, and the log can include a debugging log, an alarm log and all logs; under the normal starting completion state, the equipment can select logs with high calling possibility, such as an alarm log and an error log, and can also select only an error log; the above selection is not limited herein.
Further, the device may store the corresponding type of log, and specifically, the device may include a temporary log storage area and a formal log storage area; when the device is started, all logs can be stored in the temporary log storage area, and after the log type corresponding to the starting state is selected, the logs of the corresponding type in the temporary log storage area can be transferred to the formal log storage area, and the temporary log storage area is cleared.
Optionally, the log comprises a debug log and a non-debug log; the log type corresponding to the normal starting completion state comprises a non-debugging log; the log type corresponding to the abnormal starting state comprises all logs. The non-debug log may include an information log, an alarm log, and an error log. When the equipment is in a normal starting completion state, the equipment can store the non-debugging log; when the device is in an abnormal starting completion state, the device can store all logs.
The log processing method obtains the starting state of the equipment; the starting state comprises a normal starting completion state and an abnormal starting state; then, according to the starting state of the equipment, selecting and storing the logs of corresponding types; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state. The equipment acquires the starting state, so that the corresponding type of logs can be stored according to the starting state, and when the equipment is in a normal starting completion state, the logs with lower content integrity can be stored, the requirement on the storage capacity of the equipment is reduced, and the cost performance of log storage is improved; and when the equipment is in the abnormal starting state, the equipment can store the log with higher content integrity, so that the equipment can analyze the abnormal starting of the equipment according to the stored log, and obtain a more accurate analysis result.
In one embodiment, the boot process of the device includes sequential booting of a plurality of software modules. When the starting state of the device is obtained, the starting state of each software module in the device can be obtained respectively.
Specifically, software modules in the device may be divided into a BOOT program (BOOT for short), an Operating System (Operating System, OS for short) and an Application program (APP for short), and after the device is powered on or restarted, the BOOT may be started first, the OS may be started through the BOOT, and the APP may be started through the OS finally.
When the device obtains the starting state, the starting state of each software module can be obtained respectively. The device can acquire the starting state of each software module through the logic processing unit, and can also query each starting state acquired by the logic processing unit through a log management module in the APP after the APP is started. The Logic processing unit may be implemented by a Programmable Logic Device (CPLD), or may be implemented by a single chip, which is not limited herein.
Further, the device may determine the start state of each software module according to the identifier of the log file generated during the operation of the software module, and optionally, for each software module, the device may determine the start state of the software module according to the start duration of the software module.
After the device obtains the starting state of each software module, the device can select and store the logs of the type corresponding to the starting state of each software module according to the starting state of each software module in the device.
For example, if the BOOT in the software module is in a normal BOOT completion state, the device may store a non-debug log generated during the operation of the BOOT, and if the OS is in an abnormal BOOT state, the device may store all logs generated during the operation of the OS.
According to the log processing method, the device stores the log types corresponding to the starting states of the software modules according to the starting states of the software modules, and the cost performance of log storage is further improved.
Fig. 2 is a schematic flowchart of a log processing method in another embodiment, which relates to a manner in which a device acquires a start state of a software module, and based on the foregoing embodiment, as shown in fig. 2, a process in which the device acquires the start state of each software module includes:
s201, when the software module is started, starting the starting time length timing of the software module.
The device can obtain the starting duration of the software module through the internal logic processing unit when the software module is started.
Specifically, the software module may send a start starting message to the logic processing unit when starting, and after receiving the start starting message of the software module, the logic processing unit in the device may set the start state of the software module to be not started, then clear a timer in the timing management module, and control the start duration to start timing.
S202, before the starting time length exceeds a preset normal starting time threshold, whether a software module starting completion message is received or not is judged.
The normal start time threshold of each software module may be the same or different.
Specifically, after the normal startup of the software module in the device is completed, a software module startup completion message may be issued to the logical processing unit. The device can compare the current starting time with a normal starting time threshold according to the change of the starting time, and judge whether a software module starting completion message is received before the starting time exceeds a preset normal starting time threshold.
And S203, if so, determining the starting state of the software module to be a normal starting completion state.
If the logic processing unit in the device receives the software module start completion message before the timing of the timer exceeds the preset normal start time threshold, that is, the start completion time of the software module is less than or equal to the preset normal start time threshold, the device may determine that the software module is in a normal start completion state.
And S204, if not, determining that the starting state of the software module is an abnormal starting state.
If the logic processing unit in the device does not receive the software module start completion message before the timing of the timer exceeds the preset normal start time threshold, that is, the software module is not started successfully within the normal start time threshold, the device may determine that the software module is in an abnormal start state.
According to the log processing method, the device judges whether the start completion message is received or not before the start duration of the software module reaches the preset normal start time threshold, so that the start state of the software module can be timely and accurately judged, logs of corresponding types can be selected to be stored according to the start state, and the cost performance of log storage is improved.
Fig. 3 is a schematic flowchart of a log processing method in another embodiment, which relates to a manner when a device determines that a start state of a software module is an abnormal start state, where the abnormal start state includes an abnormal start completion state and an abnormal non-start state, and based on the above embodiment, as shown in fig. 3, a process of the device acquiring the start state of each software module includes:
s301, before the starting duration exceeds a preset reset processing time threshold, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal boot time threshold.
The device may also set a reset processing time threshold for the software module, the reset processing time threshold being greater than the normal startup time threshold. After determining that the starting time duration of the software module is greater than the preset normal starting time threshold, the device may continue to time the starting time duration to determine whether to reset the module.
And S302, if yes, determining that the starting state of the software module is an abnormal starting completion state.
If the logic processing unit in the device receives the software module start completion message before the timing of the timer exceeds the preset reset processing time threshold, that is, the start completion time of the software module is less than or equal to the preset reset processing time threshold, the device considers that the software module is started completely, but exceeds the normal start duration threshold, and the software module can be determined to be in an abnormal start completion state.
And S303, if not, restarting the equipment, and determining the starting state of each software module of the equipment as a non-starting state.
If the timing of the timer exceeds the preset reset processing time threshold, the logic processing unit in the device does not receive the software module start completion message, that is, the software module is not started within the reset processing time threshold, the device needs to be reset, and the start state of each software module of the device can be determined to be the non-start state.
According to the log processing method, the device determines whether the software modules of the device are finally started according to the reset processing time threshold, and determines the starting state of each software module as an un-started state under the condition that the starting is not finished, so that the starting state of the software modules which can be acquired by the device is more accurate; furthermore, the equipment is automatically restarted under the condition that the software module is not started, so that the equipment can be restarted as soon as possible without manual reset.
In one embodiment, the above steps are explained by specific application scenarios. As shown in fig. 4, a processor, a non-volatile memory, a complex programmable logic device CPLD; the nonvolatile memory is divided into a temporary log storage area and a formal log storage area. The CPLD comprises a timing management module and a reset control module, wherein the timing management module is used for starting timing of the software module, recording the starting time of the software module, marking the related software module to be in an abnormal starting completion state when the starting time is greater than a preset normal starting time threshold, and marking the related software module not to be in an un-started state when the starting time is greater than a preset reset processing time threshold; the reset control module is used for resetting the processor when the software module is not started. When the software module is started on the processor, a software module starting message and a software module starting completion message are sent to the CPLD through a starting information channel between the processor and the CPLD; meanwhile, the log management module on the processor can also inquire the starting state information of the related module through the starting information channel. The startup information channel can use SPI interface channel, and also can use other communication links such as I2C, UART, CANBUS, etc.
After the device is powered on or restarted, the BOOT is started first, then the BOOT starts the OS, and finally the OS starts the APP, and the starting process is as shown in fig. 5. The starting time Tboot, Tos and Tapp of the 3 software modules and the corresponding starting states Sboot, Sos and Sapp are correspondingly recorded on the CPLD.
Taking the software module BOOT as an example, a BOOT state obtaining manner of the BOOT is described, as shown in fig. 6, a BOOT state obtaining process of the BOOT includes:
s401, receiving a message for starting a software module;
s402, setting the starting state of the software module to be not started;
s403, resetting the timer, and starting the starting time length timing of the software module;
s404, before the starting time exceeds a preset normal starting time threshold, judging whether a software module starting completion message is received or not; if yes, executing S405, otherwise executing S406;
s405, determining that the starting state of the software module is a normal starting completion state, and ending the process.
S406, before the starting time exceeds a preset reset processing time threshold, judging whether a software module starting completion message is received or not; if not, executing S407, if yes, executing S408;
s407, restarting the equipment, and determining the starting state of each software module of the equipment as an un-starting state;
s408, determining the starting state of the software module to be an abnormal starting completion state.
When each module is started, firstly, debugging logs and non-debugging logs are stored in a temporary log storage area, and after the log management submodule in the APP module is started, the CPLD can be inquired to obtain the starting state information of each module. If the starting state is 'normal starting completion', filtering out the debugging logs stored in the corresponding module log information of the temporary log storage area, and only transferring the non-debugging logs to the formal log storage area; and in the abnormal starting state, all the logs are transferred to the formal log storage area.
The implementation principle and implementation effect of the log processing method are similar to those of the above embodiments, and are not described herein again.
It should be understood that although the various steps in the flow charts of fig. 1-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided a log processing apparatus including: an acquisition module 10 and a storage module 20, wherein:
an obtaining module 10, configured to obtain a starting state of the device; the starting state comprises a normal starting completion state and an abnormal starting state;
the storage module 20 is used for selecting and storing the logs of the corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
The log processing device provided by the embodiment of the application can implement the method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
In one embodiment, as shown in fig. 8, on the basis of the above embodiment, the device includes a temporary log storage area and a formal log storage area; the temporary log storage area contains all logs generated when the device is started, and the storage module 20 includes:
a storage unit 201, configured to dump the corresponding type of log in the temporary log storage area to a formal log storage area;
and a clearing unit 202 for clearing the temporary log storage area.
In one embodiment, on the basis of the above embodiment, the log includes a debug log and a non-debug log; the storage module 20 is specifically configured to: when the equipment is in a normal starting completion state, storing the non-debugging log; and when the equipment is in an abnormal starting completion state, storing all logs.
In one embodiment, on the basis of the above-described embodiment, the boot process of the device includes sequential boot of a plurality of software modules; the obtaining module 10 is specifically configured to: and respectively acquiring the starting state of each software module in the equipment.
In an embodiment, on the basis of the above embodiment, the storage module 20 is specifically configured to: and selecting and storing the logs of the types corresponding to the starting states of the software modules according to the starting states of the software modules in the equipment.
In an embodiment, on the basis of the above embodiment, the obtaining module 10 is specifically configured to: and for each software module, determining the starting state of the software module according to the starting time length of the software module.
In an embodiment, as shown in fig. 9, on the basis of the above embodiment, the obtaining module 10 includes:
the control unit 101 is used for controlling the starting duration of the software module to start timing when the software module is started;
the judging unit 102 is configured to judge whether a software module start completion message is received before the start duration exceeds a preset normal start time threshold;
a first determining unit 103, configured to determine that a start state of the software module is a normal start completion state when receiving the software module start completion message;
the second determining unit 104 is configured to determine that the starting state of the software module is an abnormal starting state when the software module starting completion message is not received.
In an embodiment, on the basis of the above embodiment, the abnormal start includes an abnormal start completion state and an abnormal start state, and the obtaining module 10 is specifically configured to: before the starting time length exceeds a preset reset processing time threshold value, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal starting time threshold; if so, determining the starting state of the software module as an abnormal starting completion state; if not, restarting the equipment, and determining the starting state of each software module of the equipment as the non-starting state.
In an embodiment, on the basis of the above embodiment, the control unit 101 is specifically configured to: receiving a message that a software module starts to be started; setting the starting state of the software module to be not started; and resetting the timer and controlling the starting time length of the software module to start timing.
For the specific limitation of the log processing device, reference may be made to the above limitation on the log processing method, which is not described herein again. The respective modules in the log processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the device, and can also be stored in a memory in the device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a device is provided, the internal structure of which may be as shown in FIG. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the device is used to store log processing data. The network interface of the device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a log processing method.
Those skilled in the art will appreciate that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration relevant to the present teachings and does not constitute a limitation on the devices to which the present teachings may be applied, and that a particular device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided an apparatus comprising a memory and a processor, the memory having a computer program stored therein, the processor when executing the computer program implementing the steps of:
acquiring a starting state of equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
selecting and storing logs of corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
In one embodiment, an apparatus includes a temporary log storage area and a formal log storage area; the temporary log storage area contains all logs generated when the equipment is started; the processor, when executing the computer program, further performs the steps of: transferring the corresponding type of logs in the temporary log storage area to a formal log storage area; and clearing the temporary log storage area.
In one embodiment, the log includes a debug log and a non-debug log; the processor, when executing the computer program, further performs the steps of: when the equipment is in a normal starting completion state, storing the non-debugging log; and when the equipment is in an abnormal starting completion state, storing all logs.
In one embodiment, the boot process of the device includes sequential booting of a plurality of software modules; the processor, when executing the computer program, further performs the steps of: and respectively acquiring the starting state of each software module in the equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and selecting and storing the logs of the types corresponding to the starting states of the software modules according to the starting states of the software modules in the equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and for each software module, determining the starting state of the software module according to the starting time length of the software module.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the software module is started, controlling the starting time length of the software module to start timing; before the starting time exceeds a preset normal starting time threshold, judging whether a software module starting completion message is received or not; if so, determining the starting state of the software module as a normal starting completion state; if not, determining that the starting state of the software module is an abnormal starting state.
In one embodiment, the abnormal boot includes an abnormal boot completed state and an un-boot state; the processor, when executing the computer program, further performs the steps of: before the starting time length exceeds a preset reset processing time threshold value, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal starting time threshold; if so, determining the starting state of the software module as an abnormal starting completion state; if not, restarting the equipment, and determining the starting state of each software module of the equipment as the non-starting state.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving a message that a software module starts to be started; setting the starting state of the software module to be not started; and resetting the timer and controlling the starting time length of the software module to start timing.
The implementation principle and technical effect of the device provided by this embodiment are similar to those of the method embodiments described above, and are not described herein again.
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:
acquiring a starting state of equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
selecting and storing logs of corresponding types according to the starting state of the equipment; the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
In one embodiment, an apparatus includes a temporary log storage area and a formal log storage area; the temporary log storage area contains all logs generated when the equipment is started; the computer program when executed by the processor further realizes the steps of: transferring the corresponding type of logs in the temporary log storage area to a formal log storage area; and clearing the temporary log storage area.
In one embodiment, the log includes a debug log and a non-debug log; the computer program when executed by the processor further realizes the steps of: when the equipment is in a normal starting completion state, storing the non-debugging log; and when the equipment is in an abnormal starting completion state, storing all logs.
In one embodiment, the boot process of the device includes sequential booting of a plurality of software modules; the computer program when executed by the processor further realizes the steps of: and respectively acquiring the starting state of each software module in the equipment.
In one embodiment, the computer program when executed by the processor further performs the steps of: and selecting and storing the logs of the types corresponding to the starting states of the software modules according to the starting states of the software modules in the equipment.
In one embodiment, the computer program when executed by the processor further performs the steps of: and for each software module, determining the starting state of the software module according to the starting time length of the software module.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the software module is started, controlling the starting time length of the software module to start timing; before the starting time exceeds a preset normal starting time threshold, judging whether a software module starting completion message is received or not; if so, determining the starting state of the software module as a normal starting completion state; if not, determining that the starting state of the software module is an abnormal starting state.
In one embodiment, the abnormal boot includes an abnormal boot completed state and an un-boot state; the computer program when executed by the processor further realizes the steps of: before the starting time length exceeds a preset reset processing time threshold value, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal starting time threshold; if so, determining the starting state of the software module as an abnormal starting completion state; if not, restarting the equipment, and determining the starting state of each software module of the equipment as the non-starting state.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving a message that a software module starts to be started; setting the starting state of the software module to be not started; and resetting the timer and controlling the starting time length of the software module to start timing.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as 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 invention. 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 of log processing, the method comprising:
acquiring a starting state of equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
selecting and storing logs of corresponding types according to the starting state of the equipment; and the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
2. The log processing method according to claim 1, wherein the device includes a temporary log storage area and a formal log storage area; the temporary log storage area is used for storing all logs generated when the equipment is started; according to the starting state of the equipment, selecting and storing the logs of the corresponding types, wherein the step comprises the following steps:
transferring the logs of the corresponding types in the temporary log storage area to the formal log storage area;
and clearing the temporary log storage area.
3. The log processing method according to claim 2, wherein the log includes a debug log and a non-debug log; the step of selecting and storing the log of the corresponding type according to the starting state of the equipment comprises the following steps:
when the equipment is in a normal starting completion state, storing a non-debugging log;
and when the equipment is in an abnormal starting completion state, storing all logs.
4. A log processing method according to any of claims 1 to 3, wherein the start-up procedure of the device comprises sequential start-up of a plurality of software modules; the acquiring the starting state of the equipment comprises the following steps:
and respectively acquiring the starting state of each software module in the equipment.
5. The log processing method according to claim 4, wherein the selecting and storing logs of corresponding level types according to the startup state of the device comprises:
and selecting and storing logs of types corresponding to the starting states of the software modules according to the starting states of the software modules in the equipment.
6. The log processing method according to claim 4, wherein the obtaining the activation state of each software module in the device includes:
and for each software module, determining the starting state of the software module according to the starting duration of the software module.
7. The log processing method according to claim 6, wherein the abnormal boot includes an abnormal boot completed state and an un-boot state; the determining the starting state of the software module according to the starting duration of the software module includes:
before the starting time length exceeds a preset reset processing time threshold value, judging whether a software module starting completion message is received or not; the reset processing time threshold is greater than the normal start time threshold;
if so, determining that the starting state of the software module is an abnormal starting completion state;
if not, restarting the equipment, and determining the starting state of each software module of the equipment as an un-starting state.
8. A log processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the starting state of the equipment; the starting state comprises a normal starting completion state and an abnormal starting state;
the storage module is used for selecting and storing the logs of the corresponding types according to the starting state of the equipment; and the content integrity of the log stored in the abnormal starting state is higher than that of the log stored in the normal starting completion state.
9. An apparatus comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one 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 of any one of claims 1 to 7.
CN201911273418.9A 2019-12-12 2019-12-12 Log processing method, device, equipment and storage medium Pending CN111124727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911273418.9A CN111124727A (en) 2019-12-12 2019-12-12 Log processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911273418.9A CN111124727A (en) 2019-12-12 2019-12-12 Log processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111124727A true CN111124727A (en) 2020-05-08

Family

ID=70499831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911273418.9A Pending CN111124727A (en) 2019-12-12 2019-12-12 Log processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111124727A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468029A (en) * 2021-09-06 2021-10-01 成都数之联科技有限公司 Log management method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484593A (en) * 2016-09-29 2017-03-08 北京小米移动软件有限公司 Log processing method, device and electronic equipment
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109656786A (en) * 2018-12-27 2019-04-19 天弘基金管理有限公司 Journal obtaining method and device
CN110502494A (en) * 2019-08-30 2019-11-26 北京思维造物信息科技股份有限公司 Log processing method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484593A (en) * 2016-09-29 2017-03-08 北京小米移动软件有限公司 Log processing method, device and electronic equipment
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109656786A (en) * 2018-12-27 2019-04-19 天弘基金管理有限公司 Journal obtaining method and device
CN110502494A (en) * 2019-08-30 2019-11-26 北京思维造物信息科技股份有限公司 Log processing method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468029A (en) * 2021-09-06 2021-10-01 成都数之联科技有限公司 Log management method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN110290546B (en) Method and device for restarting and positioning base station, base station equipment and storage medium
CN104794016A (en) Mobile terminal crash testing and processing method and system
CN110851159B (en) Business rule updating method and device, computer equipment and storage medium
CN111611021A (en) Log data transmission method and device, computer equipment and storage medium
CN111124727A (en) Log processing method, device, equipment and storage medium
CN110096233B (en) Method and device for dynamically adapting back-end parameters based on solid state disk
CN109407646B (en) Vehicle fault data acquisition method and device, storage medium and management server
CN113190399A (en) Log storage method and device, computer equipment and storage medium
CN116015425B (en) Optical module control method and device, storage medium and electronic device
CN116668268A (en) Network repair method for terminal equipment, terminal equipment and storage medium
CN105791514B (en) Application starting monitoring method and device
CN110555017A (en) block chain data cleaning method and device, computer equipment and storage medium
CN115686899A (en) Terminal abnormity capture analysis method and device
CN113918423A (en) Cloud platform monitoring method and device and application thereof
CN109901998B (en) Resource recovery method, device, system, computer equipment and storage medium
CN109343792B (en) Storage space configuration method and device, computer equipment and storage medium
CN116756044B (en) RPC remote debugging method, device and application based on data link tracking
CN113110991A (en) Page element positioning method and device, storage medium and electronic device
CN110764940A (en) Processing method and device for service exception of distributed system
CN114385329B (en) Process management method and device, electronic device and readable storage medium
CN111372291A (en) Radio Resource Control (RRC) connection reestablishment method and device
CN109686394B (en) Nand Flash Phy parameter configuration method and device
CN113676244B (en) Control method and system based on satellite mobile communication terminal
CN114513765B (en) Data monitoring method, system, electronic device and storage medium
CN107484150B (en) EV-DO network connection method, device and terminal

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510663 Shenzhou Road 10, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangzhou, Guangdong

Applicant after: Jingxin Network System Co.,Ltd.

Address before: 510663 Shenzhou Road 10, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangzhou, Guangdong

Applicant before: COMBA TELECOM SYSTEMS (CHINA) Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200508