Log collection method and device, server and storage medium

By determining the target storage area according to the module identification of the log application, the isolated collection and storage of log data is realized, which solves the high cost and long time problem of the system's unified collection of log data, improves the efficiency of log data collection and analysis, and reduces the load on the vehicle-mounted system. burden.

CN118656353AInactive Publication Date: 2024-09-17WUHU LION AUTOMOTIVE TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410769075.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, the unified collection of log data through the system has the problems of high cost and long time. Especially when processing a large number of application logs, the complexity of data filtering and analysis increases, resulting in lengthy processes and slow response times.

Method used

By determining the target storage area of ​​log data according to the module identification of each log application, the isolated collection and storage of log data is realized. The module identification is used as the primary key to store log data, ensuring that different application logs do not interfere with each other and are separated from the local system resources of the vehicle. dependence.

Benefits of technology

It realizes the physical or logical isolation of log data, reduces the burden on the vehicle system, reduces the cost, improves the efficiency of log data collection and analysis, and solves the high cost and long time problem of the system uniformly collecting log data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656353A
    Figure CN118656353A
Patent Text Reader

Abstract

The invention relates to the technical field of Internet of Vehicles, in particular to a log collection method and device, a server and a storage medium, and the method comprises the steps: obtaining log data generated by one or more log applications; identifying a module identifier of each log application, and determining a target storage area of the log data of which the module identifier is a primary key; and storing the log data to the target storage area. Therefore, the problems of high cost, long time and the like due to unified collection of log data through a system in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle networking technology, and in particular to a log collection method, device, server and storage medium. Background Art

[0002] With the rapid development of information technology, cars are no longer just a simple means of transportation, but have evolved into a comprehensive service platform that integrates multi-dimensional functions such as entertainment, information, safety, and personalized services. As a key component of automotive intelligence, the smart cockpit integrates various ecological applications such as multimedia playback, navigation services, voice assistants, video entertainment, etc., to achieve in-depth satisfaction of users' personalized needs. These applications not only require high interactivity and convenience, but also must ensure stable operation to provide a seamless and pleasant driving and riding experience. However, with the surge in the number of ecological applications and the improvement of users' requirements for application experience, how to efficiently and in real time collect and analyze the log data generated by these applications has become a major challenge to ensure the stability of the smart cockpit and optimize the user experience.

[0003] Related technologies generally rely on the unified collection of log data by the system to provide a comprehensive system view, but this is often costly, and when processing a large number of application logs, it faces the increased complexity of data screening and analysis, resulting in lengthy processes and slow response times. Summary of the invention

[0004] The present application provides a log collection method, device, server and storage medium to solve the problems of high cost and long time in the related art of uniformly collecting log data through a system.

[0005] A first aspect of the present application provides a log collection method, which is applied to a server and includes the following steps: obtaining log data generated by one or more log applications; identifying the module identifier of each log application, and determining a target storage area for the log data with the module identifier as the primary key; and storing the log data in the target storage area.

[0006] Optionally, determining the target storage area of ​​the log data according to the module identifier includes: acquiring a correspondence table between the module identifier and the storage area; and determining the target storage area of ​​the log data according to the module identifier and the correspondence table.

[0007] Optionally, the server and the vehicle interact through a push service to obtain log data generated by one or more log applications, including: sending a push instruction to the vehicle based on the push service; wherein the vehicle receives the push instruction and obtains the log data to be uploaded generated by one or more log applications according to the push instruction, and uploads the log data generated by one or more log applications to the server.

[0008] Optionally, before identifying the module identifier of the log data, the method further includes: setting a filtering condition; and filtering the log data according to the filtering condition.

[0009] Optionally, the log data includes one or more of a business log, a crash log, and a performance log.

[0010] A second aspect of the present application provides a log collection device, which is applied to a server and includes: an acquisition module for acquiring log data to be uploaded generated by one or more log applications; a determination module for identifying a module identifier of each log application and determining a target storage area for log data with the module identifier as a primary key; and a collection module for storing the log data in the target storage area.

[0011] Optionally, the determination module is further used to: obtain a correspondence table between module identifiers and storage areas; and determine a target storage area for the log data according to the module identifiers and the correspondence table.

[0012] Optionally, the server interacts with the vehicle via a push service, and the acquisition module is further used to:

[0013] A push instruction is sent to the vehicle based on a push service; wherein the vehicle receives the push instruction, obtains log data to be uploaded generated by one or more log applications according to the push instruction, and uploads the log data generated by one or more log applications to the server.

[0014] Optionally, the log collection device further includes: a filtering module, which is used to set filtering conditions before identifying the module identifier of the log data; and filter the log data according to the filtering conditions.

[0015] Optionally, the log data includes one or more of a business log, a crash log, and a performance log.

[0016] The third aspect of the present application provides a server, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the log collection method as described in the above embodiment.

[0017] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the log collection method as described in the above embodiment.

[0018] Therefore, this application has at least the following beneficial effects:

[0019] The embodiment of the present application can determine the target storage area of ​​the log data according to the module identifier of each log application, and store the log data in the target storage area with the module identifier as the primary key, so as to realize the isolated collection and storage of the log data. Therefore, by defining an independent log storage area for each ecological application in the smart cockpit, the physical or logical isolation of the log data is realized, ensuring that different application logs do not interfere with each other, breaking away from the dependence on the local system resources of the vehicle, reducing the burden on the vehicle system, and solving the problems of high cost and long time in the related technology of collecting log data uniformly through the system.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flow chart of a log collection method provided according to an embodiment of the present application;

[0023] Figure 2 This is an example diagram of log isolation collection provided according to an embodiment of the present application;

[0024] Figure 3 This is an example diagram of log upload and storage provided according to an embodiment of the present application;

[0025] Figure 4 This is an example diagram of a log collection device provided according to an embodiment of the present application;

[0026] Figure 5 A schematic diagram of the structure of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0028] The following describes the log collection method, device, server and storage medium of the embodiment of the present application with reference to the accompanying drawings. In response to the problems mentioned in the above background technology, the present application provides a log collection method, in which the target storage area of ​​the log data can be determined according to the module identification of each log application, and the log data is stored in the target storage area with the module identification as the primary key, so as to realize the isolated collection and storage of the log data. Thus, by defining an independent log storage area for each ecological application in the smart cockpit, the physical or logical isolation of the log data is realized, ensuring that the logs of different applications do not interfere with each other, breaking away from the dependence on the local system resources of the vehicle, reducing the burden on the vehicle system, and solving the problems of high cost and long time in the related technology of collecting log data uniformly through the system.

[0029] Specifically, Figure 1 A flow chart of a log collection method provided in an embodiment of the present application.

[0030] like Figure 1 As shown, the log collection method is applied to the server and includes the following steps:

[0031] In step S101 , log data generated by one or more log applications is obtained.

[0032] The log data may include one or more of business logs, crash logs, and performance logs.

[0033] It is understandable that each log application can integrate the log collection SDK on the vehicle side to realize the isolated collection and upload of logs to the server side, such as Figure 2 As shown, the vehicle-side SDK has the following functions: dividing the storage path and space size, defining the module identifier corresponding to the log, and collecting logs by type (business logs, crash logs, performance logs, etc.). The server side of the embodiment of the present application obtains the log data generated by one or more log applications by receiving the data uploaded by the vehicle-side.

[0034] In an embodiment of the present application, the server and the vehicle interact through a push service to obtain log data generated by one or more log applications, including: sending a push instruction to the vehicle based on the push service; wherein the vehicle receives the push instruction and obtains the log data to be uploaded generated by one or more log applications according to the push instruction, and uploads the log data generated by one or more log applications to the server.

[0035] Specifically, if Figure 3The interactive process between the server and the vehicle shown in the figure realizes the interaction between the vehicle SDK and the cloud service through the push service. The server sends a command for the specified vehicle to upload logs. After receiving the upload command, the vehicle SDK uploads the collected logs. The transmission of logs is realized through the network protocol, and the server realizes the query and download of logs through the log search and view management page.

[0036] In step S102, the module identifier of each log application is identified, and a target storage area of ​​the log data with the module identifier as the primary key is determined.

[0037] In an embodiment of the present application, each log application in the smart cockpit (such as application A, B, C) is regarded as an independent module, and a unique module identifier (such as A, B, C) is defined for each module. This module identifier is like an ID number, which is used to distinguish the log data generated by different applications and ensure the accuracy and traceability of the log data classification. In addition to the unique module identifier of the application, each log data also contains other ancillary information, such as log type (error log, debug log, event log, etc.), record timestamp, etc. This information enriches the content of the log, facilitates the subsequent classification, filtering and analysis of the log, and quickly locates problems or performs performance evaluation.

[0038] Furthermore, after the logs are collected, the embodiments of the present application can be stored in different storage areas or logical partitions according to the application module identifiers to which they belong. This is conducive to efficient use of resources, and can ensure the safe isolation of data and avoid confusion between different application logs.

[0039] In one embodiment of the present application, determining a target storage area for log data with a module identifier as a primary key includes: obtaining a correspondence table between module identifiers and storage areas; and determining the target storage area for log data according to the module identifier and the correspondence table.

[0040] Among them, the correspondence table is the different correspondences between module identifiers and storage areas. The embodiment of the present application can pre-calibrate the correspondence table. After obtaining the module identifier of the log application, the target storage area of ​​the log data can be quickly and accurately determined based on the correspondence table and the module identifier of the log application.

[0041] In one embodiment of the present application, before identifying the module identifier of the log data, it also includes: setting a filtering condition; and filtering the log data according to the filtering condition.

[0042] It is understandable that among the massive logs generated by many applications in the smart cockpit, a large part may be routine operation records or low-level information logs, which are of limited value for diagnosing problems or optimizing applications. The embodiment of the present application can exclude these irrelevant logs by filtering. Thus, only the required application logs are collected, and there is no need to pay attention to the complex logs of the entire system. This not only saves storage space and computing resources, but also allows the development and operation and maintenance teams to locate the problem logs that really need attention more quickly, thereby accelerating the problem solving process. Among them, users can customize or add filtering conditions according to actual needs. For example, logs can be filtered by dimensions such as log level, user operation path, and specific keywords.

[0043] In step S103, the log data is stored in the target storage area.

[0044] It is understandable that after receiving the logs from each application, the server uses the module identifier as the primary key for isolated storage, thereby realizing isolated collection and lightweight storage of the log data, and storing the ancillary information at the same time, thereby realizing further screening and management of the logs.

[0045] Combine the following Figure 3 The upload, storage and management of the logs in the above embodiment are described in detail, including the server and the vehicle terminal (sdk), wherein the specific process of the server is as follows:

[0046] S1. Push service. The push service is the communication bridge between the server and the vehicle. The server sends push instructions (type, time, size, etc.) to trigger the logs that need to be uploaded by the vehicle.

[0047] S2. Log upload and download. Provide the ability to upload logs on the vehicle side and download logs on the server side, and realize cross-device transmission of logs.

[0048] S3, stores the collected logs uploaded by the vehicle terminal (according to type, time, size, etc.), and provides a data source for later log persistence and retrieval functions.

[0049] The specific interaction process of the vehicle terminal (sdk) is as follows:

[0050] C1. Real-time collection related, divided into business, performance, crash logs according to type, adding log time and size.

[0051] C2, push service, receives log upload instructions (type, time, size, etc.) from the server and uploads the corresponding logs, such as the business logs of the most recent week.

[0052] C3. Upload the filtered logs (type, time, size, etc.) to cloud storage for later retrieval and analysis.

[0053] S4. Log analysis and download management module, which can be used for online retrieval and analysis (according to type, time, size, etc.), or for downloading original and filtered logs for local analysis.

[0054] According to the log collection method proposed in the embodiment of the present application, the target storage area of ​​the log data can be determined according to the module identifier of each log application, and the log data is stored in the target storage area with the module identifier as the primary key, so as to realize the isolated collection and storage of the log data. Therefore, by defining an independent log storage area for each ecological application in the smart cockpit, the physical or logical isolation of the log data is realized, ensuring that different application logs do not interfere with each other, breaking away from the dependence on the local system resources of the vehicle, reducing the burden on the vehicle system, and solving the problems of high cost and long time in the related technology of collecting log data uniformly through the system.

[0055] Next, the log collection device proposed according to the embodiment of the present application is described with reference to the accompanying drawings.

[0056] Figure 4 It is a block diagram of a log collection device according to an embodiment of the present application.

[0057] like Figure 4 As shown, the log collection device 10 includes: an acquisition module 100 , a determination module 200 and a collection module 300 .

[0058] Among them, the acquisition module 100 is used to obtain log data generated by one or more log applications; the determination module 200 is used to identify the module identifier of each log application and determine the target storage area of ​​the log data with the module identifier as the primary key; the collection module 300 is used to store the log data to the target storage area.

[0059] In one embodiment of the present application, the determination module 200 is further used to: obtain a correspondence table between module identifiers and storage areas; and determine a target storage area for log data according to the module identifiers and the correspondence table.

[0060] In one embodiment of the present application, the server and the vehicle interact through a push service, and the acquisition module 100 is further used to: send a push instruction to the vehicle based on the push service; wherein the vehicle receives the push instruction, and obtains the log data to be uploaded generated by one or more log applications according to the push instruction, and uploads the log data generated by one or more log applications to the server.

[0061] In one embodiment of the present application, the log collection device 10 further includes: a filtering module, which is used to set filtering conditions before identifying the module identifier of the log data; and filter the log data according to the filtering conditions.

[0062] In one embodiment of the present application, the log data includes one or more of a business log, a crash log, and a performance log.

[0063] It should be noted that the above explanation of the log collection method embodiment is also applicable to the log collection device of this embodiment, and will not be repeated here.

[0064] According to the log collection device proposed in the embodiment of the present application, it is possible to determine the target storage area of ​​the log data according to the module identifier of each log application, and store the log data in the target storage area with the module identifier as the primary key, thereby realizing isolated collection and storage of the log data. Thus, by defining an independent log storage area for each ecological application in the smart cockpit, physical or logical isolation of the log data is realized, ensuring that different application logs do not interfere with each other, breaking away from the dependence on the local system resources of the vehicle, reducing the burden on the vehicle system, and solving the problems of high cost and long time in the related technology of uniformly collecting log data through the system.

[0065] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present application. The server may include:

[0066] Memory 401 , processor 402 , and a computer program stored in the memory 401 and executable on the processor 402 .

[0067] When the processor 402 executes the program, the log collection method provided in the above embodiment is implemented.

[0068] Furthermore, the server also includes:

[0069] The communication interface 403 is used for communication between the memory 401 and the processor 402 .

[0070] The memory 401 is used to store computer programs that can be executed on the processor 402 .

[0071] The memory 401 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0072] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0073] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.

[0074] The processor 402 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0075] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above log collection method is implemented.

[0076] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0077] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0078] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0079] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0080] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0081] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A log collection method, characterized in that: The method is applied to a server and comprises the following steps: Get log data generated by one or more log applications; Identify the module identifier of each log application, and determine the target storage area of ​​the log data with the module identifier as the primary key; The log data is stored in the target storage area.

2. The log collection method according to claim 1, characterized in that: The step of determining the target storage area of ​​the log data with the module identifier as the primary key includes: Obtain a correspondence table between module identifiers and storage areas; A target storage area for the log data is determined according to the module identifier and the corresponding relationship table.

3. The log collection method according to claim 1, characterized in that: The server interacts with the vehicle through a push service, and the obtaining of log data generated by one or more log applications includes: Sending a push instruction to the vehicle based on the push service; wherein the vehicle receives the push instruction, obtains the log data to be uploaded generated by the one or more log applications according to the push instruction, and uploads the log data to be uploaded generated by the one or more log applications to the server.

4. The log collection method according to claim 1, characterized in that: Before identifying the module identifier of the log data, the method further includes: Set filter conditions; The log data is filtered according to the filtering condition.

5. The log collection method according to any one of claims 1 to 4, characterized in that: The log data includes one or more of business logs, crash logs, and performance logs.

6. A log collection device, characterized in that: The device is applied to a server and includes: An acquisition module, used to acquire log data generated by one or more log applications; A determination module, used to identify a module identifier of each log application, and determine a target storage area for log data with the module identifier as a primary key; The collection module stores the log data in the target storage area.

7. The log collection device according to claim 6, characterized in that: The determining module is further used for: Obtain a correspondence table between module identifiers and storage areas; A target storage area for the log data is determined according to the module identifier and the corresponding relationship table.

8. The log collection device according to claim 6, characterized in that: The server interacts with the vehicle through a push service, and the acquisition module is further used to: Sending a push instruction to the vehicle based on the push service; wherein the vehicle receives the push instruction, obtains the log data to be uploaded generated by the one or more log applications according to the push instruction, and uploads the log data generated by the one or more log applications to the server.

9. A server, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the log collection method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed, it is executed by a processor to implement the log collection method according to any one of claims 1 to 5.