Vehicle-mounted safety platform log analysis system and method, electronic equipment and medium
By designing the log analysis system of the on-board security platform, and using the configuration file dynamic analysis logs and generation interface, the problem of low log analysis efficiency and inability to achieve real-time analysis in the existing technology is solved, efficient and automated log analysis is achieved, supporting real-time requirements and reducing maintenance costs.
Patent Information
- Application Number
- CN202411920136.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, log analysis of on-board security platform relies on manual verification, is inefficient, difficult to identify complex data patterns, and cannot realize real-time analysis, which cannot meet the real-time requirements of on-board security platform.
A log analysis system for on-board security platform is designed, including log acquisition module, decompression module, log analysis module, log analysis module and interface dynamic generation module. Through the configuration file dynamic analysis of logs and generation interface, automated and efficient log analysis is achieved.
It improves the efficiency and accuracy of log analysis, supports real-time analysis, reduces maintenance costs, enhances system flexibility and scalability, and reduces memory consumption and parsing time.
Smart Images

Figure CN120050203A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of log analysis, and in particular to a log analysis system, method, electronic device and medium for an in-vehicle safety platform. Background Art
[0002] Rail transit in-vehicle safety platforms usually include multiple sensors and control units, which can monitor the running state of the vehicle in real time, such as speed, acceleration, steering angle, temperature, voltage, etc. In addition, it can also collect fault codes, time data of rail transit vehicles in motion, and other information related to vehicle safety. Currently, most log analysis relies on manual log checking, which consumes a lot of time and energy. Especially when dealing with a large amount of data, the efficiency is low. Secondly, it is difficult for manual checking to identify and analyze complex data patterns and associations, and key safety hazards may be missed. Then, manual checking usually cannot achieve real-time log analysis and is difficult to meet the real-time requirements of the in-vehicle safety platform. Therefore, an automated and highly efficient log analysis method for the in-vehicle safety platform is needed to solve the pain points of manual log checking.
[0003] After retrieval, Chinese Patent Application Publication No. CN104636241B discloses an automatic analysis method for in-vehicle controller log data based on requirement modeling, including the following steps: Step S101, model the software requirements of the rail transit in-vehicle controller that generates log data; Step S102, load the configuration file required for log data analysis; Step S103, load the log data; Step S104, according to the model established in Step S101 and the variable mapping table established in Step S102, identify the input and output parameters of the model in the log data, calculate the expected output parameters according to the logical and arithmetic relationships between the input and output in the model, and analyze and compare with the actual output parameters in the log; Step S105, record, count the analysis results and visually display them with charts. This existing patent application has the problems of poor scalability and non-support for dynamic interface generation because it needs to calculate output parameters through a model.
[0004] After retrieval, the Chinese invention patent application publication number CN115859941A discloses a method and device for real-time analysis of vehicle-mounted ATC logs, including: obtaining vehicle-mounted ATC log data to be analyzed in real time, and reading a pre-configured configuration file, in which the storage data structures of multiple fields are initialized, and each field forms a mapping relationship with the structure of the vehicle-mounted ATC log data; parsing the vehicle-mounted ATC log data according to the configuration file using a pre-configured general parsing algorithm, the general parsing algorithm is configured to sequentially extract information from the vehicle-mounted ATC log data according to the structure of each field in the configuration file, parse out the information corresponding to each field and store it in the corresponding storage data structure respectively; extracting the feature values in each parsed field respectively, and judging the fault status and locating the fault position according to the extracted feature values. This existing invention application has problems such as poor scalability, lack of support for dynamic interface generation, and high update difficulty due to the lack of plug-in design.
[0005] How to achieve automatic and efficient analysis of vehicle-mounted safety platform logs has become a technical problem to be solved. Summary of the Invention
[0006] The purpose of the present invention is to provide a vehicle-mounted safety platform log analysis system, method, electronic device and medium to overcome the defects of the above-mentioned existing technologies.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] According to one aspect of the present invention, a vehicle-mounted safety platform log analysis system is provided, which includes a log acquisition module, a decompression module, a log parsing module, a log analysis module and an interface dynamic generation module connected in sequence;
[0009] The system further includes a configuration module connected to the log parsing module and the interface dynamic generation module respectively;
[0010] The configuration module is used to configure and parse the configuration file;
[0011] The log acquisition module obtains compressed log data from the vehicle-mounted safety platform and sends it to the decompression module for decompression;
[0012] The log parsing module parses the decompressed log data according to the configuration file, sends it to the log analysis module for analysis, and then outputs the log analysis result;
[0013] The interface dynamic generation module dynamically generates a log analysis software interface according to the configuration file and updates the log analysis result to the log analysis interface for display.
[0014] Preferably, the configuration file includes message structure configuration and interface configuration for log parsing and dynamic interface generation.
[0015] More preferably, the dynamically generated interfaces include a log type selection interface and a log analysis interface;
[0016] The log type selection interface is dynamically generated according to the interface configuration and is used to select the log transmission method;
[0017] The log analysis interface is dynamically generated according to the message structure and is used to display the log analysis results.
[0018] Preferably, the log acquisition module obtains log data from the vehicle-mounted safety platform in different ways according to the log transmission method; specifically: if the log transmission method is online transmission, the log acquisition module requests online compressed log data from the vehicle-mounted safety platform; if the log transmission method is offline transmission, the log acquisition module copies the offline compressed log data from the vehicle-mounted safety platform.
[0019] Preferably, the decompression module decompresses the received log data using LZ4.
[0020] More preferably, the log parsing module parses the decompressed log according to the message structure and distributes the parsing processes of each board to each sub-thread according to the board type field of the vehicle-mounted safety platform.
[0021] Preferably, the log analysis module obtains the log data to be analyzed for each board from the message queue, performs log analysis according to the board type, and outputs the log analysis results of each type of vehicle-mounted safety platform board.
[0022] Preferably, the interface dynamic generation module dynamically generates a log analysis interface according to the message structure and displays the log analysis results on the log analysis interface through the Qt main thread in a lazy loading manner.
[0023] According to another aspect of the present invention, a method for analyzing vehicle-mounted safety platform logs is provided, and the method includes the following steps:
[0024] Step 1: Start the vehicle-mounted safety platform log analysis system;
[0025] Step 2: Read and load the configuration file from the configuration module, and the configuration file is classified as: message structure configuration and interface configuration;
[0026] Step 3: Parse the loaded configuration file to obtain the message structure and interface configuration for the logs to be parsed; send the parsed message structure to Step 6;
[0027] Step 4: The log acquisition module acquires online or offline log data and sends it to the decompression module;
[0028] Step 5: The decompression module decompresses the compressed log data and stores the decompressed log data in a local temporary folder;
[0029] Step 6: According to the message structure, the interface dynamic generation module dynamically generates a log analysis interface;
[0030] Step 7: The log parsing module and the log analysis module sequentially perform log parsing and log analysis on the log data decompressed in Step 7;
[0031] Step 8: Display the log analysis result in the log analysis interface.
[0032] Preferably, both the log parsing module and the log analysis module perform log parsing and log analysis on the log data according to the in-vehicle safety platform board type.
[0033] Preferably, the lazy loading method is used to read data and update the log analysis interface when the log analysis result is updated.
[0034] Preferably, the interface is configured to dynamically generate a log type selection interface, and the log transmission method is selected as online transmission or offline transmission by operating the log type selection interface.
[0035] According to the third aspect of the present invention, an electronic device is provided, including a memory and a processor, where a computer program is stored on the memory, and the method described above is implemented when the processor executes the program.
[0036] According to the fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and the method described above is implemented when the program is executed by a processor.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1) The present invention dynamically parses the logs of each board through the message structure in the configurable configuration file, and at the same time dynamically generates a log analysis interface according to the message structure, and displays the analysis result in the log analysis interface. The system is modularly designed, effectively improving the code reusability and reducing the maintenance cost.
[0039] 2) The present invention adopts a plug-in architecture design, divides the application program into a series of plug-ins, and each plug-in is developed, tested, and deployed independently, which improves the flexibility of the system; at the same time, the plug-in design improves the scalability of the system. To add new functions, only new plug-ins need to be developed and applied to the system; in addition, when a certain plug-in needs to be updated, only the plug-in needs to be updated separately without modifying the entire system, reducing the coupling degree of the system.
[0040] 3) The message structure for dynamically generating the log analysis interface and log parsing in the present invention can be configured through a configuration file, which facilitates the update of the message structure. The interface is developed using a cross-platform Qt application structure, which is flexible and configurable and has strong adaptability, effectively reducing the maintenance cost.
[0041] 4) The present invention adopts a lazy loading design pattern to update the interface and parsing process, effectively reducing the memory consumption of the local computer and the time consumed by log parsing, and effectively improving the fluency of the system.
[0042] 5) The present invention uses the LZ4 compression / decompression algorithm to compress the binary vehicle-mounted safety platform log and send it to the system of the present invention for decompression, reducing the time consumed by log transmission.
[0043] 6) The present invention supports online and offline log analysis, solves the disadvantages of the manual log verification method, and effectively improves the operation and maintenance efficiency of the rail transit vehicle-mounted safety platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic structural diagram of the vehicle-mounted safety platform log analysis system in the present invention;
[0045] Figure 2 It is a schematic logical flow diagram of the vehicle-mounted safety platform log analysis system in the present invention;
[0046] Figure 3 It is a schematic flow diagram of the vehicle-mounted safety platform log analysis method in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] This embodiment relates to a log analysis system for an in-vehicle safety platform. The system is connected to the in-vehicle safety platform. During the daily operation of rail transit vehicles, the in-vehicle safety platform obtains log data of the in-vehicle safety platform through various boards and sensors. Its lower computer compresses the log data through the LZ4 algorithm and sends it to the analysis system, which analyzes the log data. The LZ4 algorithm provides very fast compression and decompression performance and is suitable for the rail transit scenario of this invention.
[0049] The system is implemented based on the Qt development framework. Its main thread is used to refresh the UI, and the child thread is used to handle data-consuming operations.
[0050] The lower computer of the in-vehicle safety platform first compresses the binary log data using the LZ4 algorithm, and then divides the log data into two parts: online transmission and offline transmission according to the log transmission method selected by the user. For online transmission, the in-vehicle safety platform compresses the real-time log data and transmits it to the analysis system through the network port; for offline transmission: the in-vehicle safety platform saves the compressed log data locally and transmits it to the analysis system by copying.
[0051] Such as Figure 1 The system includes the following modules:
[0052] 1) Log acquisition module: According to the log transmission method selected by the user, it obtains log data from the in-vehicle safety platform in different ways and then sends it to the decompression module. For online transmission, the log acquisition module requests online data from the in-vehicle safety platform, and then the in-vehicle safety platform transmits the online compressed data to the log acquisition module; for offline transmission, the log acquisition module copies the offline compressed log data from the in-vehicle safety platform.
[0053] 2) Configuration module: Sets and parses the configuration file. The configuration file includes message structure configuration and interface configuration; it sends the parsed message structure and interface configuration to the log parsing module and the interface dynamic generation module respectively. The message structure is the log data structure used for log parsing.
[0054] 3) Decompression module: Decompresses the received compressed log using LZ4, saves it in the local temporary folder, and sends it to the log parsing module.
[0055] 4) Log analysis module: Obtains the log data to be analyzed for each board from the message queue after parsing the data, performs log analysis according to the board type, outputs the log analysis results of each type of in-vehicle safety platform board, and discovers the interface dynamic generation module for display.
[0056] 5) Log parsing module: Parse the decompressed logs according to the message structure in the configuration file, and allocate the parsing processes of each board to each sub-thread according to the on-vehicle safety platform board type field.
[0057] 6) Interface dynamic generation module, dynamically generate a log analysis interface according to the message structure, and update the log analysis results to the log analysis interface through the Qt main thread; Log type selection interface: Dynamically generated according to the parsed interface configuration, used to select the log parsing method, including online parsing or offline analysis.
[0058] As attached Figure 2 The following is the logical flow chart of the on-vehicle safety platform log analysis system of the present invention, and the specific steps are as follows:
[0059] Step 21: Load configuration data using the singleton pattern for dynamically generating the interface and dynamically parsing log data;
[0060] Step 22: Dynamically generate a software interface according to the configuration file loaded in Step 21; The interface includes a log type selection interface and a log analysis interface;
[0061] Step 23: The on-vehicle safety platform compresses the binary configuration file using the LZ4 algorithm;
[0062] Step 24: The decompression module decompresses the algorithm compressed in Step 23 and stores it in a temporary folder;
[0063] Step 25: The log parsing module parses the temporarily decompressed data obtained in Step 4 according to the configuration file loaded in Step 21 and parses it into hexadecimal string data;
[0064] Step 26: Put the data decompressed in Step 25 into the message queue and wait for the producer to consume;
[0065] Step 27: The log analysis module obtains the log data of each board from the message queue, performs log analysis according to the board type, and sends them to the interface dynamic generation module respectively;
[0066] Step 28: The dynamic generation module updates the software interface UI through the main thread according to the data of each board type.
[0067] The present invention adopts the lazy loading method, reads data for update when the page needs to be updated, reduces the memory consumption of the local computer, and effectively improves the fluency of the system. The present invention performs intelligent analysis on the on-vehicle safety platform logs, helps the operation and maintenance personnel quickly locate the fault location, and at the same time performs trend analysis on the fault information, which helps to discover the potential safety hazards of the on-vehicle safety platform, solves the shortcomings of the manual log checking method, and effectively improves the operation and maintenance efficiency of the rail transit on-vehicle safety platform.
[0068] This embodiment relates to a method for analyzing vehicle-mounted safety platform logs. The vehicle-mounted logs are compressed using the LZ4 compression algorithm, and the logs of each module are dynamically parsed according to a configurable message structure. At the same time, a software interface is dynamically generated according to the message content, and the parsing results are displayed on the front-end log analysis interface to achieve intelligent analysis of vehicle-mounted safety platform logs.
[0069] As Figure 3 shown in the specific implementation flowchart of the vehicle-mounted safety platform log analysis method of the present invention, the specific steps are as follows:
[0070] Step 1: Run the log analysis software and display the main software interface;
[0071] Step 2: Read and load the configuration file from the configuration module. The configuration file is classified as: message structure configuration and interface configuration;
[0072] Step 3: Parse the loaded configuration file to obtain the message structure and interface configuration for the logs to be parsed. Send the parsed interface configuration to Step 4, and at the same time send the parsed log message structure to Step 8;
[0073] Step 4: Dynamically generate a log type selection interface according to the interface configuration;
[0074] Step 5: Select the log transmission method as online transmission or offline transmission through the operation of the log type selection interface;
[0075] Step 6: Log data acquisition: If the log transmission method is online transmission, the log acquisition module obtains real-time compressed log data from the vehicle-mounted safety platform; if it is offline transmission, the compressed log data saved locally is obtained from the vehicle-mounted safety platform by copying; the log acquisition module sends the obtained compressed log data to the decompression module;
[0076] Step 7: The decompression module decompresses the log data compressed by the LZ4 algorithm and stores the decompressed log data in a local temporary folder;
[0077] Step 8: Dynamically generate a log analysis interface according to the message structure parsed from the configuration file;
[0078] Step 9: The log parsing module and the log analysis module sequentially perform log parsing and log analysis on the log data decompressed in Step 7;
[0079] Step 10: Display the log analysis results of each type of vehicle-mounted safety platform board on the log analysis interface;
[0080] Step 11: When it is necessary to end the viewing of the log parsing results, close the log analysis software;
[0081] Step 12: Release the software memory and exit the software process.
[0082] After the log is decompressed, the parsing process of each board is assigned to each sub-thread according to the board type field, and then asynchronous communication between sub-threads is achieved through a message queue. At the same time, the load is evenly distributed to multiple consumers to avoid overloading a single consumer and improve the overall performance of the system. After the log analysis module retrieves the data from the message queue, it updates the interface through the Qt main thread to display the log analysis results.
[0083] The electronic device of the present invention includes a central processing unit (CPU), which can execute various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or computer program instructions loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM, and RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0084] Multiple components in the device are connected to the I / O interface, including: an input unit, such as a keyboard, a mouse, etc.; an output unit, such as various types of displays, speakers, etc.; a storage unit, such as a disk, an optical disc, etc.; and a communication unit, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0085] The processing unit executes the various methods and processes described above. For example, in some embodiments, the method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of the method described above can be executed. Alternatively, in other embodiments, the CPU can be configured to execute the method in any other appropriate manner (e.g., by means of firmware).
[0086] The functions described above herein can be at least partially performed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), and so on.
[0087] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.
[0088] In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0089] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A vehicle safety platform log analysis system, characterized in that: The system includes a log acquisition module, a decompression module, a log parsing module, a log analysis module and an interface dynamic generation module which are connected in sequence; The system also includes a configuration module connected to the log parsing module and the interface dynamic generation module respectively; The configuration module is used to configure and parse configuration files; The log acquisition module acquires compressed log data from the vehicle safety platform and sends it to the decompression module for decompression; The log parsing module parses the decompressed log data according to the configuration file, sends it to the log analysis module for analysis, and then outputs the log analysis results; The interface dynamic generation module dynamically generates a log analysis software interface according to a configuration file, and updates the log analysis result to the log analysis interface for display.
2. The vehicle-mounted safety platform log analysis system according to claim 1, characterized in that: The configuration file includes message structure configuration and interface configuration, which are used for log parsing and dynamic interface generation.
3. The vehicle-mounted safety platform log analysis system according to claim 2, characterized in that: The dynamically generated interfaces include the log type selection interface and the log analysis interface; The log type selection interface is dynamically generated according to the interface configuration and is used to select the log transmission mode; The log analysis interface is dynamically generated according to the message structure and is used to display the log analysis results.
4. The vehicle-mounted safety platform log analysis system according to claim 1, characterized in that: The log acquisition module acquires log data from the vehicle-mounted safety platform in different ways according to the log transmission mode; specifically: if the log transmission mode is online transmission, the log acquisition module requests online compressed log data from the vehicle-mounted safety platform; if the log transmission mode is offline transmission, the log acquisition module copies offline compressed log data from the vehicle-mounted safety platform.
5. The vehicle-mounted safety platform log analysis system according to claim 1, characterized in that: The decompression module performs LZ4 decompression on the received log data.
6. The vehicle-mounted safety platform log analysis system according to claim 2, characterized in that: The log parsing module parses the decompressed log according to the message structure, and distributes the parsing process of each board to each sub-thread according to the board type field of the vehicle safety platform.
7. The vehicle-mounted safety platform log analysis system according to claim 1, characterized in that: The log analysis module obtains the log data to be analyzed of each board from the message queue, performs log analysis according to the board type, and outputs the log analysis results of each type of vehicle safety platform board.
8. The vehicle-mounted safety platform log analysis system according to claim 1, characterized in that: The interface dynamic generation module dynamically generates a log analysis interface according to the message structure, and displays the log analysis result to the log analysis interface through the Qt main thread in a lazy loading manner.
9. An analysis method using the vehicle safety platform log analysis system according to any one of claims 1 to 8, characterized in that: The method comprises the following steps: Step 1: Start the vehicle safety platform log analysis system; Step 2: Read and load the configuration file from the configuration module. The configuration file is classified into: message structure configuration and interface configuration; Step 3: Parse the loaded configuration file to obtain the message structure and interface configuration of the log to be parsed; send the parsed message structure to step 6; Step 4: The log acquisition module acquires online or offline log data and sends it to the decompression module; Step 5: The decompression module decompresses the compressed log data and stores the decompressed log data in a local temporary folder; Step 6: According to the message structure, the interface dynamic generation module dynamically generates the log analysis interface; Step 7: The log parsing module and the log analysis module perform log parsing and log analysis on the log data decompressed in step 7 in turn; Step 8: Display the log analysis results on the log analysis interface.
10. The analysis method according to claim 9, characterized in that The log parsing module and the log analysis module both perform log parsing and log analysis on the log data according to the vehicle safety platform board type.
11. The analysis method according to claim 9, characterized in that The lazy loading method is used to read data and update the log analysis interface when the log analysis results are updated.
12. The analysis method according to claim 9, characterized in that The interface configuration is used to dynamically generate a log type selection interface, and the log transmission mode is selected as online transmission or offline transmission through the operation log type selection interface.
13. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 9 to 12 is implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 9 to 12 is implemented.
Citation Information
Patent Citations
Automated Analysis Method of Vehicle Controller Log Data Based on Requirements Modeling
CN104636241B
Vehicle-mounted ATC log real-time analysis method and device
CN115859941A
Cited By
Vehicle-mounted safety platform maintenance and diagnosis method
CN120986493A