An automated method, apparatus, device, and medium for failure diagnosis list

By automatically generating fault diagnosis lists and C language code using Simulink's Sfunction function, the problem of numerous fault diagnosis list items in battery management systems is solved, achieving efficient fault handling and model automation.

CN115878130BActive Publication Date: 2025-12-12DR OCTOPUS INTELLIGENT TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211739910.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-12-12
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

The battery management system has a large number of fault diagnosis list entries, numerous diagnostic solutions and processing mechanisms, and pure model building is time-consuming, labor-intensive, and prone to misalignment, resulting in low work efficiency.

Method used

Using the Sfunction function in Simulink, a target fault diagnosis list is generated from a fault diagnosis list template, C language code is automatically generated, and a target module conforming to the Simulink standard format is constructed to realize model automation and fault handling functions.

Benefits of technology

It improves the efficiency of fault diagnosis and handling, reduces workload, enables more tasks to be processed in a limited time, reduces the occurrence of errors, and adapts to policy updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878130B_ABST
    Figure CN115878130B_ABST
Patent Text Reader

Abstract

The application provides an automatic processing method and device for a fault diagnosis list, equipment and a medium. The method comprises the following steps: generating a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module; for each fault state in the target fault diagnosis list, generating a C language code corresponding to the fault state based on parameters corresponding to the fault state recorded in the target fault diagnosis list; generating a target module conforming to a Simulink standard format according to the C language code corresponding to each fault state to obtain a target model; and replacing the target model under a path corresponding to a preset function in a development model, so that the target model realizes a fault diagnosis list processing function corresponding to the preset function. Through the method and device, the automatic generation of a model and the automatic generation of a C language code are realized, the processing operation is more efficient, the workload is greatly reduced, and the work 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 software, in particular, to an automatic processing method and device of a fault diagnosis list, equipment and medium. BACKGROUND

[0002] The battery management system of an electric vehicle is one of the most important systems. The internal system of the battery is composed of multiple modules, including current modules, voltage modules, temperature modules, high-voltage interlocking modules, collision modules, insulation modules, fast and slow charging modules, state machines, contactor modules, thermal management modules SOX modules, etc., and the fault processing module is to collect the faults reported by the above-mentioned modules, and calculate and output the required fault level, power limit, light signal and fast and slow charging balance prohibition. The number of fault diagnosis entries in the battery management system is large, and the types of fault diagnosis schemes and processing mechanisms are various. Fault diagnosis is generally developed according to a unified diagnosis list. According to the size of the influence of cell voltage, temperature, current, high voltage, SOX, communication and other faults, it is divided into four levels of Warning, Alarm, Operation and Safety. According to the influence on people and the vehicle, each entry has fault setting conditions and time, fault recovery conditions and time, different fault levels, DTC number, power limit, whether to prohibit charging and whether to light the fault light, etc. The diagnosis list often contains more than one hundred diagnosis entries. The pure model is used to build the software model and the fault classification processing. The pure model input is disordered, time-consuming and laborious, and is easy to misplace, which may cause problems. SUMMARY

[0003] Therefore, the purpose of the present application is to provide an automatic processing method, device, equipment and medium of a fault diagnosis list. By using the customizable Sfunction function in Simulink, the model automatic generation and C language code automatic generation are realized. Through the fixed fault diagnosis list, the function is quickly matched with the diagnosis entries of different projects, and the processing operation is more efficient, which greatly reduces the workload, thereby improving the work efficiency and being able to handle more tasks in limited time.

[0004] In a first aspect, an embodiment of the present application provides an automatic processing method of a fault diagnosis list, which comprises:

[0005] generating a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module;

[0006] generating a target C language code corresponding to each fault state in the target fault diagnosis list based on parameters corresponding to the fault state recorded in the target fault diagnosis list.

[0007] generating a target module in a Simulink standard format according to the target C language code corresponding to each fault state, to obtain a target model;

[0008] replacing the target model to a path corresponding to the preset function in the development model, so that the target model realizes the fault diagnosis list processing function corresponding to the preset function.

[0009] Further, the fault diagnosis list template includes a plurality of columns, the plurality of columns including an input interface column, a diagnosis fault code column, a fault bit column, and a plurality of fault state columns; the target fault diagnosis list is generated according to the fault diagnosis list template and a plurality of input interfaces preset in the fault processing module, including:

[0010] For each input interface, the initial parameters collected by the input interface under different diagnosis fault codes are obtained through the input interface;

[0011] The identification number corresponding to the input interface is added to the input interface column in the fault diagnosis list template, and each diagnosis fault code is added to the diagnosis fault code column in the fault diagnosis list template;

[0012] For each diagnosis fault code, each initial parameter is added to the corresponding column according to the parameter type of each initial parameter collected by the input interface under the diagnosis fault code, to generate the target fault diagnosis list.

[0013] Further, the fault state includes a fault level in a charging state, a fault level in a driving state, a fault recharging level, and a fault discharging level, and the parameter corresponding to the fault state is a level parameter.

[0014] Further, the target C language code corresponding to the fault state is generated based on the parameter corresponding to the fault state recorded in the target fault diagnosis list, including:

[0015] A plurality of level parameters recorded in the fault state column corresponding to the fault state in the target fault diagnosis list are determined;

[0016] For each level parameter, a plurality of fault bits collected by a plurality of input interfaces under different diagnosis fault codes are determined in the fault bit column of the target fault diagnosis list under the level parameter;

[0017] The fault bits collected by the plurality of input interfaces under different diagnosis fault codes under the level parameter are logically OR processed to obtain the initial C language code corresponding to the fault state under the level parameter;

[0018] The plurality of initial C language codes are shifted according to the size of the respective corresponding parameter levels to determine the target C language code.

[0019] Further, the fault state includes whether slow charging is prohibited after the fault occurs, whether fast charging is prohibited after the fault occurs, whether equalization is prohibited after the fault occurs, whether the light is on when the driving fault occurs, and whether the light is on when the charging fault occurs, and the parameter corresponding to the fault state is a logic variable.

[0020] Further, the target C language code corresponding to the fault state is generated based on the parameter corresponding to the fault state recorded in the target fault diagnosis list, including:

[0021] A plurality of logic variables recorded in the fault state column corresponding to the fault state in the target fault diagnosis list are determined.

[0022] For each logic variable, a plurality of fault bit positions collected by a plurality of input interfaces under the logic variable under different diagnostic fault codes are determined in the fault bit position column of the target fault diagnosis list.

[0023] The fault bit positions collected by the plurality of input interfaces under the logic variable under different diagnostic fault codes are logically OR processed to obtain the initial C language code corresponding to the fault state under the logic variable.

[0024] The plurality of initial C language codes are shifted according to the size of the respective corresponding logic variables to determine the target C language code.

[0025] In a second aspect, the embodiments of the present application further provide an automatic processing device of a fault diagnosis list, and the automatic processing device comprises:

[0026] A list generation module is configured to generate a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module.

[0027] A code generation module is configured to generate, for each fault state in the target fault diagnosis list, a target C language code corresponding to the fault state based on a parameter corresponding to the fault state recorded in the target fault diagnosis list.

[0028] A model generation module is configured to generate a target model conforming to a Simulink standard format according to the target C language code corresponding to each fault state to obtain a target model.

[0029] A model replacement module is configured to replace the target model to a path corresponding to a preset function in a development model, so that the target model implements a fault diagnosis list processing function corresponding to the preset function.

[0030] Further, the fault diagnosis list template includes a plurality of columns, the plurality of columns including an input interface column, a diagnosis fault code column, a fault bit column, and a plurality of fault state columns; when the list generation module is used to generate a target fault diagnosis list according to the fault diagnosis list template and a plurality of input interfaces preset in the fault processing module, the list generation module is further used to;

[0031] For each input interface, initial parameters collected by the input interface under different diagnosis fault codes are obtained through the input interface;

[0032] An identification number corresponding to the input interface is added to the input interface column in the fault diagnosis list template, and each diagnosis fault code is added to the diagnosis fault code column in the fault diagnosis list template;

[0033] For each diagnosis fault code, each initial parameter is added to a corresponding column according to a parameter type corresponding to the initial parameter collected by the input interface under the diagnosis fault code, so as to generate the target fault diagnosis list.

[0034] In a third aspect, an electronic device is provided, including a processor, a memory, and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, and the machine readable instructions are executed by the processor to perform the steps of the automatic processing method of the fault diagnosis list as described above.

[0035] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to perform the steps of the automatic processing method of the fault diagnosis list as described above.

[0036] The automatic processing method, device, equipment, and medium for the fault diagnosis list provided by the embodiments of the present application first generate a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module; then, for each fault state in the target fault diagnosis list, a target C language code corresponding to the fault state is generated based on parameters corresponding to the fault state recorded in the target fault diagnosis list; a target module conforming to a Simulink standard format is generated according to the target C language code corresponding to each fault state, to obtain a target model; finally, the target model is replaced in a path corresponding to a preset function in a development model, so that the target model implements a fault diagnosis list processing function corresponding to the preset function.

[0037] The application utilizes the customizable Sfunction function in Simulink, not only realizes automatic generation of the model and automatic generation of the C language code, realizes quick matching of the diagnosis items of different projects through the fixed fault diagnosis list, more efficiently processes the operation, greatly reduces the workload, thereby improves the work efficiency, and can process more tasks in limited time. And the generation of the C code is realized through the script, the interface list is automatically matched, manual modification of the C code is avoided, when the C code is generated, the different fault bit positions corresponding to the output levels are processed through shifting and logical or, so that more fault level conditions can be processed, and the occurrence of errors is reduced. In the application, the method for automatically generating the C code of the fault diagnosis list of the Excel table and the Sfunction function is more simple and convenient than the traditional pure model one-to-one search and addition of logic, the function of fault processing can be automatically realized through the constructed model, and the strategy update is more adaptable.

[0038] In order to make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are described in detail as follows. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments, and it should be understood that the following drawings only show some embodiments of the application, and therefore should not be regarded as a limitation to the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0040] Figure 1 A flow chart of the automatic processing method of the fault diagnosis list provided by the embodiments of the application;

[0041] Figure 2 A schematic diagram of the fault diagnosis list template provided by the embodiments of the application;

[0042] Figure 3 A schematic diagram of the target fault diagnosis list provided by the embodiments of the application;

[0043] Figure 4 A structural schematic diagram of the automatic processing device of the fault diagnosis list provided by the embodiments of the application;

[0044] Figure 5 A structural schematic diagram of the electronic device provided by the embodiments of the application. DETAILED DESCRIPTION

[0045] To make the purposes, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by a person skilled in the art without creative work falls within the scope of protection of the present application.

[0046] First, the application scenarios applicable to the present application are introduced. The present application can be applied to the field of computer software.

[0047] The battery management system of an electric vehicle is one of the most important systems. The internal system of the battery is composed of multiple modules, including current modules, voltage modules, temperature modules, high-voltage interlocking modules, collision modules, insulation modules, fast and slow charging modules, state machines, contactor modules, thermal management modules SOX modules, etc., and the fault processing module is to collect the faults reported by the above-mentioned modules, and to calculate and output the required fault levels, power limits, light signals, and fast and slow charging equalization prohibitions.

[0048] It is found through research that the number of fault diagnosis items in the battery management system is large, and the types of fault diagnosis schemes and processing mechanisms are various. Fault diagnosis is generally developed according to a unified diagnosis list. According to the influence of cell voltage, temperature, current, high voltage, SOX, communication, etc., it is divided into four levels of description, namely Warning, Alarm, Operation, and Safety. According to the influence on people and the vehicle, each item has fault setting conditions and time, fault recovery conditions and time, different fault levels, DTC number, power limit, whether to prohibit charging, and whether the fault light is on, etc. The diagnosis list often contains more than one hundred diagnosis items. The pure model is used to build the software model and the classification processing of faults. The pure model input is disordered, time-consuming and laborious, and is easy to misplace, resulting in problems.

[0049] Many current strategies are to build a fault diagnosis model, and different entries are respectively built for pure model subsystem logic. Although some fixed library models are used and all quantities are made into calibration quantities, it is convenient for model maintenance and modification in later period. However, this method is not suitable for pure model initial development and different supplier strategy switching. In the pure model scheme, the fault bits in each functional module are sent to the fault processing module, and the fault processing module performs subsequent subsystem function operation through the value of the fault bit. The architecture of the previous model is that each fault bit corresponds to a fault level, the same fault level is processed centrally, and then the power reduction and the power reduction rate corresponding to each level are operated, and then the balance is operated one by one, whether to prohibit or allow fast charging. Overall, the fault processing module needs to be searched one by one when modified, which is relatively cumbersome.

[0050] Based on this, the embodiment of the application provides an automatic processing method of a fault diagnosis list. The Sfunction function in Simulink is used to realize automatic generation of a model and automatic generation of C language code. Through a fixed fault diagnosis list, different project diagnosis entries are quickly matched, and processing operations are more efficient, thereby greatly reducing the workload and improving work efficiency, so that more tasks can be processed in limited time.

[0051] Referring to Figure 1 , Figure 1 is a flowchart of an automatic processing method of a fault diagnosis list provided by the embodiment of the application. As shown in Figure 1 , the automatic processing method of the fault diagnosis list provided by the embodiment of the application comprises the following steps.

[0052] S101, generating a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module.

[0053] It should be noted that the fault diagnosis list template refers to a table template that is pre-constructed and used to generate the target fault diagnosis list. The fault processing module refers to a module in a battery management system of an electric vehicle. The input interface refers to an interface provided in the fault processing module and used to receive information generated by other modules in the battery management system.

[0054] For the above step S101, in specific implementation, the target fault diagnosis list is generated according to the fault diagnosis list template and the plurality of input interfaces preset in the fault processing module.

[0055] Referring to Figure 2 , Figure 2 is a schematic diagram of a fault diagnosis list template provided by the embodiment of the application. As shown in Figure 2As shown in the above table, the fault diagnosis list template provided by the embodiments of the present application includes a plurality of columns, which include an input interface column, a diagnosis fault code column, a fault bit column, and a plurality of fault state columns. The input interface is used by the fault processing module to acquire fault information reported by other modules, for example, the fault information reported by the current module, the voltage module, the temperature module, the high voltage interlock module, the collision module, the insulation module, the fast and slow charging module, the state machine, the contactor module, the thermal management module, and the SOX module. The diagnosis fault code column represents different diagnosis fault codes corresponding to different fault bits. The fault bit column represents fault bits of different faults in different signals. The fault state column represents the state of the electric vehicle in the fault condition. According to the embodiments provided by the present application, the initial fault state column includes a fault level column in the charging state, a fault level column in the driving state, a fault back charging level column, a fault discharging level column, a column indicating whether slow charging is prohibited after the fault occurs, a column indicating whether fast charging is prohibited after the fault occurs, a column indicating whether equalization is prohibited after the fault occurs, a column indicating whether the light is on when the driving fault occurs, and a column indicating whether the light is on when the charging fault occurs. Since the fault diagnosis list template is associated with whether the electric vehicle is in the charging state, the input interface of the fault processing module also includes ConnectSts (fast and slow charging connection state).

[0056] For the above step S101, the target fault diagnosis list is generated according to the fault diagnosis list template and a plurality of input interfaces preset in the fault processing module, including:

[0057] In step 1011, for each input interface, the initial parameters collected by the input interface under different diagnosis fault codes are acquired through the input interface.

[0058] It should be noted that the initial parameters refer to the parameters of the input interface in different fault states under different diagnosis fault codes. For example, when the fault state is the fault level in the charging state, the initial parameters can be the fault level parameters collected by the input interface in the charging state, for example, the initial parameters are 4.

[0059] For the above step 1011, in the specific implementation, for each input interface, the initial parameters collected by the input interface under different diagnosis fault codes are acquired through the input interface.

[0060] In step 1012, the identification number corresponding to the input interface is added to the input interface column in the fault diagnosis list template, and each diagnosis fault code is added to the diagnosis fault code column in the fault diagnosis list template.

[0061] For the above step 1012, in the specific implementation, since the input interface column exists in the fault diagnosis list template, the identification number corresponding to the input interface is added to the input interface column in the fault diagnosis list template. The fault diagnosis list template also has a diagnosis fault code column, so each diagnosis fault code is added to the diagnosis fault code column in the fault diagnosis list template.

[0062] Step 1013, for each diagnosis fault code, according to the parameter type corresponding to each initial parameter collected by the input interface under the diagnosis fault code, each initial parameter is added to the corresponding column to generate the target fault diagnosis list.

[0063] For the above step 1013, in the specific implementation, since different diagnosis fault codes correspond to different initial parameters, for each diagnosis fault code, according to the parameter type corresponding to each initial parameter collected by the input interface under the diagnosis fault code, each initial parameter is added to the corresponding column to generate the target fault diagnosis list. For example, the parameter type corresponding to the initial parameter collected by the input interface under the diagnosis fault code is the fault level in the charging state, so the initial parameter is added to the fault level column in the charging state.

[0064] Please refer to Figure 3 Please refer to Figure 3 , Figure 3 A schematic diagram of a target fault diagnosis list provided by an embodiment of the present application. As shown in Figure 3 , the parameters obtained by the input interface are filled into the fault diagnosis list template to generate the target fault diagnosis list.

[0065] S102, for each fault state in the target fault diagnosis list, the target C language code corresponding to the fault state is generated based on the parameters corresponding to the fault state recorded in the target fault diagnosis list.

[0066] For the above step S102, in the specific implementation, for each fault state recorded in the target fault diagnosis list, the target C language code corresponding to the fault state is generated based on the parameters corresponding to the fault state recorded in the target fault diagnosis list. Here, M script CCodeGen_fun.m is used to first extract the information of the target fault diagnosis list into AllData, and then each fault state in the target fault diagnosis list generates fault handling code FltHndleCustom.c.

[0067] Specifically, please refer to Figure 2The fault state provided by the embodiments of the present application includes a fault level in a charging state, a fault level in a driving state, a fault recharging level, and a fault discharging level. When the fault state is one of the above-mentioned fault levels, the parameter corresponding to the fault state is a level parameter.

[0068] Further, for the step S102, the generating of the target C language code corresponding to the fault state based on the parameter corresponding to the fault state recorded in the target fault diagnosis list comprises:

[0069] A: determining, in the target fault diagnosis list, a plurality of level parameters recorded in a fault state column corresponding to the fault state.

[0070] For the step A, in a specific implementation, the target fault diagnosis list records a plurality of parameters collected by a plurality of input interfaces, including parameters in different fault states. Therefore, for each fault state, the plurality of level parameters recorded in the fault state column corresponding to the fault state are determined in the target fault diagnosis list. For example, when the fault state is a fault level in a charging state, the fault state column corresponding to the fault state is a fault level column in the charging state, and the level parameters can include level 1, level 2, level 3, level 4, and level 5.

[0071] B: for each level parameter, determining, in a fault bit column of the target fault diagnosis list, a plurality of fault bits collected by the plurality of input interfaces under different diagnostic fault codes.

[0072] For the step B, in a specific implementation, the target fault diagnosis list includes a fault bit column. For each level parameter, the plurality of fault bits collected by the plurality of input interfaces under different diagnostic fault codes are determined in the fault bit column of the target fault diagnosis list. Here, for example, when the level parameter is level 1, the fault bits collected by the input interface under different diagnostic fault codes when the level parameter is level 1 are determined in the fault bit column of the target fault diagnosis list. As an example, please refer to Figure 3 When the fault state is a fault discharging level, Figure 3 the fault discharging level includes level 1 and level 2. When the level parameter is level 1, the fault bits collected by the input interface BSWCOMmError under the diagnostic fault code U016487, the fault bits collected by the input interface BSWCOMmError under the diagnostic fault code U182841, and the fault bits collected by the input interface HiUIntLoopFltSts under the diagnostic fault code P191226 are determined in the fault bit column of the target fault diagnosis list shown in Figure 3 When the level parameter is level 2, the fault bits collected by the input interface BSWCOMmError under the diagnostic fault code U016487, the fault bits collected by the input interface BSWCOMmError under the diagnostic fault code U182841, and the fault bits collected by the input interface HiUIntLoopFltSts under the diagnostic fault code P191226 are determined in the fault bit column of the target fault diagnosis list shown inFigure 3 The fault bit column of the target fault diagnosis list shown can determine that when the fault discharge level is level 2, the fault bit 0 collected when the diagnostic fault code is P191C47 is included in the input interface HiUIntLoopFltSts.

[0073] C: Perform logical OR processing on the fault bits collected under different diagnostic fault codes for multiple input interfaces under the level parameter to obtain the initial C language code corresponding to the fault state of the level parameter.

[0074] For step C above, in specific implementation, after determining the fault bits collected under different diagnostic fault codes for multiple input interfaces under the level parameter in step B, perform logical OR processing on each fault bit, that is, perform shifting on different fault bits of the fault input equal to the level parameter and then take the logical OR in the generated FltHndleCustom.c code, so as to realize the generation of the initial C language code. As an example, continuing the example in step C, when the level parameter is level 1, perform logical OR processing on all fault bits under the level parameter, and the obtained initial C language code is “Derating level Discharging_FL1=(BSWCOMmError-U016487&(1<<20))|(BSWCOMmError-U182841&(1<<21))|(HiUIntLoopFltSts-P191226&(1<<5));”. When the level parameter is level 2, perform logical OR processing on all fault bits under the level parameter, and the obtained initial C language code is “Derating level Discharging_FL2=HiUIntLoopFltSts-P191C47&(1<<0)|0;”.

[0075] D: Shift multiple initial C language codes according to the size of each corresponding parameter level to determine the target C language code.

[0076] For step D above, in specific implementation, since each level parameter corresponds to an initial C language code, shift multiple initial C language codes according to the size of each corresponding parameter level first, and then combine them, so as to obtain the target C language code corresponding to the fault state. Specifically, shift the initial C language code corresponding to the smallest parameter level in multiple parameter levels to the first line, and so on, to obtain the target C language code.

[0077] Specifically, refer to Figure 2The fault state provided by the embodiments of the present application includes whether to prohibit slow charging after the fault occurs, whether to prohibit fast charging after the fault occurs, whether to prohibit balancing after the fault occurs, whether to light up when driving fault occurs, and whether to light up when charging fault occurs. When the above several fault states of the fault state, the parameters corresponding to the fault state are logical variables. Here, the logical variable includes 0 and 1, where 0 means no, and 1 means yes. For example, when the fault state is whether to prohibit slow charging after the fault occurs, when the logical variable is 0, it means that slow charging is not prohibited after the fault occurs, and when the logical variable is 1, it means that slow charging is prohibited after the fault occurs.

[0078] Further, for the above step S102, the C language code corresponding to the fault state is generated based on the parameters corresponding to the fault state recorded in the target fault diagnosis list, including:

[0079] a: determining a plurality of logical variables recorded in the fault state column corresponding to the fault state in the target fault diagnosis list.

[0080] For the above step a, in specific implementation, the target fault diagnosis list records a plurality of parameters collected by the input interface, including parameters under different fault states. Therefore, for each fault state, a plurality of logical variables recorded in the fault state column corresponding to the fault state in the target fault diagnosis list are determined. For example, when the fault state is whether to light up when charging fault occurs, the fault state column corresponding to the fault state is whether to light up when charging fault occurs, and the logical variable can include 0 and 1.

[0081] b: for each logical variable, determining a plurality of fault bits collected by the plurality of input interfaces under different diagnostic fault codes in the fault bit column of the target fault diagnosis list.

[0082] For the above step b, in specific implementation, the target fault diagnosis list includes a fault bit column, and for each logical variable, a plurality of fault bits collected by the plurality of input interfaces under different diagnostic fault codes in the fault bit column of the target fault diagnosis list are determined. Here, for example, when the logical variable is 0, the fault bits collected by the input interface under different diagnostic fault codes when the logical variable is 0 are determined in the fault bit column of the target fault diagnosis list. As an example, please refer to Figure 3 When the fault state is whether to light up when charging fault occurs, Figure 3 the logical variable corresponding to whether to light up when charging fault occurs in the target fault diagnosis list includes 0 and 1, where 0 means that the light does not light up when the charging fault occurs, and 1 means that the light lights up when the charging fault occurs. When the logical variable is 0, the fault bits collected by the input interface under different diagnostic fault codes when the logical variable is 0 are determined in the fault bit column of the target fault diagnosis list. Figure 3The fault bit column of the target fault diagnosis list shown can determine that when the logic variable is 0, the fault bit 20 collected by the input interface BSWCOMmError when the diagnostic fault code is U016487, the fault bit 0 collected by the input interface HiUIntLoopFltSts when the diagnostic fault code is P191C47, and the fault bit 5 collected by the input interface HiUIntLoopFltSts when the diagnostic fault code is P191226 are included. When the logic variable is 1, the fault bit column of the target fault diagnosis list shown can determine that the fault bit 21 collected by the input interface BSWCOMmError when the diagnostic fault code is U182841 is included. Figure 3 The fault bit column of the target fault diagnosis list shown can determine that when the logic variable is 1, the fault bit 21 collected by the input interface BSWCOMmError when the diagnostic fault code is U182841 is included.

[0083] c: performing logical or processing on the fault bits collected by the multiple input interfaces under different diagnostic fault codes under the logic variable to obtain the fault state in the initial C language code corresponding to the logic variable.

[0084] For the above step c, in the implementation, after determining the fault bits of the multiple input interfaces under different diagnostic fault codes under the logic variable in step b, performing logical or processing on each fault bit, that is, performing shifting on the different fault bits of the fault input equal to the logic variable and then taking logical or in the generated FltHndleCustom.c code, so as to realize the generation of the initial C language code. As an example, continuing the embodiment in step c, when the logic variable is 0, performing logical or processing on all the fault bits under the logic variable to obtain the initial C language code as “ChargeTrolamp_FL0=(BSWCOMmError-U016487&(1<<20))|(HiUIntLoopFltSts-P191C47&(1<<0))|(HiUIntLoopFltSts-P191226&(1<<5));”. When the logic variable is 1, performing logical or processing on all the fault bits under the logic variable to obtain the initial C language code as “ChargeTrolamp_FL1=BSWCOMmError-U182841&(1<<21)|0;”.

[0085] d: shifting the multiple initial C language codes according to the size of the respective logic variable to determine the target C language code.

[0086] For the above step d, in the implementation, since each logical variable corresponds to a piece of initial C language code, the plurality of initial C language codes are shifted according to the size of the respective corresponding logical variable, and then combined, so as to obtain the target C language code corresponding to the fault state. Specifically, the initial C language code corresponding to the smallest logical variable in the plurality of logical variables is shifted to the first line, and so on, so as to obtain the target C language code.

[0087] S103, generating a target module conforming to the Simulink standard format according to the target C language code corresponding to each fault state, so as to obtain a target model.

[0088] It should be noted that the Sfunction is a system function (System function) in Simulink supporting module simulation, which is a function used to describe the characteristics and functions of a module, supporting multiple languages such as M and C. The SFunction provides a powerful mechanism for expanding the functions of the Simulink environment. When the modules provided by the Simulink library are not enough to meet the needs of the user, the user can create a module by himself through the S function to complete the expected action. As the core content of Simulink, the S function supports simulation and provides data transmission functions for code generation. The executable file of the S function written in C language is a mex file, which is a dynamic link executable file in the MATLAB environment, which can meet the functions of input and output of unit test simulation model. At the same time, since the script realizes manual modification without human intervention, it is not necessary to test whether the input and output are correct, which reduces a lot of work of unit test cases. The target module is generated when makeSfun.m is executed according to the target C language code.

[0089] For the above step S103, in the implementation, after obtaining the target C language code corresponding to each fault state in step S102, a target module conforming to the Simulink standard format is generated according to the target C language code corresponding to each fault state, so as to obtain a target model. Specifically, makeSfun.m is executed in MATLAB, wherein legacy_code('slblock_generate',def) can generate Sfunction Block, sfun_FltHndleCustom.mexw64, sfun_FltHndleCustom.tlc.

[0090] S104, replacing the target model to the path corresponding to the preset function in the development model, so that the target model realizes the fault diagnosis list processing function corresponding to the preset function.

[0091] It should be noted that the preset function refers to a function used to perform the fault diagnosis list processing function in the development model. According to the embodiments provided in the present application, the preset function is void IPErrCat (DTAllFaults*AllFaults, boolean ConnectSts, ErrCat*out).

[0092] For the above step S104, in specific implementation, after the target model is obtained, the target model is replaced into the path corresponding to the preset function in the development model, so that the target model realizes the fault diagnosis list processing function corresponding to the preset function in the development model. The development of the model is automatically realized for a large number of fault diagnosis entries in the fault diagnosis list, and then the fault processing is realized. Compared with the form of pure model building, the quality of the model is improved, and the efficiency of model development is also improved.

[0093] The automatic processing method for the fault diagnosis list provided in the embodiments of the present application first generates a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module; then, for each fault state in the target fault diagnosis list, a target C language code corresponding to the fault state is generated based on parameters corresponding to the fault state recorded in the target fault diagnosis list; a target module conforming to a Simulink standard format is generated according to the target C language code corresponding to each fault state, so as to obtain a target model; finally, the target model is replaced into a path corresponding to a preset function in a development model, so that the target model realizes a fault diagnosis list processing function corresponding to the preset function.

[0094] The present application utilizes the customizable Sfunction function in Simulink, not only realizes automatic generation of the model and automatic generation of the C language code, but also realizes rapid matching of the function to the diagnosis entries of different projects through the fixed fault diagnosis list, and more efficiently performs the processing operation, so that the workload is greatly reduced, thereby improving the work efficiency and being able to process more tasks in limited time. Moreover, the generation of the C code is realized through the script, the interface list is automatically matched, manual modification of the C code is avoided, and when the C code is generated, the different fault bit positions corresponding to the output levels are processed through shifting and logical or processing, so that more fault level conditions can be processed, and the occurrence of errors is reduced. In the present application, the method for automatically generating the C code from the fault diagnosis list of the Excel table and the Sfunction function is more simple and convenient than the traditional pure model one-by-one search and increase of the logic, and the function of the fault processing can be automatically realized through the constructed model, and the strategy update can be better adapted.

[0095] Please refer to Figure 4 , Figure 4A structural schematic diagram of an automatic processing device for a fault diagnosis list is provided in the embodiments of the present application. As shown in Figure 4 The automatic processing device 400 comprises:

[0096] a list generation module 401 configured to generate a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module;

[0097] a code generation module 402 configured to generate, for each fault state in the target fault diagnosis list, target C language code corresponding to the fault state based on parameters corresponding to the fault state recorded in the target fault diagnosis list;

[0098] a model generation module 403 configured to generate a target model conforming to a Simulink standard format according to the target C language code corresponding to each fault state, to obtain a target model;

[0099] a model replacement module 404 configured to replace the target model under a path corresponding to a preset function in a development model, so that the target model implements a fault diagnosis list processing function corresponding to the preset function.

[0100] Further, the fault diagnosis list template comprises a plurality of columns, the plurality of columns comprising an input interface column, a diagnosis fault code column, a fault bit column, and a plurality of fault state columns; when the list generation module 401 is configured to generate a target fault diagnosis list according to a fault diagnosis list template and a plurality of input interfaces preset in a fault processing module, the list generation module 401 is further configured to:

[0101] for each input interface, acquire initial parameters collected under different diagnosis fault codes through the input interface;

[0102] add an identification number corresponding to the input interface to the input interface column in the fault diagnosis list template, and add each diagnosis fault code to the diagnosis fault code column in the fault diagnosis list template;

[0103] for each diagnosis fault code, add each initial parameter to a corresponding column according to a parameter type corresponding to each initial parameter collected under the diagnosis fault code through the input interface, to generate the target fault diagnosis list.

[0104] Further, the fault state comprises a fault level in a charging state, a fault level in a driving state, a fault recharging level, and a fault discharging level, and the parameter corresponding to the fault state is a level parameter.

[0105] Further, the code generation module 402 is further configured to:

[0106] determine a plurality of level parameters recorded in the fault state column corresponding to the fault state in the target fault diagnosis list;

[0107] For each level parameter, determine a plurality of fault bit positions of the input interfaces under the level parameter collected under different diagnostic fault codes in the fault bit position column of the target fault diagnosis list;

[0108] perform logical OR processing on the fault bit positions of the input interfaces under the level parameter collected under different diagnostic fault codes to obtain an initial C language code corresponding to the level parameter of the fault state;

[0109] shift a plurality of the initial C language codes according to the size of the respective corresponding parameter levels to determine the target C language code.

[0110] Further, the fault state includes whether to prohibit slow charging after the fault occurs, whether to prohibit fast charging after the fault occurs, whether to prohibit equalization after the fault occurs, whether to light up when the driving fault occurs, and whether to light up when the charging fault occurs, and the parameter corresponding to the fault state is a logical variable.

[0111] Further, the code generation module 402 is further configured to:

[0112] determine a plurality of logical variables recorded in the fault state column corresponding to the fault state in the target fault diagnosis list;

[0113] For each logical variable, determine a plurality of fault bit positions of the input interfaces under the logical variable collected under different diagnostic fault codes in the fault bit position column of the target fault diagnosis list;

[0114] perform logical OR processing on the fault bit positions of the input interfaces under the logical variable collected under different diagnostic fault codes to obtain an initial C language code corresponding to the logical variable of the fault state;

[0115] shift a plurality of the initial C language codes according to the size of the respective corresponding logical variables to determine the target C language code.

[0116] Please refer to Figure 5 , Figure 5A structural schematic diagram of an electronic device provided in an embodiment of the present application is shown in FIG. 1. Figure 5 As shown in FIG. 1, the electronic device 500 includes a processor 510, a memory 520 and a bus 530.

[0117] The memory 520 stores machine readable instructions executable by the processor 510, and when the electronic device 500 is running, the processor 510 communicates with the memory 520 through the bus 530. When the machine readable instructions are executed by the processor 510, the steps of the automatic processing method of the fault diagnosis list in the method embodiment shown in FIG. 2 can be performed. For details, refer to the method embodiment, which will not be repeated here. Figure 1

[0118] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the automatic processing method of the fault diagnosis list in the method embodiment shown in FIG. 2 can be performed. For details, refer to the method embodiment, which will not be repeated here. Figure 1

[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

[0120] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.

[0121] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0122] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. ​​

[0123] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various program code storage media.

[0124] It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, the terms "first", "second", "third" and the like are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0125] Finally, it should be noted that the above-described embodiments are only specific implementations of the present application, which are used to illustrate the technical solutions of the present application, but not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacements to some technical features. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An automated processing method for a fault diagnosis list, characterized in that, The automated processing method includes: The target fault diagnosis list is generated based on the fault diagnosis list template and multiple preset input interfaces in the fault handling module. For each fault state in the target fault diagnosis list, target C language code corresponding to the fault state is generated based on the parameters recorded in the target fault diagnosis list. Generate target modules conforming to the Simulink standard format based on the target C language code corresponding to each fault state to obtain the target model; Replace the target model with the path corresponding to the preset function in the development model, so that the target model can implement the fault diagnosis list processing function corresponding to the preset function; The fault status includes fault level in charging state, fault level in driving state, fault recharge level, and fault discharge level, and the parameter corresponding to the fault status is the level parameter; the generation of target C language code corresponding to the fault status based on the parameter corresponding to the fault status recorded in the target fault diagnosis list includes: In the target fault diagnosis list, determine the multiple level parameters recorded in the fault status column corresponding to the fault status; For each level parameter, the fault bits collected by multiple input interfaces under different diagnostic fault codes are determined in the fault bit column of the target fault diagnosis list under that level parameter. The fault bits collected from multiple input interfaces under different diagnostic fault codes at this level parameter are logically ORed to obtain the initial C language code corresponding to the fault state at this level parameter. The initial C language code is shifted according to the size of its corresponding parameter level to determine the target C language code; wherein, the initial C language code corresponding to the smallest parameter level among the multiple parameter levels is shifted to the first line, and so on, to obtain the target C language code; The fault states include whether slow charging is prohibited after a fault occurs, whether fast charging is prohibited after a fault occurs, whether equalization is prohibited after a fault occurs, whether the indicator light illuminates when a driving fault occurs, and whether the indicator light illuminates when a charging fault occurs. The parameters corresponding to the fault states are logical variables. The generation of target C language code corresponding to the fault state based on the parameters recorded in the target fault diagnosis list includes: In the target fault diagnosis list, determine the multiple logical variables recorded in the fault status column corresponding to the fault status; For each logical variable, the fault bits collected by multiple input interfaces under different diagnostic fault codes are determined in the fault bit column of the target fault diagnosis list. The fault bits collected from multiple input interfaces under different diagnostic fault codes under this logical variable are logically ORed to obtain the initial C language code corresponding to the fault state under this logical variable. The initial C language code is shifted according to the size of its corresponding logical variable to determine the target C language code; wherein, the initial C language code corresponding to the smallest logical variable among the multiple logical variables is shifted to the first line, and so on, to obtain the target C language code.

2. The automated processing method according to claim 1, characterized in that, The fault diagnosis list template includes multiple columns, including an input interface column, a diagnostic fault code column, a fault bit column, and multiple fault status columns; The step of generating a target fault diagnosis list based on the fault diagnosis list template and multiple preset input interfaces in the fault handling module includes: For each input interface, the initial parameters collected at that input interface under different diagnostic fault codes are obtained through that input interface; Add the identifier corresponding to the input interface to the input interface column of the fault diagnosis list template, and add each diagnostic fault code to the diagnostic fault code column of the fault diagnosis list template; For each diagnostic fault code, based on the parameter type of each initial parameter under that diagnostic fault code collected by the input interface, each initial parameter is added to the corresponding column to generate the target fault diagnosis list.

3. An automated processing device for a fault diagnosis list, characterized in that, The automated processing device includes: The list generation module is used to generate a target fault diagnosis list based on the fault diagnosis list template and multiple preset input interfaces in the fault handling module. The code generation module is used to generate target C language code corresponding to each fault state in the target fault diagnosis list based on the parameters corresponding to the fault state recorded in the target fault diagnosis list. The model generation module is used to generate a target module conforming to the Simulink standard format based on the target C language code corresponding to each fault state, so as to obtain the target model; The model replacement module is used to replace the target model with the path corresponding to the preset function in the development model, so that the target model can implement the fault diagnosis list processing function corresponding to the preset function. The fault status includes fault level in charging state, fault level in driving state, fault recharge level, and fault discharge level, and the parameter corresponding to the fault status is a level parameter; when the code generation module generates the target C language code corresponding to the fault status based on the parameter corresponding to the fault status recorded in the target fault diagnosis list, the code generation module is further used for: In the target fault diagnosis list, determine the multiple level parameters recorded in the fault status column corresponding to the fault status; For each level parameter, the fault bits collected by multiple input interfaces under different diagnostic fault codes are determined in the fault bit column of the target fault diagnosis list under that level parameter. The fault bits collected from multiple input interfaces under different diagnostic fault codes at this level parameter are logically ORed to obtain the initial C language code corresponding to the fault state at this level parameter. The initial C language code is shifted according to the size of its corresponding parameter level to determine the target C language code; wherein, the initial C language code corresponding to the smallest parameter level among the multiple parameter levels is shifted to the first line, and so on, to obtain the target C language code; The fault states include whether slow charging is prohibited after a fault occurs, whether fast charging is prohibited after a fault occurs, whether equalization is prohibited after a fault occurs, whether the indicator light illuminates when a driving fault occurs, and whether the indicator light illuminates when a charging fault occurs. The parameters corresponding to the fault states are logical variables. When the code generation module generates the target C language code corresponding to the fault state based on the parameters corresponding to the fault state recorded in the target fault diagnosis list, the code generation module is further used for: In the target fault diagnosis list, determine the multiple logical variables recorded in the fault status column corresponding to the fault status; For each logical variable, the fault bits collected by multiple input interfaces under different diagnostic fault codes are determined in the fault bit column of the target fault diagnosis list. The fault bits collected from multiple input interfaces under different diagnostic fault codes under this logical variable are logically ORed to obtain the initial C language code corresponding to the fault state under this logical variable. The initial C language code is shifted according to the size of its corresponding logical variable to determine the target C language code; wherein, the initial C language code corresponding to the smallest logical variable among the multiple logical variables is shifted to the first line, and so on, to obtain the target C language code.

4. The automated processing device according to claim 3, characterized in that, The fault diagnosis list template includes multiple columns, including an input interface column, a diagnostic fault code column, a fault bit column, and multiple fault status columns; when the list generation module generates a target fault diagnosis list based on the fault diagnosis list template and multiple preset input interfaces in the fault processing module, the list generation module is also used for: For each input interface, the initial parameters collected at that input interface under different diagnostic fault codes are obtained through that input interface; Add the identifier corresponding to the input interface to the input interface column of the fault diagnosis list template, and add each diagnostic fault code to the diagnostic fault code column of the fault diagnosis list template; For each diagnostic fault code, based on the parameter type of each initial parameter under that diagnostic fault code collected by the input interface, each initial parameter is added to the corresponding column to generate the target fault diagnosis list.

5. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the automated processing method for a fault diagnosis list as described in any one of claims 1 to 2.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the automated processing method for the fault diagnosis list as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • UDS diagnosis interface software generation method, device and equipment

    CN109213132A

  • Efficient and convenient information management method for development of automobile fault diagnosis management system

    CN113805551A