Fault data processing method and device, computer equipment and storage medium

By initializing the snapshot information array in the fault data processing system and using the addresses associated with the diagnostic fault code list for fault data storage and reading, the problem of low storage and reading efficiency in the prior art is solved, and a more efficient fault diagnosis process is achieved.

CN120029801APending Publication Date: 2025-05-23CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510002758.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art is less efficient in storing and reading faulty data, resulting in delays and inaccuracies during repairs.

Method used

By placing the variable name, data length and data address of the snapshot data into the snapshot information array during initialization, the addresses associated with the diagnostic fault code list are used to store and read the fault data.

Benefits of technology

It significantly improves the storage and reading efficiency of fault data, reduces delays and errors during maintenance, and improves the accuracy and efficiency of fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029801A_ABST
    Figure CN120029801A_ABST
Patent Text Reader

Abstract

The invention provides a fault data processing method and device, computer equipment and a storage medium, and belongs to the technical field of computers. According to the method, the variable name, the data length and the data address of the snapshot data needing to be stored are put into the snapshot information array during initialization, so that when fault data are stored, the snapshot information when the fault occurs can be directly stored into the nonvolatile storage area according to the address associated with the fault diagnosis code list, and the fault diagnosis efficiency is improved. And the storage efficiency of the fault data is greatly improved. In a similar way, the fault data is quickly acquired according to the address associated with the diagnosis fault code list when being read, so that the reading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a fault data processing method, device, computer equipment and storage medium. Background Art

[0002] Vehicle diagnosis is the monitoring of an event. When an event deviates from expectations, it is called a "fault". When a vehicle fails, the diagnostic function is essential. Different diagnostic requirements can be designed according to different scenarios. In order to better distinguish the types of faults, these events are usually associated with different diagnostic trouble codes (DTC). At the same time, in order to enable maintenance personnel to identify fault events faster and more accurately, it is also necessary to read the snapshot data corresponding to the DTC.

[0003] At present, snapshot data is usually obtained in real time and stored together with DTC as fault data. However, this method will result in low efficiency in storing and reading fault data. Therefore, a new fault data processing method is needed to improve the efficiency of storage and reading. Summary of the invention

[0004] The embodiments of the present application provide a method, device, computer equipment and storage medium for processing fault data, which greatly improves the storage efficiency and reading efficiency of fault data. The technical solution is as follows:

[0005] In one aspect, a method for processing fault data is provided, the method comprising:

[0006] In response to power being turned on, a diagnostic trouble code list and a snapshot information array are initialized, the snapshot information array is used to store snapshot information of snapshot data that needs to be stored, the snapshot information including a variable name, data length and data address of the snapshot data;

[0007] In response to a fault occurring, when the fault occurs for the first time, based on the diagnostic trouble code list and the snapshot information array, data in a first snapshot page is stored in a non-volatile storage area according to a first address, the first snapshot page storing snapshot information when the fault occurs for the first time, the first address being an address associated with the diagnostic trouble code list corresponding to the fault;

[0008] When the fault occurs for the last time, the data in the second snapshot page is stored in the non-volatile storage area according to the first address, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

[0009] In another aspect, a fault data processing device is provided, the device comprising:

[0010] An initialization module, for initializing a diagnostic trouble code list and a snapshot information array in response to power being turned on, wherein the snapshot information array is used to store snapshot information of snapshot data to be stored, wherein the snapshot information includes a variable name, a data length, and a data address of the snapshot data;

[0011] a storage module, for, in response to a fault, storing data in a first snapshot page in a non-volatile storage area according to a first address based on the diagnostic trouble code list and the snapshot information array when the fault first occurs, wherein the first snapshot page stores snapshot information when the fault first occurs, and the first address is an address associated with the diagnostic trouble code list corresponding to the fault;

[0012] The storage module is further configured to store the data in the second snapshot page in the non-volatile storage area according to the first address when the fault occurs for the last time, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

[0013] In some embodiments, the initialization module is used to initialize the diagnostic fault code list in response to power being turned on; obtain a snapshot data segment of preset snapshot data; store the snapshot data segment in the non-volatile storage area; for any snapshot data that needs to be stored, obtain the snapshot data segment of the snapshot data from the non-volatile storage area, and write the variable name, data length and data address of the snapshot data into the snapshot information array.

[0014] In some embodiments, the storage module is further used to obtain a configuration table, which defines whether the snapshot data needs to be stored and to which snapshot page the storage is allocated.

[0015] In some embodiments, the storage module is also used to record the snapshot data allocated to the first snapshot page when the fault occurs for the first time; query the index of the fault in the diagnostic fault code list; calculate the first address based on the index; and store the data in the first snapshot page in the non-volatile storage area according to the first address.

[0016] In some embodiments, the storage module is also used to record the snapshot data allocated to the second snapshot page when the fault occurred for the last time; query the index of the fault in the diagnostic fault code list; calculate the first address based on the index; and store the data in the second snapshot page in the non-volatile storage area according to the first address.

[0017] In some embodiments, the storage module is also used to respond to a data read request, determine the index of the diagnostic trouble code in the diagnostic trouble code list according to the diagnostic trouble code in the data read request; calculate a second address based on the index; retrieve the stored snapshot information from the non-volatile storage area according to the second address; fill the variable name and data length of the snapshot data in the snapshot information into the corresponding position in the diagnostic message to obtain a diagnostic message.

[0018] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the fault data processing method in the embodiment of the present application.

[0019] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the fault data processing method in the embodiment of the present application.

[0020] On the other hand, a computer program product is provided, which includes a computer program code, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the fault data processing method provided in various optional implementations of the above-mentioned aspects.

[0021] The embodiment of the present application provides a fault data processing solution, which puts the variable name, data length and data address of the snapshot data to be stored into the snapshot information array during initialization, and then when storing fault data, the snapshot information when the fault occurs can be directly stored in the non-volatile storage area according to the address associated with the diagnostic fault code list, which greatly improves the storage efficiency of fault data. Similarly, when reading fault data, it can be quickly obtained according to the address associated with the diagnostic fault code list, which improves the reading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a schematic diagram of an implementation environment of a fault data processing method provided in an embodiment of the present application;

[0024] Figure 2 is a flowchart of a fault data processing method provided according to an embodiment of the present application;

[0025] Figure 3 is a flowchart of another fault data processing method provided according to an embodiment of the present application;

[0026] Figure 4 is a flowchart of another fault data processing method provided according to an embodiment of the present application;

[0027] Figure 5 is a block diagram of a fault data processing device provided according to an embodiment of the present application;

[0028] Figure 6 It is a structural schematic diagram of a vehicle controller provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0030] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.

[0031] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.

[0032] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the snapshot data and faults involved in this application are obtained with full authorization.

[0033] Figure 1 Schematic diagram of the implementation environment of the fault data processing method provided in the embodiment of the present application. Figure 1 , the implementation environment includes: a terminal 110 and a server 120.

[0034] The terminal 110 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc., but is not limited thereto. For example, the terminal 110 is a terminal used by a driver of a vehicle, and the driver can control the vehicle through the terminal 110. In some embodiments, the terminal 110 can also be an in-vehicle terminal of the vehicle itself, that is, the user can use the in-vehicle terminal of the vehicle to set the vehicle.

[0035] The terminal 110 may be connected to the server 120 via a wireless network or a wired network.

[0036] The server 120 may include at least one of a single server, multiple servers, a cloud computing platform, or a virtualization center. The server 120 is used to provide background services for applications that support virtual scenes. Optionally, the server 120 may undertake the main computing work, and the terminal 110 may undertake the secondary computing work; or, the server 120 undertakes the secondary computing work, and the terminal 110 undertakes the main computing work; or, the server 120 and the terminal 110 use a distributed computing architecture for collaborative computing.

[0037] Figure 2 is a flowchart of a fault data processing method provided according to an embodiment of the present application, such as Figure 2 As shown, in the embodiment of the present application, the method for processing fault data is described by taking the execution by a computer device as an example. The method comprises the following steps:

[0038] 201. In response to power being turned on, a diagnostic trouble code list and a snapshot information array are initialized. The snapshot information array is used to store snapshot information of snapshot data that needs to be stored. The snapshot information includes a variable name, data length, and data address of the snapshot data.

[0039] In the embodiments of the present application, power-on generally refers to "power on". A diagnostic trouble code (DTC) is a specific code used to identify a fault in a device. When the power is just turned on, the list used to record the diagnostic trouble codes is prepared, generally by clearing the old data remaining before, setting the initial format of the list or related parameters, etc. The snapshot information array here is a data structure, and its purpose is to store specific snapshot information. Initialization refers to the startup preparation of this array, such as opening up the corresponding memory space, defining the basic properties of the array, such as the length of the array, the data type, etc., to ensure that data can be stored normally in it later.

[0040] 202. In response to a fault occurring, when the fault first occurs, based on the diagnostic fault code list and the snapshot information array, the data in the first snapshot page is stored in the non-volatile storage area according to the first address, the first snapshot page stores the snapshot information when the fault first occurs, and the first address is the address associated with the diagnostic fault code list corresponding to the fault.

[0041] In an embodiment of the present application, when a device failure is detected, if the failure occurs for the first time, the fault type and the associated storage address are determined through the diagnostic fault code list, and the snapshot data to be stored are known through the snapshot information array.

[0042] The first snapshot page can be understood as a specific storage area or logic page used to record relevant data when the fault first occurs, which stores various key data captured at the moment when the fault first occurs.

[0043] The first address is a clearly defined identifier of a specific storage location for storing these data, just like assigning a "room number" to the data in the storage area. According to this "room number" (address), the data can be stored accurately.

[0044] The non-volatile storage area refers to a storage area where the data will not be lost even if the device is powered off. Flash memory and other storage media belong to this type of storage media.

[0045] 203. When the fault occurs for the last time, store the data in the second snapshot page in the non-volatile storage area according to the first address, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

[0046] In the embodiment of the present application, the device may have the same fault multiple times during operation, and this is the time node when the fault was detected for the last time. The second snapshot page is similar to the first snapshot page mentioned above, and is also an area for storing specific data, storing the relevant snapshot information captured when the fault last occurred.

[0047] The embodiment of the present application provides a fault data processing solution, which puts the variable name, data length and data address of the snapshot data to be stored into the snapshot information array during initialization, and then when storing fault data, the snapshot information when the fault occurs can be directly stored in the non-volatile storage area according to the address associated with the diagnostic fault code list, which greatly improves the storage efficiency of fault data. Similarly, when reading fault data, it can be quickly obtained according to the address associated with the diagnostic fault code list, which improves the reading efficiency.

[0048] Figure 3is a flowchart of another fault data processing method provided according to an embodiment of the present application. Figure 3 As shown, in the embodiment of the present application, the method for processing fault data is described by taking the execution by a computer device as an example. The method comprises the following steps:

[0049] 301. In response to power being turned on, a diagnostic trouble code list is initialized.

[0050] In the embodiment of the present application, power-on means that current starts to flow into various circuits of the device, causing the device to enter a startup state from a shutdown state.

[0051] A diagnostic trouble code (DTC) is a standardized code used to identify faults in a device system. For example, in an automotive electronic system, the engine control module (ECM) monitors the working status of various sensors and actuators. If the data sent by a sensor (such as a water temperature sensor) is out of the normal range, the ECM will generate a corresponding diagnostic trouble code. This fault code may be a combination of numbers and letters, such as "P0118". Different codes represent different types of faults. Maintenance personnel can quickly determine the system and specific location of the fault by reading this code.

[0052] The diagnostic trouble code list is a collection of these trouble codes. During the operation of the equipment, all diagnostic trouble codes will be recorded in this list for subsequent query and analysis.

[0053] Optionally, initializing the diagnostic trouble code list refers to a series of preparations for the diagnostic trouble code list when the power is just turned on.

[0054] First, clear the previous diagnostic trouble codes in the list. This is because the previous diagnostic trouble codes may have been generated during the last operation of the device, and the new startup process requires a clean recording environment. For example, in the fault diagnosis system of the car, each time the vehicle is started, the system will first clear the previously stored fault codes to ensure that the fault records after this startup are for the current operation cycle.

[0055] Secondly, the initial format and parameters of the list are set. This includes determining the storage structure of the list (such as array, linked list, etc.), data type (usually the fault code is in string or digital format), storage capacity (how many fault codes can be stored), etc. For example, a simple equipment fault code list may be initialized as a string array of length 100, each element is used to store a fault code, and the data type is ASCII character type, which can accommodate 100 different fault code records.

[0056] The purpose of initialization is to enable the diagnostic trouble code list to accurately and efficiently record new trouble codes after the equipment is started. By clearing old records and setting appropriate format parameters, it is ensured that the list can work normally in the new operation cycle, providing reliable information support for equipment fault diagnosis and maintenance.

[0057] 302. Obtain a snapshot data segment of preset snapshot data.

[0058] In the embodiment of the present application, snapshot data refers to a set of actual values ​​presented by relevant variables, parameters, etc. in the system at a specific moment or time. Snapshot data is also called a freeze frame.

[0059] For example, taking a car as an example, when a certain condition is triggered at a certain moment during the driving process of the vehicle (such as detecting an abnormal situation or sampling at a certain time interval), the engine speed is 3000 rpm, the oil temperature is 90 degrees Celsius, the water temperature is 80 degrees Celsius, and the vehicle speed is 80 kilometers per hour. These specific values ​​are combined into the snapshot data at this moment, which can reflect the actual operating status of the system at that time.

[0060] At the software level, data can be represented by specific variables. For example, temperature, voltage, etc. can be defined as variables. In order to distinguish and identify these variables, a unique DID, i.e., variable name, is assigned to each variable.

[0061] A complete snapshot data often contains multiple different parts or different parameter values, and a "snapshot data segment" is one of the parts obtained after dividing the complete snapshot data. For example, the snapshot data of the above-mentioned car as a whole contains multiple parameter values ​​such as engine speed, oil temperature, water temperature, and vehicle speed. Then the single parameter "engine speed" and its corresponding value can be regarded as a snapshot data segment. Similarly, data related to "oil temperature" can also be used as an independent data segment. It is also possible to divide according to other rules, such as dividing according to the source module of the data, the part of the snapshot data from the engine control module is one data segment, and the part from the chassis control module is another data segment, etc.

[0062] 303. Store the snapshot data segment in a non-volatile storage area.

[0063] In the embodiment of the present application, the non-volatile storage area is a special storage area, and its biggest feature is that even if the device is powered off, the data stored therein will not be lost. Common non-volatile storage media include flash memory (such as our common USB flash drives, solid-state hard drives, etc. are based on flash memory technology), read-only memory (ROM, such as the BIOS chip on the motherboard of early computers uses ROM to store some basic system startup information), etc. In electronic equipment or various control systems, non-volatile storage areas are usually used to store data that needs to be stored for a long time and cannot be lost due to accidental power failure of the device, such as device configuration parameters, important historical operation records, key fault-related information, etc.

[0064] After obtaining the snapshot data segments, they need to be placed in the non-volatile storage area through corresponding storage mechanisms, program instructions or hardware control means.

[0065] 304. For any snapshot data that needs to be stored, obtain the snapshot data segment of the snapshot data from the non-volatile storage area, and write the variable name, data length and data address of the snapshot data into the snapshot information array.

[0066] In an embodiment of the present application, a computer device may obtain a configuration table, which defines whether snapshot data needs to be stored and to which snapshot page the snapshot data is allocated for storage.

[0067] For example, the variable name, data length and data address of each variable that needs to record snapshot data are recorded in the snapshot information array. The snapshot information array may include multiple data, each of which corresponds to a snapshot data.

[0068] Among them, each snapshot data corresponds to a certain variable. For example, "engine speed" is a variable name, which clarifies the specific meaning of this data. Through the variable name, we can clearly know what aspect of the situation this data reflects.

[0069] Data length refers to the storage space occupied by the snapshot data, usually measured in bytes. For example, if the engine speed data is stored in an integer variable, in common programming languages, integer data generally occupies 4 bytes, so its data length is 4 bytes. Knowing the data length helps to accurately locate and process the data in the storage area, and also facilitates the reasonable allocation of resources for subsequent data transmission, reading and other operations.

[0070] The data address indicates the specific storage location of the snapshot data in the storage area (here, the non-volatile storage area), just like each data has a unique "room number" in the storage "big warehouse", and the corresponding snapshot data can be accurately found through this address. For example, in computer memory, the data address can be a hexadecimal number that identifies the specific physical location or logical location of the data in the memory.

[0071] The snapshot information array is a data structure used to store various snapshot data related information. It can usually be a table or list. Each element (or each row) in it is used to store key information such as the variable name, data length, and data address of a set of snapshot data. Writing the above key information into the snapshot information array is equivalent to establishing an "index directory". When you need to find and use a certain snapshot data later, you can first use this snapshot information array to quickly locate the specific situation of the corresponding data, which is convenient for data retrieval, analysis, and system status assessment, fault diagnosis, etc. based on these snapshot data.

[0072] 305. In response to a fault occurring, when the fault first occurs, based on the diagnostic fault code list and the snapshot information array, the data in the first snapshot page is stored in the non-volatile storage area according to the first address, the first snapshot page stores the snapshot information when the fault first occurs, and the first address is the address associated with the diagnostic fault code list corresponding to the fault.

[0073] In the embodiment of the present application, when the fault occurs for the first time, that is, when the fault status bit 0 is set to 1, the snapshot data allocated to the first snapshot page is recorded. Then, the index of the fault is queried in the diagnostic fault code list. Then, the first address is calculated based on the index. Finally, the data in the first snapshot page is stored in the non-volatile storage area according to the first address.

[0074] 306. When the fault occurs for the last time, the data in the second snapshot page is stored in the non-volatile storage area according to the first address, and the second snapshot page stores the snapshot information when the fault occurs for the last time. In the embodiment of the present application, when the fault occurs for the last time, that is, when the fault status bit 0 is set to zero and bit 5 is set to 1, the snapshot data allocated to the second snapshot page is recorded. Then, the index of the fault is queried in the diagnostic fault code list. Then, the first address is calculated based on the index. Finally, the data in the second snapshot page is stored in the non-volatile storage area according to the first address.

[0075] In some embodiments, when UDS (Unified Diagnostic Services) has a need to read snapshot data. The computer device responds to the data read request, and determines the index of the diagnostic trouble code in the diagnostic trouble code list according to the diagnostic trouble code in the data read request. Then, the computer device calculates the second address based on the index. The stored snapshot information is retrieved from the non-volatile storage area according to the second address. Finally, the variable name and data length of the snapshot data in the snapshot information are filled into the corresponding position in the diagnostic message to obtain a diagnostic message.

[0076] For example, an intermittent fault occurred in the engine control system of a car. The maintenance personnel wanted to understand the specific situation when the fault occurred. So they used professional car diagnostic equipment (computer equipment that communicates with the car electronic control unit based on the UDS protocol) to send a data read request to the car's engine control unit, in order to obtain the previously stored fault-related snapshot data. For example, the data read request contains the diagnostic fault code "P0118" representing the abnormality of a certain sensor of the engine. After receiving this request, the car's engine control unit (computer equipment) will search for the index corresponding to "P0118" in the diagnostic fault code list stored in itself. This index is similar to the "number" of this fault code in the list. Then, based on the found index, the second address is calculated by a pre-set calculation rule (such as a certain algorithm combined with the characteristics of the storage structure, etc.). This second address specifies the specific storage location of the snapshot information to be obtained in the non-volatile storage area (such as the on-board flash memory chip, which is used to store important data for a long time). Then, according to the calculated second address, the previously stored snapshot information is accurately retrieved from the non-volatile storage area. These snapshot information contain variable names, data lengths, and other contents such as the engine speed and water temperature at that time. Finally, the snapshot information such as the variable name "EngineRPM" of the snapshot data of engine speed and its data length (assuming 4 bytes) are filled into the corresponding position of the diagnostic message (a message format used to transmit diagnostic information between the diagnostic device and the vehicle control unit) according to the format specified by the UDS protocol. Finally, a complete diagnostic message is formed and sent back to the diagnostic device used by the maintenance personnel. In this way, the maintenance personnel can clearly see the relevant data at the moment the fault occurs, which is convenient for accurate analysis of the cause of the fault.

[0077] In order to make the fault data processing solution provided in the embodiment of the present application easier to understand, see Figure 4 shown. Figure 4 FIG. 1 is a flow chart of another method for processing fault data according to an embodiment of the present application. Figure 4As shown, the following steps are included: 401. Power on the device. 402. Fault detection. 403. Determine whether the storage condition is met. 404. If it is met, store the snapshot information in the non-volatile storage area. 405. Receive an information read request. 406. Read data from the non-volatile storage area and assemble it into a diagnostic message.

[0078] The embodiment of the present application provides a fault data processing solution, which puts the variable name, data length and data address of the snapshot data to be stored into the snapshot information array during initialization, and then when storing fault data, the snapshot information when the fault occurs can be directly stored in the non-volatile storage area according to the address associated with the diagnostic fault code list, which greatly improves the storage efficiency of fault data. Similarly, when reading fault data, it can be quickly obtained according to the address associated with the diagnostic fault code list, which improves the reading efficiency.

[0079] Figure 5 is a block diagram of a fault data processing device provided according to an embodiment of the present application. The device is used to execute the steps of the above-mentioned fault data processing method. Figure 5 , the device comprises:

[0080] Initialization module 501, for initializing a diagnostic trouble code list and a snapshot information array in response to power on, the snapshot information array being used to store snapshot information of snapshot data to be stored, the snapshot information including a variable name, data length and data address of the snapshot data;

[0081] A storage module 502, for responding to a fault, when the fault first occurs, based on the diagnostic trouble code list and the snapshot information array, storing data in a first snapshot page in a non-volatile storage area according to a first address, wherein the first snapshot page stores snapshot information when the fault first occurs, and the first address is an address associated with the diagnostic trouble code list corresponding to the fault;

[0082] The storage module 502 is further configured to store the data in the second snapshot page in the non-volatile storage area according to the first address when the fault occurs for the last time, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

[0083] In some embodiments, the initialization module 501 is used to initialize the diagnostic fault code list in response to power being turned on; obtain a snapshot data segment of preset snapshot data; store the snapshot data segment in a non-volatile storage area; for any snapshot data that needs to be stored, obtain the snapshot data segment of the snapshot data from the non-volatile storage area, and write the variable name, data length and data address of the snapshot data into the snapshot information array.

[0084] In some embodiments, the storage module 502 is further used to obtain a configuration table, which defines whether the snapshot data needs to be stored and to which snapshot page the storage is allocated.

[0085] In some embodiments, the storage module 502 is also used to record the snapshot data allocated to the first snapshot page when the fault occurs for the first time; query the index of the fault in the diagnostic fault code list; calculate the first address based on the index; and store the data in the first snapshot page in the non-volatile storage area according to the first address.

[0086] In some embodiments, the storage module 502 is also used to record the snapshot data allocated to the second snapshot page when the fault occurs for the last time; query the index of the fault in the diagnostic fault code list; calculate the first address based on the index; and store the data in the second snapshot page in the non-volatile storage area according to the first address.

[0087] In some embodiments, the storage module 502 is also used to respond to a data read request, determine the index of the diagnostic trouble code in the diagnostic trouble code list according to the diagnostic trouble code in the data read request; calculate a second address based on the index; retrieve the stored snapshot information from the non-volatile storage area according to the second address; fill the variable name and data length of the snapshot data in the snapshot information into the corresponding position in the diagnostic message to obtain a diagnostic message.

[0088] The embodiment of the present application provides a fault data processing device, which puts the variable name, data length and data address of the snapshot data to be stored into the snapshot information array during initialization, and then when storing fault data, the snapshot information when the fault occurs can be directly stored in the non-volatile storage area according to the address associated with the diagnostic fault code list, which greatly improves the storage efficiency of the fault data. Similarly, when reading fault data, it can be quickly obtained according to the address associated with the diagnostic fault code list, which improves the reading efficiency.

[0089] It should be noted that: the texture display device provided in the above embodiment only uses the division of the above functional modules as an example when running an application program. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the texture display device provided in the above embodiment and the fault data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0090] In an embodiment of the present application, the computer device can be configured as a vehicle controller, which can also be referred to as a terminal. Figure 6 It is a structural schematic diagram of a vehicle controller provided according to an embodiment of the present application.

[0091] Typically, the vehicle controller 600 includes: a main control module 601, a CAN interface 602, a hard-wire input interface 603, and a hard-wire output interface 604. The main control module 601 is connected to the CAN interface 602, the hard-wire input interface 603, and the hard-wire output interface 604, respectively.

[0092] The main control module 601 generally includes a processor and a memory. Among them, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the vehicle display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning. The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory is used to store at least one computer program, and the at least one computer program is used to be executed by the processor to implement the fault data processing method provided in the method embodiment of the present application.

[0093] The CAN interface 602 may include a power CAN interface, a motor CAN interface, and a diagnostic CAN interface, wherein the power CAN interface is used to communicate with a power system module of the vehicle, the motor CAN interface is used to communicate with a motor controller of the vehicle, and the diagnostic CAN interface is used to communicate with a diagnostic device.

[0094] The hard-wire input interface 603 is used to receive hard-wire control signals. The hard-wire output interface 604 is used to send control instructions to the electronic control components of the vehicle so that the electronic control components of the vehicle perform corresponding actions. The electronic control components of the vehicle include a power management system, a motor controller, an on-board charger, a body control system, etc.

[0095] The main control module 601 can communicate with the vehicle's power system module, motor controller and diagnostic equipment through the CAN interface 602, and generate control instructions based on the hard-wired control signal received by the hard-wired input interface 603 to send control instructions to the vehicle's electronic control components through the hard-wired output interface 604.

[0096] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the vehicle controller 600, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0097] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor of a computer device to implement the operation performed by the computer device in the fault data processing method of the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0098] The embodiment of the present application also provides a computer program product, which includes a computer program code, and the computer program code is stored in a computer-readable storage medium. The processor of the computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the fault data processing method provided in the above various optional implementations.

[0099] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0100] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for processing fault data, characterized in that: The method comprises: In response to power being turned on, a diagnostic trouble code list and a snapshot information array are initialized, the snapshot information array is used to store snapshot information of snapshot data that needs to be stored, the snapshot information including a variable name, data length and data address of the snapshot data; In response to a fault occurring, when the fault occurs for the first time, based on the diagnostic trouble code list and the snapshot information array, data in a first snapshot page is stored in a non-volatile storage area according to a first address, the first snapshot page storing snapshot information when the fault occurs for the first time, the first address being an address associated with the diagnostic trouble code list corresponding to the fault; When the fault occurs for the last time, the data in the second snapshot page is stored in the non-volatile storage area according to the first address, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

2. The method according to claim 1, characterized in that In response to power-on, initializing the diagnostic trouble code list and the snapshot information array includes: In response to power being turned on, initializing a diagnostic trouble code list; Obtaining a snapshot data segment of preset snapshot data; Storing the snapshot data segment in the non-volatile storage area; For any snapshot data that needs to be stored, a snapshot data segment of the snapshot data is obtained from the non-volatile storage area, and a variable name, data length and data address of the snapshot data are written into the snapshot information array.

3. The method according to claim 2, characterized in that The method further comprises: A configuration table is obtained, wherein the configuration table defines whether the snapshot data needs to be stored and to which snapshot page the snapshot data is allocated for storage.

4. The method according to claim 1, characterized in that: When the fault occurs for the first time, based on the diagnostic fault code list and the snapshot information array, storing the data in the first snapshot page in the non-volatile storage area according to the first address includes: When the fault occurs for the first time, recording the snapshot data allocated to the first snapshot page; Querying the index of the fault in the diagnostic trouble code list; Obtaining the first address by calculation based on the index; The data in the first snapshot page is stored in a non-volatile storage area according to the first address.

5. The method according to claim 1, characterized in that When the fault occurs for the last time, storing the data in the second snapshot page in the non-volatile storage area according to the first address includes: When the fault occurs for the last time, recording the snapshot data allocated to the second snapshot page; Querying the index of the fault in the diagnostic trouble code list; Obtaining the first address by calculation based on the index; The data in the second snapshot page is stored in a non-volatile storage area according to the first address.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to a data read request, determining an index of the diagnostic trouble code in the diagnostic trouble code list according to the diagnostic trouble code in the data read request; Calculate and obtain a second address based on the index; fetching the stored snapshot information from the non-volatile storage area according to the second address; The variable name and data length of the snapshot data in the snapshot information are filled into the corresponding position in the diagnosis message to obtain the diagnosis message.

7. A fault data processing device, characterized in that: The device comprises: An initialization module, for initializing a diagnostic trouble code list and a snapshot information array in response to power being turned on, wherein the snapshot information array is used to store snapshot information of snapshot data to be stored, wherein the snapshot information includes a variable name, a data length, and a data address of the snapshot data; a storage module, for, in response to a fault, storing data in a first snapshot page in a non-volatile storage area according to a first address based on the diagnostic trouble code list and the snapshot information array when the fault first occurs, wherein the first snapshot page stores snapshot information when the fault first occurs, and the first address is an address associated with the diagnostic trouble code list corresponding to the fault; The storage module is further configured to store the data in the second snapshot page in the non-volatile storage area according to the first address when the fault occurs for the last time, and the second snapshot page stores the snapshot information when the fault occurs for the last time.

8. A computer device, characterized in that: The computer device includes a processor and a memory, the memory is used to store at least one computer program, and the at least one computer program is loaded by the processor to execute the fault data processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store at least one computer program, and the at least one computer program is used to execute the fault data processing method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the fault data processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Data storage and remote monitoring system and method based on UDS

    CN120785918A