Fault storage method and device, electronic equipment and storage medium

By using the first and second status identifiers of the fault storage program in the car controller for double authentication, the problem of running errors and functional abnormalities caused by repeated calls of the fault storage program is solved, and the stability of fault data storage is achieved.

CN118689682APending Publication Date: 2024-09-24CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410597530.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the automotive controller, when multiple fault monitoring programs request the storage of fault data at the same time, the fault storage program may be called repeatedly, resulting in program operation errors or abnormal fault storage functions.

Method used

By obtaining the first state identifier and the second state identifier of the fault storage program, the idle state of the fault storage program is determined through double authentication identification, avoiding repeated calls and ensuring stable storage of fault data.

Benefits of technology

It effectively avoids repeated calls of the fault storage program, ensures the stability of the fault data storage task, and prevents program running errors and functional abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689682A
    Figure CN118689682A
Patent Text Reader

Abstract

The invention discloses a fault storage method and device, electronic equipment and a storage medium, and relates to the technical field of data storage. The fault storage method comprises the following steps: in response to a fault storage request, obtaining a first state identifier of a fault storage program; when it is determined that the first state identifier is a first idle identifier, updating the first state identifier to be a first non-idle identifier, and obtaining a second state identifier of the fault storage program; and calling the fault storage program according to the second state identifier so as to store fault data in the fault storage request. According to the embodiment of the invention, the idle state of the fault storage program is determined by adopting a dual authentication identification mode of the first state identifier and the second state identifier, so that the problem of processing conflict caused by calling the same fault storage program at the same time is prevented, and a controller can operate a storage task of fault data more stably; and fault storage task running errors or fault storage function abnormities are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a fault storage method, device, electronic equipment and storage medium. Background Art

[0002] There are dozens or even hundreds of fault detection programs running in the car controller. Each fault detection program is responsible for detecting different faults. These fault detection programs run independently of each other and have different task operation cycles. When the fault detection program detects a fault, it will request the fault storage program to store the fault data in the fault memory. Storing fault data will bring additional computing load to the controller.

[0003] The fault storage program may process the fault storage request by query or trigger. When the query method is used to process the fault storage request, the fault storage program may not be called directly, but the corresponding variable may be assigned a value, indicating that the fault needs to be stored, but the differentiated response rate requirements of each fault monitoring program cannot be met. When the trigger method is used to process the fault storage request, the fault detection program will directly call the fault storage program when it detects a fault, which can allow all fault storage to receive a timely response and reduce the average computing load of the microcontroller. However, when multiple fault monitoring programs request to store faults at the same time, the fault storage program will be called repeatedly. Especially for multi-core multi-tasking microcontrollers, multiple fault monitoring programs will often call the fault storage program at the same time, which may cause program operation errors or abnormal fault storage functions. Therefore, how to prevent the fault storage program from being repeatedly called and causing abnormal fault storage functions has become a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a fault storage method, device, electronic device and storage medium to solve the problem in the prior art that a fault storage program is repeatedly called at the same time, resulting in program running errors or abnormal fault storage functions.

[0005] According to one aspect of the present invention, a fault storage method is provided, wherein the method comprises:

[0006] In response to the fault storage request, obtaining a first state identifier of the fault storage program;

[0007] When it is determined that the first state identifier is a first idle flag, updating the first state identifier to a first non-idle flag, and acquiring a second state identifier of the fault storage program;

[0008] The fault storage program is called according to the second state identifier to store the fault data in the fault storage request.

[0009] According to another aspect of the present invention, a fault storage device is provided, wherein the device comprises:

[0010] A first identification determination module, configured to obtain a first state identification of a fault storage program in response to a fault storage request;

[0011] A second identification determination module is used to update the first state identification to a first non-idle identification when it is determined that the first state identification is a first idle identification, and obtain a second state identification of the fault storage program;

[0012] A fault storage module is used to call the fault storage program according to the second state identifier to store the fault data in the fault storage request.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the fault storage method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the fault storage method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention obtains the first state identifier of the fault storage program in response to a fault storage request. When it is determined that the first state identifier is the first idle flag, the first state identifier is updated to the first non-idle flag, and the second state identifier of the fault storage program is obtained, and the fault storage program is called according to the second state identifier to store the fault data in the fault storage request. The present application adopts the first state identifier and the second state identifier as a dual authentication identifier to determine the idle state of the fault storage program to prevent the problem of processing conflicts caused by calling the same fault storage program at the same time, so that the controller can run the fault data storage task more stably and avoid fault storage task operation errors or fault storage function abnormalities.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0021] Figure 1 A flowchart of a query-type fault storage method provided by the prior art;

[0022] Figure 2 A flowchart of a trigger fault storage method provided by the prior art;

[0023] Figure 3 is a flowchart of a fault storage method provided according to Embodiment 1 of the present invention;

[0024] Figure 4 is a flowchart of another fault storage method provided according to Embodiment 2 of the present invention;

[0025] Figure 5 is a flowchart of another fault storage method provided according to Embodiment 3 of the present invention;

[0026] Figure 6 is a flowchart of another fault storage method provided according to Embodiment 3 of the present invention;

[0027] Figure 7 is a flowchart of a fault diagnosis method provided according to Embodiment 3 of the present invention;

[0028] Figure 8 is a structural schematic diagram of a fault storage device provided according to a fourth embodiment of the present invention;

[0029] Fig. 9 It is a structural schematic diagram of an electronic device for implementing the fault storage method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] In the following examples, Figure 1-Figure 2 The process of fault storage is described by taking the example that a fault detection program detects a fault in a vehicle and generates a fault storage request.

[0033] It should be noted that Figure 1 The following is a flowchart of a query-based fault storage method provided by the prior art. Figure 1 As shown, the fault detection program can detect faults in the vehicle and generate a fault storage request. The number of fault detection programs can include n. After the fault detection program generates a fault storage request, the fault storage request can be stored in a fault variable or a fault storage request queue. The fault storage program can be run at a fixed cycle (such as once every 100ms) to check the "fault variable or fault storage request queue" to determine whether to store the fault and which fault storage area to store the fault in. Among them, the number of fault storage areas can be m, such as 1-20, which is not limited. The real-time performance of the fault storage method through query is poor, and the program execution efficiency is lower.

[0034] Figure 2 The following is a flowchart of a trigger fault storage method provided by the prior art. Figure 2 As shown, after the fault detection program detects a fault in the vehicle and generates a fault storage request, the fault storage program can be actively called and the fault storage request can be input to the fault storage program. After the fault detection program is called, it runs to determine whether to store the fault and in which fault storage area to store the fault. However, after the fault detection program detects a fault, it actively calls the fault storage program. There are situations where multiple fault detection programs call the fault storage program at the same time, which will cause abnormal execution of the fault storage program.

[0035] The present invention is to solve the following problems Figure 1 In the case of the query-based fault storage method shown in FIG. 1 , the real-time performance of the fault storage is low, and in order to solve the problem of Figure 2In the case of the query-based fault storage method shown, when there are multiple fault detection programs that call the fault storage program at the same time, the fault storage program will be executed abnormally, and a fault storage solution in the present invention is proposed.

[0036] Embodiment 1

[0037] Figure 3 1 is a flowchart of a fault storage method provided according to Embodiment 1 of the present invention. This embodiment is applicable to the case of storing fault data. The method can be executed by a fault storage device. The fault storage device can be implemented in the form of hardware and / or software. The fault storage device can be configured in an electronic device or a controller. Figure 3 As shown, the method includes:

[0038] S110. In response to a fault storage request, obtain a first state identifier of a fault storage program.

[0039] Among them, the fault storage request can be understood as a request information that needs to store the fault-related information into the storage area when there is a fault in the vehicle. In the actual operation process, when a vehicle fault is detected, a fault storage request can be generated. In one embodiment, the fault storage request can be generated by a fault detection program in the vehicle. The fault storage request can include fault data, such as fault diagnostic codes and freeze frames. The fault storage program can be understood as a program for performing fault storage, and fault storage can be performed by calling the fault storage program.

[0040] The first state identifier can be understood as a state identifier information of the fault storage program, which is used to indicate the state of the fault storage program. The first state identifier includes a first idle flag and a first non-idle flag. Exemplarily, the first idle flag and the first non-idle flag can be different pre-set flag bits. The first idle flag can indicate that the current running state of the fault storage program is idle; the first non-idle flag can indicate that the current running state of the fault storage program is non-idle. For example, the first idle flag can be to assign the state identifier information to 0, and the first non-idle flag can be to assign the state identifier information to a preset value, such as 1.

[0041] In an embodiment, when a fault storage request is received, the first state identifier of the fault storage program can be read. In the actual operation process, the corresponding flag information can be extracted as the first state identifier; or, a preset fault storage interface can be called to extract the first state identifier of the fault storage program.

[0042] S120: When it is determined that the first state identifier is the first idle flag, the first state identifier is updated to a first non-idle flag, and a second state identifier of the fault storage program is obtained.

[0043] The first state flag and the first non-idle flag may both be pre-set flag information, the first idle flag is used to indicate that the current running state of the fault storage program is idle; the first non-idle flag is used to indicate that the current running state of the fault storage program is non-idle. To distinguish the first idle flag from the first non-idle flag, the first state flag and the first non-idle flag are assigned different values. For example, the first idle flag and the first non-idle flag may be assigned values ​​of 0 and 1, respectively.

[0044] The second state identifier can be understood as another state identifier information of the fault storage program, which is used to indicate the state of the fault storage program. In the actual process, it may take a delay time to update the first state identifier from the first idle flag to the first non-idle flag. If the fault storage program is called to store fault data while the first state identifier is updated, the first state identifier obtained at this time is still the first idle flag, and the fault storage program will be repeatedly called. The second state identifier can be used to verify the idle state of the fault storage program twice to avoid repeated calls of the fault storage program. The second state identifier may include a second idle flag and a second non-idle flag. Among them, the second idle flag can indicate that the current running state of the fault storage program is idle; the second non-idle flag can indicate that the current running state of the fault storage program is non-idle. Exemplarily, the second idle flag and the second non-idle flag can also be different pre-set flags, such as the second idle flag can be to assign the state identifier information to 0, and the first non-idle flag can be to assign the state identifier information to a preset value to identify the second state identifier.

[0045] In an embodiment, after determining that the first state identifier is the first idle identifier, the first state identifier can be updated to the first non-idle identifier to indicate that the fault storage program already has a fault storage task. Then, the second state identifier of the fault storage program is obtained. Exemplarily, a fault storage interface can be preset to extract the second state identifier of the fault storage program, or, flag bit information corresponding to the second state identifier can be extracted to determine the second state identifier.

[0046] S130: Call a fault storage program according to the second state identifier to store the fault data in the fault storage request.

[0047] The fault data may be understood as data indicating the fault condition, and may include fault type, fault diagnosis code, freeze frame, etc. In actual operation, the fault data may be stored in a fault storage request, and carried into the fault storage program by the fault storage request.

[0048] In an embodiment, the second state identifier can be determined. When the second state identifier is determined to be the second non-idle identifier, it can be considered that there is a task to store fault data in the fault storage request, and the fault storage request can be stored in a preset information processing queue, or the fault storage request can be stored in a preset data area to wait for storage. When the second state identifier is determined to be the second idle identifier, a fault storage program can be called to extract the fault data in the fault storage request and store the fault data; or, it can be determined whether the preset information processing queue is empty or whether there is a fault storage request in the preset data area, extract the fault storage request with the front storage time, store the fault data in the fault storage request in the preset information processing queue or the preset data area in turn, and then store the fault data in the fault storage request.

[0049] In an embodiment of the present invention, a first state identifier of a fault storage program is obtained in response to a fault storage request. When it is determined that the first state identifier is a first idle flag, the first state identifier is updated to a first non-idle flag, and a second state identifier of the fault storage program is obtained. The fault storage program is called according to the second state identifier to store the fault data in the fault storage request. The present application uses a dual authentication identifier of the first state identifier and the second state identifier to determine the idle state of the fault storage program to prevent the problem of processing conflicts caused by calling the same fault storage program at the same time, so that the controller can run the fault data storage task more stably and avoid fault storage task operation errors or fault storage function abnormalities.

[0050] In one embodiment, after obtaining the first state identifier of the fault storage program, the method further includes:

[0051] When it is determined that the first state identifier is the first non-idle flag, the fault storage request is stored in a preset information processing queue.

[0052] Among them, the preset information processing queue can be understood as a pre-set restricted linear data structure. The preset information processing queue follows the first-in-first-out principle, that is, the fault storage request that enters the queue first is processed first, and at the same time, the newly added fault storage request is stored at the end of the preset information processing queue.

[0053] In an embodiment, when it is determined that the first state identifier is the first non-idle flag, it can be considered that the fault storage program is executing the fault data storage task, and the fault storage request can be stored in a preset information processing queue to wait for the storage of the fault data.

[0054] In one embodiment, the process of generating a fault storage request includes:

[0055] When the detected vehicle has a fault, identify the fault type;

[0056] Determine fault data of the fault type, and combine the fault data as a fault storage request; wherein the fault data at least includes: a fault diagnosis code and a freeze frame.

[0057] Among them, the fault diagnosis code refers to the identification code generated when the vehicle fails to function and indicates the type of fault. The freeze frame refers to the data and parameters of the operating status of the vehicle's related systems at the moment or near the moment of the fault, such as the vehicle speed and time when the fault occurred, which facilitates the inspection and repair of vehicle faults.

[0058] In an embodiment, when a vehicle fails, a unit for performing vehicle fault detection can identify the fault type of the fault. For example, a fault detection program can be called to determine the fault type of the fault. Then, fault data such as a fault diagnostic code and a freeze frame corresponding to the fault type are determined, and the fault data is combined as a fault storage request. For example, the fault data can be spliced ​​to generate a fault storage request.

[0059] In one embodiment, after updating the first state flag to the first non-idle flag, the method further includes: updating the second state flag to the second non-idle flag.

[0060] Specifically, when the first state identifier is updated to the first non-idle flag, it can be considered that the running state of the fault storage program is non-idle, and accordingly, the second state identifier needs to be updated to the second non-idle flag to avoid repeated calls to the fault storage program. In the actual operation process, there are differences in the response rates of different fault monitoring programs. There may be two fault storage requests that call the fault storage program at the same time. When the first state identifier is called, both are the first idle flag, and the second state identifier needs to be called. When calling the second state identifier, there is a time difference with calling the first state identifier. At this time, one of the fault storage requests has been called successfully, and while updating the first state identifier to the first non-idle flag, the second state identifier has been updated to the second non-idle flag. In response to another fault storage request, the second state identifier of the fault storage program is obtained as the second non-idle flag, avoiding repeated calls of the same fault storage program and achieving smooth operation of the fault storage task.

[0061] Embodiment 2

[0062] Figure 4 1 is a flowchart of another fault storage method provided according to Embodiment 2 of the present invention. This embodiment is further optimized and expanded based on the above embodiment and can be combined with various optional technical solutions in the above embodiment. Figure 4 As shown, the method includes:

[0063] S210: When a fault storage request is identified, a preset fault storage interface is called to extract a first state identifier of a fault storage program.

[0064] The first state flag includes a first idle flag and a first non-idle flag.

[0065] The preset fault storage interface can be understood as a function for calling a fault storage program, which can call the identification information of the fault storage program to extract the first state identification and the second state identification of the fault storage program. In one embodiment, the first state identification and the second state identification can be stored in a register.

[0066] In an embodiment, when a fault storage request is monitored and identified, a preset fault storage interface may be called to extract a first state identifier of a fault storage program through the preset fault storage interface.

[0067] S220: When it is determined that the first state flag is the first idle flag, the first state flag is set from the first idle flag to the first non-idle flag.

[0068] In an embodiment, when it is determined that the first state flag is the first idle flag, the first state flag may be set from the first idle flag to the first non-idle flag, that is, the first state flag is modified to the first non-idle flag.

[0069] S230: Call a preset fault storage interface to extract a second state identifier of the fault storage program.

[0070] The second state flag includes a second idle flag and a second non-idle flag.

[0071] In an embodiment, a preset fault storage interface may be called, and the second state identifier of the fault storage program may be extracted from the register through the preset fault storage interface.

[0072] S240: When it is determined that the second state identifier is a second non-idle flag, store the fault storage request in a preset information processing queue.

[0073] In an embodiment, when it is determined that the second state identifier is the second non-idle flag, it can be considered that the fault storage program is executing the fault data storage task, and the fault storage request can be stored in a preset information processing queue to wait for the storage of the fault data.

[0074] S250: When it is determined that the second state flag is the second idle flag, the second state flag is updated to a second non-idle flag, and a fault storage program is called to extract fault data in the fault storage request, and the fault data is stored.

[0075] In an embodiment, when it is determined that the second state identifier is the second idle flag, the second state identifier can be updated from the second idle flag to the second non-idle flag, and then the fault data contained in the fault storage request is extracted through the fault storage program, and the fault data is stored in the corresponding storage location. In the actual operation process, the fault storage program corresponding to the fault storage program can be called to store the fault data.

[0076] According to an embodiment of the present invention, when a fault storage request is identified, a preset fault storage interface is called to extract a first state identifier of a fault storage program; when it is determined that the first state identifier is a first idle flag, the first state identifier is set from the first idle flag to a first non-idle flag; and then the preset fault storage interface is called to extract a second state identifier of the fault storage program; when it is determined that the second state identifier is a second non-idle flag, the fault storage request is stored in a preset information processing queue; when it is determined that the second state identifier is a second idle flag, the second state identifier is updated to a second non-idle flag; and the fault storage program is called to extract fault data in the fault storage request, and the fault data is stored. The idle state of the fault storage program is determined by means of dual authentication identifiers of the first state identifier and the second state identifier, so as to prevent the problem of processing conflicts caused by calling the same fault storage program at the same time. At the same time, the fault storage requests in the preset information processing queue can be stored in sequence to ensure the smooth operation of the fault data storage.

[0077] In one embodiment, after calling the fault storage program to extract the fault data in the fault storage request and storing the fault data, the method further includes:

[0078] Determine whether the preset information processing queue is empty;

[0079] When it is determined that the preset information processing queue is not empty, calling the fault storage program to read the fault storage request in the preset information processing queue according to the queue entry time, determining the fault data in the fault storage request, and storing the fault data in the preset information processing queue until it is determined that the preset information processing queue is empty;

[0080] When it is determined that the preset information processing queue is empty, the first state flag is set to a first idle flag, and the second state flag is set to a second idle flag.

[0081] In an embodiment, when a fault storage program is called to extract fault data in a fault storage request, after storing the fault data, data in a preset information processing queue can be extracted to determine whether the preset information processing queue is empty to identify whether there is a request that needs to be processed. When it is determined that the preset information processing queue is not empty, the fault storage program can be called to read the fault storage request in the preset information processing queue according to the queue entry time, and the fault information corresponding to the fault storage request in the preset information processing queue is stored in sequence until it is determined that the preset information processing queue is empty. When it is determined that the preset information processing queue is empty, it can be considered that the fault storage program does not have a fault storage task, and the first state flag can be set to a first idle flag, and the second state flag can be set to a second idle flag, so that when a new fault storage request appears, the fault storage request can be called to store data in time.

[0082] Embodiment 3

[0083] Figure 5 FIG. 1 is a flowchart of another fault storage method provided according to Embodiment 3 of the present invention. This embodiment is based on the above embodiment and takes the fault storage method implemented by the fault detection program, the fault storage interface program and the fault storage program as an example to further illustrate a fault storage method. Figure 5 As shown, the fault detection program can detect faults in the vehicle and generate a fault storage request. The number of fault detection programs can include n. After the fault detection program generates a fault storage request, the fault storage interface program can be called. The fault storage interface program determines whether it is currently idle based on the identifications F1 and F2 of the fault storage program. If it is idle, the fault storage program is directly called to perform fault storage; if it is not currently idle, the fault type information is stored in the preset information processing queue. When the fault storage program completes the fault storage request being processed, the fault storage program is immediately called again with the fault information in the queue as input until all the fault type information in the preset information processing queue is processed. In this case, the fault storage is still real-time, and conflicts caused by multiple fault detection programs requesting fault storage at the same time are avoided.

[0084] Figure 6 This is a flowchart of another fault storage method provided according to the third embodiment of the present invention. This embodiment is based on the above embodiment, taking the first state marker as F1, the first idle flag as F1=0, and the first non-idle flag as set F1=1; taking the second state marker as F2, the second idle flag as F2=0, and the second non-idle flag as set F2=1 as an example to further illustrate a fault storage method.

[0085] Among them, the fault detection program is responsible for the identification of the fault. In one embodiment, Figure 7is a flow chart of a fault diagnosis method provided according to Embodiment 3 of the present invention. Figure 7 As shown, when a fault is detected, the fault storage interface program is called, and the fault type information is passed to the fault interface program. A system may include multiple fault detection programs, and each fault detection program may call the fault storage interface program at any time. Among them, the fault storage interface program can be considered as the preset fault storage interface in the above embodiment.

[0086] like Figure 6 As shown, when the fault type information is received, the first state identifier F1 is first called through the fault storage interface program to determine whether the fault storage program is currently idle. When it is determined that F1 is not equal to 0, the fault type information is stored in the preset information processing queue; when it is determined that F1=0, F1 is set to 1, and the second state identifier F2 is called to determine whether the fault storage program is currently idle. When it is determined that F2 is not equal to 0, the fault type information is stored in the preset information processing queue; when it is determined that F2=0, F2 is set to 1, and it is determined whether the preset information processing queue is empty. When it is determined that the preset information processing queue is not empty, the earliest fault type information in the preset information processing queue is obtained, the fault type information is cleared and the fault storage program is called for storage. When it is determined that the preset information processing queue is empty, F1 and F2 are cleared, so that when new fault type information appears, the fault storage program can be called to store data in time.

[0087] Embodiment 4

[0088] Figure 8 FIG. 1 is a schematic diagram of a structure of a fault storage device provided according to Embodiment 4 of the present invention. Figure 8 As shown, the device includes: a first identification determination module 81, a second identification determination module 82 and a fault storage module 83.

[0089] The first identification determination module 81 is used to obtain a first state identification of the fault storage program in response to the fault storage request;

[0090] A second identification determination module 82, configured to update the first state identification to a first non-idle identification and obtain a second state identification of the fault storage program when determining that the first state identification is a first idle identification;

[0091] The fault storage module 83 is used to call the fault storage program according to the second state identifier to store the fault data in the fault storage request.

[0092] In an embodiment of the present invention, a first identification determination module responds to a fault storage request and obtains a first state identification of a fault storage program. When the second identification determination module determines that the first state identification is a first idle flag, the module updates the first state identification to a first non-idle flag and obtains a second state identification of the fault storage program. The fault storage module calls the fault storage program according to the second state identification to store the fault data in the fault storage request. The present application uses a dual authentication identification method of the first state identification and the second state identification to determine the idle state of the fault storage program to prevent the problem of processing conflicts caused by calling the same fault storage program at the same time, so that the controller can run the fault data storage task more stably and avoid fault storage task operation errors or fault storage function abnormalities.

[0093] In one embodiment, the first identification determination module 81 includes:

[0094] The first identification determination unit is used to call a preset fault storage interface to extract a first state identification of the fault storage program when a fault storage request is identified; wherein the first state identification includes a first idle flag and a first non-idle flag.

[0095] In one embodiment, the second identification determination module 82 includes:

[0096] A flag updating unit, used for setting the first state flag from a first idle flag to a first non-idle flag;

[0097] The second identification determination unit is used to call a preset fault storage interface to extract a second state identification of the fault storage program; wherein the second state identification includes a second idle flag and a second non-idle flag.

[0098] In one embodiment, the fault storage module 83 includes:

[0099] A first storage unit, configured to store the fault storage request into a preset information processing queue when determining that the second state identifier is a second non-idle flag;

[0100] The second storage unit is used for updating the second state flag to a second non-idle flag when it is determined that the second state flag is a second idle flag, calling a fault storage program to extract fault data in the fault storage request, and storing the fault data.

[0101] In one embodiment, the fault storage device further includes:

[0102] A queue identification module is used to determine whether a preset information processing queue is empty;

[0103] The data processing module is used to call the fault storage program to read the fault storage request in the preset information processing queue according to the queue entry time when it is determined that the preset information processing queue is not empty, determine the fault data in the fault storage request, and store the fault data in the preset information processing queue until it is determined that the preset information processing queue is empty;

[0104] The flag setting module is used to set the first state flag to a first idle flag and the second state flag to a second idle flag when it is determined that the preset information processing queue is empty.

[0105] In one embodiment, the fault storage device further includes:

[0106] The queue storage module is used to store the fault storage request into a preset information processing queue when it is determined that the first state identifier is a first non-idle flag.

[0107] In one embodiment, the fault storage device further includes:

[0108] A type determination module is used to identify the fault type of the fault when a fault occurs in the detected vehicle;

[0109] The request generation module is used to determine the fault data of the fault type and combine the fault data as a fault storage request; wherein the fault data at least includes: a fault diagnosis code and a freeze frame.

[0110] The fault storage device provided in the embodiment of the present invention can execute the fault storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0111] Embodiment 5

[0112] Fig. 9 1 is a schematic diagram of the structure of an electronic device that implements the fault storage method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0113] like Fig. 9As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0114] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0115] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a fault storage method.

[0116] In some embodiments, the fault storage method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the fault storage method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the fault storage method in any other appropriate manner (e.g., by means of firmware).

[0117] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0118] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0119] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0121] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0122] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A fault storage method, characterized in that: include: In response to the fault storage request, obtaining a first state identifier of the fault storage program; When it is determined that the first state identifier is a first idle flag, updating the first state identifier to a first non-idle flag, and acquiring a second state identifier of the fault storage program; The fault storage program is called according to the second state identifier to store the fault data in the fault storage request.

2. The method according to claim 1, characterized in that The step of obtaining, in response to the fault storage request, a first state identifier of the fault storage program includes: When the fault storage request is identified, a preset fault storage interface is called to extract a first state identifier of the fault storage program; wherein the first state identifier includes a first idle flag and a first non-idle flag.

3. The method according to claim 1, characterized in that The updating of the first state identifier to a first non-idle flag and obtaining a second state identifier of the fault storage program includes: Setting the first state flag from a first idle flag to a first non-idle flag; A preset fault storage interface is called to extract a second state identifier of the fault storage program; wherein the second state identifier includes a second idle flag and a second non-idle flag.

4. The method according to claim 1, characterized in that: The calling the fault storage program according to the second state identifier to store the fault data in the fault storage request includes: When it is determined that the second state identifier is a second non-idle flag, storing the fault storage request in a preset information processing queue; When it is determined that the second state identifier is a second idle flag, the second state identifier is updated to a second non-idle flag, and the fault storage program is called to extract the fault data in the fault storage request, and the fault data is stored.

5. The method according to claim 4, characterized in that After calling the fault storage program to extract the fault data in the fault storage request and storing the fault data, the method further includes: Determining whether the preset information processing queue is empty; When it is determined that the preset information processing queue is not empty, calling the fault storage program to read the fault storage request in the preset information processing queue according to the queue entry time, determining the fault data in the fault storage request, and storing the fault data in the preset information processing queue until it is determined that the preset information processing queue is empty; When it is determined that the preset information processing queue is empty, the first state flag is set to a first idle flag, and the second state flag is set to a second idle flag.

6. The method according to claim 1, characterized in that After obtaining the first state identifier of the fault storage program, the method further includes: When it is determined that the first state identifier is a first non-idle flag, the fault storage request is stored in a preset information processing queue.

7. The method according to claim 1, characterized in that The generation process of the fault storage request includes: When the vehicle is detected to have a fault, identifying the fault type of the fault; Determine fault data of the fault type, and combine the fault data as the fault storage request; wherein the fault data at least includes: a fault diagnostic code and a freeze frame.

8. A fault storage device, characterized in that: include: A first identification determination module, configured to obtain a first state identification of a fault storage program in response to a fault storage request; A second identification determination module is used to update the first state identification to a first non-idle identification when it is determined that the first state identification is a first idle identification, and obtain a second state identification of the fault storage program; A fault storage module is used to call the fault storage program according to the second state identifier to store the fault data in the fault storage request.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the fault storage method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the fault storage method according to any one of claims 1 to 7 when executed.