An optimization method for storing and reading back diagnostic trouble codes (DTCs)

By introducing the intermediate software component VcDTC SWC, the problems of poor real-time performance and low development efficiency caused by cross-core calls were solved, and the storage and readback of fault codes were optimized, thereby improving the real-time performance and development efficiency of the software program.

CN115167343BActive Publication Date: 2025-12-09ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210727798.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2025-12-09
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

In the existing technology, the poor real-time performance caused by cross-core calls during the storage and readback of fault codes (DTCs) and the inability to perform development activities in parallel result in low development efficiency.

Method used

An intermediate software component, VcDTC SWC, is introduced as a bridge to uniformly call functions of the basic software layer. The application software layer interacts with VcDTC through a standard interface, avoiding direct interaction with the basic software layer. VcDTC and DEM are placed in the same code partition.

Benefits of technology

It improves the real-time performance of software programs, decouples the application software layer and the basic software layer, allows development activities to be carried out in parallel, and significantly improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167343B_ABST
    Figure CN115167343B_ABST
Patent Text Reader

Abstract

The application provides an optimization method for fault code (DTC) storage and readback, comprising an application software layer, a basic software layer and an intermediate software component, the basic software layer and the intermediate software component are arranged in a first code partition, the intermediate software component is used for receiving an instruction issued by the application software layer, then the intermediate software component calls a corresponding function of the basic software layer according to the instruction and returns an execution result to the application software layer. The application introduces the intermediate software component as an intermediate medium of the application software layer and the basic software layer, when a fault occurs, the application software layer only needs to send a detected fault state to the intermediate software component, the intermediate software component uniformly calls the function, and cross-code partition calling of the function is avoided. Meanwhile, after an interactive interface of the application software layer and the intermediate software component is determined, the application software layer can be decoupled from the basic software layer in functional development, and development work can be carried out in parallel, and development efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of automobiles, in particular to an optimization method for fault code (DTC) storage and readback. BACKGROUND

[0002] When the application software layer contains many software components (SWC), different SWC are divided into different code partitions (cores or kernels) according to functions. The code partition (kernel) is intended to divide the SWC implementing the same function into the same kernel, and to avoid function cross-kernel calls as much as possible. The kernel can improve resource utilization and reduce hardware load. When a fault occurs, multiple fault codes (DTCs) are set, and the problem of function cross-kernel calls between different kernels occurs. After the SWC of different kernels detects the fault setting (records the current fault state to the basic software layer BSW), the basic software layer function is called across the code partition (core or kernel). Different SWC calling the basic software layer function will cause poor real-time performance of the code. When multiple faults occur at the same time, the code running of each kernel has a certain order, which will cause poor real-time performance of the program, and the architecture level is chaotic. The above implementation method makes the coupling between the application software layer (ASW) and the basic software layer (BSW) high, and the application software layer (ASW) and the basic software layer (BSW) cannot be developed in parallel. Simultaneous cross-code partition calls during ASW function development will increase the computational load of another code partition. Moreover, under this development method, the basic software layer and the application software layer cannot be decoupled (reduce the coupling degree between modules) during function development. The application software layer depends on the basic software layer function, and the application software layer cannot verify whether the function is feasible before the basic software layer is configured. Only after the basic software layer is developed, the ASW can be developed accordingly, which leads to serial development activities and low development efficiency. SUMMARY

[0003] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide an optimization method for fault code (DTC) storage and readback, which solves the problem of low development efficiency of the prior art.

[0004] To achieve the above object and other related objects, the present application provides an optimization method for fault code (DTC) storage and readout, introduces an intermediate software component SWC (VcDTC SWC) to realize the diagnostic function as an intermediate bridge to uniformly call the functions of the underlying software layer. The SWC and the underlying software layer are placed in the same code partition (Core or kernel), and the application software layer ASW only needs to send the fault status (EventStatus) detected by the ASW of the corresponding DTC to the VcDTC through the standard interface S / R Port (standard AUTOSAR interface), and the VcDTC stores and reads the corresponding DTC through the function call of the service component of the underlying software layer. After introducing the SWC, the ASW interacts with the VcDTC through the S / R Port without directly calling the functions of the underlying software layer; at the same time, after introducing the SWC, the ASW does not need to interact with the BSW, but only needs to determine the interaction interface between the ASW and the VcDTC to carry out the development activities.

[0005] In an embodiment of the present application, an optimization method for fault code (DTC) storage and readout comprises:

[0006] an application software layer (ASW);

[0007] an underlying software layer (BSW); and

[0008] an intermediate software component, the underlying software layer and the intermediate software component are arranged in a first code partition, and the intermediate software component is used to receive the instructions issued by the application software layer, and then the intermediate software component calls the corresponding functions of the underlying software layer according to the instructions and returns the execution results to the application software layer.

[0009] In an embodiment of the present application, the application software layer exchanges data with the intermediate software component through a standard interface.

[0010] In an embodiment of the present application, the application software layer comprises at least one ordinary software component, the underlying software layer comprises at least one service component, the ordinary software component exchanges information with the corresponding service component through the intermediate software component to realize the corresponding function.

[0011] In an embodiment of the present application, when the ordinary software component needs to send instructions and data to the service component to execute the corresponding function, the ordinary software component sends the instructions and data to the intermediate software component through the standard interface, and the intermediate software component calls the corresponding functions provided by the service component according to the predetermined corresponding relationship to realize the predetermined function.

[0012] In an embodiment of the present application, the common software component is a fault detection component, the service component is a fault event manager (DEM), the fault detection component exchanges fault codes with the fault event manager through the intermediate software component, and the storage and readback of the fault codes are realized.

[0013] In an embodiment of the present application, the application software layer includes a plurality of common software components.

[0014] In an embodiment of the present application, the plurality of common software components are classified into different second code partitions according to functions and relevance, and the application software layer includes a plurality of second code partitions, which are independent of each other and responsible for different functions.

[0015] In an embodiment of the present application, the basic software layer includes a plurality of service components to realize different functions corresponding to the plurality of common software components of the application software layer.

[0016] In an embodiment of the present application, when a fault is detected by the corresponding common software component in the second code partition, a variable of the standard interface is assigned a value and transmitted to the intermediate software component through the standard interface, and the intermediate software component stores the fault code into the second code partition through the service component; when the fault code needs to be read back, the intermediate software component acquires the corresponding fault code state value through the service component and uploads it to the application software layer through the standard interface.

[0017] In an embodiment of the present application, when a fault is detected by the corresponding common software component in the second code partition, an event state variable is assigned a first value and transmitted to the intermediate software component of the first code partition through the standard interface, the intermediate software component calls a corresponding function of the service component in the same code partition according to the event state variable to store the fault code, and when the common software component needs to read back the fault code, the intermediate software component calls the corresponding function of the service component to read the fault code, assigns a second value to the fault code state variable, and transmits it back to the common software component through the standard interface, and the common software component completes the readback of the fault code according to the fault code state variable.

[0018] As described above, the present application has the following beneficial effects:

[0019] 1) After introducing SWC (VcDTC SWC) to realize the diagnostic function, all ASW corresponding EventStatus is packaged in the form of S / RPort and sent to the SWC, and the function call is performed through the SWC. This scheme can decouple ASW (application software layer) and BSW (basic software layer), and ASW does not need to directly interact with BSW. After the interaction interface between ASW and VcDTC is determined, the development activities of ASW and BSW can be performed in parallel. The greatest benefit of function decoupling is that the development activities are performed in parallel, and there is no interference between different parts of the development link, which can improve the development efficiency and shorten the development cycle;

[0020] 2) VcDTC SWC and DEM (diagnostic management module of basic software layer) of the basic software layer are placed in the same core, and the function call is completed in the same core. This way avoids cross-core function calls, and unified direct function calls in the same core by VcDTC can improve real-time performance and responsiveness. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 A development mode diagram of fault code (DTC) storage and readout of the prior art is shown.

[0022] Figure 2 An implementation path diagram of an optimized method of fault code (DTC) storage and readout of the present application is shown.

[0023] Figure 3 A principle diagram of an optimized method of fault code (DTC) storage and readout of the present application is shown. DETAILED DESCRIPTION

[0024] The embodiments of the present application will be described in detail below with specific reference to specific examples. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in the specification. The present application can also be implemented or applied by different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the following examples and features in the examples can be combined with each other without conflict. It should also be understood that the terms used in the embodiments of the present application are for describing specific specific embodiments, and are not intended to limit the protection scope of the present application. The test methods in the following examples are not specified, and are usually performed under conventional conditions or under conditions recommended by the manufacturers.

[0025] Please refer to Figures 1 to 3It is to be understood that the structures, proportions, sizes, etc. shown in the drawings accompanying the present specification are to be taken as illustrative only and are not to be taken as limiting the present application, which is to be understood as encompassing all modifications, alterations, and changes that fall within the scope of the appended claims. Also, the terms "upper", "lower", "left", "right", "intermediate", "one", etc. as used herein are intended to be illustrative only and are not to be taken as limiting the present application, which is to be understood as encompassing all modifications, alterations, and changes that fall within the scope of the appended claims.

[0026] AUTOSAR is an abbreviation of AUTomotive Open System ARchitecture, which is a development standard. In the AUTOSAR software architecture, the automotive embedded system software is divided into an application software layer (ASW), a runtime environment (RTE), a basic software layer (BSW), and a microcontroller (MCU) from top to bottom. In order to ensure the independence of the upper layer and the lower layer, in the usual case, each layer can only use the interface provided by the next layer, and provide the corresponding interface to the upper layer.

[0027] First, refer to Figure 1, the DTC storage and readback scheme in the mainstream implementation scheme of the diagnosis of the host manufacturers on the market is as follows: ASW judges whether the fault condition is met by receiving the fault flag bits of the battery, motor, etc., the diagnosis interface uploaded by BSW or the logical arbitration of the application software layer, and sets the corresponding fault status (EventStatus) detected by ASW. The predefined values are as follows: 0 represents DEM_EVENT_STATUS_PASSED (normal), 1 represents DEM_EVENT_STATUS_FAILED (fault), 2 represents DEM_EVENT_STATUS_PREPASSED (pre-normal), 3 represents DEM_EVENT_STATUS_PREFAILED (pre-fault), the Set_EventStatus (setting DTC according to fault status EventStatus) function of the basic software layer is called to set (record the current fault status to the basic software layer BSW) the fault status, and the corresponding DTC is set when EventStatus = 3 (PreFailed, pre-fault) is detected. Then, the basic software layer stores the set DTC in the corresponding DEM partition. When reading back the DTC, ASW calls the Get_EventStatus function (used to read back the corresponding DTC status) to read the corresponding DTC status value for use by the application software layer.

[0028] Next, please refer to Figure 2The application provides an implementation path of a DTC storage and read optimization method. When a fault is detected by a normal software component (ASW_SWC, a minimum unit for realizing a function of an application software layer) of a second code partition (Core1), a first value (0 / 1 / 2 / 3) is assigned to an event status variable (EventStatus), and is transmitted to an intermediate software component (VcDTC SWC) of a first code partition (Core4) through a standard interface (S / R Port). The intermediate software component (VcDTC SWC) stores the fault code according to the corresponding function DEM_SetEventStatus (used for setting the corresponding DTC status) of a service component DEM of the same code partition called by the event status variable (EventStatus). When the normal software component (ASW_SWC) needs to read the fault code (DTC), the intermediate software component (VcDTC SWC) calls the corresponding function DEM_GetEventStatus of the service component DEM to read the fault code (DTC), assigns a second value (DTC status) to a fault code status variable (DTC_Status), and transmits the fault code status variable (DTC_Status) back to the normal software component (ASW_SWC) through the standard interface. The normal software component completes the reading of the fault code according to the fault code status variable (DTC_Status). The reading is whether the current fault status is recorded successfully, that is, whether the current value of the DTC is recorded (or the recorded value is several) by the intermediate layer by calling the DEM_GetEventStatus function of the BSW, and the corresponding DTC in the BSW is called by the function to confirm whether the status in the DTC is recorded successfully. Then the corresponding DTC value is obtained, and is assigned to the DTC_Status and is transmitted to the ASW through the S / R Port.

[0029] Specifically, when the application software layer (ASW) detects that the fault is true and the diagnostic enable condition is met, the Port:EventStatus is assigned from the application software layer to the standard interface (S / R Port) of AUTOSAR, and is then sent to the VcDTC SWC of the intermediate layer. The VcDTC SWC of the intermediate layer calls the DEM function DEM_SetEventStatus (DTC_SoftWare_Label, EventStatus) according to the specific parameter value (coding value) of the EventStatus (DTC_SoftWare_Label is the specific DTC variable name, and is the software identification corresponding to the DTC in the software). The DEM detects that the EventStatus=3 is the fault confirmation time, avoids fault false alarm (Debounce), sets the DTC to the BSW basic software layer after a period of time, records that the fault is detected by the ASW, and stores the DTC.

[0030] When ASW needs to read back the fault status, DTC status is processed logically, VcDTC in the middle layer calls DEM function DEM_GetEventStatus(DTC_SoftWare_Label) to get the corresponding DTC status from the DTC module in BSW, and assigns it to S / R Port: DTC_Status, which is uploaded to ASW through the interface. ASW judges and processes the interface logically.

[0031] ASW judges the condition of setting DTC. Once the condition of setting DTC is met, ASW_SWC of core1 will assign a variable out to 3, otherwise it will assign out to 2. ASW_SWC stores the condition of DTC. Only when the condition of DTC is met, the value of out can be assigned to the variable EventStatus, otherwise it is assigned to 0. Then ASW sends the variable EventStatus to VcDTC SWC, and finally uses the variable EventStatus to call the function of storing and reading DTC in the SWC.

[0032] When switch = 1, EventStatus = 3. That is, when the condition of storing DTC is met, a predetermined value is assigned to the event status variable. Interface variable EventStatus_1 is a S / R port that ASW gives to VcDTC when storing DTC. It has four values of 0 / 1 / 2 / 3, but only one value at the same time. Similarly, DTC_Status1 is a S / R port that VcDTC gives to ASW when reading back DTC. It also has four values of 0 / 1 / 2 / 3, but only one value at the same time.

[0033] Further specifically, real-time fault detection is automatically performed during the use of the vehicle, or the vehicle maintenance personnel also initiates fault detection actively. During the detection process, each predetermined detection point is detected one by one. For a certain detection point, when the ordinary software component (SWC) responsible for fault detection in the application software layer (ASW) detects a fault, the output variable is assigned a value of 3, where the value 3 represents PreFailed, i.e. preliminary fault status, which needs to be further confirmed. When no fault is detected, the output variable is assigned a value of 2, where the value 2 represents PrePassed, i.e. preliminary normal status, which also needs to be further confirmed.

[0034] At this time, if the vehicle automatic controller needs to record this detection result, or the maintenance personnel needs the vehicle controller to record this detection result, then the fault detection SWC sets switch1 to 1, when switch1 = 1, the SWC assigns the value of output to the EventStatus variable, since the value of output is 2 or 3, the value of EventStatus is also 2 or 3.

[0035] Then, the fault detection SWC transmits the EventStatus to the intermediate software component VcDTC through the AUTOSAR standard interface S / R Port. After receiving the EventStatus, the VcDTC judges that when the EventStatus is not equal to 0, it calls the interface function DEM_SetEventStatus of the basic software layer (BSW) fault event manager (DEM) to transmit the EventStatus to the DEM. After receiving the EventStatus, the DEM stores the detection result corresponding to the detection point in the fault code (DTC) storage area after debouncing processing, and if it is determined that there is a fault, the corresponding fault flag is set; if it is determined that the detection result is normal, the corresponding fault flag is cleared. The debouncing processing process is that the DEM does not store immediately when it receives a certain EventStatus for the first time, but waits until it receives the same EventStatus several times (for example, it can be set to 3 times) to confirm and store the EventStatus.

[0036] After receiving the EventStatus, the VcDTC judges that when the EventStatus is not equal to 0, it calls the interface function DEM_GetEventStatus of the DEM to obtain the DTC state value. The VcDTC assigns the obtained DTC state value to the DTC_Status variable and transmits it to the fault detection SWC through the S / R Port for use by the vehicle automatic controller or the maintenance personnel.

[0037] As can be seen from the above, the introduction of the intermediate software component VcDTC avoids cross-code partition function calls and improves the real-time performance of software program execution. At the same time, the application software layer can be decoupled from the basic software layer in functional development, and the development work can be carried out in parallel, greatly improving the development efficiency.

[0038] Figure 3 What is to be shown is an extended system diagram based on the software architecture of the application. In the entire software system, the application software layer is composed of a plurality of ordinary software components SWC, which are classified into different code partitions according to functions and relevance, Figure 3The 72 SWCs are distributed in three code partitions of core1 to core3. If there are more SWCs, the number of code partitions can be increased. After the number of SWCs is increased, the partitions need to be adjusted according to functions, so that the SWCs realizing the same functions are distributed in the same core to avoid interaction between different cores. The VcDTC and DEM are placed in the same code partition core4.

[0039] When different faults occur, the ASW detects that the fault condition is met, uniformly sets EventStatus=3 in the form of an S / R interface, and sends the interface to the VcDTC. After the SWC receives the interface, DEM function DEM_SetEventStatus is uniformly called to pass the value of EventStatus to the underlying software layer. After the underlying software layer detects that EventStatus=3, Debounce is performed for a period of time to confirm the fault, and then the corresponding DTC is set.

[0040] When the ASW needs to read the DTC status, the VcDTC calls the DEM function DEM_GetEventStatus to obtain the DTC status and assigns the DTC status to the corresponding S / R interface to upload to the ASW.

[0041] The function of the architecture is mainly used for troubleshooting. When a vehicle fault occurs, the fault code can be read by using a diagnostic instrument, so as to locate which part of the ASW application software layer logic has a problem, and through troubleshooting, it can be located which specific condition has a problem, and then it is fixed to which specific fault occurs. For example, when the variable output is 2, it corresponds to PREPASSED, which means no fault. When the variable output is 3, it corresponds to PREFAILED, which means a fault. After BSW, a time delay judgment is performed. If it has been set for 2 to 3 cycles of time delay judgment and is still PREFAILED, it is finally judged as FAILED. The judgment result can be obtained by reading the fault code through the diagnostic instrument. When the fault code is 0, it is judged as no fault. When the fault code is 1, it is judged as a fault.

[0042] In summary, the VcDTC SWC is introduced as an intermediate medium of the ASW and the BSW. The SWC and the DEM are placed in the same core, and function calls are all realized by the SWC. The introduction of the SWC makes the ASW not directly interact with the BSW. When a fault occurs, the ASW only needs to send the fault EventStatus to the VcDTC. The SWC uniformly calls the DEM function to avoid function cross-code partition calls and improve the real-time performance of software program execution. At the same time, after the interaction interface between the ASW and the VcDTC is determined, the ASW can be decoupled from the BSW function development, and the development work can be carried out in parallel, which can greatly improve the development efficiency. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has high industrial utilization value.

[0043] The above embodiments are only illustrative of the principles and effects of the present application, and are not intended to limit the present application. Any modification or change made by those skilled in the art without departing from the spirit and scope of the present application shall be covered by the claims of the present application.

Claims

1. An optimization method for fault code (DTC) storage and readback, comprising: an application software layer (ASW) comprising at least one common software component; a basic software layer (BSW) comprising at least one service component; and an intermediate software component, the application software layer exchanging data with the intermediate software component through a standard interface, the common software component exchanging information with the corresponding service component through the intermediate software component, the basic software layer and the intermediate software component being arranged in a first code partition, and the service component of the basic software layer and the intermediate software component being arranged in the same core, the intermediate software component being configured to receive an instruction issued by each common software component of the application software layer, and then invoke a corresponding function in the corresponding service component of the basic software layer according to the instruction and return an execution result to the application software layer.

2. The method of optimizing DTC storage and readback according to claim 1, wherein, When the common software component needs to send an instruction and data to the service component to execute a corresponding function, the common software component sends the instruction and data to the intermediate software component through the standard interface, and the intermediate software component invokes a corresponding function provided by the service component according to a predetermined correspondence to implement a predetermined function.

3. The method of optimizing DTC storage and readback according to claim 1, wherein, The common software component is a fault detection component, the service component is a fault event manager (DEM), and the fault detection component exchanges a fault code with the fault event manager through the intermediate software component to implement storage and readback of the fault code.

4. The method of optimizing DTC storage and readback according to claim 1, wherein, The application software layer comprises a plurality of common software components.

5. The method of optimizing DTC storage and readback according to claim 4, wherein, The plurality of common software components are classified into different second code partitions according to functions and relevancies, and the application software layer comprises a plurality of second code partitions, which are independent of each other and are responsible for different functions.

6. The method of optimizing DTC storage and readback according to claim 4, wherein, The basic software layer comprises a plurality of service components to implement different functions corresponding to the plurality of common software components of the application software layer.

7. The method of optimizing the storage and readback of diagnostic trouble codes (DTCs) of claim 5, wherein, When a fault is detected by the corresponding common software component in the second code partition, a variable of the standard interface is assigned a numerical value and transmitted to the intermediate software component through the standard interface, and the intermediate software component stores the fault code to the first code partition through the service component, and when the fault code needs to be read back, the intermediate software component acquires a corresponding fault code state value through the service component and uploads the fault code state value to the application software layer through the standard interface.

8. The method of optimizing the storage and readback of diagnostic trouble codes (DTCs) of claim 7, wherein, The corresponding normal software component in the second code partition detects the fault, assigns a first value to an event status variable when the fault code needs to be stored, and transmits to the intermediate software component in the first code partition through the standard interface, and the intermediate software component calls the corresponding function of the service component in the same code partition to store the fault code according to the event status variable, and when the normal software component needs to read back the fault code, the intermediate software component calls the corresponding function of the service component to read the fault code, assigns a second value to a fault code status variable, and transmits back to the normal software component through the standard interface, and the normal software component completes the reading back of the fault code according to the fault code status variable.

Citation Information

Patent Citations

  • Virtual electronic control unit in AUTOSAR

    CN111338315A

  • Novel software architecture for vehicle

    CN115098072A