CN117389968A - Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium - Google Patents

Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium Download PDF

Info

Publication number
CN117389968A
CN117389968A CN202311310056.2A CN202311310056A CN117389968A CN 117389968 A CN117389968 A CN 117389968A CN 202311310056 A CN202311310056 A CN 202311310056A CN 117389968 A CN117389968 A CN 117389968A
Authority
CN
China
Prior art keywords
log
core
vehicle
log data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311310056.2A
Other languages
Chinese (zh)
Inventor
庾昂
徐萍
杜帅帅
苏炎
魏辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
United Automotive Electronic Systems Co Ltd
Original Assignee
United Automotive Electronic Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by United Automotive Electronic Systems Co Ltd filed Critical United Automotive Electronic Systems Co Ltd
Priority to CN202311310056.2A priority Critical patent/CN117389968A/en
Publication of CN117389968A publication Critical patent/CN117389968A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the technical field of vehicles and discloses a vehicle log storage and transmission method, a device, a vehicle, electronic equipment and a medium.

Description

Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium
Technical Field
The present invention relates to the field of vehicle technologies, and in particular, to a method and an apparatus for storing and transmitting a vehicle log, a vehicle, an electronic device, and a medium.
Background
Along with the continuous evolution of the whole vehicle electronic and electric architecture towards the centralized direction of the area, the vehicle-mounted central gateway controller is also upgraded from a single MPU (Micro Processor Unit )/MCU (Mirco Controller Unit, micro control unit) architecture to a multi-core SoC (System on Chip) architecture with higher product complexity. The vehicle-mounted central gateway controller generally merges multiple functional domains, such as gateway, body, chassis, ADAS (Advanced Driver Assistance System, advanced driving assistance system) functions, and the like. In order to facilitate problem analysis and investigation of the auxiliary controller and the vehicle electronics system, a log (log) function is indispensable. Generally, the log function can record the state information of the internal hardware of the controller, trace data (Trace data) during the running of software, various key register configuration information and the like in a simple format, and can derive the log information when the problem is checked in the later period, so as to provide data support for the root original and responsible source of the problem and the like.
In a gateway controller of a single MPU/MCU architecture, a log module of the single MPU/MCU architecture may be used, and the problem of log collection and export may be solved by simple configuration, however, on a multi-functional converged cross-domain multi-core controller, log collection and uploading needs to be performed by combining an operating system and a functional domain of each core, and a scheme for log collection and uploading of the gateway controller of the single MPU/MCU architecture is no longer applicable, so a scheme for log collection and uploading of the cross-domain multi-core controller is needed.
Disclosure of Invention
The invention provides a vehicle log storage and transmission method, a device, a vehicle, electronic equipment and a medium, which are used for solving the technical problem that a scheme for collecting and uploading logs of a cross-domain multi-core controller is lacked in the related technology.
The embodiment of the invention provides a vehicle log storage method, which comprises the following steps: acquiring vehicle log data, wherein the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content; obtaining a log storage path of the vehicle log data according to the category identification; and storing the vehicle log data into a first preset storage space based on the log storage path so as to enable a log demand end to request the stored vehicle log data.
In an embodiment of the present invention, if the vehicle log data includes first log data of a first core, acquiring the vehicle log data of the vehicle includes at least one of: the first-core first application transmits a first-core first application log to a diagnosis log and tracking module based on a preset standard log record interface, and the diagnosis log and tracking module is used for transmitting the first-core first application log as first log data to a first-core log server side so that the first-core log server side can acquire the first log data; the first core second application sends the system log as the first log data to a first core log server through a system log daemon so that the first core log server acquires the first log data; the first core kernel sends the core log as the first log data to a first core log server through a system log daemon, so that the first core log server acquires the first log data.
In an embodiment of the present invention, before the first core log server obtains the first log data of the core, the method further includes: a data source module for acquiring the first log data; if the data source module is a target source module, encrypting the first log data; and sending the encrypted first log data to a first core log server.
In an embodiment of the present invention, if the vehicle log data includes second log data of a second core, obtaining vehicle log data of a vehicle includes: the second log interface module of the second core receives second log data, wherein the second log data comprises at least one of upper-layer application log data and basic software log data; and sending the second log data to a log driving module, packaging the second log data, and transmitting the packaged second log data to a first core log server through inter-core communication so that the first core log server can acquire the second log data.
In an embodiment of the present invention, if the vehicle log data includes second log data of a second core, obtaining vehicle log data of a vehicle includes: collecting log data of the second core starting stage; storing the log data of the second core starting stage into a preset second storage space through a boot loader module of the second core; the second log interface module accesses the preset second storage space to acquire the second core starting stage log data, sends the second core starting stage log data serving as the second log data to the log driving module, packages the second log data, and transmits the packaged second log data to the first core log server through inter-core communication so that the first core log server acquires the second log data.
In an embodiment of the present invention, before transmitting the packaged second log data to the first core log server through inter-core communication, the method includes at least one of: acquiring the running state of the first core, if the running state comprises a system dormancy or awakening stage, storing the second log data into a third preset storage space, monitoring the running state of the first core, and if the running state is updated to be started, triggering the second log data stored in the third preset storage space to be transmitted to a first core log server through inter-core communication based on the log driving module; and acquiring the running state of the first core, and triggering the transmission of the packed second log data to the first core log server through inter-core communication if the running state is the completion of starting.
In an embodiment of the present invention, if the vehicle log data includes third log data, obtaining the vehicle log data of the vehicle includes: collecting third log data of a first node controller of the whole vehicle through a routing module of the second core; and transmitting the third log data to a log driving module through a second log interface module of a second core so as to package the third log data, and transmitting the packaged third log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the third log data.
In an embodiment of the invention, the method further comprises at least one of: acquiring fourth log data of a second node controller of the whole vehicle, and storing the fourth log data into a controller local of the second node controller of the whole vehicle so as to enable a log demand end to request the stored fourth log data; collecting first core starting stage log data of the first core, and storing the first core starting stage log data into the first preset storage space according to a preset first core starting file path so as to enable a log demand end to request the stored first core starting stage log data.
In an embodiment of the present invention, storing the vehicle log data into a first preset storage space based on the log storage path includes: performing target format conversion on the vehicle log data; and storing the vehicle log data subjected to the target format conversion into a first preset storage space based on the log storage path.
The embodiment of the invention also provides a vehicle log transmission method, which comprises the following steps: acquiring a vehicle log uploading request, wherein the vehicle log uploading request comprises a target controller identifier, a log storage path, log time and a log file size threshold; obtaining the controller type of the target controller according to the target controller identification matching; if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to the log storage path and the log time, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller; and generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
In an embodiment of the present invention, after obtaining the controller type of the target controller according to the target controller identifier matching, the method further includes: if the controller type comprises a whole vehicle second node controller, determining at least part of fourth log data locally stored by the controller of the whole vehicle second node controller as target log data according to the log time; and generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
In one embodiment of the present invention, generating a vehicle log file based on the log file size threshold and the target log data includes at least one of: generating a vehicle log file based on the target log data if the total data size of the target log data is less than or equal to the log file size threshold; if the total data size of the target log data is larger than the log file size threshold, splitting the target log data into a plurality of target log sub-data, and generating a vehicle log file based on each target log sub-data, wherein the sub-data size of the target log sub-data is smaller than or equal to the log file size threshold.
The embodiment of the invention also provides a vehicle log storage device, which comprises: the system comprises a log acquisition module, a log storage module and a log storage module, wherein the log acquisition module is used for acquiring vehicle log data, the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content; the path matching module is used for matching according to the category identification to obtain a log storage path of the vehicle log data; the storage module is used for storing the vehicle log data into a first preset storage space based on the log storage path so as to enable a log demand end to request the stored vehicle log data.
The embodiment of the invention also provides a vehicle log transmission device, which comprises: the system comprises a request acquisition module, a log storage module and a log file size module, wherein the request acquisition module is used for acquiring a vehicle log uploading request, and the vehicle log uploading request comprises a target controller identifier, a log storage path, a log time and a log file size threshold; the type matching module is used for obtaining the controller type of the target controller according to the target controller identification matching; the log screening module is used for determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to the log storage path and the log time if the controller type comprises at least one of the cross-domain multi-core controller and a whole vehicle first node controller, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller; and the uploading module is used for generating a vehicle log file based on the log file size threshold and the target log data and uploading the vehicle log file.
The embodiment of the invention also provides a vehicle, which comprises the vehicle log storage device according to any one of the embodiments and/or the vehicle log transmission device according to any one of the embodiments.
The embodiment of the invention also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the method according to any one of the embodiments.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the method of any one of the embodiments when being executed by a processor.
In the scheme realized by the vehicle log storage method, the transmission method, the device, the vehicle, the electronic equipment and the medium, the vehicle log storage method obtains at least one of the first log data of the first core, the second log data of the second core and the third log data of the whole vehicle first node controller which are arranged in the cross-domain multi-core controller of the vehicle as the vehicle log data, obtains the corresponding log storage path based on the category identification matching of the vehicle log data, stores the vehicle log data in the first preset storage space based on the log storage path, so that the log demand end requests the stored vehicle log data.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a system architecture for a vehicle log storage method and a vehicle log transmission method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for storing vehicle logs according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a vehicle log transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a specific application architecture of a vehicle log storing and transmitting method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a vehicle log storage device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a vehicle log transmission device according to an embodiment of the present invention;
FIG. 7 is a schematic view of a vehicle according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of an electronic device according to an embodiment of the invention;
fig. 9 is a schematic diagram of another structure of an electronic device according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture for a vehicle log storage method and a vehicle log transmission method according to an embodiment of the present invention. As shown in fig. 1, at least one of a user terminal, such as a mobile phone 103, a computer 104, and the like, is used as a log request terminal, and a request can be made from a cloud 102 to a vehicle terminal 101 for a log stored in the vehicle terminal 101. The cross-domain multi-core controller is arranged in the vehicle end 101, and the log data of the vehicle can be stored through the vehicle log storage method provided by the embodiment of the application, so that the log demand end can request the log data.
It should be noted that, the implementation of the method of this embodiment may also be implemented by other devices known to those skilled in the art, and the specific implementation is not limited herein, and the above is merely an example, and the specific implementation may be selected by those skilled in the art as required.
Referring to fig. 2, fig. 2 is a flow chart of a vehicle log storage method according to an embodiment of the present invention, where the method may be applied to a log collection scenario of a vehicle provided with a cross-domain multi-core controller, and the method includes the following steps:
in step S210, vehicle log data is acquired.
The vehicle log data comprises at least one of first log data of a first core of the vehicle, second log data of a second core and third log data of a first node controller of the whole vehicle, wherein the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises a category identifier and log content. For example, the first core is an A core and the second core is an R core and/or an M core. The category identification is set for category division criteria preset by a person skilled in the art, and is used for classifying the log data. The data storage paths with different first preset storage spaces are preset for different category identifiers. The log content is the content of the log data itself, including but not limited to at least one of a controller identification of the log source, log time, etc.
The first log collection software module may be deployed in advance in the first core to collect first log data in the first core, and the second log collection software module may be deployed in the second core to collect second log data in the second core. The first LOG collecting software Module can adopt the LOG Server of the A core as a core component, the second LOG collecting software Module can adopt the LOG Module & Driver of the R core as a core component, so that the basic function Module for uploading big data of the central gateway controller (cross-domain multi-core controller) can be reused, the research and development cost and period are greatly reduced, the multiplexing rate of the existing software Module is improved, and the computing power of the chip is fully excavated.
The second node controller of the whole vehicle can be a main routing node such as an Ethernet node controller of the whole vehicle and the like, and is not provided with a controller in the cross-domain multi-core controller. The log file (fourth log data) of the whole vehicle second node controller is collected and managed by each whole vehicle second node controller.
In one embodiment, if the vehicle log data includes first log data of the first core, the obtaining the vehicle log data of the vehicle includes at least one of:
the first-core first application transmits a first-core first application log to a diagnosis log and tracking module based on a preset standard log record interface, and the diagnosis log and tracking module is used for transmitting the first-core first application log as first log data to a first-core log server side so that the first-core log server side can acquire the first log data;
The first core second application sends the system log as first log data to a first core log server through a system log daemon so that the first core log server obtains the first log data;
the first core kernel sends the core log as first log data to a first core log server through a system log daemon so that the first core log server obtains the first log data.
If the first core is the A core, the A core LOG Server module can be used as a first core LOG Server to record and manage the master control LOG.
Taking An Application (AA) of an A core based on a Adaptive Application framework as a first application of a first core, presetting a standard LOG record interface as a standard LOG record API (Application Programming Interface, application program interface) provided based on a AP (Adaptive Platform) component, taking a DLT (Diagnostic Log and Trace) LOG module as an example for a diagnosis LOG and tracking module, transmitting a LOG to a DLT LOG module based on the application (AA) of the Adaptive Application framework, and transmitting the LOG to a LOG Server module through a private protocol so as to provide a mode for acquiring first LOG data of the first core. The private protocol may be a predefined protocol for a person skilled in the art, and will not be described herein.
Taking the non-AP (Linux) application of the a core as the first core second application as an example, the non-AP (Linux) application of the a core sends the system LOG as first LOG data to the first core LOG Server through a rsyslog function in a system LOG daemon module Syslogd, so that the first core LOG Server (a core LOG Server module) obtains the first LOG data to provide another way for obtaining the first LOG data of the first core.
The scheme can also support the collection of the kernel LOG of the core A (the first core), the kernel LOG is used as the first LOG data to be sent to the first core LOG Server through the system LOG daemon by the first core, so that the first core LOG Server (the core A LOG Server module) can acquire the first LOG data, and another way for acquiring the first LOG data of the first core is provided.
In another embodiment, if the vehicle log data includes second log data of the second core, obtaining the vehicle log data of the vehicle includes: the second log interface module of the second core receives second log data, wherein the second log data comprises at least one of upper-layer application log data and basic software log data; and sending the second log data to a log driving module, packaging the second log data, and transmitting the packaged second log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the second log data.
For example, taking the R core as a second core, taking the LOG Driver of the R core as a LOG driving Module, taking the second LOG interface Module as the LOG Module of the R core, providing a LOG transmission interface for the upper layer application SWC (Software Component) of the R core and the basic software DEM (Diagnostics Event Manager, diagnostic event manager), DET (Development Error Tracer, development error tracker) and the like through the LOG Module of the R core, collecting the LOGs of the upper layer application SWC of the R core and the LOGs of the basic software DEM, DET and the like, receiving the LOG of SWC, DEM, DET through the LOG Module of the second LOG interface Module, driving the package LOG message by the LOG Driver, and transmitting the package LOG message to the LOG Server Module of the a core through the IPC, thereby realizing the collection of the LOG of the a core. Through the LOG Server, LOG information transmitted by the R core is obtained by accessing the IPC. And finally, uniformly and accurately transferring all LOG files to the eMMC according to the category identification of the LOG header and the specified folder path by the LOG Server.
In another embodiment, if the vehicle log data includes second log data of the second core, obtaining the vehicle log data of the vehicle includes: collecting log data of a second core in a starting stage; storing the log data of the second core starting stage into a preset second storage space through a boot loader module of the second core; the second log interface module accesses a preset second storage space to acquire log data of a second core starting stage, sends the log data of the second core starting stage to the log driving module as second log data, packages the second log data, and transmits the packaged second log data to the first core log server through inter-core communication so that the first core log server acquires the second log data.
Taking an R core as a second core, taking a LOG Driver of the R core as a LOG driving Module, taking a Norflash arranged in a cross-domain multi-core controller as a preset second storage space as an example, the scheme also supports collection of system starting LOGs of the R core, the LOG data of the R core in the starting stage are collected through a Boot LOG Module and transmitted to the Norflash through a Bootloader (Boot loader Module), the LOG data of the R core in the Norflash in the starting stage are transmitted to the LOG Driver through a LOG Module (second LOG interface Module) of the R core, and the LOG data is transmitted to a LOG Server Module of the A core through IPC, so that the collection of the system starting LOGs of the A core can be realized.
In one embodiment, before transmitting the packaged second log data to the first core log server via inter-core communication, the method includes at least one of:
acquiring the running state of the first core, if the running state comprises a system dormancy or awakening stage, storing second log data into a third preset storage space, monitoring the running state of the first core, and if the running state is updated to be started, triggering the second log data stored in the third preset storage space to be transmitted to a first core log server through inter-core communication based on a log driving module;
And acquiring the running state of the first core, and triggering the transmission of the packed second log data to the first core log server through inter-core communication if the running state is the completion of starting.
Taking the first core as the A core and taking the second core as the R core as an example, if the A core is in a sleep or wake-up stage of a system which is not operated yet, temporarily storing second log data collected by the R core in a third preset storage space in the period, after the A core operates normally, transmitting the second log data to the A core through IPC (inter-core communication), and if the A core is in a normal operation stage, directly transmitting the second log data to the A core through IPC without temporarily storing the third preset storage space.
For example, the third preset storage space may be a cache provided in the R core, and at this time, if the a core is still in a sleep or wake-up stage of a system that is not yet running before the R core is powered down, log data of the third preset storage space may be restored to the second preset storage space, so as to ensure that the data will not be lost, and after the a core is normally running, the data in the second preset storage space is transferred to the a core through IPC. The first preset storage space and the second preset storage space are both nonvolatile storage media. In another example, the third preset storage space and the second preset storage space may be two storage areas divided by the same storage space.
In an embodiment, if the vehicle log data includes third log data, acquiring the vehicle log data of the vehicle includes: collecting third log data of a first node controller of the whole vehicle through a routing module of a second core; and transmitting the third log data to a log driving module through a second log interface module of the second core so as to package the third log data, and transmitting the packaged third log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the third log data.
For example, still taking the second core as an R core and taking the first core as an a core as an example, the R core is deployed with a first communication master node, for example, the R core is deployed with a whole vehicle CAN/LIN node, and the log of the whole vehicle CAN/LIN node controller is collected through a routing module of the R core and is synchronized to the a core through IPC. Specifically, the logs of the whole vehicle CAN/LIN node controller are transmitted to the second log interface module through the routing module of the R core, and then packaged by the log driving module, and sent to the first core log server through inter-core communication, so that the collection of the logs of the whole vehicle CAN/LIN node controller CAN be realized by the A core.
Because there may be multiple R cores and/or M cores in the cross-domain multi-core controller, at this time, one R core or M core may be used as a second core, and the other R core and/or M core may be used as a third core, and the third log data of the third core may be transmitted to the routing module of the second core through inter-core communication, and then the third log data may be transmitted to the second log interface module through the routing module, and further packaged by the log driving module, and sent to the first core log server through inter-core communication, so that the collection of the third log data in the third core can be implemented by the a-core. Wherein the number of third cores may be one or more.
By the method, the logs of the cross-domain multi-core controller in the vehicle can be collected, and the technical scheme for collecting the logs of the cross-domain multi-core controller is provided.
Step S220, according to the category identification, the log storage path of the vehicle log data is obtained through matching.
The log head of each log is provided with a category identifier for representing the category of the log, and the category identifier of the log head of each log is analyzed to inquire a preset log storage path corresponding to the category identifier.
In an embodiment, a mapping relationship between a plurality of log storage paths and category identifiers in a first preset storage space is preconfigured, one category identifier may correspond to one log storage path, or a plurality of category identifiers may correspond to one log storage path, or one category identifier corresponds to a plurality of log storage paths, and when one category identifier corresponds to a plurality of log storage paths, a suitable log storage path may be selected according to a remaining capacity of a sub-storage space corresponding to the log storage path and a current data amount of log data.
In this embodiment, the manner of obtaining the log storage path of the vehicle log data according to the category identification matching may be: searching an identification path mapping table based on the category identification to obtain a log storage path corresponding to the category identification, wherein the identification path mapping table is preset by a person skilled in the art and represents records of the log storage path corresponding to each category identification. The log storage path characterizes a specific sub-storage space of the first preset storage space.
Step S230, storing the vehicle log data into a first preset storage space based on the log storage path, so that the log demand end can request the stored vehicle log data.
The vehicle log data is stored in the specific sub-storage space in the first preset storage space according to the category identification, so that the subsequent call to the vehicle log data can be facilitated.
The first log data, the second log data and the third log data are all collected together through the first core log server. However, some log data in the vehicle may be collected and stored directly in the first preset storage space, such as log data in the first core starting stage, instead of passing through the first core log server.
In an embodiment, the vehicle log storage method further includes: collecting first core starting stage log data of a first core, and storing the first core starting stage log data into a first preset storage space according to a preset first core starting file path so as to enable a log demand end to request the stored first core starting stage log data.
In an embodiment, for a whole ethernet node controller in a vehicle, that is, a controller in which a main routing node is not disposed in a cross-domain multi-core controller, log collection may be implemented by using the following manner to obtain fourth log data of a second node controller of the whole vehicle, and the fourth log data is stored in a local controller of the second node controller of the whole vehicle, so that a log demand end requests the stored fourth log data.
Therefore, the collection and storage of the fourth log data of the first core, the second core, the whole Ethernet node controller and the third log data of the whole CAN/LIN node controller mounted on the second core in the cross-domain multi-core controller are realized, and the call is carried out when needed.
In an embodiment, before the first core log server obtains the first log data of the core, the method further includes: a data source module for acquiring first log data; if the data source module is a target source module, encrypting the first log data; and sending the encrypted first log data to a first core log server.
Due to information security requirements, some application functions of the a-core, such as IDS (Intrusion Detection Systems, intrusion detection system), may be designed to separately upload log encryption to the cloud. The method can also be applied to unified collection, the data is uploaded after being encrypted, whether the first log data needs to be encrypted or not is determined by identifying a data source module of the first log data, if the data source module is an IDS (integrated services system) module and the like, encryption is needed, and the encrypted first log data is sent to a first core log server to ensure data security. The target source module is a module preset by an IDS and other persons skilled in the art.
It should be noted that, the eMMC and the Norflash illustrated in the embodiment of the present invention are used as external storage devices, and may be other storage media, such as nand flash, for example. The "a core" and the "R core" mentioned in the embodiment of the present embodiment are merely illustrative examples of the core types of the SoC, and may be core types of other SoC schemes, such as "M core" and the like.
In one embodiment, to facilitate use of subsequent vehicle log data, storing the vehicle log data into a first preset storage space based on a log storage path includes: performing target format conversion on the vehicle log data; and storing the vehicle log data subjected to the target format conversion into a first preset storage space based on the log storage path. Therefore, the vehicle log data stored in the first preset storage space are in one or more preset formats, and can be more conveniently and quickly utilized directly during subsequent data reading and analysis without format conversion.
According to the vehicle log storage method, at least one of the first log data of the first core, the second log data of the second core and the third log data of the first node controller of the whole vehicle in the cross-domain multi-core controller of the vehicle is taken as the vehicle log data, the corresponding log storage paths are obtained based on the category identification matching of the vehicle log data, the vehicle log data is stored in the first preset storage space based on the log storage paths, so that a log demand end requests the stored vehicle log data.
In addition, the vehicle log storage method can perform target format conversion on the vehicle log data before the vehicle log data are stored in the first preset storage space so as to realize format unification, so that the formats of the log files are unified, and later reading and analysis are convenient.
Taking the first core as the core A as an example, the software based on the Adaptive Application architecture and the Linux system software based on the non-Adaptive Application architecture are considered in the log collection scheme aiming at the core A, and the method can be flexibly selected and used according to a software design mode in actual application, so that the scheme is high in practicability.
Referring to fig. 3, fig. 3 is a flow chart of a vehicle log transmission method according to an embodiment of the present invention, where the method may be applied to a log transmission scenario of a vehicle provided with a cross-domain multi-core controller, and used for transmitting vehicle log data stored by the vehicle log storage method or other vehicle log data stored in a manner known to those skilled in the art, and the method includes the following steps:
step S310, a vehicle log uploading request is acquired.
The vehicle log uploading request comprises a target controller identifier, a log storage path, log time and a log file size threshold. The target controller identifier may be information such as a target ECU name, a target ECU code, or the like, which can characterize the identity of the ECU of the required log, and the log storage path is the storage path of the first preset storage space in the above embodiment, and based on the log storage path, the vehicle log data stored in the specific location can be found. The log time is the generation or collection time of the log, and the vehicle log data of the corresponding time period can be screened based on the log time due to the timestamp carried by the vehicle log data. The log time may be a single time point, and it may be considered that the vehicle log data after the time point may be the vehicle log data that needs to be requested, and the log time may be a time period, for example, from the time of the XX year XX month XX day X to the time of the XX year XX month XX day XX, so that the screening of the requested vehicle log data may be performed based on the time period and the time stamp of the vehicle log data. The upper limit of the size of the log files uploaded by the size of the log files is favorable for limiting the number of the log files uploaded, and the situation that the running period of the uploading task is too long to influence other application performances of the controller is prevented.
The vehicle log uploading request can be sent by a mobile terminal such as a mobile phone and other log demand terminals, and the cloud terminal forwards the vehicle log uploading request to a vehicle networking terminal such as a T-Box of a vehicle, so that the vehicle obtains the vehicle log uploading request.
Step S320, the controller type of the target controller is obtained according to the target controller identification matching.
Since there are multiple types of controllers in the vehicle, that is, the types of the controllers include, but are not limited to, a cross-domain multi-core controller (serving as a central gateway controller), a whole-vehicle second node controller, a whole-vehicle first node controller, and the like, at this time, the type of the controller to which the currently requested vehicle log data belongs can be primarily known through the target controller identification, and further, the acquisition of the vehicle log data is performed in a corresponding manner.
The first node controller of the whole vehicle may be a controller in which a main routing node such as an ethernet node controller of the whole vehicle is arranged in a cross-domain multi-core controller. The second node controller of the whole vehicle can be regarded as a controller, such as an Ethernet node controller of the whole vehicle, in which the main routing node is not arranged in the cross-domain multi-core controller, such as the Ethernet node controller of the whole vehicle.
The cross-domain multi-core controller may be provided with a first core, a second core, and one or more third cores, for example, the first core may be an a core, the second core may be an R core or an M core, and the third core may be other cores in the cross-domain multi-core controller besides the first core and the second core.
Step S330, if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to a log storage path and log time.
The first preset storage space is used for storing vehicle log data collected through a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller.
The collection manner of collecting the vehicle log data by the first core log server and the storage rule of the first preset storage space may refer to the vehicle log storage method in the foregoing embodiment, that is, the vehicle log data is stored in a manner provided by any one of the foregoing vehicle log storage method embodiments.
In another embodiment, after obtaining the controller type of the target controller according to the target controller identification matching, the method further includes: if the controller type comprises a whole vehicle second node controller, determining at least part of fourth log data locally stored by the controller of the whole vehicle second node controller as target log data according to the log time; and generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
In the above-described embodiment, since the vehicle log data in the entire vehicle second node controller is stored locally in the controller of the entire vehicle second node controller, if the storage path is fixed at this time, the acquisition of the vehicle log data can be realized without using the log storage path. Of course, the vehicle log data in the whole vehicle second node controller can be stored according to the preset whole vehicle second node storage rule, at this time, a corresponding log storage path can be obtained according to the whole vehicle second node storage rule, and the collection of the vehicle log data is realized based on the log storage path.
Step S340, generating a vehicle log file based on the log file size threshold and the target log data, and uploading.
In this way, the determined target log data can be segmented into one or more vehicle log files based on the log file size threshold, and the file size of each vehicle log file is smaller than or equal to the log file size threshold so as to facilitate the transmission of the subsequent vehicle log files.
In an embodiment, generating the vehicle log file based on the log file size threshold and the target log data includes at least one of:
Generating a vehicle log file based on the target log data if the total data size of the target log data is less than or equal to the log file size threshold;
if the total data size of the target log data is larger than the log file size threshold, splitting the target log data into a plurality of target log sub-data, generating a vehicle log file based on each target log sub-data, wherein the sub-data size of the target log sub-data is smaller than or equal to the log file size threshold.
For example, one way to determine the number of target log sub-data is: if the quotient of the total data size and the log file size threshold is an integer, the number is a quotient value, and if the quotient of the total data size and the log file size threshold is a fraction, the number is the fraction of the integer bit plus 1, at this time, the sub-data size of each target log sub-data may be the same, or there may be at least two sub-data sizes of the target log sub-data that are different, which may be determined based on the needs of those skilled in the art.
According to the vehicle log transmission method provided by the embodiment, the controller type of the target controller is obtained according to the target controller identification matching by acquiring the vehicle log uploading request comprising the target controller identification, the log storage path, the log time and the log file size threshold; if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to a log storage path and log time, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller; the method provides a scheme for log transmission of a cross-domain multi-core controller, wherein a time window for collecting logs is designed in an uploading strategy, so that a user can position needed log files according to interesting time points, the efficiency of data correlation and analysis problems is improved, the upper limit of the size of the files is considered in the uploading strategy, the quantity of the uploaded log files is limited, and the overlong running period of an uploading task is prevented from influencing other application performances of the controller.
In addition, the log uploading function is based on a basic function module for uploading big data of the central gateway controller, so that the research and development cost and period are greatly reduced, the multiplexing rate of the existing software module is improved, and the computing power of a chip is fully mined.
Along with the continuous evolution of the whole vehicle electronic and electric architecture towards the centralized direction of the area, the vehicle-mounted central gateway controller is also upgraded from a single MPU/MCU architecture to a multi-core SoC architecture with higher product complexity, and a plurality of functional domains (such as gateway, vehicle body, chassis, ADAS functions and the like) are generally fused. In order to facilitate problem analysis and investigation of the auxiliary controller and the vehicle electronics system, a log (log) function is indispensable. Generally, the function can record the state information of the internal hardware of the controller, trace data during the running of software, various key register configuration information and the like in a simple format, and can derive the log information when the problem is examined later, thereby providing data support for the root original, responsibility tracing and the like of the problem. In a gateway controller of a single MPU/MCU architecture, a log module of a framework software can be used, the problems of log collection and export can be solved by simple configuration, however, an operating system and a functional domain of each core are required to be combined on a multi-functional fused cross-domain multi-core controller, and a log collection function of a set of system is deployed. In addition, as the current demand for remote analysis of vehicle problems increases, there is a need for remote delivery of collected local log information to problem analysts. Referring to fig. 4, fig. 4 is a schematic diagram of a specific application architecture of a vehicle LOG storing and transmitting method provided by the embodiment of the present invention, as shown in fig. 4, an exemplary scheme for designing a whole vehicle LOG collecting and uploading by a central gateway controller based on a SoC chip architecture, taking a first Core as an a Core and a second Core as an R Core as an example. The second LOG interface Module of the R core is LOG Module, and provides LOG transmission interface for upper layer application SWC of the R core such as ASW (Application Software Layer ) in fig. 4 and base software DEM, DET, etc. through LOG Module, and then the LOG Driver drives and packages LOG message, and transmits the LOG message to LOG Server of the a core through IPC. In addition, the R core may collect log information separately and cache the log information locally (e.g. preset second storage space Norflash) in the sleep or wake-up stage of the system that the a core has not yet operated, and synchronize to the a core through IPC after waiting for the a core to start. And the LOG Server module of the A core is used for master control LOG record and management. The a core transmits a Log (first core first application Log) to a DLT Module (diagnostic Log and tracking Module) based on An Application (AA) of a Adaptive Application framework, namely a first core first application, based on a standard logging API (preset standard logging interface) provided by an AP component (AP Log in fig. 4), and then transmits the Log (first core first application Log) to a Log Server through a private protocol; the non-AP (Linux) application of the A core, namely a first core second application (such as a Linux App) and a Kernel Kernel, transmits the LOG of the Kernel LOG sys to the LOG Server through the rsyslog function of the Sysslog module; in addition, the LOG Server obtains LOG information transmitted by the R core by accessing the IPC. And finally, uniformly and accurately transferring all LOG files to a first preset storage space eMMC by the LOG Server according to the category identification of the LOG header and the specified folder path.
If the LOG of the Bootloader at the starting stage (LOG data at the starting stage of the second core) needs to be collected, since the starting stage file in the general R core is recorded in the Norflash of the preset second storage space by the Bootloader, the LOG can be obtained by accessing the Norflash by the LOG Module of the R core, and then the LOG and other R core LOGs are transmitted to the A core together through inter-core communication; the log data of the first core starting stage of the core A is directly recorded in the eMMC by a Bootloader such as U-boot, and can be obtained by setting a corresponding Bootloader log file path request by a user side.
Because of the information security requirement, some application functions of the a core, such as IDS, may be designed to separately encrypt and upload the log to the cloud, that is, the AA (IDS) shown in fig. 4 may directly transmit the vehicle log data to the gateway Switch, further upload the vehicle log data to the T-BOX, and feed back to the cloud. If the data is allowed, the data can be collected uniformly in the mode similar to the collection mode of the first application log of the first core, but the data is encrypted and then uploaded.
The method comprises the steps of collecting and synchronizing logs of a CAN/LIN node controller of the whole vehicle to an A core through a Route module Route of an R core for unified management and uploading. The Route Module router of the R core (the Route Module of the second core) is used for collecting LOGs (third LOG data) of the CAN/LIN node controller of the whole vehicle, transmitting the LOGs to the LOG Module, and the LOG Driver is used for driving and packaging LOG messages, transmitting the LOG messages to the LOG Server of the A core through IPC, and storing the LOG messages according to a LOG storage path through the LOG Server.
The logs (fourth log data) of the ETH ECU aiming at the whole-vehicle Ethernet node controllers are collected and managed by the whole-vehicle Ethernet node controllers, are transmitted to the T-Box by means of gateway Switch, are finally uploaded to the Cloud OEM Cloud, and are further transmitted to a user side, such as a computer, collection and the like.
It should be noted that, as shown in fig. 4, the number of ethernet node controllers ETH ECU of the whole vehicle may be multiple and the number of CAN/LIN node controllers ECU of the whole vehicle may be multiple. The eMMC and Norflash mentioned above are used as external storage devices, and may be other storage media, such as nand flash, etc., for example only; the above-mentioned "a core" and "R core" are merely illustrative examples of the core type of the SoC, and may be core types of other SoC schemes, such as "M core", and the like.
Based on the above vehicle log storage method, a vehicle log transmission method will be described below. By using the existing cloud communication link of big data collection, namely two-stage communication of the OEM cloud-TBox-central gateway controller, a user edits a log collection request (vehicle log uploading request) at a user end such as a computer, collection and the like, wherein the vehicle log uploading request at least comprises: target ECU name (code, target controller identification); log path name (log storage path); start-stop time (log time) of log file; log file size upper limit (log file size threshold). The user sends the vehicle log uploading request to the T-Box in the form of a file through the cloud, and the T-Box is transmitted to the big data collection application through SOME/IP. The big data collection application analyzes the log collection request, and if the target ECU is identified as a non-central gateway controller (a cross-domain multi-core controller), the collection request is transmitted to the corresponding ECU through a Switch; if the target ECU is identified as the target ECU (cross-domain multi-core controller), the log files in the corresponding paths of the eMMC are retrieved, all the log files in the time window are screened according to the starting time of the log files, and the log data are extracted to be packaged in a cache and sent to the T-Box. And after receiving the log data, the T-Box forms a log file according to the cloud requirements and uploads the log file.
The method provided by the embodiment has at least the following beneficial effects:
1. the functions of collecting and uploading the controller logs at the SoC level are realized by the mode of main control of the A core and auxiliary collection of the R core. Compared with the traditional design that controllers of a plurality of functional domains upload logs respectively, the method greatly improves the efficiency of log collection and uploading, and enables the formats of log files to be unified, thereby facilitating later reading and analysis.
2. The log uploading function is based on a basic functional module for uploading big data of the central gateway controller, so that the research and development cost and period are greatly reduced, the multiplexing rate of the existing software module is improved, and the computing power of a chip is fully excavated.
3. The A-core log collection scheme of the invention considers the software based on the AA architecture and the Linux system software based on the non-AA architecture, can be flexibly selected and used according to a software design mode in actual application, and has high scheme practicability.
4. The time window for collecting the log is designed in the uploading strategy, so that the log file required by the user for positioning according to the interested time point is facilitated, and the data correlation and the problem analysis efficiency are improved.
5. The upper limit of the file size is considered in the uploading strategy, which is favorable for limiting the number of uploading log files and preventing the overlong running period of the uploading task from affecting other application performances of the controller.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In one embodiment, a vehicle log storage device is provided, which corresponds to the vehicle log storage method in the above embodiment one by one. Referring to fig. 5, fig. 5 is a schematic structural diagram of a vehicle log storage device according to an embodiment of the present invention, and as shown in fig. 5, the vehicle log storage device 500 includes a log obtaining module 501, a path matching module 502 and a storage module 503. The functional modules are described in detail as follows: the log obtaining module 501 is configured to obtain vehicle log data, where the vehicle log data includes at least one of first log data of a first core, second log data of a second core, and third log data of a first node controller of the whole vehicle, the first core and the second core are disposed in a cross-domain multi-core controller of the vehicle, and the vehicle log data includes a category identifier and log content; the path matching module 502 is configured to obtain a log storage path of the vehicle log data according to the category identification matching; the storage module 503 is configured to store the vehicle log data into a first preset storage space based on the log storage path, so that the log demand end requests the stored vehicle log data.
In an embodiment, if the vehicle log data includes first log data of the first core, the log obtaining module includes at least one of a preset standard log record interface and a system log daemon;
the first-core first application transmits a first-core first application log to a diagnosis log and tracking module based on a preset standard log record interface, and the diagnosis log and tracking module is used for transmitting the first-core first application log as first log data to a first-core log server side so that the first-core log server side can acquire the first log data;
the first core second application sends the system log as first log data to a first core log server through a system log daemon so that the first core log server obtains the first log data;
the first core kernel sends the core log as first log data to a first core log server through a system log daemon so that the first core log server obtains the first log data.
In an embodiment, the apparatus further includes an encryption module, configured to obtain the data source module of the first log data before the first log server of the first core obtains the first log data of the core; if the data source module is a target source module, encrypting the first log data; and sending the encrypted first log data to a first core log server.
In an embodiment, if the vehicle log data includes second log data of a second core, the log obtaining module further includes a second log interface module of the second core; the second log interface module of the second core is used for receiving second log data, and the second log data comprises at least one of upper-layer application log data and basic software log data; and sending the second log data to a log driving module, packaging the second log data, and transmitting the packaged second log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the second log data.
In an embodiment, if the vehicle log data includes second log data of the second core, the log acquisition module further includes a second core start stage log data acquisition module for acquiring the second core start stage log data; storing the log data of the second core starting stage into a preset second storage space through a boot loader module of the second core; the second log interface module accesses a preset second storage space to acquire log data of a second core starting stage, sends the log data of the second core starting stage to the log driving module as second log data, packages the second log data, and transmits the packaged second log data to the first core log server through inter-core communication so that the first core log server acquires the second log data.
In this embodiment, before transmitting the packaged second log data to the first core log server through inter-core communication, the apparatus includes at least one of the following:
the temporary storage module is used for acquiring the running state of the first core, storing second log data into a third preset storage space if the running state comprises a system dormancy or awakening stage, monitoring the running state of the first core, and triggering the second log data stored in the third preset storage space to be transmitted to a first core log server through inter-core communication based on the log driving module if the running state is updated to be completed;
the triggering module is used for acquiring the running state of the first core, and triggering the transmission of the packed second log data to the first core log server through inter-core communication if the running state is that the starting is completed.
In an embodiment, if the vehicle log data includes third log data, the log acquisition module further includes a third log data acquisition module, configured to acquire the third log data of the first node controller of the whole vehicle through the routing module of the second core; and transmitting the third log data to a log driving module through a second log interface module of the second core so as to package the third log data, and transmitting the packaged third log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the third log data.
In one embodiment, the apparatus further comprises at least one of:
the fourth log data acquisition module is used for acquiring fourth log data of the second node controller of the whole vehicle, and storing the fourth log data into the controller local of the second node controller of the whole vehicle so as to enable the log demand end to request the stored fourth log data;
the first core starting stage log data acquisition module is used for acquiring first core starting stage log data of the first core, and storing the first core starting stage log data into a first preset storage space according to a preset first core starting file path so as to enable a log demand end to request the stored first core starting stage log data.
In one embodiment, a memory module includes: the format conversion module is used for carrying out target format conversion on the vehicle log data; and the storage sub-module is used for storing the vehicle log data after the target format conversion into a first preset storage space based on the log storage path.
In this embodiment, the vehicle log storage device is substantially provided with a plurality of modules for executing the vehicle log storage method in any one of the above embodiments, and specific functions and technical effects may be referred to the above embodiments and are not described herein.
In one embodiment, a vehicle log transmission device is provided, where the vehicle log transmission device corresponds to the vehicle log transmission method in the above embodiment one by one. Referring to fig. 6, fig. 6 is a schematic structural diagram of a vehicle log transmission device according to an embodiment of the present invention, and as shown in fig. 6, the vehicle log transmission device 600 includes a request obtaining module 601, a type matching module 602, a log filtering module 603, and an uploading module 604. The functional modules are described in detail as follows: the request acquisition module 601 is configured to acquire a vehicle log upload request, where the vehicle log upload request includes a target controller identifier, a log storage path, a log time, and a log file size threshold; the type matching module 602 is configured to obtain a controller type of the target controller according to the target controller identifier; the log filtering module 603 is configured to determine, if the controller type includes at least one of a cross-domain multi-core controller and a whole vehicle first node controller, at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to a log storage path and a log time, where the first preset storage space is used to store the vehicle log data collected by a first core log server of a first core, and the first core is set in the cross-domain multi-core controller; and an uploading module 604, configured to generate a vehicle log file based on the log file size threshold and the target log data, and upload the vehicle log file.
In an embodiment, the uploading module is further configured to determine, according to the log time, at least a portion of fourth log data locally stored by a controller of the second node controller of the whole vehicle as target log data if the controller type includes the second node controller of the whole vehicle after the controller type of the target controller is obtained according to the target controller identifier matching; and generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
In one embodiment, the upload module includes at least one of:
the first uploading sub-module is used for generating a vehicle log file based on the target log data if the total data size of the target log data is smaller than or equal to the log file size threshold;
and the second uploading sub-module is used for splitting the target log data into a plurality of target log sub-data if the total data size of the target log data is larger than the log file size threshold value, generating a vehicle log file based on each target log sub-data, and enabling the sub-data size of the target log sub-data to be smaller than or equal to the log file size threshold value.
In this embodiment, the vehicle log transmission device is substantially provided with a plurality of modules for executing the vehicle log transmission method in any one of the above embodiments, and specific functions and technical effects may be referred to the above embodiments and are not described herein.
In an embodiment, a vehicle for performing the vehicle log storage method and the vehicle log transmission method in the above embodiments is provided. Referring to fig. 7, fig. 7 is a schematic structural diagram of a vehicle according to an embodiment of the present invention, as shown in fig. 7, the vehicle 700 includes a vehicle log storage device 500 shown in fig. 5, and/or a vehicle log transmission device 600 shown in fig. 6.
In this embodiment, the vehicle is essentially provided with a plurality of modules for executing the method in any of the above embodiments, and specific functions and technical effects are only required by referring to the above embodiments, which are not repeated herein.
In one embodiment, an electronic device is provided, which may be a server, and an internal structure thereof may be as shown in fig. 8. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes non-volatile and/or volatile storage media and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external client through a network connection. The computer program, when executed by a processor, implements functions or steps of a vehicle log storage method and/or a vehicle log transmission method service side.
In one embodiment, an electronic device is provided, which may be a client, and the internal structure of which may be as shown in fig. 9. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external server through a network connection. The computer program, when executed by a processor, implements functions or steps of a vehicle log storage method and/or a vehicle log transmission method client side.
In one embodiment, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring vehicle log data, wherein the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content;
Obtaining a log storage path of the vehicle log data according to the category identification matching;
and storing the vehicle log data into a first preset storage space based on the log storage path so as to enable the log demand end to request the stored vehicle log data.
In another embodiment, an electronic device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a vehicle log uploading request, wherein the vehicle log uploading request comprises a target controller identifier, a log storage path, log time and a log file size threshold;
obtaining the controller type of the target controller according to the target controller identification matching;
if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to a log storage path and log time, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller;
And generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
In addition, the steps of the vehicle log storage method and/or the vehicle log transmission method provided in any of the foregoing embodiments may also be implemented when the processor of the electronic device executes the computer program.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring vehicle log data, wherein the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content;
obtaining a log storage path of the vehicle log data according to the category identification matching;
and storing the vehicle log data into a first preset storage space based on the log storage path so as to enable the log demand end to request the stored vehicle log data.
In another embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
Acquiring a vehicle log uploading request, wherein the vehicle log uploading request comprises a target controller identifier, a log storage path, log time and a log file size threshold;
obtaining the controller type of the target controller according to the target controller identification matching;
if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to a log storage path and log time, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller;
generating a vehicle log file based on the log file size threshold and the target log data, and uploading
In addition, the steps of the vehicle log storage method and/or the vehicle log transmission method provided in any of the foregoing embodiments may also be implemented when the processor of the electronic device executes the computer program.
It should be noted that, the functions or steps that can be implemented by the computer readable storage medium or the electronic device may correspond to the descriptions of the server side and the client side in the foregoing method embodiments, and are not described herein one by one for avoiding repetition.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The embodiments provided above are merely for illustrating the technical solution of the present invention, and are not limiting thereof; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (17)

1. A method of vehicle log storage, the method comprising:
acquiring vehicle log data, wherein the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content;
Obtaining a log storage path of the vehicle log data according to the category identification;
and storing the vehicle log data into a first preset storage space based on the log storage path so as to enable a log demand end to request the stored vehicle log data.
2. The vehicle log storage method of claim 1, wherein if the vehicle log data includes first log data of a first core, acquiring the vehicle log data of the vehicle includes at least one of:
the first-core first application transmits a first-core first application log to a diagnosis log and tracking module based on a preset standard log record interface, and the diagnosis log and tracking module is used for transmitting the first-core first application log as first log data to a first-core log server side so that the first-core log server side can acquire the first log data;
the first core second application sends the system log as the first log data to a first core log server through a system log daemon so that the first core log server acquires the first log data;
the first core kernel sends the core log as the first log data to a first core log server through a system log daemon, so that the first core log server acquires the first log data.
3. The vehicle log storage method of claim 2, wherein before the first core log server obtains the first log data of the core, the method further comprises:
a data source module for acquiring the first log data;
if the data source module is a target source module, encrypting the first log data;
and sending the encrypted first log data to a first core log server.
4. The vehicle log storage method of claim 1, wherein if the vehicle log data includes second log data of a second core, acquiring the vehicle log data of the vehicle comprises:
the second log interface module of the second core receives second log data, wherein the second log data comprises at least one of upper-layer application log data and basic software log data;
and sending the second log data to a log driving module, packaging the second log data, and transmitting the packaged second log data to a first core log server through inter-core communication so that the first core log server can acquire the second log data.
5. The vehicle log storage method of claim 1, wherein if the vehicle log data includes second log data of a second core, acquiring the vehicle log data of the vehicle comprises:
Collecting log data of the second core starting stage;
storing the log data of the second core starting stage into a preset second storage space through a boot loader module of the second core;
the second log interface module accesses the preset second storage space to acquire the second core starting stage log data, sends the second core starting stage log data serving as the second log data to the log driving module, packages the second log data, and transmits the packaged second log data to the first core log server through inter-core communication so that the first core log server acquires the second log data.
6. The vehicle log storage method of claim 4, wherein before transmitting the packetized second log data to the first core log server via inter-core communication, the method comprises at least one of:
acquiring the running state of the first core, if the running state comprises a system dormancy or awakening stage, storing the second log data into a third preset storage space, monitoring the running state of the first core, and if the running state is updated to be started, triggering the second log data stored in the third preset storage space to be transmitted to a first core log server through inter-core communication based on the log driving module;
And acquiring the running state of the first core, and triggering the transmission of the packed second log data to the first core log server through inter-core communication if the running state is the completion of starting.
7. The vehicle log storage method according to any one of claims 1 to 6, wherein if the vehicle log data includes third log data, acquiring the vehicle log data of the vehicle includes:
collecting third log data of a first node controller of the whole vehicle through a routing module of the second core;
and transmitting the third log data to a log driving module through a second log interface module of a second core so as to package the third log data, and transmitting the packaged third log data to a first core log server through inter-core communication so as to enable the first core log server to acquire the third log data.
8. The vehicle log storage method of any of claims 1-6, wherein the method further comprises at least one of:
acquiring fourth log data of a second node controller of the whole vehicle, and storing the fourth log data into a controller local of the second node controller of the whole vehicle so as to enable a log demand end to request the stored fourth log data;
Collecting first core starting stage log data of the first core, and storing the first core starting stage log data into the first preset storage space according to a preset first core starting file path so as to enable a log demand end to request the stored first core starting stage log data.
9. The vehicle log storage method according to any one of claims 1 to 6, wherein storing the vehicle log data into a first preset storage space based on the log storage path includes:
performing target format conversion on the vehicle log data;
and storing the vehicle log data subjected to the target format conversion into a first preset storage space based on the log storage path.
10. A vehicle log transmission method, the method comprising:
acquiring a vehicle log uploading request, wherein the vehicle log uploading request comprises a target controller identifier, a log storage path, log time and a log file size threshold;
obtaining the controller type of the target controller according to the target controller identification matching;
if the controller type comprises at least one of a cross-domain multi-core controller and a whole vehicle first node controller, determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to the log storage path and the log time, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller;
And generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
11. The vehicle log transmission method according to claim 10, wherein after obtaining the controller type of the target controller from the target controller identification match, the method further comprises:
if the controller type comprises a whole vehicle second node controller, determining at least part of fourth log data locally stored by the controller of the whole vehicle second node controller as target log data according to the log time;
and generating a vehicle log file based on the log file size threshold and the target log data, and uploading the vehicle log file.
12. The vehicle log transmission method according to any one of claims 10 or 11, wherein generating a vehicle log file based on the log file size threshold and the target log data includes at least one of:
generating a vehicle log file based on the target log data if the total data size of the target log data is less than or equal to the log file size threshold;
if the total data size of the target log data is larger than the log file size threshold, splitting the target log data into a plurality of target log sub-data, and generating a vehicle log file based on each target log sub-data, wherein the sub-data size of the target log sub-data is smaller than or equal to the log file size threshold.
13. A vehicle log storage device, the device comprising:
the system comprises a log acquisition module, a log storage module and a log storage module, wherein the log acquisition module is used for acquiring vehicle log data, the vehicle log data comprises at least one of first log data of a first core, second log data of a second core and third log data of a first node controller of the whole vehicle, the first core and the second core are arranged in a cross-domain multi-core controller of the vehicle, and the vehicle log data comprises category identification and log content;
the path matching module is used for matching according to the category identification to obtain a log storage path of the vehicle log data;
the storage module is used for storing the vehicle log data into a first preset storage space based on the log storage path so as to enable a log demand end to request the stored vehicle log data.
14. A vehicle log transmission device, characterized in that the device comprises:
the system comprises a request acquisition module, a log storage module and a log file size module, wherein the request acquisition module is used for acquiring a vehicle log uploading request, and the vehicle log uploading request comprises a target controller identifier, a log storage path, a log time and a log file size threshold;
the type matching module is used for obtaining the controller type of the target controller according to the target controller identification matching;
The log screening module is used for determining at least part of vehicle log data stored in a first preset storage space in the cross-domain multi-core controller as target log data according to the log storage path and the log time if the controller type comprises at least one of the cross-domain multi-core controller and a whole vehicle first node controller, wherein the first preset storage space is used for storing the vehicle log data collected by a first core log server of a first core, and the first core is arranged in the cross-domain multi-core controller;
and the uploading module is used for generating a vehicle log file based on the log file size threshold and the target log data and uploading the vehicle log file.
15. A vehicle, characterized in that the vehicle comprises a vehicle log storage device according to claim 13 and/or a vehicle log transmission device according to claim 14.
16. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 12 when executing the computer program.
17. A computer readable storage medium storing a computer program, which when executed by a processor implements the method of any one of claims 1 to 12.
CN202311310056.2A 2023-10-10 2023-10-10 Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium Pending CN117389968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311310056.2A CN117389968A (en) 2023-10-10 2023-10-10 Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311310056.2A CN117389968A (en) 2023-10-10 2023-10-10 Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117389968A true CN117389968A (en) 2024-01-12

Family

ID=89471203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311310056.2A Pending CN117389968A (en) 2023-10-10 2023-10-10 Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117389968A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781032A (en) * 2021-09-27 2021-12-10 中国银行股份有限公司 Log obtaining method and device
CN117687892A (en) * 2024-02-04 2024-03-12 麒麟软件有限公司 Comprehensive log acquisition method and device suitable for embedded system and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781032A (en) * 2021-09-27 2021-12-10 中国银行股份有限公司 Log obtaining method and device
CN117687892A (en) * 2024-02-04 2024-03-12 麒麟软件有限公司 Comprehensive log acquisition method and device suitable for embedded system and storage medium
CN117687892B (en) * 2024-02-04 2024-06-07 麒麟软件有限公司 Comprehensive log acquisition method and device suitable for embedded system and storage medium

Similar Documents

Publication Publication Date Title
JP7126174B2 (en) Verification system and method for collaboration of blockchain and off-chain devices
CN117389968A (en) Vehicle log storage and transmission method and device, vehicle, electronic equipment and medium
CN108769212B (en) Data synchronization method and device, computer equipment and storage medium
US9305055B2 (en) Method and apparatus for analysing data packets
US11329828B2 (en) Verification system and method for chaining data
CN110543788A (en) Data storage method, data storage device, computer-readable storage medium and computer equipment
CN111694791B (en) Data access method and device in distributed basic framework
CN111026767B (en) Block chain data storage method and device and hardware equipment
CN110784495A (en) Block chain-based discovery and configuration information management method for big data cluster system
WO2015007091A1 (en) Data record generating method and device
CN108710643B (en) Data sharing method and device, computer equipment and storage medium
CN111538754A (en) Data collection management system, method, device, equipment and storage medium
CN111464646A (en) Information processing method, information processing apparatus, electronic device, and medium
CN112911005A (en) Data synchronization system and method and parking lot data updating method
CN112835978A (en) Data storage method and device and computer equipment
WO2020114310A1 (en) Method, network node and network for recording and providing data,
CN112350875B (en) Centralized management configuration method and device for configuration data
CN114157435B (en) Document processing method and device based on blockchain technology and client
CN115473858A (en) Data transmission method and streaming data transmission system
CN115221125A (en) File processing method and device, electronic equipment and readable storage medium
CN112231152A (en) Data synchronization method, remote server, client and system
CN112749142A (en) Handle management method and system
CN117896727B (en) Vehicle end log acquisition method, device and system, vehicle end and storage medium
CN115033533A (en) Log management method, apparatus and storage medium
CN116233239B (en) Comment-based configured gateway registration method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination