A diagnostic log assembly method, apparatus, device and medium
By optimizing the storage and uploading of diagnostic logs through a dual-storage-area management strategy, the problems of storage efficiency and bandwidth burden in existing technologies are solved, achieving efficient diagnostic data management and reducing resource waste and complex operations.
Patent Information
- Application Number
- CN202510109504.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-01-22
AI Technical Summary
Existing diagnostic logging methods have issues with storage efficiency and bandwidth burden, leading to wasted diagnostic data storage and server bandwidth pressure, which affects the efficiency and accuracy of the diagnostic process.
A dual-storage area management strategy is adopted, which dynamically switches between the first and second storage areas and combines preset diagnostic interruption conditions to optimize the storage and uploading process of diagnostic data, avoid excessive data from affecting the normal writing process, and reduce the server bandwidth burden.
It improves the storage efficiency of diagnostic logs, reduces the burden on computer and server bandwidth, ensures timely collection and analysis of diagnostic data, and reduces resource waste and the need for complex operations.
Smart Images

Figure CN119987673B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a diagnostic log assembly method, device, equipment and medium. BACKGROUND
[0002] At present, with the continuous development of automobile electronics, the ECU (Electronic Control Unit) carried by the automobile is more and more, and it is also more and more complex, which brings great challenge to the troubleshooting of fault problems. The diagnostic software usually records the diagnostic data generated in the diagnostic process to form a log, and the technician locates the problem through the log after the problem occurs. There are two common diagnostic communication log recording methods: 1. Record the communication log of each diagnostic process, and upload the log generated in the diagnostic process to the server after the problem occurs. The technician analyzes the problem by taking the log from the background; 2. Set the log recording switch, do not record the log during normal diagnosis, and open the log switch after the problem occurs. Reproduce the problem by executing the diagnostic function again, and send the reproduced log to the technician to analyze the problem; the above two methods have their own disadvantages, 1. Recording log every time will waste a lot of computer memory, especially when executing ECU flashing which requires high timing, recording diagnostic data log may affect the normal flashing process and cause flashing failure, and the huge data will cause serious burden on the computer and server bandwidth; 2. Setting the log switch cannot collect the first-hand diagnostic data in time, and often needs to reproduce the second or N times to record successfully, which is not intelligent enough to affect the collection of communication log and the troubleshooting of problems.
[0003] In summary, how to store diagnostic logs to improve storage efficiency and reduce bandwidth burden is a problem to be solved at present. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a diagnostic log assembly method, device, equipment and medium, which stores diagnostic logs to improve storage efficiency and reduce bandwidth burden, and the specific scheme is as follows:
[0005] In a first aspect, the present application discloses a diagnostic log assembly method applied to diagnostic software, comprising:
[0006] Determine the to-be-diagnosed electronic control unit in the to-be-diagnosed vehicle based on the diagnostic test information, diagnose the to-be-diagnosed electronic control unit, and store the diagnostic data generated in the diagnostic process to a first storage area;
[0007] If the first storage area is filled and the diagnostic interruption condition is not triggered, store the diagnostic data generated in the subsequent diagnostic process to a second storage area;
[0008] if the diagnostic interrupt condition is not triggered until the second storage area is filled, then the first storage area is cleared, the diagnostic data in the second storage area is transferred to the first storage area, and the second storage area is cleared;
[0009] jumping to the step of storing the diagnostic data generated in the subsequent diagnostic process to the second storage area until the diagnostic interrupt condition is triggered to stop the diagnosis;
[0010] transferring the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area, and uploading the diagnostic data in the third storage area to a server as a diagnostic log.
[0011] Optionally, the size of the first storage area and the second storage area is the target size.
[0012] Optionally, the transferring of the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area comprises:
[0013] if the second storage area is empty, then transferring the target size of diagnostic data in the first storage area to the third storage area;
[0014] if the second storage area is not empty, then determining a first current size of diagnostic data in the second storage area, and determining a first temporary size of diagnostic data in the first storage area in a time order from back to front; the first temporary size is the difference between the target size and the first current size;
[0015] transferring the first current size of diagnostic data in the second storage area and the first temporary size of diagnostic data in the first storage area to the third storage area.
[0016] Optionally, before the storing of diagnostic data generated in the subsequent diagnostic process to the second storage area if the diagnostic interrupt condition is not triggered until the first storage area is filled, further comprising:
[0017] if the diagnostic interrupt condition is triggered when the first storage area is not filled, then interrupting the diagnostic process, transferring the diagnostic data in the first storage area to the third storage area, and uploading all diagnostic data in the third storage area to a server as a diagnostic log.
[0018] Optionally, before the clearing of the first storage area if the diagnostic interrupt condition is not triggered until the second storage area is filled, further comprising:
[0019] if the diagnostic interrupt condition is triggered when the second storage area is not filled, interrupting the diagnosis process, determining a second current size of the diagnostic data in the second storage area, and determining the diagnostic data of the second temporary size in the first storage area in the order from the latest to the earliest in time; the second temporary size is the difference between the target size and the second current size;
[0020] storing the determined diagnostic data of the second current size in the second storage area and the diagnostic data of the second temporary size in the first storage area into the third storage area.
[0021] Optionally, the diagnosis log assembling method further comprises:
[0022] storing the diagnosis test information into a fourth storage area;
[0023] Correspondingly, the storing of the diagnostic data of the latest target size in the first storage area and the second storage area into the third storage area and the uploading of the diagnostic data in the third storage area as a diagnosis log to a server comprises:
[0024] storing the diagnostic data of the latest target size in the first storage area and the second storage area and the diagnosis test information in the fourth storage area into the third storage area, and uploading the diagnostic data and the diagnosis test information in the third storage area as a diagnosis log to a server.
[0025] Optionally, before the diagnosing of the to-be-diagnosed electronic control unit and the storing of the diagnostic data generated in the diagnosis process into the first storage area, the method further comprises:
[0026] obtaining a preset log maximum storage size, and setting the first storage area, the second storage area, the third storage area and the fourth storage area based on the log maximum storage size; the log maximum storage size is the sum of the target size and the size of the fourth storage area.
[0027] In a second aspect, the present application discloses a diagnosis log assembling device applied to diagnosis software, comprising:
[0028] a first storage module configured to determine a to-be-diagnosed electronic control unit in a to-be-diagnosed vehicle based on diagnosis test information, diagnose the to-be-diagnosed electronic control unit and store diagnostic data generated in the diagnosis process into a first storage area;
[0029] a second storage module configured to store diagnostic data generated in a subsequent diagnosis process into a second storage area if a diagnosis interrupt condition is not triggered until the first storage area is filled.
[0030] a third storage module, configured to clear the first storage region, transfer the diagnostic data in the second storage region to the first storage region, and clear the second storage region, if the diagnostic interrupt condition is not triggered until the second storage region is filled;
[0031] a jump module, configured to jump to the step of storing the diagnostic data generated in the subsequent diagnostic process to the second storage region, and stop the diagnosis when the diagnostic interrupt condition is triggered;
[0032] a log uploading module, configured to transfer the diagnostic data of the latest target size in the first storage region and the second storage region to a third storage region, and upload the diagnostic data in the third storage region to a server as a diagnostic log.
[0033] In a third aspect, the present application discloses an electronic device, comprising:
[0034] a memory, configured to save a computer program;
[0035] a processor, configured to execute the computer program to realize the diagnostic log assembling method disclosed above.
[0036] In a fourth aspect, the present application discloses a computer readable storage medium, configured to save a computer program; wherein the computer program is executed by a processor to realize the diagnostic log assembling method disclosed above.
[0037] It can be seen that the present application determines the electronic control unit to be diagnosed in the vehicle to be diagnosed based on the diagnostic test information, diagnoses the electronic control unit to be diagnosed and stores the diagnostic data generated in the diagnostic process to a first storage region; if the diagnostic interrupt condition is not triggered until the first storage region is filled, the diagnostic data generated in the subsequent diagnostic process is stored to a second storage region; if the diagnostic interrupt condition is not triggered until the second storage region is filled, the first storage region is cleared, the diagnostic data in the second storage region is transferred to the first storage region, and the second storage region is cleared; the step of storing the diagnostic data generated in the subsequent diagnostic process to the second storage region is jumped to, and the diagnosis is stopped when the diagnostic interrupt condition is triggered; the diagnostic data of the latest target size in the first storage region and the second storage region is transferred to a third storage region, and the diagnostic data in the third storage region is uploaded to a server as a diagnostic log. It can be seen that the present application uses two regions, i.e. the first storage region and the second storage region, to store the diagnostic data, and because part of the diagnostic data can be deleted by using the two regions, the present application avoids too much diagnostic data, avoids affecting the normal flashing process to cause flashing failure, and avoids causing a serious burden on the computer and the server bandwidth; in addition, the diagnostic data does not need to be collected in the second pass, and the time and resource waste is reduced. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart of a diagnostic log assembly method disclosed in this application;
[0040] Figure 2 This is a schematic diagram of a diagnostic log assembly method disclosed in this application;
[0041] Figure 3 This is a schematic diagram illustrating the log size and diagnostic terminal condition settings disclosed in this application;
[0042] Figure 4 This is a schematic diagram of memory data disclosed in this application;
[0043] Figure 5 This is a schematic diagram of a diagnostic log assembly disclosed in this application;
[0044] Figure 6 This is a schematic diagram of another diagnostic log assembly method disclosed in this application;
[0045] Figure 7 This is a schematic diagram of another diagnostic log group leader process disclosed in this application;
[0046] Figure 8 This is a schematic diagram of a diagnostic log assembly device disclosed in this application;
[0047] Figure 9 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] Currently, with the continuous development of automobile electronics, the ECU carried by the automobile is more and more, and it is also more and more complex, which brings great challenge to the troubleshooting of fault problems. The diagnostic software usually records the diagnostic data generated in the diagnostic process to form a log, and the technician locates the problem through the log after the problem occurs. There are two common diagnostic communication log recording methods: 1. Record the communication log of each diagnostic process, and upload the log generated in the diagnostic process to the server after the problem occurs. The technician analyzes the problem by taking the log from the background; 2. Set the log recording switch, do not record the log during normal diagnosis, and open the log switch when the problem occurs. Reproduce the problem by executing the diagnostic function again, and send the reproduced log to the technician to analyze the problem; the above two methods have their own disadvantages, 1. Recording log every time will waste a lot of computer memory, especially when executing ECU flashing which has high time sequence requirement, recording diagnostic data log may affect the normal flashing process and cause flashing failure, and the huge data will cause serious burden on the computer and server bandwidth; 2. Setting the log switch cannot collect the first-hand diagnostic data in time, and often needs to reproduce the second or N times to record successfully, which is not intelligent enough to affect the collection of communication log and the troubleshooting of problems.
[0050] Therefore, an embodiment of the present application provides a diagnostic log assembly scheme, which can store diagnostic logs to improve storage efficiency and reduce bandwidth burden.
[0051] An embodiment of the present application discloses a diagnostic log assembly method, as shown in Figure 1 The method comprises the following steps.
[0052] Step S11: determining an electronic control unit to be diagnosed in a vehicle to be diagnosed based on diagnostic test information, diagnosing the electronic control unit to be diagnosed, and storing diagnostic data generated in the diagnostic process to a first storage area.
[0053] In the embodiment, as shown in Figure 2 It is a schematic diagram of a diagnostic log assembly method; in the figure, the diagnostic software first requests the server for the maximum length of the diagnostic log and the diagnostic interruption condition for triggering the uploading of the log, then the server sends the maximum length of the diagnostic log and the diagnostic interruption condition for triggering the uploading of the log to the diagnostic software, the diagnostic log records the diagnostic log to the diagnostic software according to the maximum length of the diagnostic log, and uploads the diagnostic log to the server when the diagnostic interruption condition for triggering the uploading of the log is triggered, so that the user can view the log to analyze the problem. The specific process of recording the diagnostic log is described in the subsequent content.
[0054] In the embodiment, the ECU (Electronic Control Unit) is also called driving computer, vehicle-mounted computer, etc. The ecu is composed of microprocessor, memory, input and output interface, analog-to-digital converter, and large-scale integrated circuits such as shaping and driving, like an ordinary computer.
[0055] It should be noted that the diagnostic log DiagnosticLog is divided into two parts, 1-diagnostic test information (including vehicle name, VIN, test system, test function, test time, etc.), 2-diagnostic data.
[0056] In the embodiment, before the diagnosis of the electronic control unit to be diagnosed and the storage of the diagnostic data generated in the diagnosis process to the first storage area, the method further comprises: obtaining a pre-set log maximum storage size, and setting the first storage area, the second storage area, the third storage area and the fourth storage area based on the log maximum storage size; the log maximum storage size is the sum of the target size and the size of the fourth storage area.
[0057] It should be noted that the host factory technician sets the maximum single diagnostic log DiagnoseLogMaxSize and the diagnostic log upload diagnostic interruption condition Conditions (such as the diagnostic software not receiving the ECU reply or the ECU reply 7F negative response) through the background, and the specific setting is shown in Figure 3 , which is a log size and diagnostic terminal condition setting diagram; and Figure 4 , which is a memory data diagram; after the diagnostic software is started, the log setting interface of the background is accessed through the network to obtain the size DiagnoseLogMaxSize and the diagnostic interruption condition Conditions, and four arrays are applied on the system memory, ArrayTotalLog (third storage area) (the size is DiagnoseLogMaxSize to record the final uploaded diagnostic log content), ArrayDiagnosticInfo (fourth storage area) 0 (the initialization size is M, M is less than DiagnoseLogMaxSize, which is used to dynamically store the diagnostic test information), ArrayDiagnosticData (first storage area) (the initialization size is N, M+N=DiagnoseLogMaxSize, which is used to record the communication data), and ArrayDiagnosticData_Backup (second storage area) (the initialization size is N, which is used to store the subsequent diagnostic data (communication data) when the data recorded in ArrayDiagnosticData exceeds N).
[0058] In the embodiment, before determining the to-be-diagnosed electronic control unit in the to-be-diagnosed vehicle based on the diagnostic test information, the method further comprises: storing the diagnostic test information into a fourth storage area, so as to be subsequently stored into a diagnostic log. It should be noted that, after the diagnostic software reads the vehicle information and enters the specific ECU function, the diagnostic test information is recorded into the ArrayDiagnosticInfo (the fourth storage area), at this time, the diagnostic software judges whether to interrupt the recording and upload the diagnostic log according to the Conditions issued by the server.
[0059] Step S12: If the diagnostic interrupt condition is not triggered until the first storage area is filled, the diagnostic data generated in the subsequent diagnostic process is stored into the second storage area.
[0060] In the embodiment, before the diagnostic data generated in the subsequent diagnostic process is stored into the second storage area if the diagnostic interrupt condition is not triggered until the first storage area is filled, the method further comprises: if the diagnostic interrupt condition is triggered when the first storage area is not filled, interrupting the diagnostic process, transferring the diagnostic data in the first storage area to the third storage area, and uploading all the diagnostic data in the third storage area to the server as a diagnostic log.
[0061] Step S13: If the diagnostic interrupt condition is not triggered until the second storage area is filled, the first storage area is cleared, the diagnostic data in the second storage area is transferred to the first storage area, and the second storage area is cleared.
[0062] In the embodiment, before the first storage area is cleared if the diagnostic interrupt condition is not triggered until the second storage area is filled, the method further comprises: if the diagnostic interrupt condition is triggered when the second storage area is not filled, interrupting the diagnostic process, determining a second current size of the diagnostic data in the second storage area, and determining the diagnostic data of the second temporary size in the first storage area in the order from the back to the front in time; the second temporary size is the difference between the target size and the second current size; transferring the diagnostic data of the second current size in the second storage area and the diagnostic data of the second temporary size in the first storage area to the third storage area.
[0063] Step S14: Jumping to the step of storing the diagnostic data generated in the subsequent diagnostic process into the second storage area, and stopping the diagnosis when the diagnostic interrupt condition is triggered.
[0064] Step S15: copying the latest target size of diagnostic data in the first storage area and the second storage area to the third storage area, and uploading the diagnostic data in the third storage area to the server as a diagnostic log.
[0065] In this embodiment, the size of the first storage area and the second storage area is the target size.
[0066] In this embodiment, the copying of the latest target size of diagnostic data in the first storage area and the second storage area to the third storage area includes: if the second storage area is empty, copying the target size of diagnostic data in the first storage area to the third storage area; if the second storage area is not empty, determining a first current size of diagnostic data in the second storage area, and determining a first temporary size of diagnostic data in the first storage area in the order from the latest to the earliest; the first temporary size is the difference between the target size and the first current size; copying the first current size of diagnostic data in the second storage area and the first temporary size of diagnostic data in the first storage area to the third storage area.
[0067] In this embodiment, the foregoing copying of the diagnostic test information to the fourth storage area; the copying of the latest target size of diagnostic data in the first storage area and the second storage area to the third storage area, and uploading the diagnostic data in the third storage area to the server as a diagnostic log includes: copying the latest target size of diagnostic data in the first storage area and the second storage area and the diagnostic test information in the fourth storage area to the third storage area, and uploading the diagnostic data and the diagnostic test information in the third storage area to the server as a diagnostic log.
[0068] It should be noted that diagnostic data generated during the diagnostic process is initially stored in `ArrayDiagnosticData` until the record size exceeds N. At this point, new diagnostic communication data is recorded in `ArrayDiagnosticData_Backup`. If `ArrayDiagnosticData_Backup` is also full, the data stored in `ArrayDiagnosticData_Backup` is copied to `ArrayDiagnosticData` to replace it, `ArrayDiagnosticData_Backup` is cleared, and subsequent diagnostic data is re-recorded in `ArrayDiagnosticData_Backup`, repeating this cycle until a diagnostic interruption condition is triggered. When the diagnostic software triggers the diagnostic interruption condition, it means that the log needs to be uploaded. The diagnostic software first checks if the data volume in `ArrayDiagnosticData` is less than N. If it is less than N, it means that all diagnostic communication logs are recorded in this array. At this time, `ArrayDiagnosticInfo` and `ArrayDiagnosticData` are used to populate `ArrayTotalLog`, and then uploaded to the backend server. See [link to details]. Figure 5 The diagram illustrates a diagnostic log assembly process. If the value equals N, it indicates that the recorded diagnostic data has exceeded the maximum value issued by the server and needs to be processed before uploading. The diagnostic software obtains the communication data size K stored in ArrayDiagnosticData_Backup, clears the first K bytes of content in ArrayDiagnosticData, moves the remaining NK bytes to the front of the array, and then copies the communication content from ArrayDiagnosticData_Backup from the NK position into the ArrayDiagnosticData array. Thus, the diagnostic communication data is stored in the ArrayDiagnosticData array in ascending order. The ArrayTotalLog is then populated using the ArrayDiagnosticInfo and ArrayDiagnosticData arrays and uploaded to the backend server. See details... Figure 6 and Figure 7 As shown, this is another schematic diagram of diagnostic log assembly; Figure 6 This is a schematic diagram of another diagnostic log assembly method, which details the diagnostic log assembly process. Figure 7 This is a flowchart illustrating another diagnostic log group leader workflow. The diagram is for... Figure 5 The flowchart is shown below; if the entire diagnostic process is not interrupted, these four arrays will be destroyed and memory will be released when exiting the diagnostic process.
[0069] In summary, the application can dynamically preset a trigger condition to obtain accurate synchronous diagnosis logs, facilitate technicians to troubleshoot and locate problems, and does not cause burden to user computer systems and server networks. Since operations are performed on the memory, there are no frequent file read / write operations, normal diagnosis functions are not affected, the execution efficiency and safety of the diagnosis software are greatly improved, complex manual operations are reduced, and after-sales costs are reduced.
[0070] It can be seen that the application determines a to-be-diagnosed electronic control unit in a to-be-diagnosed vehicle based on diagnosis test information, diagnoses the to-be-diagnosed electronic control unit and stores diagnosis data generated in the diagnosis process to a first storage area; if the diagnosis interrupt condition is not triggered until the first storage area is filled, diagnosis data generated in a subsequent diagnosis process is stored to a second storage area; if the diagnosis interrupt condition is not triggered until the second storage area is filled, the first storage area is cleared, the diagnosis data in the second storage area is transferred to the first storage area, and the second storage area is cleared; the step of storing diagnosis data generated in a subsequent diagnosis process to a second storage area is jumped to until the diagnosis interrupt condition is triggered to stop diagnosis; the latest target size of diagnosis data in the first storage area and the second storage area is transferred to a third storage area, and the diagnosis data in the third storage area is uploaded to a server as a diagnosis log. It can be seen that the application uses two areas, the first storage area and the second storage area, to store diagnosis data, and because the two areas are used to delete part of the diagnosis data, the application avoids too much diagnosis data, avoids affecting the normal flashing process to cause flashing failure, and avoids causing a serious burden on the computer and the server bandwidth. In addition, the second pass is not needed to collect diagnosis data, and time and resource waste is reduced.
[0071] Correspondingly, the application also discloses a diagnosis log assembly device, which refers to Figure 8 As shown in the figure, the device comprises:
[0072] A first storage module 11 is configured to determine a to-be-diagnosed electronic control unit in a to-be-diagnosed vehicle based on diagnosis test information, diagnose the to-be-diagnosed electronic control unit, and store diagnosis data generated in the diagnosis process to a first storage area.
[0073] A second storage module 12 is configured to store diagnosis data generated in a subsequent diagnosis process to a second storage area if the diagnosis interrupt condition is not triggered until the first storage area is filled.
[0074] A third storage module 13 is configured to clear the first storage area, transfer diagnosis data in the second storage area to the first storage area, and clear the second storage area if the diagnosis interrupt condition is not triggered until the second storage area is filled.
[0075] jumping to the step of storing the diagnostic data generated in the subsequent diagnostic process to the second storage area until the diagnostic interruption condition is triggered to stop the diagnosis;
[0076] logging uploading module 15, configured to copy the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area, and upload the diagnostic data in the third storage area to a server as a diagnostic log.
[0077] Wherein, the more specific working process of each module above can be the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0078] It can be seen that, based on the diagnostic test information, the diagnostic electronic control unit to be diagnosed in the vehicle to be diagnosed is determined, the diagnostic electronic control unit to be diagnosed is diagnosed, and the diagnostic data generated in the diagnostic process is stored to the first storage area. If the diagnostic interruption condition is not triggered until the first storage area is filled, the diagnostic data generated in the subsequent diagnostic process is stored to the second storage area. If the diagnostic interruption condition is not triggered until the second storage area is filled, the first storage area is cleared, the diagnostic data in the second storage area is copied to the first storage area, and the second storage area is cleared. Jump to the step of storing the diagnostic data generated in the subsequent diagnostic process to the second storage area until the diagnostic interruption condition is triggered to stop the diagnosis; copy the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area, and upload the diagnostic data in the third storage area to a server as a diagnostic log. It can be seen that, the first storage area and the second storage area are used to store diagnostic data, and because the two areas are used to delete part of the diagnostic data, it avoids too much diagnostic data, avoids affecting the normal flashing process to cause flashing failure, and avoids serious burden on the computer and server bandwidth. In addition, it does not need to collect diagnostic data for the second time, which reduces the waste of time and resources.
[0079] Further, the embodiment of the present application also provides an electronic device. Figure 9 The electronic device 20 structure diagram shown in accordance with an exemplary embodiment, the content in the figure cannot be considered as any limitation on the scope of use of the present application.
[0080] Figure 9A structural schematic diagram of an electronic device 20 is provided in the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26 and a communication bus 27. The memory 22 is configured to store a computer program, and the processor 21 is configured to load and execute the computer program to implement the related steps in the diagnostic log assembly method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiments of the present application can be specifically an electronic computer.
[0081] In the embodiments of the present application, the power supply 26 is configured to provide working voltage for each hardware device on the electronic device 20, and the communication interface 25 is configured to create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 25 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein. The input / output interface 24 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.
[0082] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include a computer program 221, and the storage mode can be temporary storage or permanent storage. In addition to the computer program capable of completing the diagnostic log assembly method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 221 can further include a computer program capable of completing other specific work.
[0083] Further, the embodiments of the present application further disclose a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the diagnostic log assembly method disclosed above.
[0084] The specific steps of the method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0085] The embodiments in the present application are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can refer to the method part.
[0086] Those skilled in the art will further appreciate that the functions of the various examples illustrated in the several embodiments disclosed herein can be implemented using electronic hardware, a combination of software and electronics, or software. To clearly illustrate this interchangeability of hardware and software, various components will be described generally in terms of their functionality while recognizing that these
[0087] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.
[0088] Finally, it should be noted that the terms "comprises", "comprising", or other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0089] The above provides a diagnostic log assembly method, device, equipment, and storage medium. The principles and implementation manners of the present application are described by using specific examples. The above example is only used to help understand the method and its core idea. For those skilled in the art, according to the idea of the present application, the specific implementation manner and application range can be changed. The above description should not be understood as a limitation of the present application.
Claims
1. A diagnostic log assembly method characterized by, The application is applied to diagnostic software, comprising: determining an electronic control unit to be diagnosed in a vehicle to be diagnosed based on diagnostic test information, diagnosing the electronic control unit to be diagnosed and storing diagnostic data generated in the diagnosis process to a first storage area; if the diagnostic interrupt condition is not triggered until the first storage area is filled, storing diagnostic data generated in a subsequent diagnosis process to a second storage area; if the diagnostic interrupt condition is not triggered until the second storage area is filled, clearing the first storage area, transferring diagnostic data in the second storage area to the first storage area, and clearing the second storage area; jumping to the step of storing diagnostic data generated in a subsequent diagnosis process to a second storage area until the diagnostic interrupt condition is triggered to stop diagnosis; transferring the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area, and uploading diagnostic data in the third storage area to a server as a diagnostic log; wherein the transferring of the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area comprises: if the second storage area is empty, transferring the target size of diagnostic data in the first storage area to the third storage area; if the second storage area is not empty, determining a first current size of diagnostic data in the second storage area, and determining a first temporary size of diagnostic data in the first storage area in the order from the latest to the earliest; the first temporary size is the difference between the target size and the first current size; transferring the first current size of diagnostic data in the second storage area and the first temporary size of diagnostic data in the first storage area to the third storage area.
2. The diagnostic log assembly method of claim 1, wherein, The size of the first storage area and the second storage area is the target size.
3. The diagnostic log assembly method of claim 1, wherein, Before the step of storing diagnostic data generated in a subsequent diagnosis process to a second storage area if the diagnostic interrupt condition is not triggered until the first storage area is filled, further comprising: if the diagnostic interrupt condition is triggered when the first storage area is not filled, interrupting the diagnosis process, transferring diagnostic data in the first storage area to the third storage area, and uploading all diagnostic data in the third storage area to a server as a diagnostic log.
4. The diagnostic log assembly method of claim 1, wherein, Before the step of clearing the first storage area if the diagnostic interrupt condition is not triggered until the second storage area is filled, further comprising: if the diagnostic interrupt condition is triggered when the second storage area is not filled, interrupting the diagnosis process, determining a second current size of diagnostic data in the second storage area, and determining a second temporary size of diagnostic data in the first storage area in the order from the latest to the earliest; the second temporary size is the difference between the target size and the second current size; transferring the second current size of diagnostic data in the second storage area and the second temporary size of diagnostic data in the first storage area to the third storage area.
5. The diagnostic log assembly method according to any one of claims 1 to 4, characterized by, Further comprising: store the diagnostic test information to a fourth storage area; Correspondingly, the step of storing the latest target size of diagnostic data in the first storage area and the second storage area to the third storage area, and uploading the diagnostic data in the third storage area to the server as diagnostic logs, comprises: storing the latest target size of diagnostic data in the first storage area and the second storage area and the diagnostic test information in the fourth storage area to the third storage area, and uploading the diagnostic data in the third storage area and the diagnostic test information to the server as diagnostic logs.
6. The diagnostic log assembly method of claim 5, wherein, Before the step of diagnosing the electronic control unit to be diagnosed and storing the diagnostic data generated in the diagnostic process to the first storage area, the method further comprises: obtaining a preset log maximum storage size, and setting the first storage area, the second storage area, the third storage area and the fourth storage area based on the log maximum storage size; the log maximum storage size is the sum of the target size and the size of the fourth storage area.
7. A diagnostic log assembly apparatus characterized by, The application is applied to diagnostic software, which comprises: a first storage module, configured to determine an electronic control unit to be diagnosed in a vehicle to be diagnosed based on diagnostic test information, diagnose the electronic control unit to be diagnosed, and store diagnostic data generated in the diagnostic process to a first storage area; a second storage module, configured to store diagnostic data generated in a subsequent diagnostic process to a second storage area if a diagnostic interrupt condition is not triggered until the first storage area is full; a third storage module, configured to clear the first storage area, store diagnostic data in the second storage area to the first storage area, and clear the second storage area if the diagnostic interrupt condition is not triggered until the second storage area is full; a jump module, configured to jump to the step of storing diagnostic data generated in a subsequent diagnostic process to a second storage area, and stop the diagnosis when the diagnostic interrupt condition is triggered; a log uploading module, configured to store the latest target size of diagnostic data in the first storage area and the second storage area to a third storage area, and upload the diagnostic data in the third storage area to a server as diagnostic logs; wherein the log uploading module is specifically configured to store the target size of diagnostic data in the first storage area to the third storage area if the second storage area is empty; if the second storage area is not empty, determine a first current size of diagnostic data in the second storage area, and determine a first temporary size of diagnostic data in the first storage area in a time order from back to front; the first temporary size is the difference between the target size and the first current size; store the first current size of diagnostic data in the second storage area and the first temporary size of diagnostic data in the first storage area to the third storage area.
8. An electronic device, comprising: The application comprises: a memory, configured to save a computer program; a processor, configured to execute the computer program to realize the diagnostic log assembling method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program product for saving a computer program; wherein the computer program, when executed by a processor, implements the diagnostic log assembly method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Node log storage method and system, electronic equipment and storage medium
CN110716695A
Log recording method and apparatus, and electronic device
US20240264918A1