Log processing method and device, equipment and storage medium
By calling the log daemon and the adaptive application communication interface, the application logs of the adaptive platform are transferred to the vehicle operating system, and attribute adjustment and filtering are performed. This solves the problem of unifying the log management of the adaptive platform and the vehicle operating system and improves the log quality. processing efficiency.
Patent Information
- Application Number
- CN202410755291.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-24
AI Technical Summary
The application logs in the adaptive platform and the log management of the in-vehicle operating system are not unified, resulting in low efficiency in log information processing and transmission.
By calling the preset log daemon, the target application log is extracted from the platform log library and transmitted to the vehicle operating system through the adaptive application communication interface. The log attributes are adjusted and filtered and stored based on the system log protocol of the vehicle operating system.
It realizes the unified management of application logs and system logs in the vehicle operating system, improves the efficiency of log processing and transmission, and ensures the correct storage and classification of logs.
Smart Images

Figure CN118694785A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a log processing method, device, equipment and storage medium. Background Art
[0002] The AUTOSAR Adaptive Platform (AUTOSAR high-performance computing platform) is an extension of the AUTOSAR architecture, specifically designed to support automotive electronic systems with highly automated and autonomous driving functions. With the popularity of the adaptive platform in vehicles, the number of applications and services configured in the adaptive platform is gradually increasing, resulting in a huge amount of log information.
[0003] Therefore, how to process the application logs of the adaptive platform and transmit them to the vehicle operating system to achieve unified management of application logs and system logs in the vehicle operating system is a problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a log processing method, device, equipment and storage medium to achieve unified management of application logs and system logs in a vehicle-mounted operating system.
[0005] According to one aspect of the present invention, a log processing method is provided, comprising:
[0006] If a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, the target application log is extracted from the platform log library by calling the preset log daemon process;
[0007] Transmitting the target application log to the vehicle operating system through the adaptive application communication interface, and controlling the vehicle operating system to adjust the properties of the target application log;
[0008] Based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the storage application log, and the storage application log is stored in the log folder under the vehicle operating system.
[0009] According to another aspect of the present invention, there is provided a log processing device, comprising:
[0010] An extraction module, for extracting target application logs from the platform log library by calling a preset log daemon if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected;
[0011] An adjustment module, used to transmit the target application log to the vehicle operating system through the adaptive application communication interface, and control the vehicle operating system to adjust the properties of the target application log;
[0012] The storage module is used to filter the target application log based on the system log protocol of the vehicle operating system, obtain the storage application log, and store the storage application log in the log folder under the vehicle operating system.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log processing method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the log processing method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the log processing method of any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention is that if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, the target application log is extracted from the platform log library by calling the preset log daemon process; the target application log is transmitted to the vehicle operating system through the adaptive application communication interface, and the vehicle operating system is controlled to adjust the properties of the target application log; based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the storage application log, and the storage application log is stored in the log folder under the vehicle operating system. By performing attribute conversion processing on the application log of the adaptive platform and transmitting it to the vehicle operating system, unified management of the application log and the system log in the vehicle operating system can be achieved.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a log processing method provided by Embodiment 1 of the present invention;
[0023] Figure 2A is a flow chart of a log processing method provided by Embodiment 2 of the present invention;
[0024] Figure 2B This is a log processing diagram based on a log daemon process provided by Embodiment 2 of the present invention;
[0025] Figure 2C This is a schematic diagram of the log storage structure of the vehicle operating system provided by the second embodiment of the present invention;
[0026] Figure 2D is a schematic diagram of the rolling storage process provided by the second embodiment of the present invention;
[0027] Figure 3 is a structural block diagram of a log processing device provided by Embodiment 3 of the present invention;
[0028] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0031] Embodiment 1
[0032] Figure 1 : is a flow chart of a log processing method provided in the first embodiment of the present invention; this embodiment is applicable to the case where a vehicle processes application logs in an adaptive platform and sends them to a vehicle-mounted operating system for unified storage with system logs. The method can be executed by a log processing device, which can be implemented in the form of hardware and / or software. The log processing device can be configured in an electronic device, such as a vehicle equipped with an adaptive platform, and executed by a control unit of the vehicle, such as Figure 1 As shown, the log processing method includes:
[0033] S101: If a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, extract the target application log from the platform log library by calling a preset log daemon process.
[0034] Among them, the vehicle adaptive platform refers to an automotive electronic system specifically used to support highly automated and autonomous driving functions. The vehicle adaptive platform can be an AUTOSAR high-performance computing platform. The vehicle adaptive platform can be an application layer built on the vehicle operating system. The vehicle operating system refers to the file system corresponding to the local intelligent operating system. For example, when the local intelligent operating system is a Linux system, the vehicle operating system can be a log protocol and file storage system in the Linux vehicle system. The vehicle adaptive platform is configured with a variety of adaptive applications with a large number of services, and a large number of application logs will be generated during the operation of the vehicle adaptive platform. The vehicle adaptive platform and the vehicle operating system can be configured in the vehicle ECU (electronic Control Unit).
[0035] The request for merged storage refers to a request to store the target application log of the vehicle adaptive platform to the vehicle operating system to merge the operating system log and the application log for storage. The preset log daemon may be configured on the vehicle adaptive platform. The log daemon may extract logs from the platform log library in response to the log collection request issued by the vehicle adaptive platform. The platform log library is the local log library of the vehicle adaptive platform. The application log may be a log generated during the process of application development to actual use. The target application log refers to the log sent by the target in the platform log library to the vehicle operating system and merged with the operating system log for storage. The target application log may include at least one of the following categories: communication (also known as COM) log, diagnostic (also known as DM) log, execution management (also known as SM) log, status (also known as EM) log, identity authentication (also known as IAM) log, encryption (also known as crypto) log, storage (also known as PM) log, and health management (also known as PHM) log.
[0036] Optionally, when the application of the vehicle adaptive platform is started, its local log module will automatically collect logs and timestamp the collected log information. When the adaptive application activity information reaches a serious level and needs to be recorded (the severity level here is the definition of activity information on the adaptive platform, and the log framework here only processes log information sent at or above the severity level), the trigger record becomes the target application log; it can also periodically generate merge storage instructions based on a preset time interval, and determine the new logs generated within the periodic time period as the target application log.
[0037] Optionally, by calling a preset log daemon, the target application log is extracted from the platform log library, including: determining the output strategy corresponding to each candidate application log under the vehicle adaptive platform; determining the candidate application log whose output strategy is to be output to the vehicle operating system as the target application log, and extracting the target application log from the platform log library by calling a preset log daemon.
[0038] The candidate application logs may be all application logs generated by each application under the vehicle adaptive platform. The output strategy refers to a preset strategy that characterizes the transmission destination of the candidate logs. The output strategy is to print to the console, to the internal log buffer of the adaptive platform, or to the vehicle operating system.
[0039] Optionally, the merged and stored requests can be parsed to directly determine the output strategy corresponding to each candidate application log, or the attribute information of each candidate log can be matched and extracted to determine the output strategy corresponding to each candidate application log, and the output strategy can be determined from the candidate logs to output the log to the vehicle operating system as the target application log. According to the log identifier of the target application log, the target application log is extracted from the platform log library by calling the preset log daemon.
[0040] Optionally, after extracting the target application log from the platform log library, it also includes: determining a target application identification number corresponding to the target application log; and updating the name field in the target application log according to the target application identification number and based on a preset field protection strategy.
[0041] The target application identification number refers to an identification number that can uniquely identify the target application log. The target application identification number can be, for example, a process identification code (PID) corresponding to the target application. The process identification code can be an identification code assigned to a process by the kernel when calling an application in a Linux system. The field protection policy can be, for example, a policy of adding an identification code after the name in the name field corresponding to the application.
[0042] Optionally, the application name corresponding to the target application log can be determined based on the name field in the target application log, and the application name is further included in the log data segment in the form of "application name [application PID]", that is, the name field in the target application log is updated.
[0043] It should be noted that by storing the application name in the form of "application name [application PID]", it is helpful to set the log filtering conditions in the form of "application name + [" to retrieve all applications involved in the log, thereby preventing the application name from being incorrectly filtered when it appears alone in other field positions, thereby achieving log filtering error protection.
[0044] S102: Transmit the target application log to the vehicle operating system through the adaptive application communication interface, and control the vehicle operating system to adjust the properties of the target application log.
[0045] The adaptive application communication interface may be a communication interface between an application and an onboard operating system in a vehicle adaptive platform, and the adaptive application communication interface may be an interface for communication based on the TCP / IP protocol (Transmission Control Protocol / Internet Protocol). The attribute of the target application log refers to a field attribute that can characterize the log category, the original attribute of the target application log may be a program name attribute, and the adjusted attribute of the target application log may be a platform log attribute.
[0046] Optionally, after determining the target application log, the log information can be packaged into a communication message based on the TCP / IP protocol through the adaptive application communication interface for transmission to the file system of the local intelligent operating system, that is, the target application log is transmitted to the vehicle operating system. Before transmission, the log information can also be filtered and processed through the platform's logging protocol.
[0047] Optionally, controlling the vehicle operating system to adjust the properties of the target application log includes: determining the log property field corresponding to each target application log; adjusting the log property field of each target application log to the system log property field of the vehicle operating system through the log platform script according to the startup dependency set in the system log protocol.
[0048] Among them, the log attribute field refers to the field that characterizes the log category to which the target application log belongs, and the content of the target attribute field can be the program name attribute. The system log protocol refers to the log protocol preset in the vehicle operating system. The system log protocol can be, for example, the Syslog log protocol. The startup dependency refers to the dependency relationship for performing attribute adjustment when the system log protocol is started. By setting the startup dependency, the target application log can be processed by the field adjustment platform method based on the log platformization script when the Linux vehicle system Syslog log protocol is started, so as to unify the target application log into the platform log attribute. The system log attribute field refers to the field that characterizes the log category under the operating system, and the content of the system log attribute field can be the platform attribute.
[0049] It should be noted that since the log file system of the vehicle operating system cannot obtain logs below the operating system level when obtaining logs, the log type it can identify is the platform log attribute, and the application logs generated in the adaptive platform belong to the program name attribute. Therefore, in order to enable the application logs to be stored in the vehicle operating system through the log protocol, the attributes of the application logs need to be adjusted to adapt to the logging protocol of the vehicle operating system.
[0050] It should be noted that by converting application logs into log attributes consistent with the vehicle operating system logs, it can help to unify the application logs and system logs with platform attributes and classify and store them according to the structure designed in the file system.
[0051] S103 , based on the system log protocol of the vehicle operating system, screening the target application log to obtain the storage application log, and storing the storage application log in the log folder under the vehicle operating system.
[0052] The system log protocol refers to the log protocol preset in the vehicle operating system, and the system log protocol may be, for example, the Syslog log protocol. The storage application log refers to the log in the target application log that ultimately needs to be stored in the vehicle operating system. The log folder under the vehicle operating system may include the log folder corresponding to each adaptive platform application, and may also include the log folder for storing the operating system log.
[0053] Optionally, based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the stored application log, including: determining the log level of the target application log based on the system log protocol of the vehicle operating system; and determining the stored application log that meets the storage conditions from the target application log according to the log level.
[0054] The log level includes at least one of the following: special attention alarm level (alert), critical level (crit), error level (err), warning level (warning), attention level (notice), normal level (info) and debug level (debug). The storage condition refers to the preset condition that determines whether storage is required according to the log level corresponding to the target application log. The storage condition can be a level above the warning level, such as special attention alarm level (alert), critical level (crit), error level (err) and warning level (warning).
[0055] It should be noted that since log information at levels below notice will not affect the normal operation of the adaptive application, and since the chip has limited storage resources, the storage conditions for logs are set to warning (warning information) and above, that is, logs that meet the storage conditions are recorded and stored. Logs of other levels are not stored in the file system of the vehicle operating system, but only in the internal log buffer of the adaptive platform.
[0056] Optionally, the rolling rule can be configured to roll according to the file size, and after rolling to a certain number of files, the oldest log file is removed to achieve the purpose of rolling storage.
[0057] Optionally, storing the stored application logs in a log folder under the vehicle operating system includes: determining the number of rolling logs and the single log size limit corresponding to the preset rolling storage strategy; determining whether each stored application log meets the size condition based on the single log size limit, and if so, rolling the stored application logs to the log folder under the vehicle operating system based on the name field and the number of rolling logs corresponding to the stored application log.
[0058] Among them, the preset rolling storage strategy refers to a strategy that represents the rolling storage method for storage application logs. The preset rolling storage strategy may include the setting of the number of rolling logs and the single log size limit. The number of rolling logs refers to the number of storage application logs that can be rolled. The number of rolling logs can be 5. The number of rolling logs can specifically be the log data that can be rolled and stored corresponding to each adaptive platform application. The single log size limit represents the limit on the maximum value of a single storage application log. The size condition can be a condition for judging whether the size of each storage application log is greater than or equal to the single log size limit.
[0059] Optionally, based on the number of rolling logs, the storage application logs corresponding to each adaptive application can be stored in the corresponding application log folder in turn. When a certain number of log files are scrolled, the oldest log file is removed, and the numbers of the existing logs are adjusted according to the name field corresponding to the storage application logs, such as adding 1 to the log name numbers of other application logs except the newly added logs. Finally, the adjusted storage application logs are stored in the corresponding log folder.
[0060] Optionally, the stored application logs may be classified according to the types of applications in the log data segments to be saved in corresponding log folders, or each stored application log may be separated according to the application name and saved in different folders.
[0061] Optionally, the storage space may be divided according to the number of module applications contained in the adaptive AUTOSAR architecture and the types of logs recorded by the Linux vehicle system platform, so as to be used to store corresponding log folders respectively.
[0062] It should be noted that by storing application logs in the log folder under the vehicle operating system, the application logs of the vehicle adaptive platform and the system logs of the operating system can be merged and stored, so that the logs of the vehicle file system and the application logs can be managed in a unified manner.
[0063] The technical solution of the embodiment of the present invention is that if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, the target application log is extracted from the platform log library by calling the preset log daemon process; the target application log is transmitted to the vehicle operating system through the adaptive application communication interface, and the vehicle operating system is controlled to adjust the properties of the target application log; based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the storage application log, and the storage application log is stored in the log folder under the vehicle operating system. By performing attribute conversion processing on the application log of the adaptive platform and transmitting it to the vehicle operating system, unified management of the application log and the system log in the vehicle operating system can be achieved.
[0064] Embodiment 2
[0065] Figure 2A is a flow chart of a log processing method provided by Embodiment 2 of the present invention; Figure 2B This is a log processing diagram based on a log daemon process provided by Embodiment 2 of the present invention; Figure 2C This is a schematic diagram of the log storage structure of the vehicle operating system provided by the second embodiment of the present invention; Figure 2D It is a flowchart of rolling storage provided in the second embodiment of the present invention. Based on the above embodiment, this embodiment provides a preferred example of transmitting logs used by the adaptive platform to the vehicle operating system for storage by controlling the interaction between the adaptive platform and the vehicle operating system.
[0066] like Figure 2A As shown, the method includes the following process:
[0067] Optionally, the application log with the program name attribute generated by the adaptive application in the adaptive platform can be determined, and after being sent through the adaptive application communication interface, it can be filtered based on the platform's own logging protocol, and then further sent to the vehicle operating system. Based on the startup dependency in the Syslog log protocol of the vehicle operating system, the attributes of the application log can be converted into the same platform attributes as the operating system log by calling the platform tool. Finally, the adjusted application log and operating system log are respectively stored in corresponding folders, such as application A log file, application B log file, and system log folder.
[0068] Optionally, the process diagram of obtaining the target application log and transmitting it through the log daemon call is as follows Figure 2B As shown, specifically, when the application of the adaptive platform detects the log that needs to be transmitted to the vehicle operating system, it can send a request to the log daemon. In response to the request, the log daemon can extract the log library corresponding to the application, obtain the target application log, and transmit the target application log through the adaptive application communication interface based on the TCP / IP protocol, so as to perform two screenings based on the platform logging protocol and the Syslog log protocol respectively, and finally obtain the storage application log to be stored in the corresponding log folders respectively.
[0069] Optional, see Figure 2CIn the operating system, each application can be distinguished by its name, and the application logs of different applications can be stored separately, while the system logs can be stored in a folder. Each application can correspond to the storage logs generated during the operation of the application. For example, application A can include application A.log, application A.log1, application A.log2, application A.log3, and application A.log4; application B can include application B.log, application B.log1, application B.log2, application B.log3, and application B.log4; application N can include application N.log, application N.log1, application N.log2, application N.log3, and application N.log4. System logs can include system.log, system.log1, system.log2, system.log3, and system.log4.
[0070] For example, see Figure 2D , if the application log folder stores five logs, namely application.log, application.log.1, application.log.2, application.log.3 and application.log.4, and the number of rolling logs corresponding to the preset rolling storage policy is 5, when the newly generated *application.log needs to be stored in the application log folder, the oldest log among the five currently stored logs, that is, the log with the longest storage time, that is, application.log.4 log, can be deleted, and the log name numbers of the other four application logs except the newly added log are further increased by 1, that is, application.log becomes application.log.1, application.log.1 becomes application.log.2, application.log.2 becomes application.log.3, and application.log.3 becomes application.log.4, thereby realizing the rolling storage of the stored application logs.
[0071] The technical solution of the present invention can classify the application log information as platform log based on the Linux vehicle system, so that it can be stored together with the system log in the same file system; the importance level of the log information is screened and filtered by filtering the data segment attributes of the log, and an error protection mechanism is added to prevent the data segment attributes of the log from being filtered incorrectly, thereby ensuring the efficiency and accuracy of log processing; and the log information can be prevented from overflowing the file system storage space through rolling storage, while facilitating the technicians to instantly obtain the latest application logs in the local file system.
[0072] Embodiment 3
[0073] Figure 3This is a structural block diagram of a log processing device provided in the third embodiment of the present invention; this embodiment is applicable to the case where the vehicle processes the application log in the adaptive platform and sends it to the vehicle operating system for unified storage with the system log. The log processing device provided in the embodiment of the present invention can execute the log processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the log processing device can be implemented in the form of hardware and / or software, and configured in an electronic device with a log processing function, such as a vehicle, and executed by the vehicle's control unit, wherein the vehicle can be configured with an adaptive platform. Figure 3 As shown, the log processing device specifically includes:
[0074] The extraction module 301 is used to extract the target application log from the platform log library by calling a preset log daemon process if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected;
[0075] An adjustment module 302, configured to transmit the target application log to the vehicle operating system through the adaptive application communication interface, and control the vehicle operating system to adjust the properties of the target application log;
[0076] The storage module 303 is used to filter the target application log based on the system log protocol of the vehicle operating system, obtain the storage application log, and store the storage application log in the log folder under the vehicle operating system.
[0077] The technical solution of the embodiment of the present invention is that if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, the target application log is extracted from the platform log library by calling the preset log daemon process; the target application log is transmitted to the vehicle operating system through the adaptive application communication interface, and the vehicle operating system is controlled to adjust the properties of the target application log; based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the storage application log, and the storage application log is stored in the log folder under the vehicle operating system. By performing attribute conversion processing on the application log of the adaptive platform and transmitting it to the vehicle operating system, unified management of the application log and the system log in the vehicle operating system can be achieved.
[0078] Furthermore, the extraction module 301 is specifically used for:
[0079] Determine the output strategy corresponding to each candidate application log under the vehicle adaptive platform; the output strategy is output to the console for printing, output to the internal log buffer of the adaptive platform, or output to the vehicle operating system;
[0080] The candidate application log whose output strategy is to output to the vehicle operating system is determined as the target application log, and the target application log is extracted from the platform log library by calling the preset log daemon process.
[0081] Furthermore, the adjustment module 302 is specifically used for:
[0082] Determine the log attribute fields corresponding to each target application log;
[0083] According to the startup dependency set in the system log protocol, the log attribute field of each target application log is adjusted to the system log attribute field of the vehicle operating system through the log platform script.
[0084] Furthermore, the storage module 303 is specifically used for:
[0085] Determine the log level of the target application log based on the system log protocol of the vehicle operating system; the log level includes at least one of the following: special attention alarm level, severe condition level, error level, warning level, attention level, normal level and debugging level;
[0086] According to the log level, the storage application log that meets the storage condition is determined from the target application logs.
[0087] Furthermore, the storage module 303 is also used for:
[0088] Determine the number of rolling logs and the size limit of a single log corresponding to the preset rolling storage strategy;
[0089] According to the single log size limit, determine whether each stored application log meets the size condition. If so, roll the stored application log to the log folder under the vehicle operating system according to the name field and the number of rolled logs corresponding to the stored application log.
[0090] Furthermore, the above device is also used for:
[0091] Determine the target application identification number corresponding to the target application log;
[0092] According to the target application identification number and based on a preset field protection strategy, the name field in the target application log is updated.
[0093] Embodiment 4
[0094] Figure 4 is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention; Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0095] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0096] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0097] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a log processing method.
[0098] In some embodiments, the log processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the log processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the log processing method in any other appropriate manner (e.g., by means of firmware).
[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0101] In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0102] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0103] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0105] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the log processing method of any embodiment of the present invention when executed by a processor.
[0106] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0108] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A log processing method, characterized in that: include: If a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected, the target application log is extracted from the platform log library by calling the preset log daemon process; Transmitting the target application log to the vehicle operating system through the adaptive application communication interface, and controlling the vehicle operating system to adjust the properties of the target application log; Based on the system log protocol of the vehicle operating system, the target application log is screened to obtain the storage application log, and the storage application log is stored in the log folder under the vehicle operating system.
2. The method according to claim 1, characterized in that By calling the preset log daemon, the target application log is extracted from the platform log library, including: Determine the output strategy corresponding to each candidate application log under the vehicle adaptive platform; the output strategy is output to the console for printing, output to the internal log buffer of the adaptive platform, or output to the vehicle operating system; The candidate application log whose output strategy is to output to the vehicle operating system is determined as the target application log, and the target application log is extracted from the platform log library by calling the preset log daemon process.
3. The method according to claim 1, characterized in that Control the vehicle operating system to adjust the properties of the target application log, including: Determine the log attribute fields corresponding to each target application log; According to the startup dependency set in the system log protocol, the log attribute field of each target application log is adjusted to the system log attribute field of the vehicle operating system through the log platform script.
4. The method according to claim 1, characterized in that: Based on the system log protocol of the vehicle operating system, the target application log is filtered to obtain the stored application log, including: Determine the log level of the target application log based on the system log protocol of the vehicle operating system; the log level includes at least one of the following: special attention alarm level, severe condition level, error level, warning level, attention level, normal level and debugging level; According to the log level, the storage application log that meets the storage condition is determined from the target application logs.
5. The method according to claim 1, characterized in that The application logs are stored in the log folder under the vehicle operating system, including: Determine the number of rolling logs and the size limit of a single log corresponding to the preset rolling storage strategy; According to the single log size limit, determine whether each stored application log meets the size condition. If so, roll the stored application log to the log folder under the vehicle operating system according to the name field and the number of rolled logs corresponding to the stored application log.
6. The method according to claim 1, characterized in that After extracting the target application log from the platform log library, it also includes: Determine the target application identification number corresponding to the target application log; According to the target application identification number and based on a preset field protection strategy, the name field in the target application log is updated.
7. A log processing device, characterized in that: include: An extraction module, for extracting target application logs from the platform log library by calling a preset log daemon if a request to merge and store the logs of the vehicle adaptive platform and the vehicle operating system is detected; An adjustment module, used to transmit the target application log to the vehicle operating system through the adaptive application communication interface, and control the vehicle operating system to adjust the properties of the target application log; The storage module is used to filter the target application log based on the system log protocol of the vehicle operating system, obtain the storage application log, and store the storage application log in the log folder under the vehicle operating system.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the log processing method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the log processing method according to any one of claims 1 to 6.
Citation Information
Cited By
Log management system based on adaptive AUTOSAR and vehicle
CN120910010A
An Adaptive AUTOSAR-Based Log Management System and Vehicle
CN120910010B
