CN107526672B - Data recording method and device - Google Patents

Data recording method and device Download PDF

Info

Publication number
CN107526672B
CN107526672B CN201610455208.1A CN201610455208A CN107526672B CN 107526672 B CN107526672 B CN 107526672B CN 201610455208 A CN201610455208 A CN 201610455208A CN 107526672 B CN107526672 B CN 107526672B
Authority
CN
China
Prior art keywords
application process
application
area
black box
shared memory
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.)
Active
Application number
CN201610455208.1A
Other languages
Chinese (zh)
Other versions
CN107526672A (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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201610455208.1A priority Critical patent/CN107526672B/en
Publication of CN107526672A publication Critical patent/CN107526672A/en
Application granted granted Critical
Publication of CN107526672B publication Critical patent/CN107526672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3452Performance evaluation by statistical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system

Abstract

The invention relates to the field of multi-core operating systems, in particular to a method and a device for recording data, wherein the method comprises the steps of monitoring the running state of each application process through a main process in the application processes, and when any application process is determined to be abnormal, determining whether equipment needs to be reset according to attribute information of any application process; if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset; and if the equipment does not need to be reset, directly uploading the data in the preset shared memory area corresponding to any application process to the maintenance terminal, so that the black box and the shared memory are combined, the black box resource is effectively utilized, the recorded information quantity is improved, and the equipment operation efficiency is improved.

Description

Data recording method and device
Technical Field
The present invention relates to the field of multi-core operating systems, and in particular, to a method and an apparatus for data recording.
Background
Multiprocess tasks are now more and more widely used due to their independence, high reliability and distribution. For example, if a certain task is used as a process alone, and if a crash only affects its own services, other tasks are not affected, and if multiple tasks are processed in the same process by using multiple threads, if an unprocessed exception occurs in a certain thread, the whole process may be abnormal, and all tasks may be affected.
Generally, multiprocessing tasks are adapted to a multi-core and multi-machine distributed system, such as LINUX multi-core operating system, and during the running process of a device, information related to the running of the device needs to be recorded so as to provide effective data analysis when the device fails.
In the prior art, a method for recording relevant information of device operation is to record relevant information of device operation through a file.
The method specifically comprises the following steps: and recording the relevant information of the equipment operation through a real-time write file in the equipment operation process. The method comprises the steps of creating a file when equipment is initialized, writing information to be recorded into a corresponding file in the running process of the equipment, and storing the information to a server or a local place before the equipment is abnormal. When the storage is performed, there are two storage modes, one is storage on a hard disk, and the other is storage on a memory.
On the other hand, for a system with a high real-time requirement, files directly stored on the hard disk cannot meet the requirement of real-time operation of the system due to the limitation of the access speed of the hard disk. On the other hand, files stored in the memory need to be uploaded to a server or a designated storage device when the system crashes, which depends on communication and uploading opportunities, and if uploading is not triggered when the device is already abnormal or communication is abnormal when uploading, the recorded device operation information cannot be stored.
In the prior art, another method for recording relevant information of equipment operation is to record relevant information of equipment operation through a software black box.
The Software Black Box of the device consists of two parts, one is a Software Black Box Recorder (SBBR) which runs on each device and is responsible for recording various information during the running of the device (the information and the system management information of the SBBR are called Black Box data of the device together); the other is a Software Black Box Storage (SBBS) running on a server or a maintenance terminal, and is responsible for storing Black Box data of each device for analysis in fault location.
The method specifically comprises the following steps: referring to fig. 1, the SBBR is responsible for receiving User data from a black box User Interface (User Interface) and temporarily storing the User data on the black box daughter card, and transmits the black box data to the SBBS through a transmission Interface (Transfer Interface) at a specific time (typically, at the time of device reboot) and stores the black box data on a non-volatile medium (hard disk).
At present, the black box adopts an independent storage device, such as a Static random access memory (Static RAM, SRAM) or a Pseudo Static random access memory (Pseudo SRAM, PSRAM), to store data, and has the characteristic that the stored data is not influenced by power failure. However, the size of the common physical black box is affected by the device, for example, 4M or 8M, so that a black box with a limited size needs to be used by a plurality of processes, the memory allocated to each process is very limited, and the critical information before the device failure may not be recorded.
Disclosure of Invention
The embodiment of the invention provides a data recording method and device, which are used for improving the effectiveness and efficiency of data recording.
The embodiment of the invention provides the following specific technical scheme:
a method of data recording, comprising:
monitoring the running state of each application process through a main process in the application processes, and determining whether equipment needs to be reset or not according to the attribute information of any application process when any application process is determined to be abnormal;
if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset;
and if the device does not need to be reset, directly uploading the data in the preset shared memory area corresponding to any application process to the maintenance terminal.
In the embodiment of the invention, the running state of each application process is monitored through a main process in the application processes, and when any application process is determined to be abnormal, whether equipment needs to be reset is determined according to the attribute information of any application process; if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset; if the device does not need to be reset, the data in the preset shared memory area corresponding to any application process is directly uploaded to the maintenance terminal, so that the black box and the shared memory are combined to record the data, and when the application process is abnormal, the data recorded in the corresponding shared memory area is copied to the black box or uploaded to the maintenance terminal, so that the access frequency and resource competition of the black box are reduced, the black box resource is effectively utilized, the recorded information quantity is improved, and the device operation efficiency is improved.
Preferably, before monitoring the running state of each application process through a host process in the application processes, the method further includes:
dividing the black box into different areas, and recording the size of each area, wherein the divided different areas at least comprise an application process area;
and respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
Therefore, the black box is divided into different areas, and the operation efficiency of the equipment is improved by classifying and recording the information in the operation process of the equipment.
Preferably, before determining that any one of the application processes is abnormal, the method further comprises:
in the running process of the main process, recording the running information of the designated thread in the main process in a pre-divided application process area in a black box, and recording the running information of other threads except the designated thread in the main process in a preset shared memory area corresponding to the main process;
and recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
Therefore, the running information of the designated thread of the main process is recorded in the black box, so that important information can be ensured not to be lost when equipment fails; and the running information of other threads of the main process and the running information of the application process which is not the main process are recorded in the shared memory area, so that the access frequency and resource competition of the black box can be reduced, and the recorded information quantity is improved.
Preferably, the running information is recorded according to a preset same format.
Therefore, unified analysis can be conveniently carried out by adopting tools in the follow-up process, the analysis efficiency is improved, and the manual workload is reduced.
Preferably, after the device is reset and the copied data is uploaded to the maintenance terminal, the method further includes:
and clearing the data in the application process area pre-divided in the black box.
An apparatus for data recording, comprising:
the monitoring unit is used for monitoring the running state of each application process through a main process in the application processes, and when any application process is determined to be abnormal, whether equipment needs to be reset is determined according to the attribute information of any application process;
the first processing unit is used for copying data in a preset shared memory area corresponding to any one application process to a pre-divided application process area in a black box if the equipment needs to be reset is determined, and uploading the copied data to the maintenance terminal after the equipment is reset;
and the second processing unit is used for directly uploading the data in the preset shared memory area corresponding to any one application process to the maintenance terminal if the device does not need to be reset.
In the embodiment of the invention, the running state of each application process is monitored through a main process in the application processes, and when any application process is determined to be abnormal, whether equipment needs to be reset is determined according to the attribute information of any application process; if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset; if the device does not need to be reset, the data in the preset shared memory area corresponding to any application process is directly uploaded to the maintenance terminal, so that the black box and the shared memory are combined to record the data, and when the application process is abnormal, the data recorded in the corresponding shared memory area is copied to the black box or uploaded to the maintenance terminal, so that the access frequency and resource competition of the black box are reduced, the black box resource is effectively utilized, the recorded information quantity is improved, and the device operation efficiency is improved.
Preferably, before monitoring the running state of each application process through a host process in the application processes, the system further includes a partitioning unit configured to:
dividing the black box into different areas, and recording the size of each area, wherein the divided different areas at least comprise an application process area;
and respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
Therefore, the black box is divided into different areas, and the operation efficiency of the equipment is improved by classifying and recording the information in the operation process of the equipment.
Preferably, before determining that any one of the application processes is abnormal, the method further includes:
in the running process of the main process, recording the running information of the designated thread in the main process in a pre-divided application process area in a black box, and recording the running information of other threads except the designated thread in the main process in a preset shared memory area corresponding to the main process;
and recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
Therefore, the running information of the designated thread of the main process is recorded in the black box, so that important information can be ensured not to be lost when equipment fails; and the running information of other threads of the main process and the running information of the application process which is not the main process are recorded in the shared memory area, so that the access frequency and resource competition of the black box can be reduced, and the recorded information quantity is improved.
Preferably, the running information is recorded according to a preset same format.
Therefore, when a fault occurs, unified analysis can be performed by adopting tools, the analysis efficiency is improved, and the manual workload is reduced.
Preferably, after the device is reset and the copied data is uploaded to the maintenance terminal, the method further includes:
and clearing the data in the application process area pre-divided in the black box.
Drawings
FIG. 1 is a schematic block diagram of data recording by a software black box in the prior art;
FIG. 2 is a flowchart illustrating an exemplary embodiment of a method for recording data;
FIG. 3 is a detailed flowchart of a data recording method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
In order to improve effectiveness and efficiency when recording data, in the embodiment of the invention, a shared memory and a black box are combined when recording data, when any application process is determined to be abnormal, if equipment needs to be reset, data in a preset shared memory area corresponding to any application process is copied to a pre-divided application process area in the black box, and after the equipment is reset, the copied data is uploaded to a maintenance terminal; and if the device does not need to be reset, directly uploading the data in the preset shared memory area corresponding to any application process to the maintenance terminal.
The present invention will be described in detail with reference to specific examples, but it is to be understood that the present invention is not limited to the examples.
Referring to fig. 2, in the embodiment of the present invention, a specific process of the data recording method is as follows:
step 100: and monitoring the running state of each application process through a main process in the application processes, and when any application process is determined to be abnormal, determining whether equipment needs to be reset according to the attribute information of any application process.
In practice, for a multi-core operating system, when a plurality of same or different application processes are run, running information of each application process in the running process is recorded for analysis during fault location, so that not only the real-time requirement of the multi-core operating system needs to be met, but also the running information during fault occurrence needs to be recorded.
Before performing step 100, further comprising:
firstly, dividing the black box into different areas according to actual requirements, and recording the size of each area, wherein the divided different areas at least comprise an application process area.
For example, referring to table 1, assuming that the total size of the black box is 4M, the black box is divided into three areas, which are Area1 (drive process Area), Area 2 (application process Area), and Area 3 (reserved Area), respectively.
TABLE 1 Black box partition table
Figure BDA0001024647280000071
The Area1 is used to record relevant information of a driver process, the driver process mainly provides services for other application processes, and the size of the driver process is set to 1M, for example.
Area 2 is used to record the running information of each application process, and all application processes can share this Area, and the size is set to 2M, for example.
Area 3 is a reserved Area in which other information to be recorded can be recorded, and is set to 1M, for example.
Of course, the black box may be divided into the above three regions, or may be divided into other different regions according to actual requirements, and the sizes of the regions are set to be different.
Further, other information such as the start address of each divided area needs to be recorded, so that the corresponding area can be quickly found and the black box can be managed.
And then, respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
That is, each application process, including the host process and other application processes other than the host process, applies for the shared memory when starting, so that a shared memory area is allocated to each application process, where the size of the shared memory is the same as the size of the application process area in the black box.
When step 100 is executed, the method specifically includes:
firstly, the running state of each application process is monitored through a main process in the application processes.
For example, the host process may monitor the running status of each application process through a two-way heartbeat message.
Then, when any application process is determined to be abnormal, whether the device needs to be reset is determined according to the attribute information of any application process.
The attribute information here indicates the characteristic requirements of the application process, for example, for the host process, the device is generally required to be reset when the host process is abnormal.
Further, when each application process records running information during the running process before determining that any application process is abnormal, the following two cases can be distinguished:
in the first case: the application process is the master process.
In the running process of the main process, the running information of the designated thread in the main process is recorded in the application process area pre-divided in the black box, and the running information of other threads except the designated thread in the main process is recorded in the preset shared memory area corresponding to the main process.
Preferably, the designated thread is a thread representing important information and key information in the main process, for example, each thread in the main process has a corresponding ID, when the main process performs real-time recording in the running process, the ID of the thread is obtained first, whether the thread is the designated thread is judged, if yes, the thread is recorded in the application process area in the black box, otherwise, the thread is recorded in the corresponding shared memory area, so that only the important information of the main process is recorded in the black box, and other information is recorded in the shared memory area, which not only ensures that the important information is not lost, but also does not need to frequently access the black box in the running process of the main process, thereby improving the efficiency.
In the second case: the application process is not the master process.
And recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
In addition to the running information of the application program, the shared memory area may also record black box management information, that is, information such as the starting address and the size of the black box divided area.
Wherein, the running information is recorded according to the same preset format.
For example, the running information content that the user needs to store each time is stored as one record, each record is composed of a header and information, the header includes information such as a serial number and a timestamp, and the information is the running information content that the user needs to store.
Therefore, the same format is adopted for recording, so that when failure analysis is carried out subsequently, unified analysis can be carried out by adopting an automatic analysis tool, the large workload of manual data analysis is avoided, abnormal information can be directly extracted, and the working efficiency is greatly improved.
It should be noted that, since the size of the shared memory area is also limited, the recording can be performed by using a circular overwriting method.
Therefore, when no abnormity occurs, the running information of each application process except the main process is recorded in the shared memory, and is not required to be recorded in the black box, so that the access frequency and resource competition of the black box are reduced; and all application processes are not required to share a black box with the limited size, and each application process has a memory area, so that the recorded information amount is improved, and the access rate of the shared memory is high.
Step 110: and if the equipment needs to be reset, copying the data in the preset shared memory area corresponding to any one application process to the application process area pre-divided in the black box, and uploading the copied data to the maintenance terminal after the equipment is reset.
When step 110 is executed, the method specifically includes:
firstly, if the device needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box.
Specifically, a black box process may be separately provided for managing the black box and the shared memory area. Therefore, when the main process monitors that a certain application process is abnormal, whether equipment needs to be reset is determined, then the black box process is informed, and after the black box process receives an instruction, corresponding operation is carried out.
Thus, when the device needs to be reset, the data in the shared memory area is copied to the application process area in the black box through the black box process.
The reason is that the black box has the characteristic that the power failure does not affect the stored data, and the data in the shared memory area is not stored after the equipment is reset, namely, the equipment is restarted; moreover, the data is copied into the black box firstly, so that the problem that the recorded operation information cannot be obtained due to uploading failure caused by abnormal conditions that may occur when the data in the shared memory is directly uploaded to the maintenance terminal when the equipment needs to be restarted is solved.
Then, after the device is reset, the copied data is uploaded to the maintenance terminal.
Thus, when an abnormality occurs, the recorded operation information is not lost.
Further, after the device is reset and the copied data is uploaded to the maintenance terminal, the data in the pre-divided application process area in the black box is emptied, that is, the black box is reinitialized to start new recording.
Step 120: and if the device does not need to be reset, directly uploading the data in the preset shared memory area corresponding to any application process to the maintenance terminal.
According to step 110, similarly, the black box process receives the indication, determines that there is an application process abnormal, and does not need to reset the device, and directly uploads the data in the shared memory region corresponding to the abnormal application process to the maintenance terminal.
It should be noted that, if the main process is abnormal, the device is generally reset, but a situation that the device is not monitored in time may occur, at this time, because the running information of the designated thread of the main process is directly recorded in the black box, when the main process is abnormal, the part of the information is uploaded to the maintenance terminal, and in addition, for example, a dog feeding operation is performed in the main process, the watchdog may copy the running information recorded in the shared memory area by the main process to the application process area of the black box through a callback function, and upload the running information to the maintenance terminal after the device is reset.
The above embodiments are further described in detail below using a specific application scenario. Specifically, referring to fig. 3, in the embodiment of the present invention, the execution process of the data recording method is specifically as follows:
for a clearer description, the black box process, the main process and the application process (not including the main process) are divided and introduced separately.
1) For the host process.
Firstly, when the main process starts to run, initializing the black box, namely, partitioning the black box and emptying data recorded in the black box.
Then, task scheduling is carried out: and recording the running information of the designated thread in an application process area in the black box, and recording the running information of the other threads in the corresponding shared memory area.
The running information of the designated thread is important information and key information of the main process.
And then, monitoring the running state of each application process, judging whether the application process is normal or not, if so, continuing task scheduling, otherwise, further judging whether equipment needs to be reset or not, and informing the black box process.
And finally, if the equipment needs to be multiplexed, delaying the resetting of the equipment after the copying of the black box is finished, otherwise, restarting the abnormal application process.
2) For the black box process.
Firstly, when the black box process starts to run, whether data of an application process area in the black box needs to be uploaded or not is judged, if yes, the data are uploaded to a maintenance terminal, and if not, whether the application process is abnormal or not needs to be copied to the black box is judged continuously.
That is to say, when the device is started, the black box process starts to run, and when the black box process starts to run each time, it is determined whether data needs to be uploaded to the maintenance terminal, so that when the device is restarted when an abnormality occurs, the running information of the application process recorded before the device is restarted can be uploaded first.
And then, judging whether the equipment needs to be reset, if so, copying the data in the corresponding shared memory area to a black box, and otherwise, directly uploading the data in the corresponding shared memory area to a maintenance terminal.
In fact, the black box process will perform subsequent operations as soon as it receives the exception message notified by the host process, that is, the black box process will continuously determine whether the application process exception message is received and needs to upload the black box.
3) For application processes (not including the host process).
First, the application process starts running, and the black box is initialized.
Then, task scheduling is carried out: and recording the operation information in the corresponding shared memory area.
Based on the above embodiments, referring to fig. 4, in an embodiment of the present invention, a data recording apparatus specifically includes:
a monitoring unit 20, configured to monitor an operating state of each application process through a main process in the application processes, and when it is determined that any one of the application processes is abnormal, determine whether to reset the device according to attribute information of the any one of the application processes;
the first processing unit 21 is configured to copy, if it is determined that the device needs to be reset, data in a preset shared memory area corresponding to the any one application process to an application process area pre-divided in a black box, and upload the copied data to the maintenance terminal after the device is reset;
the second processing unit 22 is configured to, if it is determined that the device does not need to be reset, directly upload data in the preset shared memory area corresponding to the any one application process to the maintenance terminal.
Preferably, before monitoring the running state of each application process through the host process in the application processes, the method further includes a partitioning unit 23 configured to:
dividing the black box into different areas, and recording the size of each area, wherein the divided different areas at least comprise an application process area;
and respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
Preferably, before determining that any one of the application processes is abnormal, the method further includes a recording unit 24 configured to:
in the running process of the main process, recording the running information of the designated thread in the main process in a pre-divided application process area in a black box, and recording the running information of other threads except the designated thread in the main process in a preset shared memory area corresponding to the main process;
and recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
Preferably, the running information is recorded according to a preset same format.
Preferably, after the device is reset and the copied data is uploaded to the maintenance terminal, the method further includes a clearing unit 25 configured to:
and clearing the data in the application process area pre-divided in the black box.
In summary, in the embodiment of the present invention, the running state of each application process is monitored by a main process in the application processes, and when it is determined that any one application process is abnormal, whether the device needs to be reset is determined according to the attribute information of any one application process; if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset; if the device does not need to be reset, the data in the preset shared memory area corresponding to any application process is directly uploaded to the maintenance terminal, so that the black box and the shared memory are combined to record the data, and when the application process is abnormal, the data recorded in the corresponding shared memory area is copied to the black box or uploaded to the maintenance terminal, so that the access frequency and resource competition of the black box are reduced, the black box resource is effectively utilized, the recorded information quantity is improved, and the device operation efficiency is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (8)

1. A method of data recording, comprising:
monitoring the running state of each application process through a main process in the application processes, and determining whether equipment needs to be reset or not according to the attribute information of any application process when any application process is determined to be abnormal;
if the equipment needs to be reset, copying data in a preset shared memory area corresponding to any one application process to an application process area pre-divided in a black box, and uploading the copied data to a maintenance terminal after the equipment is reset;
if the device does not need to be reset, directly uploading data in a preset shared memory area corresponding to any one application process to a maintenance terminal;
before monitoring the running state of each application process through a main process in the application processes, the method further comprises the following steps:
dividing the black box into different areas, recording the size of each area and recording the initial address of each area, wherein the divided different areas at least comprise an application process area;
and respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
2. The method of claim 1, wherein prior to determining that any one of the application processes is anomalous, further comprising:
in the running process of the main process, recording the running information of the designated thread in the main process in a pre-divided application process area in a black box, and recording the running information of other threads except the designated thread in the main process in a preset shared memory area corresponding to the main process;
and recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
3. The method of claim 1 or 2, wherein the operation information is recorded in a predetermined same format.
4. The method of claim 1, wherein after uploading the replicated data to the maintenance terminal after the device is reset, further comprising:
and clearing the data in the application process area pre-divided in the black box.
5. An apparatus for data recording, comprising:
the monitoring unit is used for monitoring the running state of each application process through a main process in the application processes, and when any application process is determined to be abnormal, whether equipment needs to be reset is determined according to the attribute information of any application process;
the first processing unit is used for copying data in a preset shared memory area corresponding to any one application process to a pre-divided application process area in a black box if the equipment needs to be reset is determined, and uploading the copied data to the maintenance terminal after the equipment is reset;
the second processing unit is used for directly uploading data in a preset shared memory area corresponding to any one application process to the maintenance terminal if the fact that the equipment does not need to be reset is determined;
before monitoring the running state of each application process through a main process in the application processes, the method further comprises a partitioning unit, configured to:
dividing the black box into different areas, recording the size of each area and recording the initial address of each area, wherein the divided different areas at least comprise an application process area;
and respectively allocating a shared memory area with the same size as the application process area to each application process according to the size of the application process area, wherein at least the running information of the corresponding application process in the running process is recorded in the shared memory area.
6. The apparatus of claim 5, wherein prior to determining that any one of the application processes is anomalous, further comprising a logging unit to:
in the running process of the main process, recording the running information of the designated thread in the main process in a pre-divided application process area in a black box, and recording the running information of other threads except the designated thread in the main process in a preset shared memory area corresponding to the main process;
and recording the running information of each application process except the main process in a corresponding preset shared memory area in the running process of each application process except the main process.
7. The apparatus of claim 5 or 6, wherein the operation information is recorded in a predetermined same format.
8. The apparatus of claim 5, wherein after uploading the replicated data to the maintenance terminal after the device is reset, further comprising a flush unit to:
and clearing the data in the application process area pre-divided in the black box.
CN201610455208.1A 2016-06-21 2016-06-21 Data recording method and device Active CN107526672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610455208.1A CN107526672B (en) 2016-06-21 2016-06-21 Data recording method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610455208.1A CN107526672B (en) 2016-06-21 2016-06-21 Data recording method and device

Publications (2)

Publication Number Publication Date
CN107526672A CN107526672A (en) 2017-12-29
CN107526672B true CN107526672B (en) 2020-06-30

Family

ID=60733788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610455208.1A Active CN107526672B (en) 2016-06-21 2016-06-21 Data recording method and device

Country Status (1)

Country Link
CN (1) CN107526672B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108549591B (en) * 2018-03-02 2021-06-15 烽火通信科技股份有限公司 Black box device of embedded system and implementation method thereof
CN109922490B (en) * 2019-01-28 2022-01-28 广东中视信息科技有限公司 Data interruption-proof continuous transmission management system
CN112052243B (en) * 2020-09-08 2021-05-14 贵州乌江水电开发有限责任公司东风发电厂 Continuous waveform recording method based on database technology

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11143740A (en) * 1997-11-05 1999-05-28 Nec Eng Ltd Processing progress monitoring device and method therefor and recording medium
CN102547815B (en) * 2011-12-22 2017-11-24 中兴通讯股份有限公司 The realization device and method of black box of multi-mode base station
CN104216795A (en) * 2013-06-04 2014-12-17 上海联影医疗科技有限公司 Multiprocess protection system and implementation method thereof
CN104331359B (en) * 2014-11-03 2018-07-31 大唐移动通信设备有限公司 The recording method and device of exception information

Also Published As

Publication number Publication date
CN107526672A (en) 2017-12-29

Similar Documents

Publication Publication Date Title
US11693723B2 (en) Query watchdog
US7134054B2 (en) Method for monitoring fault of operating system and application program
US10505830B2 (en) Container monitoring configuration deployment
CN102981931B (en) Backup method and device for virtual machine
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
US10268695B2 (en) Snapshot creation
US9753809B2 (en) Crash management of host computing systems in a cluster
CN107526672B (en) Data recording method and device
JP2007133544A (en) Failure information analysis method and its implementation device
CN104216771A (en) Restarting method and device for software program
EP3499373B1 (en) Method and apparatus for processing process
CN112948169A (en) Data backup method, device, equipment and storage medium
CN103733181A (en) Fault processing in a system
US10599530B2 (en) Method and apparatus for recovering in-memory data processing system
CN111897626A (en) Cloud computing scene-oriented virtual machine high-reliability system and implementation method
CN115080309A (en) Data backup system, method, storage medium, and electronic device
CN115480924A (en) Method and device for processing job data, storage medium and electronic equipment
US10102052B2 (en) Dumping resources
CN113609199B (en) Database system, server, and storage medium
US11941448B2 (en) Allocating computing resources to data transfer jobs based on a completed amount and an estimated priority of system failure
US11847033B1 (en) Limiting blast radius for critical on-disk data corruptions in a distributed storage system
CN105302662B (en) Multi-machine backup method and system
CN111381969B (en) Management method and system of distributed software
JP6762450B2 (en) Resource controller, resource control method and resource control program
CN114816855A (en) HDFS system data processing method, device and medium

Legal Events

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