Running state admission and event analysis system based on embedded operating system

By designing an operating state admission and event analysis system based on an embedded operating system, the problems of low universality and inconvenience in existing software are solved, and the operation state admission and event analysis of the embedded operating system are realized, ensuring the real-time nature of the system.

CN119829312AActive Publication Date: 2025-04-15BEIJING INST OF COMP TECH & APPL
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411696532.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-15
Estimated Expiration
2044-11-25

Smart Images

  • Figure CN119829312A_ABST
    Figure CN119829312A_ABST
Patent Text Reader

Abstract

The invention relates to a running state admission and event analysis system based on an embedded operating system, and belongs to the field of embedded system testing. According to the invention, the operation states of control events, task events, semaphore events, message queue events, timer events, other extension events and user-defined events are recorded and collected, and the collected events are uploaded and analyzed; and finally, graphically displaying the event information and the event interaction sequence in the operation of the embedded system application program on a development environment interface. Meanwhile, the external interference is reduced by adopting the methods of controlling the collected data volume, combining dynamic and static buffer area distribution, configuring the uploading task, adopting a timestamp driving program and the like, and the real-time requirement of the embedded operating system is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of embedded system testing, and in particular relates to a running status recording and event analysis system based on an embedded operating system. Background Art

[0002] In recent years, with the rapid development of embedded technology, embedded products have been widely used in aviation, aerospace, communications, military and other fields. The demand for testing and analysis of embedded products has gradually increased. There is an urgent need for an operation status recording and event analysis system based on an embedded operating system, which can collect and store multiple digital signals, analyze the collected signals, and intuitively display the timing relationship between signals, so as to facilitate the analysis and location of abnormal problems.

[0003] More complex embedded real-time software systems are built on top of real-time operating systems, which are managers of the entire system resources. If you can record what system calls an application uses and when, and how the real-time operating system schedules the application, you can understand how a real-time system actually works.

[0004] The current operating status recording and event analysis software has the disadvantages of low universality and inconvenient operation. It is necessary to develop products with simpler structure and more stable operating performance to upgrade the products. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] The technical problem to be solved by the present invention is how to provide a running status recording and event analysis system based on an embedded operating system to solve the problems of low universality and inconvenient operation of existing running status recording and event analysis software.

[0007] (II) Technical solution

[0008] In order to solve the above technical problems, the present invention proposes a running status recording and event analysis system based on an embedded operating system, the system comprising: a network and serial port transmission module, an event message upload task, a buffer management module, an event collection module, an event recording module, a data analysis and processing module, an interface display module and a parameter configuration module;

[0009] The network and serial port transmission module is located in the target machine and is used to transmit the data collected by the target machine to the host machine through the serial port or the network and to transmit the control commands of the host machine to the target machine through the serial port or the network;

[0010] The event message upload task is located in the target machine and is used to transmit the event collection information recorded in the buffer management module to the host machine through a special upload task;

[0011] The buffer management module is located in the target machine and is used to manage the buffer where event messages are stored and to apply for, release and use the buffer.

[0012] The event collection module is located in the target machine and is used to collect the specified event attributes and the timestamp information of the event, and store this information in the buffer management module;

[0013] The event recording module is located in the host machine and is used to display the collected events to the interface display module after receiving the collected events, and store the collected results in a file to be processed by the data analysis and processing module;

[0014] The data analysis and processing module is located in the host machine and is used to analyze and process the collected event information and provide feedback on the running status of each task and the running status of the switching relationship between the running task and other events;

[0015] The interface display module is located in the host machine and is used to display the state diagram and state table;

[0016] The parameter configuration module is located in the host machine and is used to transmit the control commands of the host machine back to the event recording module and the event collection module to select the transmission mode and collection control means.

[0017] (III) Beneficial effects

[0018] The present invention proposes a running status recording and event analysis system based on an embedded operating system. The present invention realizes the running status recording and collection of control events, task events, semaphore events, message queue events, timer events, other extended events and user-defined events, and realizes the uploading and analysis of the collected events, and finally graphically displays the event information and the event interaction sequence in the running of the embedded system application program in the development environment interface. At the same time, the present invention adopts methods such as controlling the amount of collected data, combining dynamic and static buffer allocation, configurable upload tasks and timestamp driver programs to reduce external interference, effectively ensuring the real-time requirements of the embedded operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a system architecture diagram of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0021] The purpose of the present invention is to propose a running status recording and event analysis system based on an embedded operating system, which can be used to collect, count and display various events generated on the embedded operating system (such as control events, task events, semaphore events, message queue events, timer events), provide event information required for analyzing the performance of the embedded operating system, analyze the collected events, and provide a visual graphic display window to display the analysis results; the system is divided into eight modules to realize the running status recording and event analysis of the embedded operating system, and the software can not only display the interactive relationship between the related tasks, interrupts and system objects of the application program executed on the embedded operating system, but also ensure that the real-time performance of the embedded operating system is not affected.

[0022] The present invention provides a running status recording and event analysis system based on an embedded operating system, aiming to provide a system visualization analysis approach. The system can understand the interaction between various tasks and interrupt programs by analyzing various events collected. The method can graphically display the event interaction sequence in the running of embedded system application programs by uploading the data after event analysis to an interface display module in a development environment.

[0023] Due to the real-time characteristics of the embedded operating system, the analysis and processing of the collected data cannot be placed in the target machine system for processing and analysis, and needs to be transmitted to another host machine for subsequent analysis and processing. Therefore, the implementation path of the running status recording and event analysis system based on the embedded operating system is divided into two parts to be completed collaboratively. One part is implemented on the target machine, mainly completing the recording of the running status, and the other part is implemented on the host machine, mainly completing the event analysis. The functions to be completed by the entire system are the collection of test data, the transmission of test data, the analysis of test data, and the communication and collaboration between the target machine and the host machine.

[0024] The workflow of the running status recording and event analysis system based on the embedded operating system is shown in Figure 1Specifically, the target machine of the present invention runs on a domestic embedded operating system, and various events on the target machine (including control events, task events, semaphore events, and timer events) are acquired and timestamped through an event acquisition module added to the kernel layer of the domestic embedded operating system, and the recorded events are put into a buffer management module, and the recorded event acquisition information is uploaded to the host machine through an event message upload task. The host machine is integrated into the development environment IDE, and after receiving the events collected by the target machine, the event recording module added to the host machine IDE side displays the collection results to the interface display module of the host machine IDE side on the one hand, and on the other hand, stores the collection results of the target machine side in a file, reads the events, analyzes and processes the collected events through a data analysis and processing module, and displays the processed analysis results on the interface display module.

[0025] The running status recording and event analysis system based on the embedded operating system of the present invention is mainly divided into eight software modules, such as Figure 1 As shown. Among them,

[0026] The network and serial port transmission module is located in the target machine and is used to transmit the data collected by the target machine to the host machine through the serial port or the network and to transmit the control commands of the host machine to the target machine through the serial port or the network;

[0027] The event message upload task is located in the target machine and is used to transmit the event collection information recorded in the buffer management module to the host machine through a special upload task.

[0028] The buffer management module is located in the target machine and is used to manage the buffer where event messages are stored and to apply for, release and use the buffer.

[0029] The event collection module is located in the target machine and is used to collect the specified event attributes and the timestamp information of the event, and store this information in the buffer management module;

[0030] The event recording module is located in the host machine and is used to display the collected events to the interface display module after receiving them, and store the collected results in a file for processing by the data analysis and processing module.

[0031] The data analysis and processing module is located in the host machine and is used to analyze and process the collected event information and provide feedback on the running status of each task and the running status of the switching relationship between the running task and other events;

[0032] The interface display module is located in the host machine and is used to display the state diagram and state table;

[0033] The parameter configuration module is located in the host machine and is used to transmit the control commands of the host machine back to the event recording module and the event collection module to select the transmission mode and collection control means.

[0034] The target machine of the present invention runs on a domestic embedded operating system. Since the target machine collects data through an event collection module, it will interfere with the domestic embedded operating system being tested. This interference must be controlled within a certain range, otherwise the test results obtained will have no practical significance. This interference is all on the target machine, so the program on the target machine should be as concise as possible, taking on functions that can only be implemented on the target machine, and completing other functions on the host machine.

[0035] According to this functional division idea, the target machine is responsible for data collection and data transmission, and the complex data post-analysis function is placed on the host machine. The communication and cooperation between the target machine and the host machine is implemented using the client-server model. There are two types of communication between the target machine and the host machine:

[0036] One is a control command initiated by the host machine, which is executed and responded by the target machine. In this case, the target machine is the server and the host machine is the client.

[0037] The other is that the target machine initiates the transmission of collected data and the host machine receives it. In this case, the target machine is the client and the host machine is the server.

[0038] The key problem that the target machine embedded operating system kernel needs to solve is to collect as much test information as possible while reducing interference to the target system. This is mainly achieved through the following four aspects:

[0039] (1) By providing a variety of acquisition control methods to accurately control the amount of data collected.

[0040] The acquisition control means of the present invention is divided into a hierarchical acquisition method and a classified acquisition method. The hierarchical acquisition method divides the data to be collected into three levels: the events that cause the context switch of the tested domestic embedded operating system are divided into the first level, the events that cause the task state to change are divided into the second level, and all the collected events are divided into the third level. Users can select the acquisition level according to their needs, thereby controlling the amount of data collected.

[0041] The classified collection method divides system call events into control events, task events, semaphore events, and timer events. Among them, control events include interrupt control; task events include task creation, task deletion, task start, task restart, task suspension, and task wake-up events; semaphore events include semaphore creation, semaphore deletion, semaphore acquisition, and semaphore release events; message queue events include message queue creation, message queue deletion, message queue sending, message queue emergency sending, message queue broadcast, message queue receiving, and message queue refresh events; timer events include timer creation, timer deletion, timer cancellation, timer delay start, timer scheduled start, and timer reset events. Users can choose to collect one or several types of data from these events according to their needs to accurately control the amount of data collected.

[0042] In addition, after the present invention collects event data using different collection methods, the event data is stored in blocks according to time periods, an index table is used to store the first address of the data block in each time period, and then an index-sequential search algorithm is used to query the corresponding stored data, which greatly reduces the amount of data that needs to be queried and greatly reduces the query time.

[0043] (2) Use a memory management method that combines dynamic and static buffer allocation to balance the contradiction between event collection occupying memory and time.

[0044] A part of the target machine's memory is used as a buffer to store the collected data. In order to improve the utilization rate of the memory, a strategy of dynamically allocating memory is adopted. When a lot of data is collected, more memory is allocated to store the data. When the memory space for storing the data is free, it is released to the embedded operating system so that other parts of the planning program can be used. However, dynamic memory allocation is also a time-consuming operation, which will occupy more CPU time of the target machine and will also cause unavailable memory fragments. Therefore, frequent allocation and release of small memory blocks will form new time and space interference to the target machine. The present invention solves the above contradiction by using a technology combining dynamic and static memory management, that is, the entire buffer for storing the collected data is divided into buffer blocks of equal size, and a minimum number of buffer blocks and a maximum number of buffer blocks are provided for user selection. The user can dynamically allocate memory by configuring the size of each buffer block, the minimum number of buffer blocks and the maximum number of buffer blocks.

[0045] (3) Use a dedicated upload task to transfer data, and use a configurable method to set the priority of the upload task, the timing and method of starting the upload task to reduce the disturbance of the upload activity to the original target system.

[0046] For example, the upload task priority can be lowered so that the upload is performed only when the embedded operating system on the target machine is relatively idle. Data can also be uploaded after the acquisition is completed, so that during the data acquisition period, the activity of uploading data will not affect the target machine. The transmission mode of the present invention is divided into three types, namely delayed transmission, continuous transmission and post-transmission.

[0047] Delayed transmission mode means that after the parameter configuration module on the host IDE sends a start capture command, the target machine returns data in real time, and the host IDE saves the data in the file of the event recording module until the parameter configuration module on the host IDE sends a stop capture command, at which time the data saved in the file of the event recording module is uploaded to the interface display module;

[0048] The continuous transmission mode means that once the event collection module on the target machine starts collecting data, it sends the collected data to the event recording module on the IDE side of the host machine. When the collected data accumulates to a certain level, the IDE side automatically uploads it to the interface display module, and a chart window pops up on the IDE side.

[0049] Post-analysis mode means that after the parameter configuration module on the host IDE sends a start capture command, the capture continues until the target needs to be restarted, and then the host IDE sends a stop capture command. When the target restarts and connects to the host, the event recording module on the host IDE uploads the user-specified memory area data to the interface display module, and a chart window pops up on the IDE.

[0050] (4) Use timestamps to drive programs. How to obtain the current time accuracy of the system when an event occurs is a very important issue. There are two types of timestamps for the embedded operating system running on the target machine: the first type is called a serial number, in which the time of the event is not the actual time when it occurred, but only the order in which the events occurred. The second type is the actual time of occurrence, which requires a higher accuracy of the clock. The high-precision clock in the present invention is implemented by a hardware counter, which keeps counting until it overflows. When it overflows, an interrupt is generated, and then counting starts from the beginning. This method not only ensures a higher counting accuracy, but also reduces the frequency of interrupts, thereby reducing disturbances to the system.

[0051] The key points of the present invention are:

[0052] (1) Operation status recording and real-time event collection technology based on multiple collection and control methods

[0053] The present invention adopts multiple acquisition control means to reduce interference with the target system and ensure real-time acquisition. In addition, the present invention stores event data in blocks according to time periods, uses an index table to store the first address of the data block in each time period, and adopts an index-sequential search algorithm to greatly improve the query speed.

[0054] (2) Memory management method based on a combination of dynamic and static buffer allocation

[0055] In order to balance the contradiction between event collection occupying memory and time, the present invention adopts a memory management method based on a combination of dynamic and static buffer allocation. Users can select configuration parameters to dynamically allocate memory, which not only improves memory utilization but also ensures the real-time performance of the embedded operating system.

[0056] Effects of the present invention:

[0057] The present invention realizes the recording and collection of the running status of control events, task events, semaphore events, message queue events, timer events, other extended events and user-defined events, and realizes the uploading and analysis of the collected events, and finally graphically displays the event information and the event interaction sequence in the operation of the embedded system application program in the development environment interface. At the same time, the present invention adopts methods such as controlling the amount of collected data, combining dynamic and static buffer allocation, configurable upload tasks and time stamp driver to reduce external interference, effectively ensuring the real-time requirements of the embedded operating system.

[0058] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A running status recording and event analysis system based on an embedded operating system, characterized in that: The system includes: network and serial port transmission module, event message upload task, buffer management module, event collection module, event recording module, data analysis and processing module, interface display module and parameter configuration module; The network and serial port transmission module is located in the target machine and is used to transmit the data collected by the target machine to the host machine through the serial port or the network and to transmit the control commands of the host machine to the target machine through the serial port or the network; The event message upload task is located in the target machine and is used to transmit the event collection information recorded in the buffer management module to the host machine through a special upload task; The buffer management module is located in the target machine and is used to manage the buffer where event messages are stored and to apply for, release and use the buffer. The event collection module is located in the target machine and is used to collect the specified event attributes and the timestamp information of the event, and store this information in the buffer management module; The event recording module is located in the host machine and is used to display the collected events to the interface display module after receiving the collected events, and store the collected results in a file to be processed by the data analysis and processing module; The data analysis and processing module is located in the host machine and is used to analyze and process the collected event information and provide feedback on the running status of each task and the running status of the switching relationship between the running task and other events; The interface display module is located in the host machine and is used to display the state diagram and state table; The parameter configuration module is located in the host machine and is used to transmit the control commands of the host machine back to the event recording module and the event collection module to select the transmission mode and collection control means.

2. The operation status recording and event analysis system based on embedded operating system as claimed in claim 1, characterized in that: The target machine runs on a domestic embedded operating system. Various events on the target machine are acquired and timestamped through an event collection module added to the kernel layer of the domestic embedded operating system. The recorded events are placed in a buffer management module, and the recorded event collection information is uploaded to the host machine through an event message upload task. The host machine is integrated into the development environment IDE. After receiving the events collected by the target machine, the event recording module added to the host IDE displays the collection results on the interface display module of the host IDE. At the same time, the collection results of the target machine are stored in a file, the events are read, and the collected events are analyzed and processed by the data analysis and processing module, and the processed analysis results are displayed on the interface display module.

3. The operation status recording and event analysis system based on embedded operating system as claimed in claim 1, characterized in that: The communication and collaboration between the target machine and the host machine is implemented using the client-server model.

4. The operation status recording and event analysis system based on embedded operating system as claimed in claim 3, characterized in that: There are two types of communication between the target machine and the host machine: The control command initiated by the host machine is executed and responded by the target machine. In this case, the target machine is the server and the host machine is the client. The other is that the target machine initiates the transmission of collected data and the host machine receives it. In this case, the target machine is the client and the host machine is the server.

5. The operation status recording and event analysis system based on embedded operating system according to any one of claims 1 to 4, characterized in that: The event collection module's collection control method is a hierarchical collection method, which divides the data to be collected into three levels: events that cause context switching of the domestic embedded operating system being tested are divided into the first level, events that cause changes in task status are divided into the second level, and all collected events are divided into the third level; users select the collection level according to their needs to control the amount of data collected.

6. The operating status recording and event analysis system based on embedded operating system as claimed in claim 5, characterized in that: The collection control means of the event collection module is a classified collection method, which divides system call events into control events, task events, semaphore events, and timer events; among them, control events include interrupt control events; task events include task creation, task deletion, task start, task restart, task suspension, and task wake-up events; semaphore events include semaphore creation, semaphore deletion, semaphore acquisition, and semaphore release events; message queue events include message queue creation, message queue deletion, message queue sending, message queue emergency sending, message queue broadcasting, message queue receiving, and message queue refresh events; timer events include timer creation, timer deletion, timer cancellation, timer delayed start, timer scheduled start, and timer reset events; users can choose to collect one or several types of data from these types of events according to their needs, so as to accurately control the amount of data collected.

7. The operation status recording and event analysis system based on embedded operating system as claimed in claim 6, characterized in that: After event data is collected using different collection methods, the event data is stored in blocks according to time periods. An index table is used to store the first address of the data block in each time period, and then an index-sequential search algorithm is used to query the corresponding stored data.

8. The operation status recording and event analysis system based on embedded operating system as claimed in claim 6, characterized in that: The system divides the entire buffer for storing collected data into buffer blocks of equal size, and provides a minimum number of buffer blocks and a maximum number of buffer blocks for users to choose; users dynamically allocate memory by configuring the size of each buffer block, the minimum number of buffer blocks and the maximum number of buffer blocks.

9. The operation status recording and event analysis system based on embedded operating system as claimed in claim 8, characterized in that: The system has three transmission modes, namely delayed transmission, continuous transmission and post-transmission; Delayed transmission mode means that after the parameter configuration module on the host IDE sends a start capture command, the target machine returns data in real time, and the host IDE saves the data in the file of the event recording module until the parameter configuration module on the host IDE sends a stop capture command, at which time the data saved in the file of the event recording module is uploaded to the interface display module; The continuous transmission mode means that once the event collection module on the target machine starts collecting data, it will send the collected data to the event recording module on the IDE side of the host machine. When the collected data accumulates to a certain extent, the IDE side automatically uploads it to the interface display module, and a chart window pops up on the IDE side. Post-analysis mode means that after the parameter configuration module on the host IDE sends a start capture command, the capture continues until the target machine needs to be restarted, and then the host IDE sends a stop capture command; when the target machine is restarted and connected to the host, the event recording module on the host IDE uploads the user-specified memory area data to the interface display module, and a chart window pops up on the IDE.

10. The operation status recording and event analysis system based on embedded operating system according to claim 6, characterized in that: The system uses timestamps to drive the program. The high-precision clock is implemented through a hardware counter. The hardware counter keeps counting until it overflows. When the overflow occurs, an interrupt is generated and the counting starts from the beginning.

Citation Information

Patent Citations

  • Application program playback method and system

    CN104461521A

  • Performance bottleneck analysis method and system on embedded operating system

    CN115454792A

  • Agent-based task-level debugging method under Tianyi embedded operating system

    CN115757183A

  • Virtualized file servers and methods to persistently store file system event data

    US20220318208A1

  • File analytics systems and methods including receiving and processing file system event data in order

    US20220342866A1