CN104102479A - Automatic generation method of OBD (On Board Diagnostic) variable definition source files - Google Patents

Automatic generation method of OBD (On Board Diagnostic) variable definition source files Download PDF

Info

Publication number
CN104102479A
CN104102479A CN201310123857.8A CN201310123857A CN104102479A CN 104102479 A CN104102479 A CN 104102479A CN 201310123857 A CN201310123857 A CN 201310123857A CN 104102479 A CN104102479 A CN 104102479A
Authority
CN
China
Prior art keywords
obd
variable
file
source file
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310123857.8A
Other languages
Chinese (zh)
Other versions
CN104102479B (en
Inventor
周平
张君鸿
左从兵
王海燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Treasure Car Co Ltd
Original Assignee
Beiqi Foton Motor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beiqi Foton Motor Co Ltd filed Critical Beiqi Foton Motor Co Ltd
Priority to CN201310123857.8A priority Critical patent/CN104102479B/en
Publication of CN104102479A publication Critical patent/CN104102479A/en
Application granted granted Critical
Publication of CN104102479B publication Critical patent/CN104102479B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an automatic generation method of OBD (On Board Diagnostic) variable definition source files. The automatic generation method comprises the following steps: acquiring a plurality of OBD variables, wherein each OBD variable comprises a variable name and a plurality of attribute fields; writing the OBD variables into a preset file; analyzing the preset file so as to respectively generate multiple groups of preset variables according to the name of each OBD variable, at least one part of attribute fields and multiple initial OBD variable definition files, and generate a plurality of corresponding arrays according to the multiple groups of preset variables; respectively writing the contents in the multiple arrays into the corresponding initial OBD variable definition file to generate a plurality of OBD variable definition source files. According to the embodiment provided by the invention, source codes related to the contents of the OBD modules can be automatically generated by software, so that the labor cost is reduced, the development period is shortened, the development efficiency is improved, and meanwhile, the error rate is also reduced. In addition, the automatic generation method disclosed by the embodiment has the advantages of high transportability and high universality.

Description

A kind of automatic generation method of OBD variable-definition source file
Technical field
The present invention relates to field of automobile, particularly a kind of automatic generation method of OBD variable-definition source file.
Background technology
Now, the application of automobile electronic controller in automobile is more and more extensive, has become the important composition that affects automotive performance.The construction cycle of automobile electronic controller program and quality, as a ring of car load construction cycle and quality, more and more receive automotive development business's concern.
OBD(On Board Diagnostic, automatic vehicle diagnosis system), be a pith in electronic controller program.At the beginning of this concept of OBD is introduced, it also only only has the monitoring function to exhaust system, but along with time and scientific and technological development, OBD variable body is a multifunction module that integrates detection, maintenance and management, and importance is self-evident.
When automobile making, OBD block code can be pressed the numerous correlated variabless of different classes of definition in a plurality of source code file, and variable and definition meeting thereof are used in different source program codes, and change the change that one of them variable can involve many source files, pull one hair and move the whole body, and the source file of at present relevant OBD module variable-definition adopts the mode of manual compiling and modification mostly, the change of a variable-definition, need to change one by one many correlated source file relevant portions, not only waste time and energy, and be very easy to make mistakes, have influence on cost of development and the quality of whole product.
Summary of the invention
The present invention is intended at least one of solve the problems of the technologies described above.
For this reason, the object of the invention is to propose a kind ofly can save human cost, shorten the construction cycle, improve development efficiency and accuracy rate, and there is the automatic generation method of the OBD variable-definition source file of the advantage that transplantability is high, universality is high.
To achieve these goals, embodiments of the invention have proposed a kind of OBD variable-definition source file automatic generation method, comprise the following steps: obtain a plurality of OBD variablees, wherein, described OBD variable comprises name variable and a plurality of attribute field; By in described a plurality of OBD variable default files; Described default file is resolved, to organize design variables according to the title of each OBD variable, at least a portion attribute field and a plurality of initial OBD variable-definition file generated respectively, and generate corresponding a plurality of arrays according to described many group design variables more; And respectively the content in described a plurality of arrays is write in corresponding initial OBD variable-definition file to generate a plurality of OBD variable-definition source files.
Automatic generation method according to the OBD variable-definition source file of the embodiment of the present invention, can generate the source code file that OBD module contents is relevant automatically by software, has saved human cost, shorten the construction cycle, improve development efficiency, also reduced error rate simultaneously, improved development quality.In addition, the embodiment of the present invention is applicable to different development platforms, after it can being revised a little, migrates in different development platforms and uses, and therefore also has advantages of that portability is high, universality is high.
In addition, the automatic generation method of OBD variable-definition source file according to the above embodiment of the present invention can also have following additional technical characterictic:
In an embodiment of the present invention, described a plurality of initial OBD variable-definition file comprises: obd_const.h source file, obd_data.h source file, obd_table.h source file, obd_externals.h source file, obd_config.h source file and obd.a2l source file.
In an embodiment of the present invention, the generation of described obd_externals.h source file, further comprises: the name variable that obtains the OBD variable in described default file; According to described name variable, generate external related content and write in the first array; According to described the first array, generate described obd_externals.h source file.
In an embodiment of the present invention, the generation of described obd_const.h source file, further comprises: the default attribute field group of obtaining the OBD variable in described default file; Respectively described name variable and other field combination of two are generated to new name variable; According to default attribute corresponding to attribute field, carry out assignment and write in the second array; According to described the second array, generate described obd_const.h source file.
In an embodiment of the present invention, the generation of described obd_table.h source file, further comprises: the name variable that obtains the OBD variable in described default file; According to described name variable, generate table related content and write in described the 3rd array; According to described the 3rd array, generate described obd_table.h source file.
In an embodiment of the present invention, the generation of described obd_data.h source file, further comprises: the name variable that obtains the OBD variable in described default file; According to described name variable, generate data related content and write in described the 4th array; According to described the 4th array, generate described obd_data.h source file.
In an embodiment of the present invention, the generation of described obd_config.h source file, further comprises: the name variable that obtains the OBD variable in described default file; According to name variable, generate config related content and write in the 5th array; According to described the 5th array, generate described obd_config.h source file.
In an embodiment of the present invention, the generation of described obd.a2l source file, further comprises: the name variable that obtains the OBD variable in described default file; According to name variable, generate a2l related content and write in the 6th array; According to described the 6th array, generate described obd.a2l source file.
In an embodiment of the present invention, also comprise: if read the end identifier in described default file, stop.
Additional aspect of the present invention and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Accompanying drawing explanation
Above-mentioned and/or additional aspect of the present invention and advantage accompanying drawing below combination obviously and is easily understood becoming the description of embodiment, wherein:
Fig. 1 is according to the process flow diagram of the automatic generation method of the OBD variable-definition source file of the embodiment of the present invention;
Fig. 2 is the overall work schematic diagram of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention;
Fig. 3 is the overview flow chart of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention;
Fig. 4 is the workflow diagram of sort_io_spec function of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention;
Fig. 5 a to Fig. 5 b is the generation obd_const.h source file of automatic generation method and the process flow diagram of obd_externals.h source file of OBD variable-definition source file according to an embodiment of the invention;
Fig. 6 is the process flow diagram of generation obd_table.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention;
Fig. 7 is the process flow diagram of generation obd_data.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention;
Fig. 8 is the process flow diagram of generation obd_config.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention; With
Fig. 9 is the process flow diagram of generation obd.a2l source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.
In description of the invention, it will be appreciated that, term " " center ", " longitudinally ", " laterally ", " on ", D score, " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end ", " interior ", orientation or the position relationship of indications such as " outward " are based on orientation shown in the drawings or position relationship, only the present invention for convenience of description and simplified characterization, rather than device or the element of indication or hint indication must have specific orientation, with specific orientation structure and operation, therefore can not be interpreted as limitation of the present invention.In addition, term " first ", " second " be only for describing object, and can not be interpreted as indication or hint relative importance.
In description of the invention, it should be noted that, unless otherwise clearly defined and limited, term " installation ", " being connected ", " connection " should be interpreted broadly, and for example, can be to be fixedly connected with, and can be also to removably connect, or connect integratedly; Can be mechanical connection, can be to be also electrically connected to; Can be to be directly connected, also can indirectly be connected by intermediary, can be the connection of two element internals.For the ordinary skill in the art, can concrete condition understand above-mentioned term concrete meaning in the present invention.
Below in conjunction with accompanying drawing, describe according to the automatic generation method of the OBD variable-definition source file of the embodiment of the present invention.
As shown in Figure 1, the automatic generation method according to the OBD variable-definition source file of the embodiment of the present invention, comprises the following steps:
Step S101, obtains a plurality of OBD variablees, and wherein, each OBD variable comprises name variable and a plurality of attribute field.
Step S102, writes a plurality of OBD variablees in default file.Wherein, default file is a pre-set csv file.In one embodiment of the invention, the content format example of default file is as shown in table 1:
Table 1
The OBD variable of default file comprise name variable and a plurality of attribute field as shown in table 2:
Content Sequence number Content Sequence number
Column_ID 0 Column_FF_Priority 10
Column_Fault_Name 1 Column_MIL1_Behaviour 11
Column_AFL_Threshold 2 Column_MIL2_Behaviour 12
Column_AFL_Increment 3 Column_MIL3_Behaviour 13
Column_AFL_Decrement 4 Column_MIL4_Behaviour 14
Column_DCC_Threshold 5 Column_Display_On_Tester 15
Column_DCC_Increment 6 Column_Freeze_Frame 16
Column_DCC_Decrement 7 Column_Latch_Fault 17
Column_AFF_Limit 8 Column_ExpectedMask 18
Column_DTC_Number 9 Column_EOBD_Fault 19
Table 2
Wherein, associative list 1 and table 2, wherein, for example: 1 in table 1 represents the OBD variable that ID is 1, A_SENS_SUPPLY_FAULT represents that the name of this variable is called A_SENS_SUPPLY_FAULT etc.
Step S103, resolves default file, to organize design variables according to the title of each OBD variable, at least a portion attribute field and a plurality of initial OBD variable-definition file generated respectively, and generates corresponding a plurality of arrays according to many groups design variables more.Particularly, can sort to default file, check, extract and change etc. operates to realize the parsing to default file, thereby obtains title, at least a portion attribute field and a plurality of initial OBD variable-definition file of each OBD variable.
Step S104, writes the content in a plurality of arrays respectively in corresponding initial OBD variable-definition file to generate a plurality of OBD variable-definition source files.Wherein, a plurality of initial OBD variable-definition source files comprise: obd_const.h source file, obd_data.h source file, obd_table.h source file, obd_externals.h source file, obd_config.h source file and obd.a2l source file.
Particularly, in step S104, the generation of obd_externals.h source file further comprises: the name variable that first obtains the OBD variable in default file, and write in the first array (obd_externals array) according to name variable generation external related content, then generate obd_externals.h source file according to the first array.Wherein, external related content is for example shown in table 3:
extern?const?uint8_t?A_SENS_SUPPLY_FAULT_afl_threshold;
Table 3
The generation of obd_const.h source file further comprises: the default attribute field group of first obtaining the OBD variable in default file, such as: Fault_Name field, EOBD_Fault field, MIL1 to MIL4 field, freeze_Frame field and Latch_Fault field etc., respectively name variable (Fault_Name field) and other field combination of two are generated to new name variable, according to default property value corresponding to attribute field, carry out assignment and write in the second array (obd_const array), and generating obd_const.h source file according to this second array.Const related content is as shown in table 4 below:
Table 4
In table 4, const uint8_t represents the form of variable, as title and the attribute field thereof of the expression variablees such as A_SENS_SUPPLY_FAULT_afl_threshold, A_SENS_SUPPLY_FAULT_afl_increment, A_SENS_SUPPLY_FAULT_warning_mask and A_SENS_SUPPLY_FAULT_eobd_fault, 50u, 10u, 1u and FALSE etc. represent the content of the attribute field that variable is corresponding.For example, the first row of table 4 represents that name variable is A_SENS_SUPPLY_FAULT_, and attribute field is afl_threshold, and the content that attribute field is corresponding is 50u.
The generation of obd_table.h source file further comprises: the Fault_Name field of first obtaining OBD variable in default file, and write in the 3rd array (obd_table array) according to name variable generation table related content, finally according to the 3rd array, generate obd_table.h source file.In one embodiment of the invention, table related content is as shown in table 5 below:
Table 5
The generation of obd_data.h source file further comprises: the Fault_Name field of obtaining the OBD variable in default file, and write in the 4th array (obd_data array) according to name variable generation data related content, according to the 4th array, generate obd_data.h source file.Wherein, data related content is as shown in table 6 below:
Table 6
The generation of obd_config.h source file further comprises: first according to the Fault_Name field of obtaining OBD variable in default file, and write in the 5th array (obd_config array) according to name variable generation config related content, according to the 5th array, generate obd_config.h source file.
The generation of obd.a2l source file further comprises: the Fault_Name field of first obtaining the OBD variable in default file, and write in the 6th array (obd.a2l array) according to name variable generation a2l related content, finally according to the 6th array, generate obd.a2l source file.
Further, in above-mentioned example, during end identifier in reading default file, stop reading, and stop continuing to generate OBD variable-definition source file.Wherein, finishing indications is preset by technician.
As concrete example, below in conjunction with Fig. 2-9, describe in detail according to the automatic generation method of the ODB variable-definition source file of the embodiment of the present invention.
Fig. 2 is the overall work schematic diagram of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.
As shown in Figure 2, what OBD variable was correlated with is content-defined in a csv file (being default file), i.e. Fault_Definitions.csv file in figure, then pass through perl pin language automatically by a series of operations such as the variable-definition process sequence in this csv file, inspection, extraction, changes, generate a plurality of source files of relevant obd module variable-definition, i.e. obd_const.h source file in Fig. 2, obd_data.h source file, obd_table.h source file, obd_externals.h source file, obd_config.h source file and obd.a2l source file.Wherein, perl script is a kind of language that is applicable to very much editor and processes various texts, replaces the work of human-edited and modification by the mode of carrying out perl script, can simplify widely work, raises the efficiency and quality, reduces cost of development.
Fig. 3 is the process flow diagram of the automatic generation method of OBD variable-definition source file in accordance with another embodiment of the present invention.As shown in Figure 3, the automatic generation method of OBD variable-definition source file in accordance with another embodiment of the present invention, comprises the following steps:
Step S301, Start.Be that workflow starts.
Step S302, sort_io_spec.The csv file of OBD module related content definition is carried out to Preliminary Analysis, and according to Column_ID and Column_DTC_Number, each row content parsing in file is sorted, and generate temp.csv file.
Step S303, create_obd_const_data.Particularly, resolve temp.csv file, and therefrom extract related content generation OBD_CONST, OBD_DATA, OBD_TABLES and tetra-arrays of OBD_EXTERNALS.
Step S304, output obd_const.h file.Content in the@OBD_CONST file obtaining in above-mentioned steps is written in obd_const.h file, to export obd_const.h file.
Step S305, output obd_data.h file.Content in the@OBD_DATA file obtaining is written in obd_data.h file, to export obd_data.h file.
Step S306, output obd_table.h file.Content in the@OBD_TABLES file obtaining is written in obd_table.h file, to export obd_table.h file.
Step S307, output obd_externals.h file.Content in the@OBD_EXTERNALS file obtaining is written in obd_externals.h file, to export obd_externals.h file.
Step S308, create_obd_config.Resolve temp.csv file, and therefrom extract related content generation@OBD_CONFIG array.
Step S309, output obd_config.h file.In the@OBD_CONFIG file that above-mentioned steps is obtained, content is written in obd_config.h file, to export obd_config.h file.
Step S310, create_obd_a2l.Resolve temp.csv file, and therefrom extract related content generation@OBD_A2L array.
Step S311, output obd.a2l file.Content in the@OBD_A2L file obtaining is written in obd.a2l file, to export obd.a2l file.
Step S312, End.Be that workflow finishes, stop generating OBD variable-definition source file.
From the overview flow chart of above-mentioned Fig. 2, can find out, the method can mainly be summarised as three steps:
The first step, for reading in Fault_Definitions.csv file, is carried out Preliminary Analysis to csv file, and according to Column_ID and Column_DTC_Number, each row content parsing in file is sorted, and generates temp.csv file.
Second step, for by resolving temp.csv file, generates related content and puts in OBD_CONST, OBD_DATA, OBD_TABLES, OBD_EXTERNALS, these six arrays of OBD_CONFIG, OBD_A2L according to the data that provide in csv.
The 3rd step is for writing these six arrays corresponding five <.h> files and a <.a2l> file.
As shown in Figure 4, be the workflow diagram of the sort-_io_spec function of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.Wherein, in whole perl script, have four encapsulation functions, and its concrete treatment step is as follows:
Step S401, Start.Be that workflow starts.
Step S402 reads a line content from Fault_Definitions.csv file, and if not being empty, circulation continues.
Step S403, removes the special symbol (as $, " in one's own profession, tab etc.).
Step S404, stores the content of text of processing in@fields array into.
Step S405, Loop.I.e. circulation, returns to execution step S402.
Step S406, utilizes sort function to sort to@fields array.According to Column_ID and Column_DTC_Number ,@fields array is sorted.
Step S407, outputs to the content in array@fields in temp.csv file.
Step S408, End.Be that workflow finishes.
As shown in Fig. 5 a to Fig. 5 b, be the generation obd_const.h source file of the automatic generation method of OBD variable-definition source file and the process flow diagram of obd_externals.h source file according to an embodiment of the invention.Comprise the steps:
Step S501, Start.Be that workflow starts.
Step S502 reads a line content from csv file, and when reading in content not for sky, circulation continues.
Step S503, removes the space in this journey, and is that delimiter separates this journey content with ", ", and is deposited in@fields array.
Step S504, obtains in@fields array the field about name, and generates relevant macro definition and deposit in@OBD_EXTERNALS array.
Step S505, obtains in@fields array the field about name, and generates relevant macro definition and deposit in@OBD_CONST array.
Step S506, $ fields[$ Column_EOBD_Fault]==" TRUE ".If perform step S507, otherwise execution step S515.
Step S507, $ fields[$ Column_Fault_Name]=FF_HIGH_PRIORITY.
Step S508, by $ fields[$ Column_Fault_Name] corresponding content puts into@OBD_CONST array.
Step S509, determines warning_mask according to the value of MIL1/MIL2/MIL3/MIL4 tetra-row, and is written in@OBD_CONST array.
Step S510, obtains the content of Column_Display_On_Tester row and is written in@OBD_CONST array.
Step S511, $ fields[$ Column_Freeze_Frame]==FF_REQ.To perform step S513, otherwise execution step S512.
Step S512, $ fields[$ Column_Freeze_Frame]==NONE.To perform step S514, otherwise execution step S521.
Step S513, $ fields[$ Column_Freeze_Frame]=TRUE, and be written in@OBD_CONST array, and continue execution step S512.
Step S514, $ fields[$ Column_Freeze_Frame]=FALSE, and be written in@OBD_CONST array, and continue execution step S521.
Step S515, $ fields[$ Column_FF_Priority]==low.To perform step S516, otherwise execution step S517.
Step S516, $ fields[$ Column_Fault_Name]=FF_HIGH_PRIORITY, and continue execution step S508.
Step S517, $ fields[$ Column_FF_Priority]==low.To perform step S518, otherwise execution step S519.
Step S518, $ fields[$ Column_Fault_Name]=FF_HIGH_PRIORITY, and continue execution step S508.
Step S519, $ fields[$ Column_FF_Priority]==low.To perform step S520, otherwise execution step S508.
Step S520, $ fields[$ Column_Fault_Name]=FF_HIGH_PRIORITY, and continue execution step S508.
Step S521, $ fields[$ Column_Latch_Fault]==NORMAL.To perform step S522, otherwise execution step S523.
Step S522, $ fields[$ Column_Fault_Name]=OBD_NORMAL, and be written in@OBD_CONST array, and continue execution step S523.
Step S523, $ fields[$ Column_Latch_Fault]==SERVICE LATCHED.To perform step S524, otherwise execution step S525.
Step S524, $ fields[$ Column_Fault_Name]=OBD_SERVICE, and be written in@OBD_CONST array, and continue execution step S525.
Step S525, $ fields[$ Column_Latch_Fault]==DRIVE CYCLE LATCHED.To perform step S526, otherwise execution step S527.
Step S526, $ fields[$ Column_Fault_Name]=OBD_DRIVE_CYCLE, and be written in@OBD_CONST array, and continue execution step S527.
Step S527, $ fields[$ Column_Latch_Fault]==RETAINED.To perform step S528.
Step S528, $ fields[$ Column_Fault_Name]=OBD_RETAINED, and be written in@OBD_CONST array, and continue execution step S529.
Step S529, Loop.I.e. circulation.
Step S530, closes temp file.
Step S531, End.Finish.
As shown in Figure 6, be the process flow diagram of the generation obd_table.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.Comprise the steps:
Step S601, Start.Be that workflow starts.
Step S602, generates obd_const_array gauge outfit, puts into@OBD_TABLES array.And gauge outfit table tail is all immobilized substance, directly insert.
Step S603, opens temp.csv file.
Step S604 reads a line content from csv file, and when reading in content not for sky, circulation continues.
Step S605, removes the space in this journey, and is that delimiter separates this journey content with ", ", and is deposited in@fields array.
Step S606, judgement $ fault_no unequal to 0? if so, perform step S607, otherwise execution step S608.
Step S607 inputs a carriage return character in@OBD_TABLES.
Step S608, obtains $ Column_Fault_Name field, generates variable and puts into@OBD_TABLES array.Wherein, in obd_const_array table, generate the variable that suffix is _ afl_threshold, in obd_diag_array table, generate the variable that suffix is _ afl_count.
Step S609, Loop.And return execution step S604.
Step S610, closes temp file.
Step S611, generates obd_const_array table tail, puts into@OBD_TABLES array.
Step S612, in like manner generates table obd_diag_array according to above-mentioned steps.In Obd_table.h file, one meets generation obd_const_array and obd_diag_array2 table together, and the variable generating in 2 tables is different, but its method that generates table is the same.
Step S613, End.Be that workflow finishes.
As shown in Figure 7, be the process flow diagram of the generation obd_data.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.Comprise the steps:
Step S701, Start.Be that workflow starts.
Step S702, generates obd_data.h file header, puts into@OBD_DATA array.Wherein, file header end-of-file is all immobilized substance, directly inserts.
Step S703, opens temp.csv file.
Step S704 reads a line content from csv file, and when reading in content not for sky, circulation continues.
Step S705, removes the space in this journey, and is that delimiter separates this journey content with ", ", and is deposited in@fields array.
Step S706, judgement $ fault_no unequal to 0? if so, perform step S707, otherwise execution step S708.
Step S707 inputs a carriage return character in@OBD_DATA.
Step S708, obtains $ Column_Fault_Name field, generates variable and puts into@OBD_DATA array.Particularly, generate suffix and be _ diag_flags, _ fec_count, _ aff_count, _ dcc_count, the variable of _ afl_count.
Step S709, $ fault_no=$ fault_no+1.
Step S710, Loop.And return execution step S704.
Step S711, closes temp file.
Step S712, generates OBD_MAX_NO_FAULT variable, and puts into@OBD_DATA array.
Step S713, generates obd_data.h end-of-file, puts into@OBD_DATA array.In Obd_table.h file, one meets generation obd_const_array and obd_diag_array2 table together, and the variable generating in 2 tables is different, but it is the same to generate the method for showing.
Step S714, End.Be that workflow finishes.
As shown in Figure 8, be the process flow diagram of the generation obd_config.h source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.Comprise the steps:
Step S801, Start.Be that workflow starts.
Step S802, opens temp.csv file.
Step S803 reads a line content from csv file, and when reading in content not for sky, circulation continues.
Step S804, removes the space in this journey, and is that delimiter separates this journey content with ", ", and is deposited in@fields array.Particularly, utilize the regular expression of perl, the character string of measurement of correlation amount is substituted in $ a2l_str variable.
Step S805, obtains in@fields array the field about name, and generates relevant macro definition and deposit in@OBD_CONFIG array.
Step S806, Loop.And return execution step S803.
Step S807, is defined as OBD_MAX_NO_FAULT and EOBD_MAX_NO_FAULT grand and to its assignment, is inserted in@OBD_CONFIG array.
Step S808, End.Be that workflow finishes.
As shown in Figure 9, be the process flow diagram of the generation obd.a2l source file of the automatic generation method of OBD variable-definition source file according to an embodiment of the invention.Comprise the steps:
Step S901, Start.Be that workflow starts.
Step S902, opens temp.csv file.
Step S903, $ a2l_str=get_odb_a2l_header.Generate the header part of a2l file and write in variable $ a2l_str.
Step S904, traversal cvs file, generates relevant scalar quantity and is inserted in $ a2l_str.Particularly, utilize the regular expression of perl, the gauged character string of being correlated with is substituted in $ a2l_str variable.
Step S905, traversal cvs file, generates relevant measuring amount and is inserted in $ a2l_str.Utilize the regular expression of perl, the character string of measurement of correlation amount is substituted in $ a2l_str variable.
Step S906, deposits $ a2l_str in@OBD_A2L in.
Step S907 reads a line content from csv file, and when reading in content not for sky, circulation continues.
Step S908, removes the space in this journey, and is that delimiter separates this journey content with ", ", and is deposited in@fields array.
Step S909, obtains in@fields array the field about name, and generates 29 relevant variablees and deposit in@OBD_A2L array.
Step S910, Loop.And return execution step S907.
Step S911, $ a2l_str=get_odb_a2l_trailer.Generate the ending of a2l file and write in variable $ a2l_str.
Step S912, is written to the content of $ a2l_str in@OBD_A2L array.
Step S913, End.Be that workflow finishes.
In above-mentioned example, the major function of sort_io_spec function for sorting is; The major function of create_obd_const_data function is to generate OBD_CONST, OBD_DATA, OBD_TABLES, tetra-arrays of OBD_EXTERNALS; The major function of create_obd_config function is to generate@OBD_CONFIG array; The major function of create_obd_a2l function is to generate@OBD_A2L array.In above-mentioned example, utilize perl script to replace artificial treatment, by the variable-definition of various OBD modules in csv file, by perl script, automatically read csv file content, read content, according to required sequence, by required variablees of extraction such as the definition of each class variable, titles and modify, integrate, is finally exported to required Sources file, thereby improved development efficiency and accuracy rate, reduced cost of development simultaneously.
Automatic generation method according to the OBD variable-definition source file of the embodiment of the present invention, can generate the source code file that OBD module contents is relevant automatically by software, has saved human cost, shorten the construction cycle, improve development efficiency, also reduced error rate simultaneously, improved development quality.In addition, the embodiment of the present invention is applicable to different development platforms, after it can being revised a little, migrates in different development platforms and uses, and therefore also has advantages of that portability is high, universality is high.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or feature can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: in the situation that not departing from principle of the present invention and aim, can carry out multiple variation, modification, replacement and modification to these embodiment, scope of the present invention is by claim and be equal to and limit.

Claims (9)

1. an automatic generation method for OBD variable-definition source file, is characterized in that, comprises the following steps:
Obtain a plurality of OBD variablees, wherein, described OBD variable comprises name variable and a plurality of attribute field;
Described a plurality of OBD variablees are write in default file;
Described default file is resolved, to organize design variables according to the title of each OBD variable, at least a portion attribute field and a plurality of initial OBD variable-definition file generated respectively, and generate corresponding a plurality of arrays according to described many group design variables more;
Respectively the content in described a plurality of arrays is write in corresponding initial OBD variable-definition file to generate a plurality of OBD variable-definition source files.
2. method according to claim 1, it is characterized in that, described a plurality of initial OBD variable-definition files comprise: obd_const.h source file, obd_data.h source file, obd_table.h source file, obd_externals.h source file, obd_config.h source file and obd.a2l source file.
3. method according to claim 2, is characterized in that, the generation of described obd_externals.h source file, further comprises:
Obtain the name variable of the OBD variable in described default file;
According to described name variable, generate external related content and write in the first array;
According to described the first array, generate described obd_externals.h source file.
4. method according to claim 2, is characterized in that, the generation of described obd_const.h source file, further comprises:
Obtain the default attribute field group of the OBD variable in described default file;
Respectively described name variable and other field combination of two are generated to new name variable;
According to default attribute corresponding to attribute field, carry out assignment and write in the second array;
According to described the second array, generate described obd_const.h source file.
5. method according to claim 2, is characterized in that, the generation of described obd_table.h source file, further comprises:
Obtain the name variable of the OBD variable in described default file;
According to described name variable, generate table related content and write in described the 3rd array;
According to described the 3rd array, generate described obd_table.h source file.
6. method according to claim 2, is characterized in that, the generation of described obd_data.h source file, further comprises:
Obtain the name variable of the OBD variable in described default file;
According to described name variable, generate data related content and write in described the 4th array;
According to described the 4th array, generate described obd_data.h source file.
7. method according to claim 2, is characterized in that, the generation of described obd_config.h source file, further comprises:
Obtain the name variable of the OBD variable in described default file;
According to name variable, generate config related content and write in the 5th array;
According to described the 5th array, generate described obd_config.h source file.
8. method according to claim 2, is characterized in that, the generation of described obd.a2l source file, further comprises:
Obtain the name variable of the OBD variable in described default file;
According to name variable, generate a2l related content and write in the 6th array;
According to described the 6th array, generate described obd.a2l source file.
9. the method for claim 1, is characterized in that, also comprises:
If read the end identifier in described default file, stop.
CN201310123857.8A 2013-04-10 2013-04-10 A kind of automatic generation method of OBD variable-definitions source file Expired - Fee Related CN104102479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310123857.8A CN104102479B (en) 2013-04-10 2013-04-10 A kind of automatic generation method of OBD variable-definitions source file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310123857.8A CN104102479B (en) 2013-04-10 2013-04-10 A kind of automatic generation method of OBD variable-definitions source file

Publications (2)

Publication Number Publication Date
CN104102479A true CN104102479A (en) 2014-10-15
CN104102479B CN104102479B (en) 2017-09-15

Family

ID=51670659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310123857.8A Expired - Fee Related CN104102479B (en) 2013-04-10 2013-04-10 A kind of automatic generation method of OBD variable-definitions source file

Country Status (1)

Country Link
CN (1) CN104102479B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682869A (en) * 2015-11-05 2017-05-17 财团法人资讯工业策进会 Variable definition changing device and method for flow model integration system
CN108733674A (en) * 2017-04-14 2018-11-02 宁德时代新能源科技股份有限公司 A2L file merging method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020059348A1 (en) * 2000-11-14 2002-05-16 Cypress Semiconductor Corp. Automatic documentation generation tool and associated method
WO2004081698A2 (en) * 2003-03-14 2004-09-23 Beach Solutions Limited Database tools
CN102541521A (en) * 2010-12-17 2012-07-04 ***股份有限公司 Automatic operating instruction generating device based on structured query language and method
CN102722372A (en) * 2012-05-25 2012-10-10 上海学智科技有限公司 Method and system for automatically generating codes through classification and configuration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020059348A1 (en) * 2000-11-14 2002-05-16 Cypress Semiconductor Corp. Automatic documentation generation tool and associated method
WO2004081698A2 (en) * 2003-03-14 2004-09-23 Beach Solutions Limited Database tools
CN102541521A (en) * 2010-12-17 2012-07-04 ***股份有限公司 Automatic operating instruction generating device based on structured query language and method
CN102722372A (en) * 2012-05-25 2012-10-10 上海学智科技有限公司 Method and system for automatically generating codes through classification and configuration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
POE, O.C.: "《Beginning Perl》", 31 December 2012, WILEY PUBLISHING *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682869A (en) * 2015-11-05 2017-05-17 财团法人资讯工业策进会 Variable definition changing device and method for flow model integration system
CN108733674A (en) * 2017-04-14 2018-11-02 宁德时代新能源科技股份有限公司 A2L file merging method and device
CN108733674B (en) * 2017-04-14 2021-10-08 宁德时代新能源科技股份有限公司 A2L file merging method and device

Also Published As

Publication number Publication date
CN104102479B (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN100440092C (en) Quality control system for manufacturing industrial products
CN106445795A (en) Method and device for detecting efficiency of database SQL
CN109634847A (en) Embedded product automated testing method and system
Tahvili et al. Functional dependency detection for integration test cases
DE102009055231A1 (en) Measuring system for determining a value of a physical or chemical measured variable of a medium and method for operating the measuring system
CN109754216A (en) Data processing method and device for industrial part production management
CN115617628A (en) Digital twin system, research and development method, equipment and storage medium
Sayer The anatomy of an excellent review paper
CN103064787A (en) Embedded assembly modeling and testing method based on expansion interface automata model
CN104102479A (en) Automatic generation method of OBD (On Board Diagnostic) variable definition source files
CN105547325A (en) K mean value cluster-based optical fiber inertial measurement unit temperature model coefficient determination method
DE102011011951A1 (en) Requirement-driven feature development process
Huang et al. A Novel Autoregressive Rainflow—Integrated Moving Average Modeling Method for the Accurate State of Health Prediction of Lithium-Ion Batteries
KR102093281B1 (en) Processing method of process data of smart factory
Jałowiecki et al. The methods of knowledge acquisition in the product lifecycle for a generative model's creation process
CN102799584A (en) Processing method for screening and extraction of output data of detection instrument
CN104715095B (en) A kind of method of graphical clock quality detection and analysis
CN107615188A (en) Control logic illustrates analysis apparatus and control logic figure analytic method
CN104765024A (en) Onboard radar jamming automatic detection system
CN104615535B (en) Method and device for generating test case based on extended data flow model
CN117235489A (en) Graph variation self-coding feature extraction method for multi-source monitoring data of transmission system
CN114838932A (en) Slow time-varying weak fault diagnosis method for RV reducer
CN101571797A (en) System and method for generating automatic test case
Schilling et al. FAIR and Structured Data: A Domain Ontology Aligned with Standard‐Compliant Tensile Testing
Xiao et al. An Efficient Teaching Model of International Cooperation Based on Artificial Intelligence

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180419

Address after: No. 188, Miyun District, Miyun District, Beijing, Beijing

Patentee after: Beijing treasure Car Co.,Ltd.

Address before: 102206 Changping District City, Shahe, Sha Yang Road, Beijing

Patentee before: BEIQI FOTON MOTOR Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170915