Vehicle-mounted safety computer communication data recording method

By adopting the SMP multiprocessor architecture in the on-board security computer, the communication unit and the recording unit are separated on different ARM cores and run in parallel, solving the problem of incomplete communication data recording caused by traditional single-core CPUs, and achieving more efficient CPU resource utilization and integrity of communication data recording.

CN119806865APending Publication Date: 2025-04-11卡斯柯信号(成都)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411909205.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The communication recording unit of a traditional vehicle-mounted security computer shares the same single-core CPU resource with the communication unit, which may lead to insufficient CPU resources during peak communication periods and lead to incomplete communication data recording.

Method used

Using the SMP multi-processor architecture, the on-board secure computer communication unit and the communication recording unit are separated on different ARM cores and run in parallel, increasing CPU computing resources, and ensuring the integrity of communication data records.

Benefits of technology

By separating CPU resources, the problem of incomplete communication data recording caused by insufficient CPU computing resources is avoided, and the communication recording unit is ensured that the communication recording unit will not affect the main service operation of the communication unit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806865A_ABST
    Figure CN119806865A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted safety computer communication data recording method, which relates to the technical field of train vehicle-mounted safety computers, and comprises the following steps: based on a multiprocessor architecture, two ARM cores with the same physical attribute are arranged in a CPU (Central Processing Unit), and a vehicle-mounted safety computer communication unit runs on the physical ARM core 0 of the CPU for communication; and the vehicle-mounted safety computer communication recording unit runs on the physical ARM core 1 of the CPU to carry out communication recording. Based on the SMP architecture, the communication unit and the communication recording unit of the vehicle-mounted safety computer are separated to different ARM cores to run in parallel, so that the operation resources of the CPU are increased, and the problem of incomplete communication data recording possibly caused by insufficient operation resources of the CPU is avoided; and meanwhile, the normal operation of the main service of the communication unit cannot be influenced by excessive consumption of CPU resources by the communication recording unit. According to the method, time-consuming operation is executed in a multi-task separation mode, and packet loss caused by the fact that data are not recorded in time due to the fact that a certain step is too time-consuming in serial single-task execution is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of train on-board safety computers, and more specifically to a method for recording communication data of a train on-board safety computer. Background Art

[0002] The train onboard safety computer is the center of train operation command. It undertakes important functions such as monitoring various parts of the train, processing train operation data, and controlling train operation. It is one of the key systems to ensure the safe operation of the train. The train onboard safety computer network communication system undertakes the communication function with the train control center and other train systems, and acts as a bridge for the onboard safety computer to communicate with other systems, including receiving driving permission commands, transmitting train status data, receiving scheduling information, etc. The communication data sources of the train onboard safety computer network communication system mainly include Ethernet, serial port, MVB (multi-function vehicle bus), TRDP (train real-time data communication protocol), etc. In order to facilitate the analysis and location of onboard safety computer communication faults, it is necessary to design a communication recording unit dedicated to the onboard safety computer to record the IO data of the onboard safety computer communication unit in real time and efficiently.

[0003] The communication recording unit of the traditional vehicle safety computer and the vehicle safety computer communication unit run on the same single-core CPU, and the two share the single-core CPU resources. In order to ensure that the vehicle safety computer communication unit can communicate data with the peripherals normally, the priority of the task belonging to the vehicle safety computer communication unit is adjusted higher than the priority of the task belonging to the communication recording unit by using the priority-based preemptive scheduling strategy of the strong real-time operating system. The strong real-time operating system preferentially allocates the single-core CPU resources to the vehicle safety computer communication unit. However, during peak communication periods, the large amount of communication data and the fluctuation of the rate at which the communication recording unit writes communication data to the memory may result in insufficient CPU resources allocated to the communication recording unit during certain periods, resulting in incomplete communication data recording. Summary of the invention

[0004] In order to overcome the defects existing in the above-mentioned prior art, the present invention discloses a method for recording communication data of an on-board safety computer. The present invention is based on the SMP (Symmetric Multi-Processing) multi-processor architecture, separates the on-board safety computer communication unit and the communication recording unit to different ARM cores for parallel operation, increases the CPU computing resources, avoids the problem of incomplete communication data recording that may be caused by insufficient CPU computing resources, and at the same time ensures that the communication recording unit will not affect the normal operation of the main business of the communication unit due to excessive consumption of CPU resources.

[0005] In order to achieve the above objectives, the technical solution adopted by the present invention is: A method for recording communication data of an on-vehicle safety computer comprises: based on a multi-processor architecture, two ARM cores with the same physical properties are arranged in a CPU, a communication unit of the on-vehicle safety computer runs on the physical ARM core 0 of the CPU for communication, and a communication recording unit of the on-vehicle safety computer runs on the physical ARM core 1 of the CPU for communication recording.

[0006] Preferably, the initialization process of the vehicle-mounted safety computer communication data recording method includes the following steps: S1. The vehicle safety computer communication unit creates a communication data receiving and sending task, and sets the core affinity of the communication data receiving and sending task to ARM core 0; Preferably, the communication data receiving and sending tasks include Ethernet, serial port, multi-function vehicle bus, train real-time data communication protocol multimedia communication data receiving and sending tasks.

[0007] S2. The on-board safety computer creates a global message queue globalMsgMQ and a global semaphore globalSemaphore, wherein the global message queue globalMsgMQ serves as a bridge for data transmission between the communication unit on ARM core 0 and the communication recording unit on ARM core 1, and the global semaphore globalSemaphore is used for synchronization between tasks running in parallel on ARM core 0 and ARM core 1; S3, the vehicle-mounted safety computer communication recording unit creates a cache message queue recordMsgBufMQ and a semaphore recordSemaphore, wherein the cache message queue recordMsgBufMQ is used as a secondary cache used inside the communication recording unit, and the semaphore recordSemaphore is used for synchronization between tasks inside the communication recording unit; S4. The vehicle-mounted safety computer communication recording unit creates a communication recording task and binds the core affinity of the communication recording task to ARM core 1.

[0008] Preferably, the communication recording task includes: a communication data assembly task, a communication data writing task into a file system task, a monitoring task and a file compression task.

[0009] Preferably, the on-board safety computer communication unit runs on the physical ARM core 0 of the CPU, including: when the communication unit has communication data, it processes the corresponding communication data according to the business logic of the on-board safety computer, and writes the processing results, communication data, and communication media into the global message queue globalMsgMQ, and releases the global semaphore globalSemaphore, so as to wake up the relevant tasks of the communication recording unit running on ARM core 1 with this global semaphore globalSemaphore.

[0010] Preferably, the communication data assembly task belonging to the communication recording unit of the on-board safety computer runs on ARM core 1, including: the communication data assembly task waits for the global semaphore globalSemaphore to be released and then obtains the number of messages stored in the global message queue globalMsgMQ, and obtains the number of messages that need to be processed according to the set high and low water level thresholds of the number of messages; loops through each communication message to be recorded, assembles multiple messages into a cache package that is less than or equal to NKB and stores it in the cache message queue recordMsgBufMQ, and releases the semaphore recordSemaphore to wake up the communication data writing file system task.

[0011] Preferably, the communication data writing to the file system task belonging to the on-board safety computer communication recording unit runs on ARM core 1, including: the communication data writing to the file system task waits for the semaphore recordSemaphore to be released and then obtains the number of cache packets stored in the cache message queue recordMsgBufMQ, and obtains the number of cache packets that need to be processed based on the set high and low water level thresholds of the number of cache packets; loops through each cache packet and writes it to the corresponding file in the file system based on the cache packet type and timestamp information.

[0012] Preferably, the file compression task of the vehicle-mounted safety computer communication recording unit runs on the ARM core 1, including: the file compression task cyclically checks whether there are files to be compressed that meet the conditions in the file system, and if so, compresses the files to be compressed.

[0013] Preferably, the monitoring task belonging to the on-board safety computer communication recording unit runs on ARM core 1, including: the monitoring task cyclically determines whether the remaining capacity of the file system is sufficient, and if the remaining capacity is insufficient, the historical communication data recording files are rolled out; the communication data recording files are organized into file directories according to the on-board safety computer operation cycle number, and the monitoring task pre-creates the next file directory according to the current cycle number.

[0014] Preferably, the communication data assembly task, communication data writing file system task, monitoring task and file compression task belonging to the secure computer communication recording unit have different priority attributes, among which the communication data assembly task and the communication data writing file system task have the highest priority, followed by the monitoring task, and the file compression task has the lowest priority.

[0015] Beneficial effects of the present invention: 1. The present invention is based on the SMP architecture, and separates the vehicle-mounted safety computer communication unit and the communication recording unit to different ARM cores for parallel operation, thereby increasing the CPU computing resources and avoiding the problem of incomplete communication data recording due to insufficient CPU computing resources. At the same time, it ensures that the communication recording unit will not affect the normal operation of the main business of the communication unit due to excessive consumption of CPU resources. 2. The present invention designs a secondary cache mechanism composed of a global message queue globalMsgMQ and a cache message queue recordMsgBufMQ used inside the communication recording unit. The first-level cache is the global message queue globalMsgMQ. This level of cache not only bears the function of storing the I / O data generated by the communication unit, but also has a function to cope with the fluctuation of the communication data volume of the communication unit. The communication recording unit introduces a water level control strategy, which can dynamically and timely adjust the speed of processing communication data; the second-level cache is the cache message queue recordMsgBufMQ used inside the communication recording unit. This level of cache can cope with the fluctuation of the writing rate of the file system. The writing rate of the measured file system has a certain volatility. This level of cache can store the cache packets that have not been written in time when the writing rate of the file system drops for a period of time, and write the cache packets that have not been written in time into the file system when the writing rate of the file system increases.

[0016] 3. The present invention uses multi-task separation to execute time-consuming operations (such as writing files, compressing files, creating directories, etc.), avoiding the problem of packet loss caused by untimely recording of data due to a certain step being too time-consuming in serial single-task execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of the initialization process of the vehicle-mounted safety computer communication data recording method of the present invention; Figure 2 This is a flow chart of the vehicle-mounted safety computer communication unit of the present invention running on ARM core 0; Figure 3 This is a flow chart of the communication data assembly task of the vehicle-mounted safety computer communication recording unit of the present invention running on the ARM core 1; Figure 4 The flow chart of the task of writing the communication data to the file system belonging to the vehicle-mounted safety computer communication recording unit of the present invention is run on the ARM core 1; Figure 5 This is a flow chart of the file compression task belonging to the vehicle-mounted safety computer communication recording unit of the present invention running on the ARM core 1; Figure 6 This is a flow chart of the monitoring task of the vehicle-mounted safety computer communication recording unit of the present invention running on the ARM core 1. DETAILED DESCRIPTION

[0018] The concept, specific structure and technical effects of the present invention will be clearly and completely described below in combination with the embodiments and drawings to fully understand the purpose, characteristics and effects of the present invention.

[0019] A method for recording vehicle-mounted safety computer communication data is based on an SMP architecture. A CPU has two ARM cores with the same physical properties. A vehicle-mounted safety computer communication unit runs on the physical ARM core 0 of the CPU, and a vehicle-mounted safety computer communication recording unit runs on the physical ARM core 1 of the CPU.

[0020] The initialization process of this method is as follows Figure 1 As shown: S1: The vehicle safety computer communication unit creates communication data receiving and sending tasks, including Ethernet, serial port, MVB, TRDP and other multimedia communication data receiving and sending tasks, and sets the core affinity of these tasks to ARM core 0; S2: Create a global message queue globalMsgMQ and a global semaphore globalSemaphore. The globalMsgMQ global message queue serves as a bridge for data transmission between the communication unit on ARM core 0 and the communication recording unit on ARM core 1. The globalSemaphore global semaphore is used for synchronization between tasks running in parallel on ARM core 0 and ARM core 1. S3: The on-board safety computer communication recording unit creates a cache message queue recordMsgBufMQ and a semaphore recordSemaphore. The recordMsgBufMQ cache message queue is used as a secondary cache inside the communication recording unit, and the recordSemaphore semaphore is used for synchronization between tasks inside the communication recording unit. S4: The vehicle safety computer communication recording unit creates four tasks and binds the core affinity of the four tasks to ARM core 1. The four tasks include: communication data assembly task, communication data writing file system task, monitoring task and file compression task.

[0021] The operation process of recording communication data of this method is as follows Figures 2 to 6 As shown: The vehicle safety computer communication unit runs on ARM core 0, such as Figure 2 As shown, when the communication unit has I / O data, it will process the corresponding I / O data according to the business logic of the on-board safety computer, and write the processing results, I / O data (collectively referred to as communication messages in the whole text), communication media (such as Ethernet, serial port, MVB, TRDP, etc.) into the global message queue globalMsgMQ, and release the global semaphore globalSemaphore to wake up the relevant tasks of the communication recording unit running on ARM core 1.

[0022] The communication data assembly task of the vehicle safety computer communication recording unit runs on ARM core 1, such as Figure 3 As shown, the communication data assembly task waits for the global semaphore globalSemaphore to be released and then obtains the number of messages stored in globalMsgMQ, and obtains the number of messages to be processed based on the set high and low water level thresholds of the number of messages. The water level adjustment method is added here to dynamically adjust the speed of processing the communication messages to be recorded to adapt to the fluctuation of the communication data volume. Each communication message to be recorded is processed in a loop, and multiple messages are assembled into a cache package of less than or equal to 16KB and stored in the recordMsgBufMQ cache package message queue, and the recordSemaphore semaphore is released to wake up the communication data writing file system task.

[0023] The communication data writing task of the vehicle safety computer communication recording unit is run on ARM core 1. Figure 4 As shown, the communication data writing task to the file system waits for the release of the recordSemaphore semaphore to obtain the number of cache packets stored in recordMsgBufMQ, and obtains the number of cache packets to be processed based on the high and low water level thresholds of the set cache packet number. Here, a water level adjustment method is added to dynamically adjust the speed of processing the cache packets to be recorded to adapt to the fluctuation of the writing speed of the file system. Each cache packet is processed in a loop, and written to the corresponding file in the file system according to the cache packet type, timestamp and other information.

[0024] The file compression task of the vehicle safety computer communication recording unit runs on ARM core 1, such as Figure 5 As shown, the file compression task cyclically checks whether there are files to be compressed that meet the conditions in the file system, and if there are, compresses the files to be compressed to save file system space.

[0025] The monitoring task of the vehicle safety computer communication recording unit runs on ARM core 1, such as Figure 6 As shown, the monitoring task loop determines whether the remaining capacity of the file system is sufficient. If the remaining capacity is insufficient, the historical communication data record files need to be rolled out. The communication data record files are generally organized into file directories according to the operation cycle number of the vehicle safety computer. For example, the communication data with cycle numbers 1 to 10000 are uniformly placed in one file directory. The monitoring task pre-creates the next file directory based on the current cycle number.

[0026] The four tasks belonging to the secure computer communication recording unit described above have different priority attributes, among which the communication data assembly task and the communication data writing file system task have the highest priority, followed by the monitoring task, and the file compression task has the lowest priority. This method uses the priority-based preemptive scheduling strategy of the strong real-time operating system to ensure that high-priority tasks are scheduled first, ensuring that the communication data assembly task and the communication data writing file system task are scheduled first by the CPU, that is, ensuring that the communication data is written to the file system first, and compressing as many files as possible when CPU resources are abundant.

[0027] The above is a specific description of the implementation mode of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention, and these equivalents or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for recording vehicle-mounted secure computer communication data, characterized in that: Based on the multi-processor architecture, two ARM cores with the same physical properties are set in the CPU. The on-board safety computer communication unit runs on the physical ARM core 0 of the CPU for communication, and the on-board safety computer communication recording unit runs on the physical ARM core 1 of the CPU for communication recording.

2. A method for recording vehicle-mounted safety computer communication data as claimed in claim 1, characterized in that: The initialization process of the vehicle-mounted safety computer communication data recording method includes the following steps: The vehicle safety computer communication unit creates a communication data receiving and sending task, and sets the core affinity of the communication data receiving and sending task to ARM core 0; The on-board safety computer creates a global message queue globalMsgMQ and a global semaphore globalSemaphore, wherein the global message queue globalMsgMQ serves as a bridge for data transmission between the communication unit on ARM core 0 and the communication recording unit on ARM core 1, and the global semaphore globalSemaphore is used for synchronization between tasks running in parallel on ARM core 0 and ARM core 1; The vehicle-mounted safety computer communication recording unit creates a cache message queue recordMsgBufMQ and a semaphore recordSemaphore, wherein the cache message queue recordMsgBufMQ is used as a secondary cache used inside the communication recording unit, and the semaphore recordSemaphore is used for synchronization between tasks inside the communication recording unit; The vehicle-mounted safety computer communication recording unit creates a communication recording task and binds the core affinity of the communication recording task to ARM core 1.

3. A method for recording vehicle-mounted safety computer communication data as claimed in claim 2, characterized in that: The communication recording tasks include: communication data assembly tasks, communication data writing file system tasks, monitoring tasks and file compression tasks.

4. A method for recording vehicle-mounted safety computer communication data as claimed in claim 2, characterized in that: The on-board safety computer communication unit runs on the physical ARM core 0 of the CPU, including: when the communication unit has communication data, it processes the corresponding communication data according to the on-board safety computer business logic, and writes the processing results, communication data, and communication media into the global message queue globalMsgMQ, and releases the global semaphore globalSemaphore, so as to wake up the relevant tasks of the communication recording unit running on ARM core 1 with this global semaphore globalSemaphore.

5. A method for recording vehicle-mounted safety computer communication data as claimed in claim 3, characterized in that: The communication data assembly task of the vehicle safety computer communication recording unit runs on ARM core 1, including: the communication data assembly task waits for the global semaphore globalSemaphore to be released and then obtains the number of messages stored in the global message queue globalMsgMQ, and obtains the number of messages that need to be processed according to the set high and low water level thresholds of the number of messages; loops through each communication message to be recorded, assembles multiple messages into a cache package that is less than or equal to NKB and stores it in the cache message queue recordMsgBufMQ, and releases the semaphore recordSemaphore to wake up the communication data writing file system task.

6. A method for recording vehicle-mounted safety computer communication data as claimed in claim 3, characterized in that: The communication data writing to the file system task belonging to the on-board safety computer communication recording unit runs on ARM core 1, including: the communication data writing to the file system task waits for the semaphore recordSemaphore to be released and then obtains the number of cache packets stored in the cache message queue recordMsgBufMQ, and obtains the number of cache packets that need to be processed based on the set high and low water level thresholds of the number of cache packets; loops through each cache packet and writes it to the corresponding file in the file system based on the cache packet type and timestamp information.

7. A method for recording vehicle-mounted safety computer communication data as claimed in claim 3, characterized in that: The file compression task of the vehicle-mounted safety computer communication recording unit runs on the ARM core 1, including: the file compression task cyclically checks whether there are files to be compressed that meet the conditions in the file system, and if so, compresses the files to be compressed.

8. A method for recording vehicle-mounted safety computer communication data as claimed in claim 3, characterized in that: The monitoring task belonging to the vehicle safety computer communication recording unit runs on ARM core 1, including: the monitoring task cyclically determines whether the remaining capacity of the file system is sufficient, and if the remaining capacity is insufficient, the historical communication data recording files are rolled out; the communication data recording files are organized into file directories according to the vehicle safety computer operation cycle number, and the monitoring task pre-creates the next file directory according to the current cycle number.

9. A method for recording vehicle-mounted safety computer communication data as claimed in claim 3, characterized in that: The communication data assembly task, communication data writing file system task, monitoring task and file compression task belonging to the secure computer communication recording unit have different priority attributes, among which the communication data assembly task and communication data writing file system task have the highest priority, followed by the monitoring task, and the file compression task has the lowest priority.

10. A vehicle-mounted safety computer communication data recording method as claimed in claim 2, characterized in that: The communication data receiving and sending tasks include Ethernet, serial port, multi-function vehicle bus, train real-time data communication protocol multimedia communication data receiving and sending tasks.