CN104503767A - System and method for automatically generating codes based on LIN protocol - Google Patents

System and method for automatically generating codes based on LIN protocol Download PDF

Info

Publication number
CN104503767A
CN104503767A CN201410853108.5A CN201410853108A CN104503767A CN 104503767 A CN104503767 A CN 104503767A CN 201410853108 A CN201410853108 A CN 201410853108A CN 104503767 A CN104503767 A CN 104503767A
Authority
CN
China
Prior art keywords
ldf
lin
file
database
standard database
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.)
Pending
Application number
CN201410853108.5A
Other languages
Chinese (zh)
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.)
Atech Automotive Wuhu Co Ltd
Original Assignee
Atech Automotive Wuhu 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 Atech Automotive Wuhu Co Ltd filed Critical Atech Automotive Wuhu Co Ltd
Priority to CN201410853108.5A priority Critical patent/CN104503767A/en
Publication of CN104503767A publication Critical patent/CN104503767A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention relates to a system and a method for automatically generating codes based on an LIN protocol. The system comprises an LDF file, an LDF file parser and a standard database; the LDF file comprises LIN communication parameter information; the LDF file is imported into the LDF file parser for parsing to generate corresponding databases; the LDF file parser communicates with the standard database. The standard database comprises a physical layer function set and an application layer function set; the physical layer function set of the standard database is a data transmitting/receiving functional function set written by UART/SCI interfaces universal to MCUs; the application layer function set of the standard database comprises an interface function and a network sleep awakening interface function both read and written according to LIN signals. According to the system and the method for automatically generating codes based on the LIN protocol, the development of software codes can be finished at high efficiency and high quality within short time, an automatic development mode is provided for the development of LIN software modules and the development efficiency of product software is improved.

Description

Based on the Code automatic build system and method for LIN agreement
Technical field
The invention belongs to automotive electronics LIN field of network communication, disclose a kind of method that the LDF of utilization file generates LIN bitcom code automatically.
Background technology
The software development of current automobile electronics is gradually to modularization, standardization, integrated, automation development.LIN communication module software, in different projects, customer demand (LDF file) is all different, all needs again to develop, the serious time cycle constraining product development and stability at every turn.The present invention generates LIN bitcom code automatically by LDF file, not only increases software development efficiency, also assures that reliability and the uniqueness of software.The exploitation of current LIN software function module, all need software engineer's stand-alone development physical layer functions collection and application layer collection of functions, artificial extraction is also needed for the information in LDF file and is transformed in code, very large drawback is existed for this kind of development mode: first, in physical layer functions collection and application layer collection of functions, part public in a large number is all contained for different projects, and different people is not quite similar on function name sum functions functional regional division, this just causes the significant wastage in resource.Set up a standard database in this invention, include physical layer functions collection and application layer collection of functions, because LIN hardware implementing is substantially all based on the general UART/SCI interface of MCU, can be write as general standard physical layer collection of functions, and application layer collection of functions can be write as standard completely.Secondly, when LDF fileinfo extracts, artificial extraction consumption energy consuming time, and inevitably because human factor can lead to errors, so the debugging cycle in later stage can be caused undoubtedly elongated, and simultaneously different project LDF files is also different, all needs artificial information extraction each time.
Summary of the invention
For above the deficiencies in the prior art, the invention provides a kind of Code automatic build system and method based on LIN agreement, by host computer instrument " LDF document parser ", directly import LDF file generation software code, take leave of the loaded down with trivial details and risk of artificial information extraction, one-touchly automatically to complete, realize automation and intelligentification completely.
To achieve these goals, technical scheme provided by the invention is a kind of Code automatic build system based on LIN agreement, this system comprises LDF file, LDF document parser and standard database, described LDF file comprises the parameter information of LIN communication, described LDF document parser imports LDF file and carries out the corresponding database of parsing generation, and described LDF document parser and standard database carry out communication.Described standard database comprises physical layer functions collection and application layer collection of functions, the data transmit-receive power function collection that the physical layer functions collection of described standard database is write for the general UART/SCI interface of MCU; The interface function that the application layer collection of functions of described standard database is read and write according to LIN signal and network sleep wake interface function up.The physical layer functions collection of described standard database needs to modify to the register of LDF document parser for the MCU of different model.The database of described LDF document parser comprises macro definition and the constant array of LIN signal, and described constant array comprises schedule information and id information.
Based on a code automatic generation method for LIN agreement, the method comprises the following steps: step one, LDF file import LDF document parser; Step 2, LDF document parser, generate the database corresponding with LDF file; The physical layer functions collection of step 3, standard database and application layer collection of functions generate operation and the periodic scheduling of the information realization LIN network in the database corresponding with LDF file in constant array in conjunction with LDF document parser; Step 4, according to the suction parameter of the signal macro definition in database as function, realize the read-write capability to LIN signal, LIN network sleep awakening operation with multiple dispatch list between switching; Step 5, LDF document parser generate the database corresponding with LDF file, standard database compiles and links, the automatic generation of code together with system source file.LIN signal in the database that LDF is corresponding grand, the corresponding hexadecimal digit information of macro definition of each signal, represents this signal position residing in signal list and length.In described step 2, for the LDF file of Different L IN functional requirement design, LDF document parser parses the corresponding database of different LDF files.
The invention has the advantages that: this invention is mainly used in the software development of the automobile electronics being with LIN communication function, according to the Different L DF file that client provides, can the exploitation completing software code of high-effect high-quality in the short time, exploitation for LIN software module provides the development mode of robotization, improves product software development efficiency.
Accompanying drawing explanation
Mark in the content expressed every width accompanying drawing in instructions of the present invention below and figure is briefly described:
Fig. 1 is the system flowchart of the specific embodiment of the invention 1.
Embodiment
Contrast accompanying drawing below, by the description to embodiment, the specific embodiment of the present invention is as the effect of the mutual alignment between the shape of involved each component, structure, each several part and annexation, each several part and principle of work, manufacturing process and operation using method etc., be described in further detail, have more complete, accurate and deep understanding to help those skilled in the art to inventive concept of the present invention, technical scheme.
A kind of Code automatic build system based on LIN agreement, this system comprises LDF file, LDF document parser and standard database, described LDF file comprises the parameter information of LIN communication, described LDF document parser imports LDF file and carries out the corresponding database of parsing generation, and described LDF document parser and standard database carry out communication.Described standard database comprises physical layer functions collection and application layer collection of functions, the data transmit-receive power function collection that the physical layer functions collection of described standard database is write for the general UART/SCI interface of MCU; The interface function that the application layer collection of functions of described standard database is read and write according to LIN signal and network sleep wake interface function up.The physical layer functions collection of described standard database needs to modify to the register of LDF document parser for the MCU of different model.The database of described LDF document parser comprises macro definition and the constant array of LIN signal, and described constant array comprises schedule information and id information.
As shown in Figure 1, a kind of code automatic generation method based on LIN agreement, the method comprises the following steps: step one, LDF file import LDF document parser; Step 2, LDF document parser, generate the database corresponding with LDF file; The physical layer functions collection of step 3, standard database and application layer collection of functions generate operation and the periodic scheduling of the information realization LIN network in the database corresponding with LDF file in constant array in conjunction with LDF document parser; Step 4, according to the suction parameter of the signal macro definition in database as function, realize the read-write capability to LIN signal, LIN network sleep awakening operation with multiple dispatch list between switching; Step 5, LDF document parser generate the database corresponding with LDF file, standard database compiles and links, the automatic generation of code together with system source file.LIN signal in the database that LDF is corresponding grand, the corresponding hexadecimal digit information of macro definition of each signal, represents this signal position residing in signal list and length.In described step 2, for the LDF file of Different L IN functional requirement design, LDF document parser parses the corresponding database of different LDF files
Embodiment 1:
A kind of method realizing LDF file automatic generating software code, mainly comprise LDF file, " LDF document parser " and standard database three parts, LDF file is imported " LDF document parser " and generates corresponding program source code, compiling link together with other codes of standard database and system, realizes customization LIN bitcom module.Wherein " LDF document parser " is a host computer instrument, needs self-developing, and specific implementation function is resolved in LDF file the information parameter of LIN net definitions, presents, be embedded in whole system software with the form of source code.
1. realize the method for LDF file automatic generating software code, the content of needs comprises LDF file, " LDF document parser " and standard database.It is characterized in that: the robotization of LIN module software design and standardization, host computer instrument " LDF document parser " and standard database are combined, only need import LDF file and get final product automatic generating software code, carry out compiling link again, complete software development, carry out substantial code without the need to software engineer to write, full intellectualized rapid.2. as required, the LDF file as described in 1 is LIN description document, is a kind of normative document defined in LIN agreement, contains the parameter information that LIN communication is all in this file.Client can according to the corresponding LDF file of product development requirement definition, and this LDF file is then an important input as software development.3. as required " the LDF document parser " as described in 1, be according to LDF file syntax rule, the host computer instrument designed, it can import LDF file and carry out the corresponding database of parsing generation.Include information all in LDF file with the form of code in database, these information become the part in whole system software, inquire about and call for other software modules.4. as required the standard database as described in 1, the collection of functions and the application layer collection of functions that contain LIN Physical layer, these collections of functions are the fixing of standard, in conjunction with the database of LDF file generated, can realize upper layer application to the bookkeeping of LIN network and Card read/write.LDF file.Host computer instrument, " LDF document parser ".LDF document analysis can be become the database of source code form, be defined as file " LIN CFGs ".Contain macro definition and a constant array of all LIN signals in this database, in array, define the information of dispatch list and all ID.Standard database.This software library comprises physical layer software and application layer software, physical layer software is according to LIN protocol data frame format, for the data transmit-receive power function collection that the general UART/SCI interface of MCU is write, during MCU for different model, need slightly to make an amendment at register definitions place; Application layer software is the middle layer for connecting upper strata and Physical layer, and the interface function and the network sleep that provide the read-write of LIN signal wake interface function up.Be defined as file " LIN APIs ".
First 1. 2. LDF document parser will be imported by LDF file, generate 3. file " LIN CFGs ", define the grand of all LIN signals in this file, the corresponding hexadecimal digit information of macro definition of each signal, represents this signal position residing in signal list and length; Also define a constant array simultaneously, contain information and the schedule information of all ID.4. physical layer functions and application layer function is had in file " LIN APIs ", wherein physical layer functions can in conjunction with the operation of the information realization LIN network in constant array in 3. file " LINCFGs " and periodic scheduling, application layer function is then available to the interface function that upper strata uses, by the signal macro definition in 3. file " LIN CFGs " as the suction parameter of function to realize the read-write capability to LIN signal, the switching between the sleep awakening operation of LIN network and multiple dispatch list can also be realized.
Then will 3. file " LIN CFGs ", 4. file " LIN APIs " and 5. other source files of system 6. compile & together and link, the complete software with LIN functional module can be realized.
Can find out from the step realized and to develop for different LIN functional requirements, just LDF file is different, thus content in causing 3. file " LIN CFGs " is different, and 4. file " LIN APIs " is constant substantially, so most important link is 2. LDF document parser when developing LIN functional software, the exploitation of this host computer instrument need by means of visual development platforms such as VB/VC, relate to and how LDF file is resolved, thus the function in mating 4. file " LIN APIs ".
Above by reference to the accompanying drawings to invention has been exemplary description; obvious specific implementation of the present invention is not subject to the restrictions described above; as long as have employed the improvement of the various unsubstantialities that method of the present invention is conceived and technical scheme is carried out; or design of the present invention and technical scheme directly applied to other occasion, all within protection scope of the present invention without to improve.

Claims (7)

1. the Code automatic build system based on LIN agreement, it is characterized in that: this system comprises LDF file, LDF document parser and standard database, described LDF file comprises the parameter information of LIN communication, described LDF document parser imports LDF file and carries out the corresponding database of parsing generation, and described LDF document parser and standard database carry out communication.
2. Code automatic build system according to claim 1, it is characterized in that: described standard database comprises physical layer functions collection and application layer collection of functions, the data transmit-receive power function collection that the physical layer functions collection of described standard database is write for the general UART/SCI interface of MCU; The interface function that the application layer collection of functions of described standard database is read and write according to LIN signal and network sleep wake interface function up.
3. Code automatic build system according to claim 2, is characterized in that: the physical layer functions collection of described standard database needs to modify to the register of LDF document parser for the MCU of different model.
4. Code automatic build system according to claim 1, is characterized in that: the database of described LDF document parser comprises macro definition and the constant array of LIN signal, and described constant array comprises schedule information and id information.
5. a kind of code automatic generation method based on LIN agreement according to Claims 1-4 any one, it is characterized in that, the method comprises the following steps:
Step one, LDF file import LDF document parser;
Step 2, LDF document parser, generate the database corresponding with LDF file;
The physical layer functions collection of step 3, standard database and application layer collection of functions generate operation and the periodic scheduling of the information realization LIN network in the database corresponding with LDF file in constant array in conjunction with LDF document parser;
Step 4, according to the suction parameter of the signal macro definition in database as function, realize the read-write capability to LIN signal, LIN network sleep awakening operation with multiple dispatch list between switching;
Step 5, LDF document parser generate the database corresponding with LDF file, standard database compiles and links, the automatic generation of code together with system source file.
6. volume code automatic generation method according to claim 5, it is characterized in that: the LIN signal in the database that LDF is corresponding grand, the corresponding hexadecimal digit information of macro definition of each signal, represents this signal position residing in signal list and length.
7. volume code automatic generation method according to claim 5, is characterized in that: in described step 2, and for the LDF file of Different L IN functional requirement design, LDF document parser parses the corresponding database of different LDF files.
CN201410853108.5A 2014-12-31 2014-12-31 System and method for automatically generating codes based on LIN protocol Pending CN104503767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410853108.5A CN104503767A (en) 2014-12-31 2014-12-31 System and method for automatically generating codes based on LIN protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410853108.5A CN104503767A (en) 2014-12-31 2014-12-31 System and method for automatically generating codes based on LIN protocol

Publications (1)

Publication Number Publication Date
CN104503767A true CN104503767A (en) 2015-04-08

Family

ID=52945168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410853108.5A Pending CN104503767A (en) 2014-12-31 2014-12-31 System and method for automatically generating codes based on LIN protocol

Country Status (1)

Country Link
CN (1) CN104503767A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242597A (en) * 2015-09-29 2016-01-13 中国科学院光电技术研究所 Automatic generation method of embedded controller debugging interface
CN108829379A (en) * 2018-05-31 2018-11-16 天津大学 A kind of more hardware interface communications protocol software on-demand automatic generation methods
CN114201229A (en) * 2021-11-04 2022-03-18 智新控制系统有限公司 LIN configuration code automatic generation method, system and computer readable storage medium
CN114422627A (en) * 2022-01-31 2022-04-29 重庆长安汽车股份有限公司 BLF data reading and writing and CAN message translation method based on CANoe dynamic link library
CN115664980A (en) * 2022-12-09 2023-01-31 长沙科梁科技有限公司 Simulation model generation method, simulation method, storage medium, and terminal device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063298A (en) * 2010-12-10 2011-05-18 电子科技大学 Automobile electronic controller-oriented runtime environment generation system and method
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method
CN103019742A (en) * 2012-12-31 2013-04-03 清华大学 Method for generating automatic codes on multiple DSP (Digital Signal Processor) platform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063298A (en) * 2010-12-10 2011-05-18 电子科技大学 Automobile electronic controller-oriented runtime environment generation system and method
CN102622470A (en) * 2012-02-21 2012-08-01 重庆邮电大学 General car code conversion method
CN103019742A (en) * 2012-12-31 2013-04-03 清华大学 Method for generating automatic codes on multiple DSP (Digital Signal Processor) platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
彭晓珊 等: "基于网络描述文件的LIN总线自动测试系统", 《自动化与仪表》 *
舒泽芳 等: "基于网络描述文件的新型LIN总线电动车窗设计", 《机电工程技术》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242597A (en) * 2015-09-29 2016-01-13 中国科学院光电技术研究所 Automatic generation method of embedded controller debugging interface
CN108829379A (en) * 2018-05-31 2018-11-16 天津大学 A kind of more hardware interface communications protocol software on-demand automatic generation methods
CN114201229A (en) * 2021-11-04 2022-03-18 智新控制系统有限公司 LIN configuration code automatic generation method, system and computer readable storage medium
CN114201229B (en) * 2021-11-04 2024-04-05 智新控制系统有限公司 LIN configuration code automatic generation method, system and computer readable storage medium
CN114422627A (en) * 2022-01-31 2022-04-29 重庆长安汽车股份有限公司 BLF data reading and writing and CAN message translation method based on CANoe dynamic link library
CN114422627B (en) * 2022-01-31 2023-06-27 重庆长安汽车股份有限公司 BLF data read-write and CAN message translation method based on CANoe dynamic link library
CN115664980A (en) * 2022-12-09 2023-01-31 长沙科梁科技有限公司 Simulation model generation method, simulation method, storage medium, and terminal device

Similar Documents

Publication Publication Date Title
CN108038294B (en) UVM environment building method and system
CN108121542B (en) MyBatis-based SQL statement configuration method and system
CN104503767A (en) System and method for automatically generating codes based on LIN protocol
CN104657245B (en) The automatically generating device of module level UVM verification platform based on AMBA bus
US20080244541A1 (en) Code translator and method of automatically translating modeling language code to hardware language code
CN101996131A (en) Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
US10120660B2 (en) Systems and methods for producing launchers for a mobile terminal
WO2023035563A1 (en) Applet cross-application migration method, device, terminal, system and storage medium
CN105912334A (en) Internal behavior object code generation method of AUTOSAR software assembly
KR20160063990A (en) COMPUTER-EXECUTABLE MODEL reverse engineering mETHOD AND APPARATUS PERFORMING THE SAME
CN115392176B (en) SoC chip top module integrated design method and system
CN102480467A (en) SOC (System on a Chip) software and hardware collaborative simulation verification method based on network communication protocol
CN111767217A (en) JS unit test case generation method and device
CN114064601B (en) Storage process conversion method, device, equipment and storage medium
CN114780100B (en) Compiling method, electronic device and storage medium
CN114707444B (en) Method for compiling verification system, electronic device and storage medium
CN102096729A (en) Automotive electronics oriented virtual functional bus designer
CN109542438A (en) One kind being based on visual chart development approach
CN103793458B (en) Method for nondestructively converting AADL (architecture analysis and design language) into XML (extensible markup language)
CN103677819A (en) Method and device for achieving code forward engineering based on OSGI
CN102231132B (en) Method for generating simulation test example of AADL (Architecture Analysis and Design Language) software component model based on SystemC
CN112130849B (en) Code automatic generation method and device
CN103051728A (en) Remote-procedure calling method
CN106681703A (en) Reusable interface component construction system and reusable interface component construction method
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150408

RJ01 Rejection of invention patent application after publication