Log data shunting encryption method, device, electronic device and readable storage medium

By reading the inventory configuration file in the target application, and encrypting the log data using DLT's advanced encryption standard, the problem of privacy leakage in log data transmission is solved, improving the security of data transmission and the user's sense of security.

CN118194351BActive Publication Date: 2025-05-02CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410367015.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2025-05-02
Estimated Expiration
2044-03-28

AI Technical Summary

Technical Problem

In the prior art, log data may lead to privacy leakage in transmission channels, reducing the user's sense of security.

Method used

Create a log object by reading the manifest profile when the target application starts, determining the log printing mode, and encrypting the log printing data through advanced encryption standards based on DLT, ensuring that the data is encrypted before transmission.

Benefits of technology

It realizes the security and privacy of log data during transmission, improves the security of users using the target application, and reduces the resource usage of processing log data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118194351B_ABST
    Figure CN118194351B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and provides a log data diversion encryption method, device, electronic device and readable storage medium. The method includes: reading the list configuration file of the target application and creating a corresponding log object, determining the log printing mode based on the log object; receiving log data and inputting the log object to obtain the corresponding log mode data; if the log printing mode includes one or more of the file mode or the remote mode, using the corresponding log data as the log printing data; encrypting the log printing data to obtain the encrypted log printing data; determining the preset printing process corresponding to the log printing data, sending the corresponding decryption function and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts and processes the encrypted log printing data. The log data diversion encryption method provided by the present application improves the security of log data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a log data diversion encryption method, device, electronic device and readable storage medium. Background Art

[0002] In the prior art, most vehicles' automotive electronic systems use a dedicated log recording module or system, which can be used to collect and record various data information of the automotive electronic system during development, testing and actual operation in real time, such as fault events, system status changes, sensor data, etc., and store them in a memory in a specific format. The log data can also be saved in levels, such as debug level, information level, warning level or error level, so that developers can select the appropriate log level as needed. Developers can also be allowed to customize log events, thereby realizing the configuration and filtering of log data and obtaining truly needed and useful log data.

[0003] However, the storage of log file patterns formed by log data needs to be implemented by developers themselves, and the log data may contain a large amount of sensitive information, such as users' driving habits, driving routes, etc., which may lead to privacy leakage during the transmission of log data and reduce users' sense of security. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a log data diversion encryption method, device, electronic device and readable storage medium to solve the problem in the prior art that privacy leakage may occur in the log data transmission path and reduce the user's sense of security.

[0005] A first aspect of an embodiment of the present application provides a log data offload encryption method, comprising:

[0006] When the target application is started, the manifest configuration file of the target application is read, a log object corresponding to the target application is created based on the manifest configuration file, and a log printing mode is determined based on the log object, where the log printing mode includes one or more of a console mode, a file mode, or a remote mode;

[0007] Receive log data of a target application, input the log data into a log object, and obtain log mode data corresponding to a log printing mode, wherein the log mode data includes one or more of console log data corresponding to a console mode, file log data corresponding to a file mode, or remote log data corresponding to a remote mode;

[0008] If the log printing mode includes the console mode, the diagnostic tracking library DLT is called through the console to print the console log data;

[0009] If the log printing mode includes one or more of the file mode or the remote mode, the file log data corresponding to the file mode or the remote log data corresponding to the remote mode is used as the log printing data;

[0010] Encrypting the log print data by using the DLT-based advanced encryption standard to obtain encrypted log print data;

[0011] Determine the preset printing process corresponding to the log printing data, send the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data. The preset printing process includes a daemon process and a log data viewer process.

[0012] A second aspect of an embodiment of the present application provides a log data splitting encryption device, comprising:

[0013] a configuration module configured to read a manifest configuration file of the target application when the target application is started, create a log object corresponding to the target application based on the manifest configuration file, and determine a log printing mode based on the log object, where the log printing mode includes one or more of a console mode, a file mode, or a remote mode;

[0014] A first processing module is configured to receive log data of a target application, input the log data into a log object, and obtain log mode data corresponding to a log printing mode, wherein the log mode data includes one or more of console log data corresponding to a console mode, file log data corresponding to a file mode, or remote log data corresponding to a remote mode;

[0015] The second processing module is configured to call the diagnostic tracking library DLT through the console to print console log data if the log printing mode includes the console mode;

[0016] A third processing module is configured to use the file log data corresponding to the file mode or the remote log data corresponding to the remote mode as the log printing data if the log printing mode includes one or more of the file mode or the remote mode;

[0017] An encryption module is configured to encrypt the log print data by using an advanced encryption standard based on DLT to obtain encrypted log print data;

[0018] The fourth processing module is configured to determine the preset printing process corresponding to the log printing data, send the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data. The preset printing process includes a daemon process and a log data viewer process.

[0019] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0020] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0021] Compared with the prior art, the embodiments of the present application have the following beneficial effects: when the target application is started, the list configuration file of the target application is read and the log object of the target application is created according to the list configuration file, the log printing mode is determined according to the log object, and the log printing mode includes one or more of the console mode, the file mode or the remote mode, the log data is received and input into the log object, and the log mode data corresponding to the log printing mode is obtained, so that the log objects corresponding to different log printing modes can be directly configured according to the list configuration file of the target application, the log object can directly determine the log mode data, and there is no need to repeatedly obtain the log data, occupy a large amount of memory resources, and the flexibility is high when processing the log data, and the resource occupation of processing the log data is reduced. When the log printing data exists in the console mode, the console log data is printed by calling the diagnostic tracking library through the console, and when the log printing mode includes one or more of the file mode or the remote mode, the corresponding log data is used as the log printing data, and the log printing data is encrypted by DLT to obtain the encrypted log printing data, so that the log printing data is encrypted before it is transmitted, which ensures the security and privacy of the log printing data during the transmission process, and improves the sense of security of the user when using the target application. The encrypted log printing data and the corresponding decryption function are sent to the corresponding preset printing process to decrypt the encrypted log printing data. The preset printing process can realize automatic local storage or mount point storage of log data in file mode. There is no need for separate development and maintenance to store log printing data, which saves development time and development difficulty. Since the log file formed by the log printing data can be stored on the mount point, the storage pressure of the locomotive itself is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 It is a schematic diagram of an application scenario of an embodiment of the present application;

[0024] Figure 2 It is a flow chart of a log data diversion encryption method provided by an embodiment of the present application;

[0025] Figure 3 It is a flow chart of another log data diversion encryption method provided by an embodiment of the present application;

[0026] Figure 4 It is a schematic diagram of a log data splitting encryption device provided in an embodiment of the present application;

[0027] Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0029] A log data stream encryption method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0030] Figure 1 1 is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a server 104, and a network 105.

[0031] The first terminal device 101, the second terminal device 102 and the third terminal device 103 can be hardware or software. When the first terminal device 101, the second terminal device 102 and the third terminal device 103 are hardware, they can be various electronic devices with display screens and supporting communication with the server 104, including but not limited to vehicle-mounted computers, vehicle-mounted processors, vehicle-mounted tablets, smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when the first terminal device 101, the second terminal device 102 and the third terminal device 103 are software, they can be installed in the electronic devices described above. The first terminal device 101, the second terminal device 102 and the third terminal device 103 can be implemented as multiple software or software modules, or as a single software or software module, which is not limited in the embodiment of the present application. Further, various applications can be installed on the first terminal device 101, the second terminal device 102 and the third terminal device 103, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0032] The server 104 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 104 may be a single server, or a server cluster composed of several servers, or a cloud computing service center, which is not limited in the present embodiment of the application.

[0033] It should be noted that the server 104 can be hardware or software. When the server 104 is hardware, it can be various electronic devices that provide various services for the first terminal device 101, the second terminal device 102, and the third terminal device 103. When the server 104 is software, it can be multiple software or software modules that provide various services for the first terminal device 101, the second terminal device 102, and the third terminal device 103, or it can be a single software or software module that provides various services for the first terminal device 101, the second terminal device 102, and the third terminal device 103, and the embodiment of the present application does not limit this.

[0034] The network 105 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present application.

[0035] It should be noted that the specific types, quantities and combinations of the first terminal device 101, the second terminal device 102 and the third terminal device 103, the server 104 and the network 105 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.

[0036] Figure 2 Schematic diagram of a log data diversion encryption method provided by an embodiment of the present application. Figure 2 As shown, the log data diversion encryption method includes the following steps:

[0037] S201, when a target application is started, a manifest configuration file of the target application is read, a log object corresponding to the target application is created based on the manifest configuration file, and a log printing mode is determined based on the log object;

[0038] S202, receiving log data of a target application, inputting the log data into a log object, and obtaining log mode data corresponding to a log printing mode;

[0039] S203, if the log printing mode includes the console mode, calling the diagnostic tracking library DLT through the console to print the console log data;

[0040] S204, if the log printing mode includes one or more of the file mode or the remote mode, using the file log data corresponding to the file mode or the remote log data corresponding to the remote mode as the log printing data;

[0041] S205, encrypting the log print data by using the DLT-based advanced encryption standard to obtain encrypted log print data;

[0042] S206, determine the preset printing process corresponding to the log printing data, send the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data. The preset printing process includes a daemon process and a log data viewer process.

[0043] Among them, the log printing mode includes one or more of console mode, file mode or remote mode, and the log mode data includes one or more of console log data corresponding to the console mode, file log data corresponding to the file mode or remote log data corresponding to the remote mode.

[0044] Figure 2 The log data offload encryption method can be Figure 1The remote mode is executed by any terminal device among the first terminal device, the second terminal device or the third terminal device provided, and the remote log data is sent to another terminal device through the server for execution in the remote mode.

[0045] In an exemplary embodiment of the present application, when the target application is started, the manifest configuration file Manifest corresponding to the application is read, and various settings and parameters of the target application are determined through the manifest configuration file, including parameters of the log object. A corresponding log object is created for the target application according to the manifest configuration file, and the log object is used to manage the transmission and storage of log data. At the same time, the log printing mode is determined according to the log object, wherein the log printing mode includes one or more of the console mode, the file mode, or the remote mode.

[0046] For example, the log printing mode may include a file mode, a console mode and a remote mode, or a console mode, a file mode and a remote mode. The console mode is to output the log data directly to the console interface of the application, the file mode is to write the log data to a log file, and the log file is saved locally or at a mount point, and the remote mode is to send the log data to a log data viewer through a server so that the log data can be viewed and operated by a remote log data viewer.

[0047] If the current log printing mode includes the console mode, the console log data is printed by calling the Diagnostic Log and Trace (DLT) through the console. DLT uses a dynamic library. By calling DLT, the log data of the console mode can be directly printed. The log data of the file mode and remote mode can also be forwarded, encrypted, and the reception and filtering of the log data can be controlled by calling DLT.

[0048] If the current log mode includes one or more of the file mode or the remote mode, the log file log data corresponding to the file mode or the remote log data corresponding to the remote mode is used as the log printing data, that is, when the current log mode includes the file mode and the remote mode, the log printing data includes the file log data and the remote log data; when the log mode includes the file mode or the remote mode, the log printing data includes the corresponding file log data or remote log data.

[0049] DLT is encapsulated in the logTrace dynamic library, which adds the ability to read manifest configuration files to DLT and adds the direct printing function of defined types and common data types in AUTomotive Open System Architecture (AUTOSAR) components.

[0050] Before the log printing data is sent, it needs to be encrypted. Specifically, the log printing data is encrypted by calling the Advanced Encryption Standard (AES) of DLT to ensure the security and privacy of the log printing data, thereby obtaining the encrypted log printing data.

[0051] Among them, the advanced encryption standard involved in the embodiment of the present application only needs to encrypt the payload of the DLT transmission without affecting the normal transmission of the DLT protocol data, wherein the DLT protocol data includes a standard header, an optional extended header and a payload.

[0052] The corresponding preset printing process is determined according to the log data corresponding to the log mode included in the log printing data, and the decryption function corresponding to the advanced encryption standard and the encrypted log printing data are sent to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data according to the decryption function and processes the encrypted log printing data, wherein the preset printing process includes a daemon process and a log data viewer process.

[0053] Among them, the daemon process includes the DLT daemon process, which runs on the electronic controller of the vehicle computer and is used to receive and store file log data to the mount point or locally. It can also be used to control the scrolling of log files, and is also used to receive and forward remote log data to the log data viewer. It also assumes the function of forwarding the control instructions received by the log data viewer process to the DLT. The log data viewer process includes receiving and storing remote log data through the DLT daemon process, forwarding remote log data to the log data viewer, controlling the log data viewer to receive remote log data and displaying remote log data on the log data viewer.

[0054] For example, when the log printing data includes file log data but does not include remote log data, the file log data is encrypted and sent to the daemon, which decrypts it and saves it locally or to a mount point. When the log printing data includes remote log data but does not include file log data, the remote log data is encrypted and sent to the log data viewer through the DLT daemon, and decrypted and stored through the DLT daemon. At the same time, the remote log data is forwarded to the log data viewer so that the log data viewer receives the encrypted remote log data and controls the log data viewer to decrypt and display it.

[0055] According to the technical solution provided in the embodiment of the present application, the encrypted log printing data can be decrypted, and the log data in file mode can be automatically stored locally or at a mount point through a preset printing process, thereby saving development time and development difficulty. At the same time, encrypted transmission is adopted for log data in file mode and remote mode, thereby improving the security of log data transmission.

[0056] In some embodiments, reading a manifest configuration file of a target application and creating a log object corresponding to the target application based on the manifest configuration file includes:

[0057] Read the manifest configuration file of the target application, and determine the configuration object corresponding to the target application based on the manifest configuration file, the configuration object including a log management instance, a log manifest instance, a log object instance, a log data stream instance, and a diagnostic tracking log library;

[0058] Create each configuration object and assign values ​​to each configuration object according to the configuration data in the manifest configuration file to obtain the log object corresponding to the target application.

[0059] When the target application is monitored running, the manifest configuration file corresponding to the target application is found and read by specifying the file path and identifying the file format. The manifest configuration file is analyzed to determine the configuration object corresponding to the target application. The configuration objects include log management instances, log manifest instances, log object instances, log data stream instances, and diagnostic tracking log libraries. Each configuration object has different functions and together constitute a complete log processing flow.

[0060] The log management instance is used to initialize the log object instance through the list configuration file transmitted by the log list instance, and can also construct and destroy the log object instance;

[0061] The log list instance stores the list of all log objects and related information;

[0062] The log object instance is used to record logs, record the running status, error information and other contents of the target application in the form of logs, and construct log data stream objects of all log levels during initialization. The log data stream object can return the specified log level. At the same time, the log object instance can also send the log print data in the buffer to DLT, so that DLT can print out the log print data;

[0063] The log data stream instance is used to receive log print data of different data types and store the log print data in the buffer. It can also call the function in the log object instance to refresh the log print data in the buffer. Among them, the manifest configuration file contains a text file of various configuration information required by the target application, and can customize a dedicated log process for the target application based on the manifest configuration file. The log manifest instance is used to read the manifest configuration file to obtain the basic information of the target application. The basic information includes the description of the target application, the name of the target application, the maximum log level supported, the log support mode, the log storage path, and the redundant / non-redundant mode of the log.

[0064] The log levels include: no log data 0x00 level, unrecoverable serious error 0x01 level, ambiguous error 0x02 level that affects correct function, cannot ensure correct behavior and issue a warning 0x03 level, output important operation information 0x04 level, detailed debugging information of the target application 0x05 level and additional verbose debugging information 0x06 level, where the severity from 0x00 level to 0x06 level decreases as the number increases. If the maximum supported log level is 5 in the manifest configuration file, it means that log levels from 0x00 level to 0x05 level can be supported.

[0065] Among them, the log support mode may include: 0x01 indicates support for remote mode, 0x02 indicates support for file mode, and 0x04 indicates support for console mode. For example, when the support mode displayed in the list configuration file is 2, it indicates support for file mode, when the support mode displayed in the list configuration file is 3, it indicates that the current application supports remote mode and file mode, when the support mode displayed in the list configuration file is 7, it indicates that the current application supports remote mode, file mode and console mode, and so on. The value range of the log support mode in the list configuration file can be 0 to 7.

[0066] Among them, the above numbers such as 0x00, 0x01, ..., 0x06 are in hexadecimal digital form. When defining the log level and log support mode, they are defined according to hexadecimal numbers. The manifest configuration file of each target application initializes the log object, that is, integer numbers can be used when assigning values ​​to the log object.

[0067] Create each configuration object and copy the configuration data in the manifest configuration file for each configuration object, thereby determining the multi-dimensional parameters corresponding to the log of the target application to ensure that it works as expected.

[0068] According to the technical solution provided in the embodiment of the present application, a log object that fully matches the target application and is the target application's current operation is obtained based on the manifest configuration file, which can record all important information generated by the target application during its operation, ensure the accuracy and completeness of the log data, and provide support for subsequent diagnosis and performance optimization.

[0069] In some embodiments, the log printing data is encrypted by using the advanced encryption standard based on DLT to obtain the encrypted log printing data, including:

[0070] Use the log print data as the plain text of the current advanced encryption standard, determine the key, encryption function and decryption function corresponding to the current advanced encryption standard;

[0071] The advanced encryption standard is performed on the plain text and the key through the encryption function to obtain the encrypted log printing data.

[0072] The log printing data is used as the plaintext of the current advanced encryption standard, that is, the original data to be encrypted, and the key corresponding to the current advanced encryption standard is determined. The key can determine the complexity and security of the encryption algorithm, and at the same time determine the encryption function and the corresponding decryption function. Among them, the encryption function takes the plaintext and the key as input, and outputs the encrypted log printing data through a series of mathematical operations.

[0073] By calling the encryption function, taking the plaintext and the key as the input of the encryption function, the encrypted log printing data is obtained, and the mathematical expression of the encrypted log printing data is: C=E(K, P), where C is the encrypted log printing data, K is the key, P is the plaintext, and E is the encryption function.

[0074] Among them, executing the encryption function of the Advanced Encryption Standard involves receiving plaintext and a key, taking round key addition, byte replacement, row shift, column confusion according to a first key and round key addition according to a second key as one round of encryption process, repeating the encryption process for multiple rounds, when executing the second-to-last round of encryption, updating the encryption process to byte replacement, row shift, column confusion and round key addition of another key, and when executing the last round of encryption, updating the encryption process to byte replacement, row shift and round key addition of another key, thereby obtaining encrypted log printing data.

[0075] The encrypted log print data may be a string of seemingly meaningless characters or binary codes, thereby ensuring that the encrypted log print data cannot be easily decrypted or restored even if it is illegally obtained, thereby ensuring the security of the log print data.

[0076] According to the technical solution provided in the embodiment of the present application, the log printing data is encrypted by the advanced encryption standard to obtain the encrypted log printing data, wherein the advanced encryption standard involves multiple rounds of data conversion, replacement and obfuscation, which can increase the complexity and security of the log printing data. Even if the encrypted log printing data is illegally obtained during the transmission process, it cannot be easily decrypted or restored, thereby ensuring the security of the log printing data.

[0077] In some embodiments, a decryption function corresponding to the advanced encryption standard and the encrypted log printing data are sent to a corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function, and processes the encrypted log printing data according to the preset printing process, including:

[0078] When the log print data includes file log data, the encrypted log print data, the decryption function and the key are sent to the daemon process, so that the daemon process decrypts the received log print data based on the decryption function, and stores the decrypted file log data according to a preset storage path;

[0079] When the log printing data includes remote log data, the encrypted log printing data, decryption function and key are sent to the log data viewer process, so that the log data viewer process decrypts the received log printing data based on the decryption function and displays the decrypted remote log data on the log data viewer.

[0080] After completing the encryption process of the log printing data, the decryption function corresponding to the advanced encryption standard and the encrypted log printing data are sent to the preset printing process. Alternatively, the decryption function is sent to the preset printing process after the decryption function is determined, that is, there is no strong correlation between the decryption function and the sending of the encrypted log printing data.

[0081] When the log printing data includes file log data, the encrypted log printing data, decryption function and key are sent to the daemon process, so that the daemon process decrypts the encrypted log printing data through the decryption function and key, thereby being able to store the file log data according to a preset storage path.

[0082] Among them, the decryption process is the inverse operation of the encryption process provided in the above embodiment. The encrypted log printing data is restored to the original plain text using the same key. The mathematical expression can be expressed as: P = D (K, C), where P is the plain text, D is the decryption function, K is the key, and C is the encrypted log printing data.

[0083] When the log printing data includes remote log data, the encrypted printing log data, the decryption function and the key are sent to the log data viewer process for decryption, and the decrypted remote log data is displayed on the log data viewer.

[0084] Among them, the process of the log data viewer process processing the encrypted log printing data is specifically as follows: the encrypted log printing data is sent to the daemon process, and the daemon process decrypts and saves it, and then forwards it to the log data viewer through the daemon process. What is forwarded here is still the encrypted log printing data. The log data viewer decrypts the encrypted log printing data according to the decryption function and the key, and displays the decrypted remote log printing data on the log data viewer.

[0085] Among them, the log data viewer is usually a graphical interface tool used for real-time viewing, analysis, filtering, searching, exporting, controlling and visualizing remote log data and log files stored locally or at a mount point.

[0086] According to the technical solution provided in the embodiment of the present application, the security of log printing data during transmission can be guaranteed, and targeted processing can be performed on the log printing data corresponding to different log modes, thereby improving the efficiency and accuracy of log management. At the same time, local or mount point storage of file log data can be realized, reducing development difficulty and saving development time.

[0087] In some embodiments, after determining the preset printing process corresponding to the log mode data, and sending the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, the method further includes:

[0088] When it is monitored that the log data viewer process receives a control instruction, the remote log data is updated and displayed based on the control instruction, and the console log data and the file log data are updated based on the control instruction;

[0089] The control instructions include one or more of filtering instructions, visualization instructions, search instructions, export instructions and saving instructions.

[0090] Monitor the status of the log data viewer process in real time. When the log data viewer process receives a control instruction, it immediately responds and executes the operation corresponding to the control instruction. At the same time, it synchronizes the control instruction for the console log data and the file log data to maintain the consistency of the remote log data, the console log data and the file log data. Among them, the control instruction is used to guide the log data viewer process to process and display the remote log print data, so that users or developers can perform log analysis and management more efficiently.

[0091] Among them, there are many types of control instructions, including but not limited to one or more of filtering instructions, visualization instructions, search instructions, export instructions and saving instructions. Filtering instructions are used to filter log data according to specific conditions or keywords, so as to filter irrelevant log data. Visualization instructions are used to display log data in the form of charts, curves, etc., which can more intuitively reflect the operating status and log distribution status of the target application. Search instructions are used to quickly search for specific content or events in a large amount of log data. Export instructions are used to export log data as files for further analysis and processing on other tools or platforms. Save instructions are used to save current log data or configuration information to local or remote storage for subsequent use.

[0092] For example, when a filtering instruction is received, the decrypted remote log data is filtered to display the log entries that meet the conditions, and the console log data and file log data are filtered at the same time.

[0093] According to the technical solution provided in the embodiment of the present application, flexible log processing and display can be performed according to needs, which improves the convenience and practicality of log management. At the same time, synchronizing control instructions to console log data and file log data through the log data viewer process can ensure the integrity and consistency of the log data. Regardless of viewing the log data through the log data viewer, console or file, the latest and most accurate log data can be seen.

[0094] In some embodiments, when it is detected that the log data viewer process receives a control instruction, updating and displaying the remote log data based on the control instruction includes:

[0095] Determine the control mode corresponding to the current control instruction, the control mode includes real-time control mode, historical control mode and comparative control mode;

[0096] When the control mode is the real-time control mode, executing the steps of receiving log data of the target application, inputting the log data into the log object, and obtaining log mode data corresponding to the log printing mode;

[0097] When the control mode is the historical control mode, the instruction content corresponding to the control instruction is executed in the historical file log corresponding to the historical file log data;

[0098] When the control mode is the comparison control mode, the instruction content corresponding to the control instruction is executed in the historical file log and the current remote log data.

[0099] Determine the control mode corresponding to the current control instruction, wherein the control mode includes a real-time control mode, a historical control mode, and a comparative control mode.

[0100] When the control mode is real-time control mode, the steps of receiving the log data of the target application, inputting the log data into the log object, and obtaining the log mode data corresponding to the log printing mode are executed immediately. The log data generated by the target application can be monitored and captured in real time. The log mode data will be displayed in a preset manner to ensure that the operating status and log information of the target application can be understood in real time.

[0101] When the control mode is the historical control mode, the instruction content corresponding to the control instruction is executed in the historical file log corresponding to the historical file log data. That is, when it is necessary to view or analyze the log data of the target application in a certain period of time in the past, find the relevant log records in the historical file log according to the specified time period or conditions, and execute the operations specified in the control instruction, such as filtering, searching, displaying all, and visualizing. In this way, historical data can be traced back to understand the historical operation status of the target application and the possible problem locations.

[0102] When the control mode is the comparison control mode, the instruction content corresponding to the control instruction is executed in the historical file log and the current remote log data. It is suitable for comparing log data of different time periods or different versions of the target application. According to the control instruction, the same operation can be performed simultaneously in the historical file log and the current remote log data, and the comparison results are displayed on the log data viewer, so that users or R&D personnel can clearly see the changes and differences between different data and make more accurate judgments and decisions.

[0103] According to the technical solution provided in the embodiment of the present application, the log data can be processed and displayed accordingly according to the control instructions corresponding to the real-time control mode, the historical control mode or the comparative control mode, and can flexibly respond to different needs and provide efficient and accurate log data viewing and analysis functions.

[0104] In some embodiments, after the encrypted log printing data is processed according to the preset printing process, the method further includes:

[0105] When the target application stops running, the log object is released;

[0106] Clears the real-time remote log data displayed by the log data viewer process.

[0107] After processing the encrypted log printing data according to the preset printing process, the running status of the target application is monitored in real time. When it is detected that the target application stops running, all log objects created based on the operation of this target application are released, thereby recycling resources and avoiding waste and potential memory leaks.

[0108] At the same time, in order to ensure the security and privacy of log data, the real-time remote log data displayed by the log data viewer process is cleared, thereby completely removing sensitive information that may be left in the log data viewer, further protecting the privacy of log data and preventing log data from being improperly used or leaked.

[0109] According to the technical solution provided by the embodiment of the present application, the encrypted log printing data can be processed according to the preset process, and the log object can be automatically released and the real-time remote log data can be cleared when the application stops running, thereby ensuring the security of the data and the stability of the system. Such a design makes our system more intelligent, efficient and secure, and can better meet the needs of users.

[0110] Figure 3 It is a flow chart of another log data diversion encryption method provided in an embodiment of the present application.

[0111] in, Figure 3 1 is a flow chart of the log printing mode of the above embodiment including console mode, file mode and remote mode. Figure 3 As shown, when it is detected that the target application starts to run, the log printing function of AUTOSAR is called to print the log data, and the list configuration file is read through logTrace to obtain the console log data, file log data and remote log data. The console print data is printed on the console through DLT, and the file log data and remote log data are encrypted and sent to the DLT daemon after encryption. The DLT daemon decrypts the file log data and remote log data and stores them according to the specified path. The DLT daemon forwards the remote log data to the log data viewer for viewing. At the same time, the log data viewer is responsible for receiving control instructions and forwarding the control instructions to the DLT daemon and DLT to synchronously update the console log data and the stored file data.

[0112] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0113] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0114] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0115] Figure 4 Schematic diagram of a log data shunting encryption device provided by an embodiment of the present application. Figure 4 As shown, the log data shunting encryption device includes: a configuration module 401, a first processing module 402, a second processing module 403, a third processing module 404, an encryption module 405, and a fourth processing module 406, wherein:

[0116] The configuration module 401 is configured to read the manifest configuration file of the target application when the target application is started, create a log object corresponding to the target application based on the manifest configuration file, and determine a log printing mode based on the log object, where the log printing mode includes one or more of a console mode, a file mode, or a remote mode;

[0117] The first processing module 402 is configured to receive log data of a target application, input the log data into a log object, and obtain log mode data corresponding to a log printing mode, wherein the log mode data includes one or more of console log data corresponding to a console mode, file log data corresponding to a file mode, or remote log data corresponding to a remote mode;

[0118] The second processing module 403 is configured to call the diagnostic tracking library DLT through the console to print the console log data if the log printing mode includes the console mode;

[0119] The third processing module 404 is configured to use the file log data corresponding to the file mode or the remote log data corresponding to the remote mode as the log printing data if the log printing mode includes one or more of the file mode and the remote mode;

[0120] The encryption module 405 is configured to encrypt the log print data by using the advanced encryption standard based on DLT to obtain the encrypted log print data;

[0121] The fourth processing module 406 is configured to determine the preset printing process corresponding to the log printing data, send the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data. The preset printing process includes a daemon process and a log data viewer process.

[0122] In some embodiments, the configuration module 401 is configured to:

[0123] Read the manifest configuration file of the target application, and determine the configuration object corresponding to the target application based on the manifest configuration file, the configuration object including a log management instance, a log manifest instance, a log object instance, a log data stream instance, and a diagnostic tracking log library;

[0124] Create each configuration object and assign values ​​to each configuration object according to the configuration data in the manifest configuration file to obtain the log object corresponding to the target application.

[0125] In some embodiments, the encryption module 405 is configured to:

[0126] Use the log print data as the plain text of the current advanced encryption standard, determine the key, encryption function and decryption function corresponding to the current advanced encryption standard;

[0127] The advanced encryption standard is performed on the plain text and the key through the encryption function to obtain the encrypted log printing data.

[0128] In some embodiments, the encryption module 405 is configured to:

[0129] When the log print data includes file log data, the encrypted log print data, the decryption function and the key are sent to the daemon process, so that the daemon process decrypts the received log print data based on the decryption function, and stores the decrypted file log data according to a preset storage path;

[0130] When the log printing data includes remote log data, the encrypted log printing data, decryption function and key are sent to the log data viewer process, so that the log data viewer process decrypts the received log printing data based on the decryption function and displays the decrypted remote log data on the log data viewer.

[0131] In some embodiments, after the fourth processing module 406 determines the preset printing process corresponding to the log mode data and sends the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, it is further configured to:

[0132] When it is monitored that the log data viewer process receives a control instruction, the remote log data is updated and displayed based on the control instruction, and the console log data and the file log data are updated based on the control instruction;

[0133] The control instructions include one or more of filtering instructions, visualization instructions, search instructions, export instructions and saving instructions.

[0134] In some embodiments, the fourth processing module 406 is configured to:

[0135] Determine the control mode corresponding to the current control instruction, the control mode includes real-time control mode, historical control mode and comparative control mode;

[0136] When the control mode is the real-time control mode, executing the steps of receiving log data of the target application, inputting the log data into the log object, and obtaining log mode data corresponding to the log printing mode;

[0137] When the control mode is the historical control mode, the instruction content corresponding to the control instruction is executed in the historical file log corresponding to the historical file log data;

[0138] When the control mode is the comparison control mode, the instruction content corresponding to the control instruction is executed in the historical file log and the current remote log data.

[0139] In some embodiments, after the fourth processing module 406 processes the encrypted log printing data according to the preset printing process, it is further configured to:

[0140] When the target application stops running, the log object is released;

[0141] Clears the real-time remote log data displayed by the log data viewer process.

[0142] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0143] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.

[0144] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0145] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.

[0146] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0147] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0148] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A log data diversion encryption method, characterized in that: include: When a target application is started, a manifest configuration file of the target application is read, a log object corresponding to the target application is created based on the manifest configuration file, and a log printing mode is determined based on the log object, wherein the log printing mode includes one or more of a console mode, a file mode, and a remote mode; Receive log data of the target application, input the log data into the log object, and obtain log mode data corresponding to the log printing mode, wherein the log mode data includes one or more of console log data corresponding to the console mode, file log data corresponding to the file mode, and remote log data corresponding to the remote mode; If the log printing mode includes the console mode, calling the diagnostic tracking library DLT through the console to print the console log data; If the log printing mode includes the file mode and / or the remote mode, the file log data corresponding to the file mode and / or the remote log data corresponding to the remote mode are used as log printing data; Encrypting the log print data by using an advanced encryption standard based on DLT to obtain the encrypted log print data; Determine a preset printing process corresponding to the log printing data, and send a decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data, wherein the preset printing process includes a daemon process and a log data viewer process.

2. The method according to claim 1, characterized in that Reading the manifest configuration file of the target application, and creating a log object corresponding to the target application based on the manifest configuration file, including: Reading a manifest configuration file of the target application, and determining a configuration object corresponding to the target application based on the manifest configuration file, wherein the configuration object includes a log management instance, a log manifest instance, a log object instance, a log data stream instance, and a diagnostic tracking log library; Each of the configuration objects is created, and a value is assigned to each of the configuration objects according to the configuration data in the list configuration file, so as to obtain a log object corresponding to the target application.

3. The method according to claim 1, characterized in that Encrypting the log print data by using an advanced encryption standard based on DLT to obtain the encrypted log print data includes: Taking the log print data as the plain text of the current advanced encryption standard, determining the key and encryption function corresponding to the current advanced encryption standard and the decryption function corresponding to the encryption function; The advanced encryption standard is executed on the plain text and the key through the encryption function to obtain the encrypted log printing data.

4. The method according to claim 3, characterized in that The method includes sending the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data, including: When the log print data includes the file log data, the encrypted log print data, the decryption function and the key are sent to the daemon process, so that the daemon process decrypts the received log print data based on the decryption function, and stores the decrypted file log data according to a preset storage path; When the log printing data includes the remote log data, the encrypted log printing data, the decryption function and the key are sent to the log data viewer process, so that the log data viewer process decrypts the received log printing data based on the decryption function, and displays the decrypted remote log data on the log data viewer.

5. The method according to claim 1, characterized in that After determining the preset printing process corresponding to the log mode data, and sending the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, the method further includes: When it is monitored that the log data viewer process receives a control instruction, the remote log data is updated and displayed based on the control instruction, and the console log data and the file log data are updated based on the control instruction; The control instructions include one or more of filtering instructions, visualization instructions, search instructions, export instructions and saving instructions.

6. The method according to claim 5, characterized in that When it is detected that the log data viewer process receives a control instruction, updating and displaying the remote log data based on the control instruction includes: Determine the control mode corresponding to the current control instruction, wherein the control mode includes a real-time control mode, a historical control mode and a comparative control mode; When the control mode is the real-time control mode, executing the steps of receiving the log data of the target application, inputting the log data into the log object, and obtaining the log mode data corresponding to the log printing mode; When the control mode is the historical control mode, executing the instruction content corresponding to the control instruction in the historical file log corresponding to the historical file log data; When the control mode is the comparison control mode, the instruction content corresponding to the control instruction is executed in the historical file log and the current remote log data.

7. The method according to any one of claims 1 to 6, characterized in that After the processing of the encrypted log print data, the method further includes: When it is detected that the target application stops running, releasing the log object; Clears the real-time remote log data displayed by the log data viewer process.

8. A log data splitting encryption device, characterized in that: include: a configuration module configured to read a manifest configuration file of the target application when the target application is started, create a log object corresponding to the target application based on the manifest configuration file, and determine a log printing mode based on the log object, wherein the log printing mode includes one or more of a console mode, a file mode, and a remote mode; A first processing module is configured to receive log data of the target application, input the log data into the log object, and obtain log mode data corresponding to the log printing mode, wherein the log mode data includes one or more of console log data corresponding to the console mode, file log data corresponding to the file mode, and remote log data corresponding to the remote mode; A second processing module is configured to, if the log printing mode includes the console mode, call the diagnostic tracking library DLT through the console to print the console log data; A third processing module is configured to use the file log data corresponding to the file mode and / or the remote log data corresponding to the remote mode as log printing data if the log printing mode includes the file mode and / or the remote mode; An encryption module, configured to encrypt the log print data by using an advanced encryption standard based on DLT to obtain the encrypted log print data; The fourth processing module is configured to determine the preset printing process corresponding to the log printing data, and send the decryption function corresponding to the advanced encryption standard and the encrypted log printing data to the corresponding preset printing process, so that the preset printing process decrypts the encrypted log printing data based on the decryption function and processes the encrypted log printing data. The preset printing process includes a daemon process and a log data viewer process.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Log security management method and device, platform and medium

    CN115883200A

  • Log subsystem, log system, vehicle log system and vehicle

    CN116450480A