CN113886191B - Real-time tracking data processing method and device for automatic driving system - Google Patents

Real-time tracking data processing method and device for automatic driving system Download PDF

Info

Publication number
CN113886191B
CN113886191B CN202111243519.9A CN202111243519A CN113886191B CN 113886191 B CN113886191 B CN 113886191B CN 202111243519 A CN202111243519 A CN 202111243519A CN 113886191 B CN113886191 B CN 113886191B
Authority
CN
China
Prior art keywords
tracking
data
instance
backup
event
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
CN202111243519.9A
Other languages
Chinese (zh)
Other versions
CN113886191A (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.)
Beijing Qingzhou Zhihang Technology Co ltd
Original Assignee
Beijing Qingzhou Zhihang Technology Co ltd
Filing date
Publication date
Application filed by Beijing Qingzhou Zhihang Technology Co ltd filed Critical Beijing Qingzhou Zhihang Technology Co ltd
Priority to CN202111243519.9A priority Critical patent/CN113886191B/en
Publication of CN113886191A publication Critical patent/CN113886191A/en
Application granted granted Critical
Publication of CN113886191B publication Critical patent/CN113886191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention relates to a real-time tracking data processing method and device of an automatic driving system, wherein the method comprises the following steps: designating a first trace event; creating a plurality of identical first tracking instances for the first tracking event; creating an instance switching mark and a backup switch mark; starting all first tracking examples to carry out synchronous data tracking to generate first real-time tracking data; when the backup switch mark is switched to a starting state, the first real-time tracking data of the current backup instance is not changed any more; backing up the first real-time tracking data of the current backup instance to generate first backup data; adding an absolute time stamp to the first backup data to generate corresponding second backup data; performing data restoration on the second backup data to generate third backup data; and performing data page conversion on the third backup data to generate a first data page. The invention can reduce the data preparation time and improve the positioning efficiency and accuracy of the system fault.

Description

Real-time tracking data processing method and device for automatic driving system
Technical Field
The invention relates to the technical field of data processing, in particular to a real-time tracking data processing method and device of an automatic driving system.
Background
Ftrace is a Linux kernel event tracking tool based on a dynamic detection technology, which can acquire detailed system information of a Linux kernel event during running, so as to be used for analyzing the kernel performance of Linux. The prior art scheme generally takes a designated kernel event as a trace event, performs data trace on system information of the trace event based on Ftrace technology, and generates a corresponding trace log. After the tracking event is finished, offline performance analysis is performed based on the tracking log.
However, this mode of operation is not well suited for an autopilot system. After the automatic driving system is operated, the processing results output by the same task event in the system at different places and at different times are difficult to be consistent due to the difference of surrounding environments. In this case, it is difficult to implement post-event reproduction of the problem scene based on the trace log, and effective analysis is less likely.
Disclosure of Invention
The invention aims at overcoming the defects of the prior art, and provides a real-time tracking data processing method, a device, electronic equipment and a computer readable storage medium of an automatic driving system. According to the invention, during the operation of the automatic driving system, the real-time system information of each appointed system task event in different fault states can be effectively captured, so that timely and accurate field data are provided for subsequent or real-time fault analysis and performance analysis for processing. The invention can reduce the data preparation time and improve the positioning efficiency and accuracy of the system fault.
To achieve the above object, a first aspect of an embodiment of the present invention provides a method for processing real-time tracking data of an autopilot system, the method including:
recording the designated system task event as a first tracking event;
Creating a plurality of first tracking instances with identical configuration parameters for the first tracking event based on a specified software tracking technology; each first tracking instance corresponds to a first instance index;
creating a corresponding instance switching mark and a backup switch mark for the first tracking event; the instance switching mark comprises a current instance index and a backup instance index;
Starting all the first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event, and generating corresponding first real-time tracking data; in the process of synchronous data tracking, taking the first tracking instance corresponding to the current instance index as a current tracking instance, and only continuously generating a local tracking log file according to the first real-time tracking data of the current tracking instance, and writing a corresponding event start marker or event end marker into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run when the event type of the first tracking event is an autopilot event type;
When the backup switch mark is switched from a closing state to a starting state, setting the backup instance index according to the current instance index, selecting any one of the first instance indexes except the backup instance index to set the current instance index, taking the first tracking instance corresponding to the newly set backup instance index as a current backup instance, taking the first tracking instance corresponding to the newly set current instance index as a new current tracking instance, and stopping synchronous data tracking of the current backup instance on the first tracking event so that the first real-time tracking data of the current backup instance is not changed any more;
Backing up the first real-time tracking data of the current backup instance to generate corresponding first backup data, and resetting the backup switch mark to be in a closed state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp to the first backup data according to the first physical time to generate corresponding second backup data;
Performing data restoration processing on the second backup data to generate corresponding third backup data;
And carrying out data page conversion on the third backup data to generate a corresponding first data page.
Preferably, the software tracking technique includes Ftrace techniques.
Preferably, before the creating the plurality of first tracking instances with the same configuration parameters for the first tracking event, the method further includes:
if the event type of the first tracking event is the event type of the automatic driving system, binding the first tracking event with one or more designated CPU cores based on a core binding technology of the bottom operating system to the multi-core CPU.
Preferably, the creating a corresponding instance switch flag and a backup switch flag for the first tracking event specifically includes:
Creating the corresponding instance switch flag for the first trace event; optionally initializing the current instance index by one of the first instance indexes, and initializing the backup instance index to be empty;
Creating a corresponding backup switch flag for the first trace event; and initializing the backup switch mark to be in a closed state.
Preferably, the first backup data is composed of a plurality of first trace records; the first tracking record comprises a first CPU core identifier, a first relative timestamp and a first tracking content set;
The second backup data is composed of a plurality of second tracking records; the second trace record comprises a first absolute timestamp, a second CPU core identifier, a second relative timestamp and a second trace content set; the second CPU core identifier, the second relative timestamp, the second trace content set and the corresponding first CPU core identifier, the first relative timestamp and the first trace content set of the first trace record of the second trace record are consistent; the first absolute timestamp of the second trace record is a time sum of the first relative timestamp of the corresponding first trace record and the corresponding first physical time.
Preferably, the performing data repair processing on the second backup data to generate corresponding third backup data specifically includes:
effective data retention processing is carried out on the second backup data, and corresponding first effective backup data is generated;
When the event type of the first tracking event is the kernel event type, the first effective backup data is used as the third backup data;
When the event type of the first tracking event is an automatic driving system event type, checking whether the event end marker is missing in the first effective backup data; if the checking result is missing, adding the event end marker at the tail part of the first effective backup data to generate the third backup data; and if the checking result is that the first effective backup data is not missing, taking the first effective backup data as the third backup data.
Further, the effective data retention processing is performed on the second backup data to generate corresponding first effective backup data, which specifically includes:
Classifying the second tracking records of the second backup data according to the CPU core identifier to obtain a plurality of first classification record sequences; the second CPU core identifiers of the respective second trace records of each of the first sequence of classified records are identical;
Extracting the second relative time stamp with earliest time information in each first classification record sequence as the corresponding first sequence starting time; selecting the time closest to the current time from the obtained first sequence starting times as the effective recording reference time;
and deleting the second tracking record with the second relative timestamp earlier than the effective record reference time from the second backup data, thereby obtaining the first effective backup data.
A second aspect of an embodiment of the present invention provides an apparatus for performing the real-time tracking data processing method of the autopilot system described in the first aspect, the apparatus including: the system comprises a tracking instance configuration module, a first tracking instance processing module, a second tracking instance processing module, a tracking data processing module and a tracking data conversion module;
The tracking instance configuration module is used for recording the designated system task event as a first tracking event; creating a plurality of first tracking instances with the same configuration parameters for the first tracking event based on a specified software tracking technology; each first tracking instance corresponds to a first instance index;
The first tracking instance processing module is used for creating a corresponding instance switching sign and a backup switch sign for the first tracking event, wherein the instance switching sign comprises a current instance index and a backup instance index; starting all the first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event to generate corresponding first real-time tracking data; in the process of synchronous data tracking, taking the first tracking instance corresponding to the current instance index as a current tracking instance, and only continuously generating a local tracking log file according to the first real-time tracking data of the current tracking instance, and writing a corresponding event start marker or event end marker into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run when the event type of the first tracking event is an autopilot event type;
the second tracking instance processing module is configured to set the backup instance index according to the current instance index when the backup switch flag is switched from the off state to the on state, select any one of the first instance indexes except the backup instance index to set the current instance index, use the first tracking instance corresponding to the newly set backup instance index as a current backup instance, use the first tracking instance corresponding to the newly set current instance index as a new current tracking instance, and stop synchronous data tracking of the first tracking event by the current backup instance so that the first real-time tracking data of the current backup instance no longer changes;
The tracking data processing module is used for carrying out backup on the first real-time tracking data of the current backup instance to generate corresponding first backup data, and resetting the backup switch mark to be in a closed state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp to the first backup data according to the first physical time to generate corresponding second backup data; and performing data restoration processing on the second backup data to generate corresponding third backup data;
The tracking data conversion module is used for carrying out data page conversion on the third backup data to generate a corresponding first data page.
A third aspect of an embodiment of the present invention provides an electronic device, including: memory, processor, and transceiver;
the processor is configured to couple to the memory, and read and execute the instructions in the memory, so as to implement the method steps described in the first aspect;
The transceiver is coupled to the processor and is controlled by the processor to transmit and receive messages.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a computer, cause the computer to perform the instructions of the method of the first aspect.
The embodiment of the invention provides a real-time tracking data processing method, a device, electronic equipment and a computer readable storage medium of an automatic driving system, wherein a plurality of synchronous tracking examples are created for task events of the automatic driving system based on a software tracking technology, once the automatic driving system fails to trigger a backup switch, the current tracking example in the synchronous tracking examples is converted into the backup example to carry out tracking data backup, and other synchronous tracking examples are enabled to continuously execute tracking tasks. According to the invention, during the operation of the automatic driving system, the real-time system information of each appointed system task event in different fault states can be effectively captured, so that timely and accurate field data are provided for subsequent or real-time fault analysis and performance analysis for processing. The invention greatly reduces the preparation time of fault data and improves the positioning efficiency and accuracy of system faults.
Drawings
Fig. 1 is a schematic diagram of a real-time tracking data processing method of an autopilot system according to a first embodiment of the present invention;
Fig. 2 is a block diagram of a real-time tracking data processing device of an autopilot system according to a second embodiment of the present invention;
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
An embodiment of the present invention provides a method for processing real-time tracking data of an autopilot system, as shown in fig. 1, which is a schematic diagram of the method for processing real-time tracking data of the autopilot system, the method mainly includes the following steps:
step 1, recording a designated system task event as a first tracking event;
Wherein each first tracking event corresponds to an event name and an event type, and the event type comprises a kernel event type and an autopilot system event type.
Here, the system task event may be a class event level object of an operating system or an autopilot system, a function level object, or a specific process/thread level object. When the event type is the kernel event type, the corresponding task event is related to the event class, function and process of the underlying operating system, and the corresponding event name is the name information of the event class, function and process. When the event type is the event type of the automatic driving system, the corresponding task event is related to the event class, function and thread of the upper application of the operating system, namely the automatic driving system, and the corresponding event name is the name information of the event class, function and thread.
When the event type of the first tracking event is the event type of the automatic driving system, based on the corresponding event type, function and operation resource limitation of threads, one or more CPU cores are needed to be bound to the multi-core CPU; therefore, if the event type of the first trace event is an autopilot event type, the embodiment of the present invention needs to bind the first trace event with the specified one or more CPU cores based on the core binding technology of the underlying operating system to the multi-core CPU. The core binding technology is supported by corresponding core binding instructions on different operating systems, such as Windows, unix, linux, and will not be further described herein.
Step 2, based on a specified software tracking technology, creating a plurality of first tracking instances with the same configuration parameters for a first tracking event;
wherein each first tracking instance corresponds to a first instance index.
Here, there are a variety of different software trace technology frameworks and corresponding API sets for different operating systems that enable step 2 to create a plurality of identically configured trace instances for a given system task event, such as Ftrace technology under operating system Linux, systrace technology under Windows, etc.
When the specified software tracking technology is Ftrace, each first tracking instance is actually a Ftrace instance, and the configuration parameters of Ftrace instance can refer to technical data about Ftrace of creator StevenRostedt, which is not further described herein. Conventionally, the embodiment of the invention needs to configure the specified directory paths of all levels of files of Ftrace examples; performing event name (such as name information of class event/function/process/thread) configuration of the first trace event on Ftrace examples; performing a first trace event corresponding/binding CPU core configuration on Ftrace instances (only when the event type of the first trace event is an autopilot system event type); performing cache size configuration on Ftrace examples on different CPU cores; whether the Ftrace examples can carry out cyclic writing on occupied caches on the CPU core or not is configured; the tracer type of Ftrace examples is configured, and the specific content of different type tracking is different. It should be noted that, because the size of the resources required to be consumed by each first trace event can be obtained through experimental measurement in advance, when the buffer size configuration on different CPU cores is performed on the Ftrace instance, the embodiment of the present invention sets a total buffer size according to the known experimental resource size of the first trace event, and then allocates the total buffer size based on the on-chip memory ratio of different CPU cores corresponding to/bound with the first trace event to obtain a corresponding CPU single-core buffer size, and then sets the buffer sizes on the corresponding different CPU cores according to the obtained different CPU single-core buffer sizes.
The embodiment of the invention creates a plurality of first tracking examples with the same configuration parameters for the first tracking event, and simultaneously starts the plurality of first tracking examples in the subsequent steps, so that at least two or more first tracking examples of the first tracking event are tracked simultaneously, and the obtained tracking data are the same; when a plurality of first tracking examples synchronously track, the real-time tracking data can be backed up timely through a tracking example switching mechanism provided later, and the continuity and integrity of the whole tracking data can not be damaged.
Step 3, creating a corresponding instance switching mark and a backup switch mark for the first tracking event;
Wherein the instance switching mark comprises a current instance index and a backup instance index;
the method specifically comprises the following steps: step 31, creating a corresponding instance switching mark for the first tracking event; optionally initializing a first instance index to the current instance index, and initializing the backup instance index to be empty;
step 32, creating a corresponding backup switch mark for the first tracking event; the backup switch flag is initialized to an off state.
The embodiment of the invention provides a tracking instance switching mechanism, wherein the mechanism can select one of a plurality of first tracking instances of synchronous data tracking as a current tracking instance in advance; when the real-time tracking data backup is needed, the current tracking instance is switched to a backup instance, and the tracking data of the backup instance is frozen and is not updated continuously, so that the coincidence degree of the obtained real-time tracking data and the backup time point can be ensured; at the same time, one of the first tracking instances is selected as the current tracking instance, and the other first tracking instances are not frozen, so that the real-time tracking data continuously received by the first tracking instances are continuous and complete. The instance switching mark set in the step is the mark for confirming the current tracking instance and the backup instance by the instance switching mechanism, and the current tracking instance and the backup instance can be rapidly positioned by the mark; the backup switch flag set in this step starts the real-time trace data backup operation in the above-described instance switching mechanism once it is set to the start state.
Step 4, starting all the first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event, and generating corresponding first real-time tracking data; in the process of synchronous data tracking, a first tracking instance corresponding to the index of the current instance is used as the current tracking instance, a local tracking log file is continuously generated only according to the first real-time tracking data of the current tracking instance, and when the event type of the first tracking event is the event type of the automatic driving system, a corresponding event start marker or event end marker is written into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run.
Here, the purpose of starting all the first tracking instances to perform synchronous data tracking on the processing procedure of the first tracking event is to ensure the synchronicity of the real-time tracking data of all the first tracking events so as to switch the current tracking instance among the plurality of first tracking instances at any time.
The first real-time trace data is the sum of the cached real-time trace data of the first trace instance on the different CPU cores set in step 2; different software tracking techniques will create a corresponding temporary file or file interface locally, i.e. the first real-time tracking data is available through the content of the corresponding temporary file or file interface. The size of the first real-time tracking data corresponds to the preset total size of the caches on different CPU cores. When the specified software tracking technology is Ftrace, the buffer memory on the CPU core corresponding to each Ftrace instance and capable of being circularly emptied and rewritten is called ringbuffer, and the file interface corresponding to ringbuffer of each Ftrace instance is called trace file, that is to say, when the specified software tracking technology is Ftrace, the first real-time tracking data is actually the content of the corresponding trace file, the first real-time tracking data can be obtained by reading the content of the corresponding trace file, and the content of the trace file also changes along with the cycle emptying and rewriting of ringbuffer, so that the embodiment of the invention copies the current trace file to generate the previous trace file and resets the corresponding content of the current trace file when each ringbuffer is circularly emptied and rewritten, thereby ensuring the corresponding to ringbuffer and saving the data loss caused by limited buffer.
It should be noted that, in the embodiment of the present invention, although a plurality of first real-time tracking data may be obtained by running a plurality of first tracking instances at the same time, only the first real-time tracking data generated by the current tracking instance is continuously and locally backed up in the process of performing synchronous data tracking, so as to generate a local tracking log file. When the specified software tracking technology is specifically Ftrace technologies, the embodiment of the present invention continuously adds the content of the last trace file of the Ftrace instance corresponding to the current tracking instance to the locally preset tracking log file, so as to generate a complete real-time tracking data sum.
It should be noted that, in the process of tracking the synchronous data, for the first tracking event with the event type being the event type of the autopilot system, the embodiment of the present invention will force to add an event start marker or an event end marker into the first real-time tracking data generated synchronously, where the time point corresponding to the event start marker is the start operation time point of the first tracking event, and the time point corresponding to the event end marker is the end operation time point of the first tracking event. When the specified software tracking technology is particularly Ftrace technologies, ringbuffer of each Ftrace instance also corresponds to a trace_marker file, and the content of ringbuffer in the cache can be synchronously modified by modifying the content of the trace_marker file, so that the embodiment of the invention can complete the addition of the event start marker or the event end marker into ringbuffer by adding the event start marker or the event end marker into the trace_marker file, and the trace file is synchronous with the content of ringbuffer, so that the addition operation of the corresponding event start marker or the event end marker into the trace file is synchronously completed; that is, when the specified software tracking technology is specifically Ftrace technologies, the embodiment of the present invention implements the operation of writing the event start marker or the event end marker into the first real-time tracking data of the current tracking instance by adding the event start marker or the event end marker to the trace_marker file of the Ftrace instance corresponding to the current tracking instance.
And 5, when the backup switch mark is switched from the off state to the on state, setting a backup instance index according to the current instance index, selecting any one of the first instance indexes except the backup instance index to set the current instance index, taking the first tracking instance corresponding to the newly set backup instance index as the current backup instance, taking the first tracking instance corresponding to the newly set current instance index as the new current tracking instance, and stopping synchronous data tracking of the first tracking event by the current backup instance to ensure that the first real-time tracking data of the current backup instance is not changed any more.
Here, the backup switch flag defaults to the off state, and when the backup switch flag is switched from the off state to the on state, it is indicated that the system may malfunction, and real-time tracking data of the first tracking event currently tracked, that is, the first real-time tracking data generated by the current tracking instance, needs to be backed up in time as analysis data, and because the analysis data is closest to the malfunction time point, the timeliness and the accuracy are high. The operation of switching the backup switch flag from the off state to the on state is set by the underlying operating system or other functional modules of the autopilot system, and will not be further described herein.
When the backup switch flag is switched from the off state to the on state, embodiments of the present invention perform the following operations: setting the backup instance index as the current instance index, switching the current instance index to be the new first instance index, and freezing the first real-time tracking data of the current backup instance by stopping the synchronous data tracking of the current backup instance corresponding to the backup instance index on the first tracking event so as to avoid the change. At this time, the frozen first real-time tracking data is the real-time data closest to the fault time point, and has high analysis value. Meanwhile, the switching of the current tracking instance is completed through the setting of the index of the current instance, and because the first tracking instance continuously and synchronously operated does not stop, no obvious time interruption phenomenon occurs in the local tracking log file after the switching of the current tracking instance is completed, thereby achieving the operation effects of backing up and receiving real-time tracking data.
When the specified software tracking technology is particularly Ftrace technologies, the synchronous data tracking of the first tracking event by the current backup instance can be completed by using a corresponding tracking_off instruction, and ringbuffer of the Ftrace instance corresponding to the current backup instance is in a read-only state after the tracking_off instruction is executed, so that the purpose of freezing the first real-time tracking data is achieved.
Step 6, carrying out backup on the first real-time tracking data of the current backup instance to generate corresponding first backup data, and resetting the backup switch mark to be in a closed state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp into the first backup data according to the first physical time to generate corresponding second backup data;
Wherein the first backup data is composed of a plurality of first tracking records; the first tracking record comprises a first CPU core identifier, a first relative timestamp and a first tracking content set;
The second backup data is composed of a plurality of second tracking records; the second trace record includes a first absolute timestamp, a second CPU core identification, a second relative timestamp, and a second trace content set; the second CPU core identifier, the second relative timestamp and the second tracking content set of the second tracking record are consistent with the corresponding first CPU core identifier, the first relative timestamp and the first tracking content set of the first tracking record; the first absolute time stamp of the second trace record is a time sum of the first relative time stamp of the corresponding first trace record and the corresponding first physical time.
Here, the second backup data is the content of the first backup data, and a first absolute time stamp is added to each trace record therein. The detailed trace data in each first trace record is a first trace content set, and the first CPU core identification is identification information for identifying a specific CPU core of the multi-core CPU generating the corresponding first trace content set. If the first relative timestamp of the 1 st first trace record of the first backup data is taken as the starting time 0 point of the current first real-time trace data, an absolute time reference point of each trace record, namely the first absolute timestamp, can be obtained after the first relative timestamp and the first physical time, and the absolute timestamp is used for carrying out analysis related to absolute time on backup data generated by a plurality of systems or devices during data analysis.
Step 7, carrying out data restoration processing on the second backup data to generate corresponding third backup data;
The method specifically comprises the following steps: step 71, performing effective data retention processing on the second backup data to generate corresponding first effective backup data;
Here, since the buffer sizes may be set in advance on the designated respective CPU cores are not equal, or the number of processes performed on the designated respective CPU cores by the first trace event is not equal, there may be caused an inconsistency in the total length of the real-time trace data on the different CPU cores for the same first trace event, that is, there may occur that the real-time trace data on some CPU cores is empty at some point in time, which is not of analytical value; in this case, in order to ensure the data analyzability, in the embodiment of the present invention, the start time of the real-time tracking data on all the designated CPU cores is acquired, the start time closest to the current start time is selected as the start time of the effective data, that is, the effective recording reference time, and then the real-time tracking data whose time is before the effective recording reference time is deleted, so that it is ensured that the real-time tracking data on all the designated CPU cores is not empty within the time range corresponding to the remaining data;
the method specifically comprises the following steps: step 711, classifying the second tracking record of the second backup data according to the CPU core identifier to obtain a plurality of first classification record sequences; wherein, the second CPU core identifiers of the second tracking records of each first classification record sequence are the same;
the real-time tracking data on each appointed CPU core is counted, and the counting result is a first classification record sequence;
Step 712, extracting the second relative timestamp with earliest time information in each first classification record sequence as the corresponding first sequence start time; selecting the time closest to the current time from the obtained first sequence starting times as the effective recording reference time;
Here, the second relative timestamp with the earliest time information in each first classification record sequence is actually the start time of real-time tracking data on each designated CPU core; after the reference time is effectively recorded, the real-time tracking data on all the appointed CPU cores are not empty;
Step 713, deleting the second trace record with the second relative timestamp earlier than the effective record reference time from the second backup data, thereby obtaining the first effective backup data;
Step 72, when the event type of the first trace event is the kernel event type, the first valid backup data is used as the third backup data;
Here, the event type of the first trace event is a kernel event type, which indicates that the first trace event is actually one of task events of the underlying operating system, and because corresponding event start and end markers are not added to the task events during the task synchronous data trace, the event start and end markers are not required to be identified, and the first valid backup data consolidated in the step 71 is directly output as analysis data, where the analysis data is the third backup data;
Step 73, checking whether the event end marker is missing in the first valid backup data when the event type of the first tracking event is the autopilot system event type; if the checking result is missing, adding an event end marker at the tail part of the first effective backup data to generate third backup data; and if the checking result is that the first effective backup data is not missing, the first effective backup data is used as third backup data.
Here, the event type of the first trace event is one of task events of the autopilot system, which means that the first trace event is actually one of task events of the autopilot system, because when the synchronous data trace of the task is performed, corresponding event start and end markers are added to the task events, and when corresponding data analysis is performed, analysis data is required to be at least provided with the end markers, so that the first valid backup data sorted in step 71 is checked for the event end markers, if yes, the first valid backup data is directly output as analysis data, that is, third backup data, and if not, an event end marker is added to the tail, and then the first valid backup data is output as analysis data, that is, third backup data.
And 8, performing data page conversion on the third backup data to generate a corresponding first data page.
Here, when the data page conversion is performed on the third backup data, a corresponding hypertext markup language (Hyper Text Markup Language, HTML) page, that is, the first data page is generated using a preset trace data page conversion tool. Common trace data page translation tools herein include trace2html tools. Therefore, the first data page is displayed in a text and graphic mode through the browser, and a convenient data analysis interface can be provided for a user.
Fig. 2 is a block diagram of a real-time tracking data processing device of an autopilot system according to a second embodiment of the present invention, where the device is a terminal device or a server for implementing the foregoing method embodiment, or may be a device capable of enabling the foregoing terminal device or the server to implement the foregoing method embodiment, and for example, the device may be a device or a chip system of the foregoing terminal device or the server. As shown in fig. 2, the apparatus includes: trace instance configuration module 101, first trace instance processing module 102, second trace instance processing module 103, trace data processing module 104, and trace data conversion module 105.
The trace instance configuration module 101 is configured to record a specified system task event as a first trace event; creating a plurality of first tracking instances with the same configuration parameters for the first tracking event based on a specified software tracking technology; each first tracking instance corresponds to a first instance index.
The first tracking instance processing module 102 is configured to create a corresponding instance switch flag and backup switch flag for the first tracking event, where the instance switch flag includes a current instance index and a backup instance index; starting all first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event to generate corresponding first real-time tracking data; in the process of synchronous data tracking, a first tracking instance corresponding to the index of the current instance is used as the current tracking instance, a local tracking log file is continuously generated only according to the first real-time tracking data of the current tracking instance, and when the event type of the first tracking event is the event type of the automatic driving system, a corresponding event start marker or event end marker is written into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run.
The second tracking instance processing module 103 is configured to set a backup instance index according to a current instance index when the backup switch flag is switched from an off state to an on state, select any one of first instance indexes except the backup instance index to set the current instance index, use a first tracking instance corresponding to the newly set backup instance index as a current backup instance, use a first tracking instance corresponding to the newly set current instance index as a new current tracking instance, and stop synchronous data tracking of the current backup instance on the first tracking event so that first real-time tracking data of the current backup instance no longer changes.
The trace data processing module 104 is configured to backup the first real-time trace data of the current backup instance to generate corresponding first backup data, and reset the backup switch flag to an off state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp into the first backup data according to the first physical time to generate corresponding second backup data; and performing data restoration processing on the second backup data to generate corresponding third backup data.
The trace data conversion module 105 is configured to perform data page conversion on the third backup data to generate a corresponding first data page.
The real-time tracking data processing device of the automatic driving system provided by the embodiment of the invention can execute the method steps in the method embodiment, and the implementation principle and the technical effect are similar, and are not repeated here.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the trace instance configuration module may be a processing element that is set up separately, may be implemented in a chip of the above apparatus, or may be stored in a memory of the above apparatus in the form of program code, and may be called by a processing element of the above apparatus and execute the functions of the above determination module. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more digital signal processors (DIGITAL SIGNAL Processor, DSP), or one or more field programmable gate arrays (Field Programmable GATE ARRAY, FPGA), etc. For another example, when a module above is implemented in the form of processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a System-on-a-chip (SOC).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces, in whole or in part, the processes or functions described in connection with the foregoing method embodiments. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, fiber optic, digital subscriber line ((Digital Subscriber Line, DSL)), or wireless (e.g., infrared, wireless, bluetooth, microwave, etc.), or a wireless (e.g., infrared, wireless, bluetooth, microwave, etc.), the computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc., that contains an integration of one or more available media.
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. The electronic device may be the aforementioned terminal device or server, or may be a terminal device or server connected to the aforementioned terminal device or server for implementing the method of the embodiment of the present invention. As shown in fig. 3, the electronic device may include: a processor 301 (e.g., a CPU), a memory 302, a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiving actions of the transceiver 303. The memory 302 may store various instructions for performing the various processing functions and implementing the processing steps described in the method embodiments previously described. Preferably, the electronic device according to the embodiment of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to implement communication connections between the elements. The communication port 306 is used for connection communication between the electronic device and other peripheral devices.
The system bus 305 referred to in fig. 3 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface is used to enable communication between the database access apparatus and other devices (e.g., clients, read-write libraries, and read-only libraries). The Memory may include random access Memory (Random Access Memory, RAM) and may also include Non-Volatile Memory (Non-Volatile Memory), such as at least one disk Memory.
The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a network processor (Network Processor, NP), a graphics processor (Graphics Processing Unit, GPU), etc.; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
It should be noted that, the embodiments of the present invention also provide a computer readable storage medium, where instructions are stored, when the computer readable storage medium runs on a computer, to cause the computer to perform the method and the process provided in the above embodiments.
The embodiment of the invention also provides a chip for running the instructions, and the chip is used for executing the processing steps described in the embodiment of the method.
The embodiment of the invention provides a real-time tracking data processing method, a device, electronic equipment and a computer readable storage medium of an automatic driving system, wherein a plurality of synchronous tracking examples are created for task events of the automatic driving system based on a software tracking technology, once the automatic driving system fails to trigger a backup switch, the current tracking example in the synchronous tracking examples is converted into the backup example to carry out tracking data backup, and other synchronous tracking examples are enabled to continuously execute tracking tasks. According to the invention, during the operation of the automatic driving system, the real-time system information of each appointed system task event in different fault states can be effectively captured, so that timely and accurate field data are provided for subsequent or real-time fault analysis and performance analysis for processing. The invention greatly reduces the preparation time of fault data and improves the positioning efficiency and accuracy of system faults.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A method for processing real-time tracking data of an autopilot system, the method comprising:
recording the designated system task event as a first tracking event;
Creating a plurality of first tracking instances with identical configuration parameters for the first tracking event based on a specified software tracking technology; each first tracking instance corresponds to a first instance index;
creating a corresponding instance switching mark and a backup switch mark for the first tracking event; the instance switching mark comprises a current instance index and a backup instance index;
Starting all the first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event, and generating corresponding first real-time tracking data; in the process of synchronous data tracking, taking the first tracking instance corresponding to the current instance index as a current tracking instance, and only continuously generating a local tracking log file according to the first real-time tracking data of the current tracking instance, and writing a corresponding event start marker or event end marker into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run when the event type of the first tracking event is an autopilot event type;
When the backup switch mark is switched from a closing state to a starting state, setting the backup instance index according to the current instance index, selecting any one of the first instance indexes except the backup instance index to set the current instance index, taking the first tracking instance corresponding to the newly set backup instance index as a current backup instance, taking the first tracking instance corresponding to the newly set current instance index as a new current tracking instance, and stopping synchronous data tracking of the current backup instance on the first tracking event so that the first real-time tracking data of the current backup instance is not changed any more;
Backing up the first real-time tracking data of the current backup instance to generate corresponding first backup data, and resetting the backup switch mark to be in a closed state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp to the first backup data according to the first physical time to generate corresponding second backup data;
Performing data restoration processing on the second backup data to generate corresponding third backup data;
And carrying out data page conversion on the third backup data to generate a corresponding first data page.
2. The method of claim 1, wherein the software tracking technique comprises Ftrace techniques.
3. The method of processing real-time tracking data for an autopilot system of claim 1 wherein prior to said creating a plurality of first tracking instances for the first tracking event that have identical configuration parameters, the method further comprises:
if the event type of the first tracking event is the event type of the automatic driving system, binding the first tracking event with one or more designated CPU cores based on a core binding technology of the bottom operating system to the multi-core CPU.
4. The method for processing real-time tracking data of an autopilot system according to claim 1, wherein said creating a corresponding instance switch flag and backup switch flag for said first tracking event specifically comprises:
Creating the corresponding instance switch flag for the first trace event; optionally initializing the current instance index by one of the first instance indexes, and initializing the backup instance index to be empty;
Creating a corresponding backup switch flag for the first trace event; and initializing the backup switch mark to be in a closed state.
5. The method for processing real-time tracking data of an autopilot system of claim 1 wherein,
The first backup data is composed of a plurality of first tracking records; the first tracking record comprises a first CPU core identifier, a first relative timestamp and a first tracking content set;
The second backup data is composed of a plurality of second tracking records; the second trace record comprises a first absolute timestamp, a second CPU core identifier, a second relative timestamp and a second trace content set; the second CPU core identifier, the second relative timestamp, the second trace content set and the corresponding first CPU core identifier, the first relative timestamp and the first trace content set of the first trace record of the second trace record are consistent; the first absolute timestamp of the second trace record is a time sum of the first relative timestamp of the corresponding first trace record and the corresponding first physical time.
6. The method for processing real-time tracking data of an autopilot system according to claim 5, wherein the performing data repair processing on the second backup data generates corresponding third backup data, specifically comprising:
effective data retention processing is carried out on the second backup data, and corresponding first effective backup data is generated;
When the event type of the first tracking event is the kernel event type, the first effective backup data is used as the third backup data;
When the event type of the first tracking event is an automatic driving system event type, checking whether the event end marker is missing in the first effective backup data; if the checking result is missing, adding the event end marker at the tail part of the first effective backup data to generate the third backup data; and if the checking result is that the first effective backup data is not missing, taking the first effective backup data as the third backup data.
7. The method for processing real-time tracking data of an autopilot system according to claim 6, wherein the performing effective data retention processing on the second backup data generates corresponding first effective backup data, specifically comprising:
Classifying the second tracking records of the second backup data according to the CPU core identifier to obtain a plurality of first classification record sequences; the second CPU core identifiers of the respective second trace records of each of the first sequence of classified records are identical;
Extracting the second relative time stamp with earliest time information in each first classification record sequence as the corresponding first sequence starting time; selecting the time closest to the current time from the obtained first sequence starting times as the effective recording reference time;
and deleting the second tracking record with the second relative timestamp earlier than the effective record reference time from the second backup data, thereby obtaining the first effective backup data.
8. An apparatus for performing the real-time tracking data processing method of an autopilot system of any one of claims 1 to 7, characterized in that the apparatus comprises: the system comprises a tracking instance configuration module, a first tracking instance processing module, a second tracking instance processing module, a tracking data processing module and a tracking data conversion module;
The tracking instance configuration module is used for recording the designated system task event as a first tracking event; creating a plurality of first tracking instances with the same configuration parameters for the first tracking event based on a specified software tracking technology; each first tracking instance corresponds to a first instance index;
The first tracking instance processing module is used for creating a corresponding instance switching sign and a backup switch sign for the first tracking event, wherein the instance switching sign comprises a current instance index and a backup instance index; starting all the first tracking examples to carry out synchronous data tracking on the processing process of the first tracking event to generate corresponding first real-time tracking data; in the process of synchronous data tracking, taking the first tracking instance corresponding to the current instance index as a current tracking instance, and only continuously generating a local tracking log file according to the first real-time tracking data of the current tracking instance, and writing a corresponding event start marker or event end marker into the first real-time tracking data of the current tracking instance when the first tracking event starts to run or ends to run when the event type of the first tracking event is an autopilot event type;
the second tracking instance processing module is configured to set the backup instance index according to the current instance index when the backup switch flag is switched from the off state to the on state, select any one of the first instance indexes except the backup instance index to set the current instance index, use the first tracking instance corresponding to the newly set backup instance index as a current backup instance, use the first tracking instance corresponding to the newly set current instance index as a new current tracking instance, and stop synchronous data tracking of the first tracking event by the current backup instance so that the first real-time tracking data of the current backup instance no longer changes;
The tracking data processing module is used for carrying out backup on the first real-time tracking data of the current backup instance to generate corresponding first backup data, and resetting the backup switch mark to be in a closed state after the backup is completed; taking the backup system time as a first physical time, and adding an absolute timestamp to the first backup data according to the first physical time to generate corresponding second backup data; and performing data restoration processing on the second backup data to generate corresponding third backup data;
The tracking data conversion module is used for carrying out data page conversion on the third backup data to generate a corresponding first data page.
9. An electronic device, comprising: memory, processor, and transceiver;
The processor being adapted to be coupled to the memory, read and execute the instructions in the memory to implement the method steps of any one of claims 1-7;
The transceiver is coupled to the processor and is controlled by the processor to transmit and receive messages.
10. A computer readable storage medium storing computer instructions which, when executed by a computer, cause the computer to perform the instructions of the method of any one of claims 1-7.
CN202111243519.9A 2021-10-25 Real-time tracking data processing method and device for automatic driving system Active CN113886191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111243519.9A CN113886191B (en) 2021-10-25 Real-time tracking data processing method and device for automatic driving system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111243519.9A CN113886191B (en) 2021-10-25 Real-time tracking data processing method and device for automatic driving system

Publications (2)

Publication Number Publication Date
CN113886191A CN113886191A (en) 2022-01-04
CN113886191B true CN113886191B (en) 2024-07-12

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461931A (en) * 2014-08-18 2015-03-25 记忆科技(深圳)有限公司 Method for output processing of trace logs of multi-kernel storage device and multi-kernel environment
CN106062742A (en) * 2013-12-30 2016-10-26 赛门铁克公司 Systems and methods for improving snapshot performance

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106062742A (en) * 2013-12-30 2016-10-26 赛门铁克公司 Systems and methods for improving snapshot performance
CN104461931A (en) * 2014-08-18 2015-03-25 记忆科技(深圳)有限公司 Method for output processing of trace logs of multi-kernel storage device and multi-kernel environment

Similar Documents

Publication Publication Date Title
CN107506300B (en) User interface testing method, device, server and storage medium
CN109815141B (en) Test method and device
CN110597704B (en) Pressure test method, device, server and medium for application program
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN113190220A (en) JSON file differentiation comparison method and device
CN109101412B (en) Test file generation method, test file generation device, test file testing method, test file testing device, storage medium and computer equipment
US10915426B2 (en) Intercepting and recording calls to a module in real-time
CN112540808A (en) Method for recording program behavior level calling relation and related equipment
CN112789602A (en) Reverse debugging of software failures
CN117785723A (en) Dynamic interface parameter association method and device and electronic equipment
CN112559525B (en) Data checking system, method, device and server
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN113886191B (en) Real-time tracking data processing method and device for automatic driving system
CN112685316A (en) Code execution path acquisition method and device, computer equipment and storage medium
CN115827636A (en) Method for storing and reading simulation data of logic system design from waveform database
CN110968339A (en) Method and device for front-end construction tool and electronic equipment
CN114168456A (en) Front-end performance automatic testing method based on 3D-GIS
CN115373929A (en) Test method, device, equipment, readable storage medium and program product
CN113886191A (en) Real-time tracking data processing method and device of automatic driving system
CN113987044A (en) Asset data import processing method and device and electronic equipment
CN113220586A (en) Automatic interface pressure test execution method, device and system
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN111338956A (en) Automatic pressure measurement method, device, equipment and storage medium
CN110750569A (en) Data extraction method, device, equipment and storage medium
CN116662140B (en) Automatic acquisition and playback method, device and equipment for simulation data

Legal Events

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