Log collection method, system and device and readable storage medium
By implementing accurate positioning and intelligent screening mechanisms in smart cars, only log files related to the specified time period are uploaded, which solves problems such as excessive files and high collection failure rate in existing log collection solutions, improves collection efficiency and accuracy, and reduces resource waste.
Patent Information
- Application Number
- CN202411919410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-08
AI Technical Summary
The existing smart car log collection solutions have problems such as excessive files, high collection failure rate, long waiting time, serious traffic waste, and waste of storage space. The cost of repeated collection is high and resources are seriously wasted.
By receiving the log collection request issued by the cloud, parsing and positioning it to the target APP, traversing and sorting the log files in chronological order, determining whether there is an intersection between the collection time period and the log file time period, and only uploading the log files with intersection.
It significantly improves the efficiency and accuracy of log collection, reduces data redundancy and transmission volume, saves network bandwidth and storage resources, improves the efficiency of fault diagnosis and performance analysis, and reduces operational costs.
Smart Images

Figure CN119782273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle-side log technology, and in particular to a log collection method, system, device and readable storage medium. Background Art
[0002] In the current smart car log collection scheme, log collection is usually done by collecting logs as a whole based on one or more applications under each ECU (controller). This method retrieves all historical logs of relevant functions on the vehicle side, but only a small part of the time period is actually used, resulting in a single collection file that is too large. This further leads to a series of problems, such as high log collection failure rate, long collection waiting time, serious traffic waste, and storage space waste.
[0003] In addition, the existing log file collection is mostly repeated, with high collection costs and easy to consume unnecessary traffic. Traditional log collection solutions only support a single collection of all historical logs of the entire ECU or application, and each time it is a full collection. This means that multiple collections in a short period of time will result in repeated collection of log files. The larger the file, the longer the collection time, which may be up to more than 1 hour. Full collection and repeated collection will consume unnecessary traffic each time. In addition, each collected file must be stored in the cloud for a certain period of time (such as 30 days), which is costly.
[0004] When troubleshooting vehicle failures, it is often necessary to collect vehicle operation logs. However, vehicle logs are cyclically overwritten, so sometimes it is necessary to configure periodic log uploads, that is, upload all vehicle-related logs at certain intervals (such as 48 hours). Although this method can perform log analysis in a timely manner when the problem recurs, it also causes a waste of resources.
[0005] Therefore, an improved log collection method is needed to solve the problems existing in the prior art, improve the efficiency and accuracy of log collection, and reduce resource waste. Summary of the invention
[0006] In view of the above technical problems, the present invention provides a log collection method, system, device and readable storage medium, which can solve at least one technical problem in the above background technology.
[0007] A first aspect of the present invention provides a log collection method, which is applied to a vehicle side and includes: Receive a log collection request sent by the cloud, wherein the log collection request includes a collection time period for the logs to be collected; Parse the log collection request and locate the target APP; Traverse all log files of the first layer under the target APP and sort them in preset time order; Determine whether there is a time intersection between the collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
[0008] As an optional implementation, in determining whether there is a time intersection between the collection time period and the first and last time periods of all log files, and uploading the log files with the time intersection to the cloud, the following step of deduplication of the uploaded log files is also included: Save the uploaded file records for a preset time period and update based on the upload action; If a log file with a time intersection is found in the uploaded file record as an uploaded file, the log file with a time intersection will no longer be uploaded.
[0009] As an optional implementation, traversing all log files of the first layer under the target APP and sorting them according to a preset time sequence includes: Traverse all log files in the first layer of the target APP; Sort all log files by creation time from earliest to latest, and use the creation time of the next log file as the end time of the previous file, and so on; Arrange the creation time and end time of all log files in sequence.
[0010] As an optional implementation manner, the determining whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploading the log files with the time intersection to the cloud, includes: Packing and compressing one or more log files with overlapping time periods; Log files that exceed the preset memory are split into pieces.
[0011] As an optional implementation, the log collection method further includes: The vehicle side monitors the vehicle side data based on the preset data anomaly rules; When abnormal vehicle-side data is monitored, the log file corresponding to the abnormal vehicle-side data is uploaded.
[0012] A second aspect of the present invention provides a log collection method, which is applied to the cloud, comprising: Configure fault events, the preset operating data range corresponding to the fault events, and the APP, application or module corresponding to the fault events; Obtain the operating data reported by the vehicle in real time; When the operating data meets a preset operating data range corresponding to a certain fault event, it is determined that the current vehicle has the fault event; Based on the fault event, a log collection request of the APP, application or module corresponding to the fault event is sent to the vehicle side, and the log collection request includes a collection time period for the logs to be collected.
[0013] As an optional implementation, the fault event includes at least a battery low power warning event, an air conditioning non-cooling event, and a battery pack overheating event.
[0014] As an optional implementation manner, the operating data at least includes a bus signal reported in real time when the vehicle is running.
[0015] A third aspect of the present invention provides a log collection method, comprising: The cloud sends a log collection request to the vehicle according to the preset collection time period; The vehicle side parses the log collection request and locates the target APP; The vehicle side traverses all log files of the first layer under the target APP and sorts them in a preset time sequence; The vehicle side determines whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploads the log files with time intersection to the cloud.
[0016] A fourth aspect of the present invention provides a log collection system, applied to a vehicle side, comprising: A request receiving unit, at least used to receive a log collection request sent from the cloud, wherein the log collection request includes a collection time period for the logs to be collected; A parsing and locating unit, at least used to parse the log collection request and locate it to the target APP; A traversal sorting unit, at least used to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The judgment uploading unit is at least used to judge whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
[0017] A fifth aspect of the present invention provides a log collection system, which is applied to the cloud, and includes: A configuration mapping unit is used to configure at least a fault event, a preset operating data range corresponding to the fault event, and a vehicle-side application or module corresponding to the fault event; A data acquisition unit, at least used to acquire the operating data reported by the vehicle end in real time; A fault determination unit, at least for determining that a fault event occurs in the current vehicle when the operation data satisfies a preset operation data range corresponding to a fault event; The request sending unit is at least used to send a log collection request of the APP, application or module corresponding to the fault event to the vehicle side based on the fault event, and the log collection request includes a collection time period for the logs to be collected.
[0018] A sixth aspect of the present invention provides a log collection system, comprising: A cloud request sending unit, at least used for sending a log collection request from the cloud to the vehicle end, wherein the log collection request includes a collection time period for the logs to be collected; The vehicle-side parsing and positioning unit is at least used for the vehicle-side to parse the log collection request and locate it to the target APP; The vehicle-side traversal sorting unit is at least used for the vehicle-side to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The vehicle-side judgment uploading unit is at least used for the vehicle-side to judge whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
[0019] A seventh aspect of the present invention provides an electronic device, comprising: At least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the methods described in the first to third aspects of the embodiments of the present invention.
[0020] An eighth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the method described in the first to third aspects of the embodiments of the present invention is executed.
[0021] The present invention significantly improves the efficiency and accuracy of log collection through precise positioning and intelligent screening mechanisms; by parsing cloud requests and locating the target APP, the relevant log files can be quickly locked. Combined with time sorting and intersection judgment, it ensures that only logs related to the specified time period are uploaded, effectively reducing data redundancy and transmission volume. This not only saves network bandwidth and storage resources, but also greatly improves the efficiency of subsequent analysis. At the same time, this method improves the flexibility of log collection, can quickly respond to collection needs in a specific time period, and is conducive to timely troubleshooting of vehicle faults and optimizing vehicle performance. Overall, the present invention optimizes the data collection process of smart cars, improves the efficiency of fault diagnosis and performance analysis, while reducing operating costs, and provides more reliable and efficient data support for vehicle management and user experience improvement. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1The figure is a flow chart of a log collection method in an embodiment of the present invention.
[0023] Figure 2 The figure is a flow chart of another log collection method in an embodiment of the present invention.
[0024] Figure 3 It is a schematic diagram of determining whether there are log files with time intersections in an embodiment of the present invention.
[0025] Figure 4 The figure is a flow chart of another log collection method in an embodiment of the present invention.
[0026] Figure 5 The figure is a flow chart of another log collection method in an embodiment of the present invention.
[0027] Figure 6 The figure is a flow chart of another log collection method in an embodiment of the present invention.
[0028] Figure 7 The following is a block diagram of a log collection system in an embodiment of the present invention.
[0029] Figure 8 The block diagram of another log collection system in an embodiment of the present invention.
[0030] Fig. 9 The block diagram of another log collection system in an embodiment of the present invention.
[0031] Fig.10 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] It should be understood that the terms "first", "second", and "third" etc. in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections. It should also be understood that the terms used in this disclosure specification are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0034] The vehicle-side log records the operating status of each vehicle system and component, which is crucial for diagnosing and troubleshooting vehicle faults. By analyzing the log data, vehicle performance bottlenecks can be identified and the vehicle systems and software can be optimized. Log data can also be used to analyze vehicle safety-related events, helping to improve vehicle safety, as well as reflect user patterns and habits in using the vehicle, providing a basis for improving user experience.
[0035] like Figure 1 As shown, the first aspect of the present invention provides a log collection method, comprising the following steps: Step S110: receiving a log collection request sent from the cloud, wherein the log collection request includes a VIN code, an ECU-APP, and a collection time period (accurate to minutes); Step S120: parsing the log collection request and locating the target APP; Step S130: traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; Step S140: determine whether there is a time intersection between the collection time period and the first and last time periods of all log files, and upload the log files with the time intersection to the cloud.
[0036] The present invention greatly improves the collection efficiency and accuracy by accurately locating the target APP and filtering the log files by time period, effectively reduces data redundancy, and reduces the network transmission burden and storage cost. At the same time, the present invention supports more flexible log collection strategies, which can quickly respond to the collection needs of specific time periods, and is conducive to timely troubleshooting of vehicle faults and optimizing vehicle performance. In addition, by uploading only necessary log data, not only cloud storage space is saved, but also the subsequent data analysis process is simplified, making problem location and resolution more efficient. This method significantly improves the overall efficiency and resource utilization of smart car log management while ensuring data integrity.
[0037] In one embodiment of the present invention, it is determined whether there is a time intersection between the collection time period and the first and last time periods of all log files, and the log files with the time intersection are uploaded to the cloud, and the step of deduplication of log file upload is also included: Save uploaded file records for a preset time period, such as 30 days, and update based on upload actions; If a log file with a time intersection is found in the uploaded file record as an uploaded file, the log file with a time intersection will no longer be uploaded.
[0038] Specifically, the uploaded file records can be saved in the form of an uploaded file list on the vehicle side. The vehicle side saves a list of uploaded files within 30 days and updates it every time a file is successfully uploaded. For files that already exist in the uploaded file list, they must be removed from the log files to be uploaded in the previous step according to the log collection request instruction issued by the cloud, that is, there is no need to upload this file repeatedly.
[0039] The present invention realizes intelligent file management and upload control by maintaining a list of uploaded files within 30 days, effectively avoiding repeated uploads, significantly reducing network bandwidth consumption and data transmission costs, and can accurately identify and exclude uploaded files by updating the list in real time and comparing before each upload, thereby greatly improving the efficiency of log collection. It not only saves storage space in the vehicle system and the cloud, but also reduces the time and computing resources required to process redundant data.
[0040] In one embodiment of the present invention, Figure 2 and Figure 3 As shown, in step S130, all log files of the first layer under the target APP are traversed and sorted according to a preset time sequence, including: Step S131: traverse all log files of the first layer under the target APP; Step S132: sort all log files from earliest to latest according to their creation time, and use the creation time of the next log file as the end time of the previous file, and so on; Step S133: Arrange the creation time and end time of all log files in sequence.
[0041] For details, please continue to refer to Figure 3 , the cloud instruction time is the collection time period, the vehicle side traverses all the log files of the first layer under the target APP, sorts all the files from early to late according to the creation time (TimeS), and then uses the creation time of the second file (log2) as the end time (TimeE) of the first file (log1), and the creation time of the third file as the end time of the second file... and so on.
[0042] In the present invention, the efficiency of log retrieval can be significantly improved by traversing all log files of the first layer under the target APP. First, by limiting the search scope to the first-level directory, the traversal time and system resource consumption are greatly reduced; secondly, this method simplifies the file management structure, making the organization of log files clearer and more standardized, and facilitating rapid positioning and access; finally, focusing on the first-level files also reduces system complexity and reduces path resolution and permission issues that may be caused by deeply nested directories. Therefore, the present invention not only optimizes the log collection process, but also improves the maintainability and scalability of vehicle-side collection. By centrally managing key log files, it provides a more direct and efficient data access path for subsequent data analysis and fault diagnosis, thereby enhancing the overall performance and reliability of smart cars.
[0043] In one embodiment of the present invention, Figure 4 As shown, in step S140, the process of determining whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploading the log files with the time intersection to the cloud includes: Step S141: Packing and compressing one or more log files with time intersections; Step S142: Slice the log files that exceed the preset memory.
[0044] Specifically, the first and last time periods of the log file represent the time period between the "creation time" and "end time" of the log file. The log collection time period sent from the cloud is intersected with the "creation time" and "end time" information of all log files. If there is an intersection, the intersection is taken as the "log file to be uploaded". If there is no intersection, "no log in the selected time period" is returned.
[0045] Furthermore, when the present invention obtains log files with an intersection of existence times to be uploaded to the cloud, the log files will be packaged and compressed. If multiple log collection tasks (such as case 1, case 2 and case 3) are received at the same time, each task needs to be queued and compressed on the vehicle side. Exemplarily, the queuing order is based on the order of the log files with an intersection of existence times to be uploaded to the cloud.
[0046] Furthermore, after compression is completed, if the log file exceeds the preset memory, for example, it exceeds 5M, it needs to be fragmented and then enter the upload queue to wait for upload. If all fragments of a compressed package are not uploaded and the network is disconnected or the vehicle is powered off, the upload queue should retain the unuploaded log compression package fragments for at least 24 hours (they can be deleted after the time is exceeded) and continue uploading after the network is repaired or the vehicle is powered on.
[0047] In one embodiment of the present invention, after the cloud receives all the fragments of the compressed package, it will merge and restore the fragments of the same compressed package, and then save them. If the network is disconnected or the power is cut off before the fragments of a compressed package are completely transmitted, the cloud needs to retain the received compressed package fragments for at least 24 hours (they can be deleted after the time limit is exceeded) and continue to receive the fragments after the network is repaired or the vehicle is powered on.
[0048] Furthermore, after the cloud stores the processed log file compression package in a cloud database such as OSS (Object Storage Service), the download address is displayed to the user for downloading.
[0049] The present invention improves the efficiency and reliability of log collection comprehensively by accurately defining the time range of log files, intelligent file screening, packaging, compression and fragmented upload mechanism, and breakpoint resume function. It can not only accurately locate the required log files, but also reduce the amount of data transmission through file compression. At the same time, it adopts fragmented upload and queue management to process large files, effectively avoiding data loss caused by network fluctuations and vehicle power failure. In addition, this method can significantly reduce network bandwidth consumption, improve the success rate of data transmission, and ensure the integrity and continuity of log data.
[0050] In one embodiment of the present invention, the log collection method further includes log uploading actively initiated by the vehicle end, which includes: The vehicle side monitors the vehicle side data based on the preset data anomaly rules; When abnormal vehicle-side data is monitored, the log file corresponding to the abnormal vehicle-side data is uploaded.
[0051] Specifically, the preset data anomaly rules are configured on the vehicle side, which can monitor the abnormal scenarios on the vehicle side. After the vehicle side detects a fault, it will directly package, compress and upload the corresponding log files to the cloud. For recurring faults, the vehicle side will only upload once within 24 hours to avoid invalid uploads and waste of resources caused by multiple triggering of uploads.
[0052] Taking an application scenario of the present invention, such as a black screen scenario on the vehicle side, in the black screen scenario on the vehicle side, if the vehicle side monitors that the screen reporting data and register data are abnormal and last for 5 seconds, it means that a black screen fault occurs, and if it returns to normal and lasts for 5 seconds, it means that the fault ends. Among them, the preset data abnormality rule here can be that both the screen reporting data and the register data are abnormal and last for 5 seconds. By accurately defining the preset data abnormality rule, key fault information can be captured more accurately, providing high-quality data support for subsequent analysis and problem solving, thereby significantly improving the overall operational reliability and user experience of smart cars.
[0053] In addition, the present invention significantly improves the efficiency and accuracy of vehicle fault diagnosis through active monitoring and intelligent uploading mechanism based on preset data anomaly rules. By configuring anomaly rules on the vehicle side, it can monitor and quickly identify potential problems in real time, such as black screen and other faults on the vehicle screen. Once an anomaly is detected, the relevant logs will be automatically packaged and uploaded without manual intervention, greatly shortening the fault response time. At the same time, the upload limit for repeated faults within 24 hours effectively prevents data redundancy and waste of resources. This method not only improves the timeliness and accuracy of fault diagnosis, but also optimizes data transmission and storage efficiency, and reduces unnecessary network traffic and cloud storage pressure.
[0054] like Figure 5 As shown, the second aspect of the present invention provides a log collection method, which is applied to the cloud, comprising: Step S210: configuring a fault event, a preset operating data range corresponding to the fault event, and an APP, application or module corresponding to the fault event; Step S220: acquiring the operating data reported by the vehicle end in real time; Step S230: When the operating data meets a preset operating data range corresponding to a certain fault event, it is determined that the fault event occurs in the current vehicle; Step S240: Based on the fault event, a log collection request of the APP, application or module corresponding to the fault event is sent to the vehicle end, and the log collection request includes a collection time period for the logs to be collected.
[0055] Specifically, the preset operating data range corresponding to the fault event, as well as the APP, application or module information corresponding to the fault event can be stored in the corresponding fault configuration application list; the fault event includes at least a battery low power warning event, an air conditioning non-cooling event and a battery pack overheating event; the operating data includes at least a bus signal reported in real time when the vehicle is running.
[0056] When the cloud determines that the current vehicle has a fault event, the cloud confirms the collection time period according to the information in the fault configuration application list. For example, the cloud determines the log file list 24 hours before the current vehicle has a fault event. At this time, the cloud will also filter the required log file list and filter out the log files that do not exist in the cloud. It will notify the vehicle side in the form of a log collection request, and the vehicle side will perform the corresponding log upload operation.
[0057] Specifically, the cloud will monitor pre-configured fault events through operating data such as bus signals reported in real time when the vehicle is running, such as air conditioning failure to cool, battery pack overheating, etc. Once the above fault events occur in the vehicle, it will trigger a cloud alarm. The vehicle will also preset some fault events. Once a related fault is monitored, it will notify the vehicle end and collect logs to actively report to the cloud.
[0058] In an application scenario of the present invention, such as a 12V battery low power warning scenario, the corresponding battery low power warning event is that the signal value reported by the bus signal "EBSBatVol_l" is between 3-11.8 and lasts for 5 seconds, indicating that a fault has occurred; if it is not between 3-11.8 and lasts for 5 seconds, the fault is over, and log collection is performed according to the APP, application or module involved in the cloud "12V battery power feed warning" fault configuration.
[0059] The present invention can quickly locate and collect key logs related to specific faults by pre-defining various fault events (such as battery power loss, air conditioning failure, battery overheating, etc.) and their corresponding data ranges and related application information. The cloud intelligently determines the occurrence of a fault based on real-time vehicle data and automatically determines the collection scope, such as the logs 24 hours before the fault occurs. The cloud only requests to upload missing log files by comparing with existing data, effectively avoiding repeated collection and transmission, and can provide customized data collection strategies for different types of faults, making problem analysis more accurate and efficient, thereby speeding up fault resolution and improving vehicle reliability and user satisfaction.
[0060] like Figure 6 As shown, the third aspect of the present invention provides a log collection method, comprising: Step S310: The cloud sends a log collection request to the vehicle according to a preset collection time period; Step S320: the vehicle side parses the log collection request and locates the target APP; Step S330: The vehicle end traverses all log files of the first layer under the target APP and sorts them according to a preset time sequence; Step S340: The vehicle side determines whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploads the log files with time intersection to the cloud.
[0061] like Figure 7 As shown, a fourth aspect of the present invention is a log collection system, applied to a vehicle side, comprising: The request receiving unit 410 is at least used to receive a log collection request sent by the cloud, wherein the log collection request includes a collection time period for the logs to be collected; The parsing and locating unit 420 is at least used to parse the log collection request and locate the target APP; The traversal sorting unit 430 is at least used to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The judgment uploading unit 440 is at least used to judge whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and upload the log files with the time intersection to the cloud.
[0062] like Figure 8 As shown, a fifth aspect of the present invention is a log collection system, applied to the cloud, comprising: A configuration mapping unit 510 is used to configure at least a fault event, a preset operating data range corresponding to the fault event, and a vehicle-side application or module corresponding to the fault event; The data acquisition unit 520 is at least used to acquire the operation data reported by the vehicle end in real time; The fault determination unit 530 is at least used to determine that a fault event occurs in the current vehicle when the operation data meets a preset operation data range corresponding to a fault event; The request sending unit 540 is at least used to send a log collection request of the APP, application or module corresponding to the fault event to the vehicle end based on the fault event, and the log collection request includes a collection time period for the logs to be collected.
[0063] like Fig. 9 As shown, in a sixth aspect of the present invention, a log collection system includes: The cloud request sending unit 610 is at least used for sending a log collection request from the cloud to the vehicle end, wherein the log collection request includes a collection time period for the logs to be collected; The vehicle-side parsing and positioning unit 620 is at least used for the vehicle-side to parse the log collection request and locate it to the target APP; The vehicle-side traversal sorting unit 630 is at least used for the vehicle-side to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The vehicle-side judgment uploading unit 640 is at least used for the vehicle-side to judge whether there is a time intersection between a preset collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
[0064] Based on the same idea as the method in the above embodiment, any log collection system provided by the present invention can implement the method in the above embodiment. For the convenience of explanation, the structural diagram of the system embodiment only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0065] like Fig.10 As shown, the seventh aspect of the present invention provides an electronic device, including: At least one processor; and at least one memory in communication with the processor, wherein: the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the above-mentioned log collection method.
[0066] An eighth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned log collection method is implemented.
[0067] It can be understood that computer-readable storage media may include: any entity or device capable of carrying a computer program, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc. A computer program includes a computer program code. The computer program code may be in source code form, object code form, an executable file, or some intermediate form, etc. A computer-readable storage medium may include: any entity or device capable of carrying a computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc.
[0068] In certain embodiments of the present invention, the electronic device may include a controller or a processor, and the controller is a single-chip microcomputer chip that integrates a processor, a memory, a communication module, etc. The processor may refer to a processor included in the controller. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0069] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0070] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0071] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A log collection method, applied to a vehicle, characterized in that: include: Receive a log collection request sent by the cloud, wherein the log collection request includes a collection time period for the logs to be collected; Parse the log collection request and locate the target APP; Traverse all log files of the first layer under the target APP and sort them in preset time order; Determine whether there is a time intersection between the collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
2. The log collection method according to claim 1, characterized in that: It determines whether there is a time intersection between the collection time period and the first and last time periods of all log files, and uploads the log files with time intersection to the cloud, which also includes the log file upload deduplication step: Save the uploaded file records for a preset time period and update based on the upload action; If a log file with a time intersection is found in the uploaded file record as an uploaded file, the log file with a time intersection will no longer be uploaded.
3. The log collection method according to claim 1 or 2, characterized in that: The traversal of all log files in the first layer of the target APP and sorting them in a preset time order includes: Traverse all log files in the first layer of the target APP; Sort all log files by creation time from earliest to latest, and use the creation time of the next log file as the end time of the previous file, and so on; Arrange the creation time and end time of all log files in sequence.
4. The log collection method according to claim 1, characterized in that: The determining whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploading the log files with the time intersection to the cloud, includes: Packing and compressing one or more log files with overlapping time periods; Log files that exceed the preset memory are split into pieces.
5. The log collection method according to claim 1, characterized in that: Also includes: The vehicle side monitors the vehicle side data based on the preset data anomaly rules; When abnormal vehicle-side data is monitored, the log file corresponding to the abnormal vehicle-side data is uploaded.
6. A log collection method, applied to the cloud, characterized in that: include: Configure fault events, the preset operating data range corresponding to the fault events, and the APP, application or module corresponding to the fault events; Obtain the operating data reported by the vehicle in real time; When the operating data meets a preset operating data range corresponding to a certain fault event, it is determined that the current vehicle has the fault event; Based on the fault event, a log collection request of the APP, application or module corresponding to the fault event is sent to the vehicle side, and the log collection request includes a collection time period for the logs to be collected.
7. The log collection method according to claim 6, characterized in that: The fault events include at least a battery low power warning event, an air conditioner non-cooling event, and a battery pack overheating event.
8. The log collection method according to claim 6, characterized in that: The operation data at least includes bus signals reported in real time when the vehicle is running.
9. A log collection method, characterized in that: include: The cloud sends a log collection request to the vehicle according to the preset collection time period; The vehicle side parses the log collection request and locates the target APP; The vehicle side traverses all log files of the first layer under the target APP and sorts them in a preset time sequence; The vehicle side determines whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and uploads the log files with time intersection to the cloud.
10. A log collection system, applied to a vehicle, characterized in that: include: A request receiving unit, at least used to receive a log collection request sent from the cloud, wherein the log collection request includes a collection time period for the logs to be collected; A parsing and locating unit, at least used to parse the log collection request and locate it to the target APP; A traversal sorting unit, at least used to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The judgment uploading unit is at least used to judge whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
11. A log collection system, applied to the cloud, characterized in that: include: A configuration mapping unit is used to configure at least a fault event, a preset operating data range corresponding to the fault event, and a vehicle-side application or module corresponding to the fault event; A data acquisition unit, at least used to acquire the operating data reported by the vehicle end in real time; A fault determination unit, at least for determining that a fault event occurs in the current vehicle when the operation data satisfies a preset operation data range corresponding to a fault event; The request sending unit is at least used to send a log collection request of the APP, application or module corresponding to the fault event to the vehicle side based on the fault event, and the log collection request includes a collection time period for the logs to be collected.
12. A log collection system, characterized in that: include: A cloud request sending unit, at least used for sending a log collection request from the cloud to the vehicle end, wherein the log collection request includes a collection time period for the logs to be collected; The vehicle-side parsing and positioning unit is at least used for the vehicle-side to parse the log collection request and locate it to the target APP; The vehicle-side traversal sorting unit is at least used for the vehicle-side to traverse all log files of the first layer under the target APP and sort them according to a preset time sequence; The vehicle-side judgment uploading unit is at least used for the vehicle-side to judge whether there is a time intersection between the preset collection time period and the first and last time periods of all log files, and upload the log files with time intersection to the cloud.
13. An electronic device, characterized in that: include: at least one processor; And at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the log collection method as described in any one of claims 1 to 9.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the log collection method according to any one of claims 1 to 9 is executed.