CN104331292B - A configuration generation method for protocol conversion of Internet of Vehicles middleware - Google Patents
A configuration generation method for protocol conversion of Internet of Vehicles middleware Download PDFInfo
- Publication number
- CN104331292B CN104331292B CN201410619292.7A CN201410619292A CN104331292B CN 104331292 B CN104331292 B CN 104331292B CN 201410619292 A CN201410619292 A CN 201410619292A CN 104331292 B CN104331292 B CN 104331292B
- Authority
- CN
- China
- Prior art keywords
- configuration
- protocol
- file
- code
- protocol conversion
- 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.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 102
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000006855 networking Effects 0.000 claims abstract description 51
- 238000004891 communication Methods 0.000 claims abstract description 44
- 238000005516 engineering process Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 6
- 238000006073 displacement reaction Methods 0.000 claims description 3
- 238000003672 processing method Methods 0.000 claims description 3
- 230000008676 import Effects 0.000 claims description 2
- 230000004927 fusion Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 31
- 238000013507 mapping Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 14
- 238000011161 development Methods 0.000 description 10
- 238000004458 analytical method Methods 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 238000007667 floating Methods 0.000 description 4
- 230000014509 gene expression Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 241000208340 Araliaceae Species 0.000 description 2
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 2
- 235000003140 Panax quinquefolius Nutrition 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 235000008434 ginseng Nutrition 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000008521 reorganization Effects 0.000 description 2
- 241000196324 Embryophyta Species 0.000 description 1
- 230000000712 assembly Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a kind of configuration generating methods of car networking middleware protocols conversion, the quick exploitation of protocol conversion module is realized in this method configuration, by reading the DBC file description information write according to car networking communication protocol, vehicle is added in configuration tool looks forward to communication Protocol Conversion parameter, configuration information is stored in database, automatically generates car networking middleware protocols conversion module code using protocol conversion template file.Rapid fusion vehicle body network realizes car networking communication in other networks.Configuration tool of the present invention can automatically generate configuration file and application framework, and carry out error checking to the configuration of user, avoid the intervention of worker as far as possible, reduce error rate, so as to energetically improve the stability of protocol conversion module.
Description
Technical field
The invention belongs to vehicle networking technical fields, are related to a kind of configuration generating method of car networking middleware protocols conversion.
Background technique
Car networking is that following Internet of Things gives priority to one of object, we can pass through vehicle-mounted terminal equipment and realize joy
Some hand-held intelligent functions of the equipments such as find pleasure in, make a phone call.Meanwhile we can also remotely understanding vehicle be each in real time by wireless network
The working condition of a component, vehicle location, in-vehicle device program the functions such as long-range update.Truck traffic, vehicle can also be passed through
The real-time statistics and analysis of vehicle location are realized in road communication, provide real time data for traffic scheduling and active safety systems of vehicles.
Therefore, car-mounted terminal application program, not only comprising and some general utility functions, also bring new application demand.Vehicle intelligent is whole
The important component as car networking is held, it is the bridge of vehicle and other network connections, is needed and in-vehicle network and vehicle outer net
Network carries out information exchange.Meanwhile the following car-mounted terminal not only includes fixed equipment, further includes handheld device.With car networking
The development of technology, the rear terminal that fills can be replaced directly using handheld terminal, such as mobile phone, tablet computer, and these equipment are adopted
With different software platforms.Meanwhile the important carrier of car networking --- automobile is but because of the difference of producer, In-vehicle networking communication protocols
There are difference, the car networking intelligent terminal currently researched and developed substantially is relied on assembly plant and is customized view, difference enterprise
The car networking terminal of industry is non-interchangeable.The exchange of car networking terminal, same platform software it is shared be that car networking develops
Inexorable trend.
With the application and development of car networking, in order to reduce development cost, the exchange of equipment and software is inevitable trend.By
Formula equipment is usually embedded in the car networking application function of car-mounted terminal not have, and is needed vehicle body network, vehicle is dedicated short
The net connections such as range communication network DSRC (Dedicated Short Range Communications), 2G/3G are to together
Common transport car networking information.Meanwhile board information terminal passes through the same letter of network transmission for the different systems being attached thereto
Breath, these information are indistinguishable for car-mounted terminal.
In car networking framework, terminal needs and vehicle body network, in-vehicle network equipment, the information terminal of neighbouring vehicle, road
It lateral terminal equipment and is communicated with car networking service centre to realize the functions such as vehicle vehicle/bus or train route collaboration, vehicle intelligent information
Terminal needs to provide a variety of and these network communications application services.The transmission of these information mainly passes through 3G mobile communication, short
The interaction of information is realized apart from private radio communication (DSRC), Bluetooth communication, WIFI communication, Vehicle Body Bus etc..
In order to solve the interaction of information of vehicles in car networking, it is necessary to these network integrations be got up, be jointly information of vehicles
Interactive service.In these communication networks, the networking mode of different networks is different, the data format and access mode of transmitting
All different, the message format of different vehicle enterprise design is also variant, belongs to heterogeneous network.It is other in addition to vehicle body network
Communication network is all general.These networks, unified car networking information communication mode and message format are effectively merged, rule are provided
The access interface of model is current car networking application and development problem to be solved.In order to make full use of existing equipment, enhancing vehicle connection
Net application software is shared, and middleware Technology is that a kind of compatible and portability is stronger, without changing making for existing user
With the technology of habit and equipment.
In the development process of middleware, middleware messaging bus plays the work of various assemblies information exchange high-speed channel
With the communication protocol on messaging bus between each component of carry is the custom protocol suitable for car networking middleware.It will
Body information is fused to middleware messaging bus, needs to obtain vehicle body network information, and then needs to realize vehicle CAN communication protocol
With the protocol conversion function of car networking middleware messaging bus.And vehicle CAN agreement is different for different vehicles enterprise, is depot
Technological core, it is general not open.
Existing protocol conversion is that middle unit development personnel are real by manual coding on the basis of understanding vehicle CAN agreement
Existing, i.e., vehicle enterprise need to disclose vehicle body network agreement, exist and be unfavorable for protecting vehicle enterprise intellectual property, and manual coding is inefficient and respectively
Realize the disadvantages of versatility is bad.Existing development scheme is not suitable for the development and application of middleware.So to realize car networking
The fusion of information, the conversion of agreement, it is necessary to seek one kind can protect vehicle enterprise knowledge property right and improve development efficiency and
The method of protocol conversion module versatility.
Summary of the invention
In order to overcome defect existing in the prior art, the present invention provides a kind of configuration of car networking middleware protocols conversion
The quick exploitation of protocol conversion module is realized in generation method, configuration, by reading the DBC text write according to car networking communication protocol
Part description information adds vehicle in configuration tool and looks forward to communication Protocol Conversion parameter, i.e., the agreement that DBC file describes passed through figure
Interface configurations are mapped to uniformly making by oneself under middleware NGTP (Next Generation Telematics Protocol) frame
Configuration information is stored in database by adopted agreement, using protocol conversion template file in real time workshop technology JET (Java
Emitter Templates) auxiliary under automatically generate car networking middleware protocols conversion module code.Rapid fusion vehicle body net
Network realizes car networking communication in other networks.Its technical solution is as follows:
A kind of configuration generating method of car networking middleware protocols conversion, comprising the following steps:
(1) DBC file record communication protocol information is used;
(2) translation-protocol parameter configuration is carried out by the configuration tool of graphical interfaces, and stores information in data library text
In part;
(3) middleware communication protocol conversion code is automatically generated by Code automatic build technology.
Parsing and the database purchase of file DBC file are described preferably for vehicle body application protocol.
Preferably, the communication protocol description configuration and storage specifically: DBC file, configuration are read in configuration tool
Configuration information is stored in database file afterwards, the format according to middleware standard agreement is standard, and configuration is generated and passed to
The protocol conversion mapping parameters of protocol conversion template file.
Preferably, using real time workshop technology, the code of protocol conversion is ultimately produced, do not need to change by hand
In the case of, communication component is generated after compiling, is used for car networking middleware communication.
Compared with prior art, beneficial effects of the present invention:
1) threshold of exploitation is reduced;
User, which does not need to spend a lot of time and energy, is familiar with middleware and middleware messaging bus agreement, it is only necessary in newly-built engineering
Mapping relations one by one between middle importing and configuration protocol.
2) intellectual property of protection vehicle enterprise;
For middleware for the communication between vehicle body network, it is the core for shielding different vehicle body networks.Pass through the mould
Block realizes the conversion between vehicle body communication protocol and standard traffic message format, is supplied to apply and normally lead to vehicle body network
Letter.The part is looked forward to automatically generating object code by configuration tool configuration according to middleware protocols standard by vehicle, protection vehicle enterprise
Intellectual property.
3) stability is improved;
Configuration tool can automatically generate configuration file and application framework, and carry out wrong inspection to the configuration of user
It looks into, avoids the intervention of worker as far as possible, reduce error rate, so as to energetically improve the stability of protocol conversion module.
4) code transplantability and versatility between different platform are generated;
On the one hand, protocol conversion module and bottom layer driving module use unified function interface, for unused bottom CAN
Interface platform only needs to replace different driving interfaces;On the other hand, protocol conversion template code is described using C language, is applicable in
Class unix platform and Android platform.
Detailed description of the invention
Fig. 1 protocol conversion implementation flow chart;
Fig. 2 protocol conversion illustraton of model;
Fig. 3 protocol conversion mapping graph;
Fig. 4 configuration tool block diagram;
Fig. 5 protocol configuration flow chart;
Fig. 6 protocol conversion template file flow chart;
Fig. 7 protocol conversion template UML sequence chart;
Fig. 8 Code automatic build figure;
Specific embodiment
Technical solution of the present invention is further illustrated combined with specific embodiments below.
The structure of protocol conversion implementation flow chart is as shown in Figure 1, vehicle enterprise is defeated to agreement progress by the parsing of DBC file
Enter, form the database of variable, the use of database for convenience of protocol information conditional search and secondary importing.Data item includes
The information of description input has an ID of CAN, start bit, stop bits, offset, and a series of accurate description agreements such as scale factor become
The information of amount.Messaging bus document of agreement is the file for describing car networking middleware messaging bus communication protocol.
Processing method module will configure gained information and analyze, including variable match, displacement, and search operation obtains generation
The input parameter of code mask, passes to Code Template file.
Code Template file is automatically generated under the auxiliary of configuration tool by input information and background protocol detailed rules
Protocol conversion code generates the communication component of protocol conversion, after compiling to replace different automobile types protocol conversion middleware
Component.Backup database and backup DBC file store configured protocol information description, are used for after being easily introduced into minor adjustment
The configuration of similar protocols conversion.
Protocol conversion input includes: that DBC file imports, configuration interface input, database file, protocol conversion template text
Part.The output of protocol conversion includes protocol conversion code and database file.
As described above, in terms of functions implementing the present invention include following four:
1) document analysis and storage;Using the handling function and regular expression of file in Eclipse to file content
Matching parses CAN application protocol DBC Common Profile, such as match " SG_FarLightOpen:2 | and 2@1+ (1,0) [0 | 0] " "
SG_FarLightOpen string name gets in vehicle CAN protocol information and controls information about high beam in Gateway ",
It is stored in database;Agreement describes the parsing of file and storage is to configure conversion for next step to prepare.
2) protocol conversion configuration mapping;Protocol conversion template parameter is generated, protocol conversion template is supplied to.In car networking
Between part messaging bus agreement be standard, the relationship of two kinds of agreements is mapped one by one according to the information of car networking demand, such as 1 institute of table
Show, for vehicle body CAN protocol data frame packet containing ID and DATA information, middleware protocols include function code, function subcode and data field letter
Breath carries out mapping and has reached to protocol message head, the specific position of data field, the purpose that variable is parsed.
The mapping of 1 agreement of table
| Vehicle body CAN protocol use-case | Mapping relations | Middleware protocols use-case |
| ID+DATA | <————> | Function code+function subcode+data field |
And the relationship mapped is that vehicle looks forward to itself by configuration tool by " name of the information " matching completion, to protect
The intellectual property of vehicle enterprise.
3) protocol conversion stencil design;Cumbersome degree is reduced, reliability is improved.Protocol conversion template includes protocol conversion mould
The block all information unrelated with specific agreement, contain data acquisition, and the classification processing of control is further comprised to CAN interface
Operation, to the realization code of the reception and transmission operation of middleware messaging bus interface;The creation code of receiving or sending thread is not for
The module of appearance does not need to change.The code for needing to change is realized in a template in the form of variable element, such as high beam is opened
Control code be different for different configurations, so its value code shows as following form, FFMask_State_
FarLight_open1=0x<%=elementList.get (0) .toString () %>.Variable right end is variable assignment,
Finally assignment is carried out using real time workshop.
4) real time workshop;Final agreement conversion be need code realize complete, by above-mentioned relation using configuration tool with
The mode that Code Template combines is realized, automatically generates middleware protocols conversion module code, JET using JET code generating method
The Code automatic build realized using replacement vchar method.
It realizes protocol conversion, needs first to establish protocol conversion model (Fig. 2), due to vehicle enterprise protocol knowledge property right protection etc.
Characteristic, car networking middleware protocols conversion module needs are realized in a manner of configuring, specifically mapping relations between configuration protocol
(Fig. 3), final protocol conversion are to implement specific configuration flow (Fig. 5) by configuration tool (Fig. 4) to obtain, protocol code
Finally automatically generating (Fig. 8) needs code conversion template file (Fig. 6) to obtain configuration parameters obtained generation.Code Template information
Processing timing is shown by protocol conversion template UML sequence chart (Fig. 7).
1) document analysis and storage
The parsing that agreement describes file analyzes the format group that will carry out 2 kinds of different agreements of protocol conversion in detail
At providing foundation for the conversion map relationship of agreement.
Referring to Fig. 1, wherein document analysis and storage
CAN application protocol DBC Common Profile is parsed, vehicle CAN protocol information is got, such as matches " SG_
FarLightOpen:2 | 2@1+ (1,0) [0 | 0] " " Gateway " this section of DBC the file information, it obtains as shown in table 2 below complete
The information of each data segment is described.Each data segment accurately describes the CAN protocol information an of node.
2 vehicle body CAN protocol use-case of table
| Nodename | ID | Start bit | Occupy position | Zoom factor | Big small end | It is minimum | It is maximum | Unit/value |
| High beam is opened | 7A0 | 2 | 2 | 1 | - | - | - | 0x11 |
| Left front tire pressure | 7A8 | 0 | 4 | 0.1 | s | 0 | 5 | Bar |
Car networking middleware messaging bus agreement is parsed, as shown in table 3, the transmission of control command mainly includes control function
Code, function subcode and data field.(integer, single-precision floating point, double precision are floating according to the processing method of agreement for the data field of analog quantity
Point) it is handled.
3 middleware protocols use-case of table
| Name of the information | Protocol function code | Function subcode | Protocol data domain |
| High beam is opened | 4001 | 0001 | 17 |
| Left front tire pressure | 4002 | 0005 | Data |
2) based on NGTP protocol conversion configuration mapping
The configuration of protocol conversion is mapped as the core of protocol conversion;The model for first setting up protocol conversion, in model
On the basis of be described in detail to protocol conversion specific field mapping relations and realization.Then the realization of specific mapping relations has been sketched
Tool, the simple structure of configuration tool and enterprise realize the flow chart of configuration mapping.
Referring to fig. 2, protocol conversion illustraton of model
The board information terminal of different vehicles can read the information of car body control module BCM by CAN interface, read
BCM information is converted to middleware communication protocol format by message conversion module, it is converted after information be sent to middleware and disappear
Bus is ceased, (main include mobile terminal application, vehicle enterprise Remote Terminals for Weather Servics, other service terminals to the application of most Zhongdao car networking
Car networking application program), message also can be transmitted to board information terminal in car networking application, passes through middleware protocols conversion module
Car body control module is handed down to after conversion.Background service is protocol conversion module to different agreement with the key that vehicle body can communicate
Mutual conversion.
The a part of protocol conversion module as car networking middleware, interface one end are vehicle body CAN bus, and the other end is
Middleware messaging bus.CAN communication bus network is connected on specific In-vehicle networking by CAN transceiver;Middleware message
Bus is a virtual bus, is connected to the various communication components and application component of middleware thereon, and each component passes through this void
Quasi- messaging bus is communicated.Wherein the description of CAN communication agreement is described using the CAN application protocol standard of Vector company
Method DBC file describes method;DBC file include node, variable start bit, stop position, range, offset etc. be enough to describe and
Analyze the Global Information of a CAN network.MATLAB and the CAN bus protocal analysis test software CANoe of mainstream etc. are supported
The file of such format.Middleware communication agreement uses next generation car networking agreement NGTP (Next Generation
Telematics Protocol) custom protocol under protocol frame.
Referring to Fig. 3, protocol conversion mapping graph;
Conversion map mainly includes the conversion on 2 directions, that is, sends and receive process.In transmission flow, middleware association
View distinguishes the message for being sent to different components by the parsing of function code and function subcode, such as function code in column right in the following table 4
4001 are sent to the message of vehicle body with the combination expression of function subcode 1001;Separately there is the combination of code 4001 and function subcode 2001 to indicate
It is sent to the message of engine.Then it is determined according to the information of data field and is sent to the specific component of vehicle sound, that is, determine the CAN sent
Specific set and the position in frame is reset in message.Data field 17 indicates that high beam control is opened in table 4, is mapped to vehicle body CAN
Agreement is that ID is 7A0, and the 0-1 of Section 1 of 8 bytes of data frame is to set 1.Receive the opposite process that process is transmission flow, root
The value of function code and data field is determined according to the parsing of the position state in 8 bytes of vehicle body CAN protocol ID and data frame.
4 agreement of table maps use-case (high beam)
| Vehicle body CAN protocol use-case | Mapping relations | Middleware protocols use-case |
| ID(7A0)+DATA(0x11) | <————> | Function code (4001)+function subcode (1001)+data field (17) |
Configuration tool structure chart referring to fig. 4
Configuration tool sheet contains document analysis module, views module, code life as a window application
At module and database operating modules.Document analysis module parses DBC file;Views module contains needed for configuration
View, browsing, edition function;The basis of code generation module is JET code generating method;Database operating modules utilize
The database manipulation class that Eclipse is provided is write SQL standard scripting language and is operated to data.
Referring to Fig. 5 protocol configuration flow chart
Vehicle enterprise completes the configuration of agreement according to protocol configuration flow chart, creates after starting configuration tool or importing one existing
Configuration information, describe in configuration tool to configure protocol information and select according to the CAN protocol of target vehicle corresponding
Protocol conversion Code Template file.The parameter of configuration contains the corresponding relationship of middleware protocols Yu vehicle body CAN protocol, corresponding
Relationship is matched by name variable.Such as the following table 5, configured with the entitled standard of the variable of middleware protocols defined.It is selecting
In the correspondence vehicle body CAN protocol of different middleware standard agreements, according to the agreement of the list item configuration vehicle body of regulation.
5 configuration item Verbose Listing of table
Check the correctness of configuration after the completion, including whether CAN beacon information is correct, whether CAN data information repeats, mould
Whether plate is correct.Check that the errorless rear real time workshop for clicking configuration tool, the code of generation are compiled under Target compiling environment
Translate generation protocol conversion module.Protocol conversion module is installed to realization car networking protocol conversion on board information terminal, is realized
Communicate two-way interactive.Wherein CAN receives and dispatches function and uses SocketCAN standard interface.
3) protocol conversion stencil design
Protocol conversion template file is the mother matrix of final code, and the whole codes for containing protocol conversion are realized, specific to wrap
Code skeleton file containing protocol conversion.It ensure that the correctness and reliability of final code.
Referring to Fig. 6 protocol conversion template file flow chart and Fig. 7 protocol conversion template UML sequence chart
The major function of template is exactly that specified message is obtained from CAN network, extracts useful part and is encapsulated as middleware mark
Quasiconfiguaration is sent to middleware messaging bus and opposite process and the control instruction that messaging bus is sent is converted to CAN report
Text formats.Wherein change data is carried out during transmitting-receiving, and it is inquiry that data are received for application program
Process, sending data is control process.
Information protocol-dependent in code is extracted to the parameter as template.The parameter of template passes through configuration tool
Configuration information is calculated.Protocol conversion template program flow chart as shown, main function be entire template program entrance,
Protocol conversion template program mainly includes the transmitting-receiving of message, i.e., mainly sends thread and receive_ comprising send_threadfun
Threadfun receiving thread, main task concentrate on the reception process of message, and receiving thread processing, which refers to, receives messaging bus
The message sended over, and then handled, including control message, query messages and emergency message, correspond respectively to institute in figure
The control flow shown, querying flow and urgent process.Template file, which is adopted, to be shown a C language, and dynamic link library is finally compiled as, with
Guarantee versatility and the replaceability in linux system and android system.
Since it is desired that obtaining vehicle body state to fill the shape of non-controlling position in this message in the calculating process of control flow
State, so containing the process of querying flow.Such as preceding 2 expressions vehicle window control bit in binary digit 0101, rear two expressions
High beam control bit, when controlling operation to high beam, preceding 2 vehicle window control bits are the non-controlling position that this CAN controls message,
It needs to keep original state, so needing to inquire original vehicle window control bit state before CAN control message is issued to bus.Ginseng
See Fig. 7 protocol conversion template UML sequence chart, typical case's control message calculation process is as follows:
(1) middleware messaging bus sends control command to communication component, and the major function of communication component is exactly that agreement turns
It changes.
(2) it parses, message is split according to the definition of background message, judge to need the control bit that controls, as high beam is opened, and
According to the mask that the obtained control mask of configuration is controlled, such as high beam _ open control code 0x0000000000000001 (standard
Data frame 64).
(3) CAN query message is sent, and inquires the state of other control bits in primary current control bit association message, and CAN is looked into
Message is ask to return to obtain status code 0x0000000000000010.
(4) status code with control mask phase or
High beam _ open control mask | | the data field 0x0000000000000011 that status code is sent.
(5) data field and CANID CAN data frame is packaged into be sent in bus by CAN interface.
Fragment in the internet and reorganization operation be because the MTU value of different communication networks is different, and the fragment in figure and
Reorganization operation is to correspond to different CAN network nodes because of information needed for middleware messaging bus protocol data domain,
It needs to separate request data, inquires combination again after receiving returned data parsing.
4) real time workshop
The specific code details that source code can make user that need not understand middleware code is automatically generated, is more convenient to generate
Qualified code, is saved the time for us, reduces complexity, shortens the development cycle.
Referring to Fig. 8 Code automatic build figure
Although it is very powerful that machine automatically generates source code, being inserted into code into program will become very complicated, very
Indigestibility.Having a kind of method that can reduce complexity, that is exactly to use template with readability is increased.
In Eclipse modeling framework (EMF) project, include two very powerful tools for being used to generate source code:
JET (JavaEmitter Templates) and JMerge (Java Merge).Using JET code generating method in eclipse with
The form that character string passes ginseng carries out the generation of code.Since the code of generation needs to provide communication interface for messaging bus, and it is logical
Agreement nonstandardized technique is believed, so code legibility is guaranteed using the code generating method based on template.
As shown, the process of Code automatic build is to define a template, it is intermediate by JET engine generation java,
It is intermediate to have generate method, character string code is ultimately generated according to configuration parameter.From the point of view of user, do not know usually
Road JET engine and intermediate presence, it is only necessary to which editing template code is passed to configuration parameter, generates generation using intermediate method
Code file.
As shown in lower template simple examples, for the switch control of dipped headlight and high beam, the incoming parameter of code is
Argument, is a list array, and array contains the parameter of all transmitting.
According to the code ultimately generated above are as follows:
The resulting CAN application protocol information of configuration is wherein contained in 16 system fields.For example, when control high beam is opened,
The value of variable FFMask_State_NearLight_open1 is sent, minimum 2 byte is 0xC1, other high bytes are according to inquiry shape
State filling.
In code generation process, configuration parameter is to ultimately generate the basis of code in figure, the parameter of code building transmitting
Mainly have:
Digital quantity: parameter includes that the control (state) of complete 1 mask and each variable of this digital quantity in CAN message information is covered
Code.These masks are all the parameters of user configuration by condition query, displacement, with or wait obtained from calculating operations.
Analog quantity: parameter includes complete 1 mask of this analog quantity in CAN message information and the side for handling this original analog amount
Method.Such as integer, single-precision floating point or double-precision floating point processing.
Other: CAN communication interface function may when protocol conversion module reads a little different platform CAN bus information
Interface is read using different CAN.
The code file ultimately produced is the combination of c file and h file, in the auxiliary of compiling link file and make tool
Under automatically generate file destination.
The above, only best mode for carrying out the invention, anyone skilled in the art is in the present invention
In the technical scope of disclosure, the simple change or equivalence replacement for the technical solution that can be become apparent to each fall within of the invention
In protection scope.
Claims (4)
1. a kind of configuration generating method of car networking middleware protocols conversion, which comprises the following steps:
(1) DBC file record communication protocol information is used,
(2) translation-protocol parameter configuration is carried out by the configuration tool of graphical interfaces, and stored information in database file;
(3) middleware communication protocol conversion code is automatically generated by Code automatic build technology;Specifically includes the following steps:
Vehicle enterprise inputs agreement by the parsing of DBC file, forms the database of variable, the use of database is for convenience of association
Discuss the conditional search and secondary importing of information, the information that data item contains description input has an ID of CAN, start bit, stop bits,
Offset, a series of information of accurate description protocol variables including scale factor, messaging bus document of agreement are description vehicle connection
The file of net middleware messaging bus communication protocol;
Processing method module will configure gained information and analyze, including variable match, displacement, and search operation obtains code mould
The input parameter of plate, passes to Code Template file;
Code Template file automatically generates agreement under the auxiliary of configuration tool by input information and background protocol detailed rules
Transcode generates the communication component of protocol conversion, after compiling to replace different automobile types protocol conversion middleware component;
Backup database and backup DBC file store configured protocol information description, are easily introduced into after minor adjustment for similar
The configuration of protocol conversion;Protocol conversion input includes: that DBC file imports, configuration interface input, database file, protocol conversion
Template file, the output of protocol conversion include protocol conversion code and database file.
2. the configuration generating method of car networking middleware protocols conversion according to claim 1, which is characterized in that for vehicle
Body application protocol describes parsing and the database purchase of file DBC file.
3. the configuration generating method of car networking middleware protocols conversion according to claim 1, which is characterized in that described logical
Believe agreement description configuration and storage specifically: read DBC file in configuration tool, configuration information is stored in data with postponing
In library file, the format according to middleware standard agreement is standard, and configuration generates the agreement for passing to protocol conversion template file
Conversion map parameter.
4. the configuration generating method of car networking middleware protocols conversion according to claim 1, which is characterized in that using certainly
Dynamic code Generation, ultimately produces the code of protocol conversion, and in the case where not needing to change by hand, communication is generated after compiling
Component is used for car networking middleware communication.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410619292.7A CN104331292B (en) | 2014-11-03 | 2014-11-03 | A configuration generation method for protocol conversion of Internet of Vehicles middleware |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410619292.7A CN104331292B (en) | 2014-11-03 | 2014-11-03 | A configuration generation method for protocol conversion of Internet of Vehicles middleware |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104331292A CN104331292A (en) | 2015-02-04 |
| CN104331292B true CN104331292B (en) | 2019-01-22 |
Family
ID=52406026
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410619292.7A Active CN104331292B (en) | 2014-11-03 | 2014-11-03 | A configuration generation method for protocol conversion of Internet of Vehicles middleware |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104331292B (en) |
Families Citing this family (52)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105246025B (en) * | 2015-09-08 | 2018-09-14 | 宇龙计算机通信科技(深圳)有限公司 | A kind of method and device of control V2X business transmission |
| CN105512097A (en) * | 2015-11-26 | 2016-04-20 | 普华基础软件股份有限公司 | File analyzing method |
| CN106997176A (en) * | 2016-01-22 | 2017-08-01 | 郭骏贤 | General control method for area network of vehicle controller |
| CN107132832B (en) * | 2016-02-29 | 2019-10-11 | 株洲南车时代电气股份有限公司 | A kind of DBC document analysis and its Programming Methodology based on CAN communication |
| CN107231279A (en) * | 2016-03-26 | 2017-10-03 | 深圳市沃特玛电池有限公司 | A kind of message parsing method based on CAN communication |
| US9940142B2 (en) | 2016-05-20 | 2018-04-10 | At&T Mobility Ii Llc | Connected car resource manager with associated applications control |
| CN105978898B (en) * | 2016-06-28 | 2019-09-27 | 南京南瑞继保电气有限公司 | A network security threat assessment method and system for a substation monitoring system |
| CN106254460A (en) * | 2016-08-05 | 2016-12-21 | 浪潮软件股份有限公司 | Method for accessing message middleware from mobile terminal |
| CN107872441B (en) * | 2016-09-28 | 2021-08-17 | 阿里巴巴集团控股有限公司 | Method and apparatus for generating device attribute configuration file |
| CN106850531B (en) * | 2016-11-21 | 2020-01-14 | 中国航天科工集团第四研究院第四总体设计部 | Template-based protocol code generation method |
| CN106992980B (en) * | 2017-03-30 | 2020-03-17 | 南京维能信息技术有限公司 | Gateway conversion protocol teaching method and device based on Internet of things |
| CN106950864B (en) * | 2017-04-11 | 2019-12-13 | 重庆长安新能源汽车科技有限公司 | A CAN communication program generation method and device for a vehicle controller |
| CN107388480B (en) * | 2017-06-26 | 2020-07-31 | 珠海格力电器股份有限公司 | Air conditioner control method and device and air conditioner system |
| CN107644059A (en) * | 2017-08-18 | 2018-01-30 | 广州视源电子科技股份有限公司 | Method and device for exporting database file, storage medium and terminal equipment |
| CN107704245A (en) * | 2017-09-21 | 2018-02-16 | 深圳市麦斯杰网络有限公司 | Protocol accessing method, device and computer-readable recording medium |
| CN108600192B (en) * | 2018-04-03 | 2021-03-30 | 南京越博动力系统股份有限公司 | Regular expression based DBC file analysis and message analysis method |
| CN108833394B (en) * | 2018-06-07 | 2020-10-09 | 中国人民解放军63889部队 | Protocol conversion algorithm of data acquisition system |
| CN109033338B (en) * | 2018-07-23 | 2022-02-01 | 北京新能源汽车股份有限公司 | Method and system for generating database file of automobile communication protocol |
| CN109582639A (en) * | 2018-11-01 | 2019-04-05 | 广东国鸿氢能科技有限公司 | A kind of automobile protocol database document generating method and device |
| CN109639789A (en) * | 2018-12-05 | 2019-04-16 | 广东国鸿氢能科技有限公司 | Fuel cell module data monitoring method and system |
| CN109688026A (en) * | 2018-12-24 | 2019-04-26 | 北京新能源汽车股份有限公司 | Network protocol data detection method and device |
| CN109861976A (en) * | 2018-12-27 | 2019-06-07 | 广州天源信息科技股份有限公司 | Internet of things equipment protocol fitting method |
| CN109889482B (en) * | 2018-12-27 | 2020-05-12 | 北京理工大学 | A vehicle protocol analysis method and system |
| CN109561104A (en) * | 2018-12-28 | 2019-04-02 | 深圳市创梦天地科技有限公司 | A kind of communication protocol conversion method and device |
| CN109976828B (en) * | 2019-03-12 | 2022-04-22 | 北京奇艺世纪科技有限公司 | Method and device for configuring file |
| CN111835627B (en) * | 2019-04-23 | 2022-04-26 | 华为技术有限公司 | Communication method of vehicle-mounted gateway, vehicle-mounted gateway and intelligent vehicle |
| CN110196715A (en) * | 2019-06-25 | 2019-09-03 | 上海仪电汽车电子系统有限公司 | A kind of code generating system and method |
| CN112910830B (en) * | 2019-12-04 | 2022-10-21 | 北京博瑞华通科技有限公司 | Data transmission system, data uploading method and data issuing method of Internet of vehicles |
| CN111049717A (en) * | 2019-12-26 | 2020-04-21 | 潍柴动力股份有限公司 | Variable acquisition method and device |
| CN111478944B (en) * | 2020-03-10 | 2022-08-30 | 福建工程学院 | Vehicle-mounted terminal and vehicle CAN protocol adaptation method, device, equipment and medium |
| CN111338616A (en) * | 2020-03-24 | 2020-06-26 | 北京自如信息科技有限公司 | Protocol analysis code generation method and device and electronic equipment |
| CN111708568B (en) * | 2020-05-06 | 2023-07-07 | 福建天泉教育科技有限公司 | Modularized development decoupling method and terminal |
| CN111445717A (en) * | 2020-05-08 | 2020-07-24 | 广东技术师范大学 | Public traffic intelligent monitoring cloud service platform |
| CN111740956B (en) * | 2020-05-19 | 2023-05-26 | 腾讯科技(深圳)有限公司 | Vehicle communication method, device, computer readable medium and electronic equipment |
| CN111880780B (en) * | 2020-07-28 | 2024-03-15 | 北京经纬恒润科技股份有限公司 | Method, device and platform for developing boot loader of MCU |
| CN112256253B (en) * | 2020-11-12 | 2023-09-01 | 北斗星通智联科技有限责任公司 | Code generation method, device, electronic device and computer-readable storage medium |
| CN112445491B (en) * | 2020-11-19 | 2024-09-10 | 深圳市元征科技股份有限公司 | File sequence processing method, device, terminal equipment and storage medium |
| CN113015132B (en) * | 2021-03-25 | 2023-09-22 | 联合汽车电子有限公司 | Communication method and communication system |
| CN113259437B (en) * | 2021-05-11 | 2022-11-04 | 中国第一汽车股份有限公司 | Method and device for determining vehicle network protocol and storage medium |
| CN115412613B (en) * | 2021-05-26 | 2023-11-24 | 博泰车联网科技(上海)股份有限公司 | Method for managing aftermarket devices of a vehicle, and computer storage medium |
| CN113259233B (en) * | 2021-07-02 | 2021-09-28 | 奥特酷智能科技(南京)有限公司 | DDS-based automation gateway of heterogeneous communication protocol |
| CN113568876B (en) * | 2021-08-04 | 2024-03-26 | 江苏爱玛车业科技有限公司 | Method and device for automatically generating DBC file |
| CN113824621B (en) * | 2021-09-22 | 2023-04-14 | 石家庄通合电子科技股份有限公司 | CAN communication method based on signals and CAN controller |
| CN114265636A (en) * | 2021-12-23 | 2022-04-01 | 北京天融信网络安全技术有限公司 | A configuration method and device of a communication protocol, and a storage medium |
| CN114281576A (en) * | 2022-03-08 | 2022-04-05 | 魔门塔(苏州)科技有限公司 | Dual-communication-architecture algorithm calling method and device, algorithm control method and vehicle |
| CN114925444A (en) * | 2022-04-25 | 2022-08-19 | 一汽奔腾轿车有限公司 | Wiring harness configuration condition design method, terminal and storage medium |
| CN115037808A (en) * | 2022-06-15 | 2022-09-09 | 东风悦享科技有限公司 | Method, system and storage medium for rapidly realizing vehicle data access to cloud platform |
| CN115267389B (en) * | 2022-07-25 | 2025-03-21 | 安徽橡豫智能科技有限公司 | A method for implementing a DC charging protocol test device based on Raspberry Pi |
| CN115686524B (en) * | 2022-08-31 | 2025-09-19 | 中国人民解放军海军工程大学 | Method for writing CAN analyzer Sfunction module by Simulink calling dynamic link library |
| CN116132467B (en) * | 2022-12-12 | 2026-02-24 | 嬴彻星创智能科技(上海)有限公司 | Vehicle communication method, device, electronic equipment and storage medium |
| CN116192897B (en) * | 2023-02-08 | 2026-04-14 | 天津测度空间智能科技有限公司 | Development method and device of Internet of things component |
| CN120276717B (en) * | 2025-06-06 | 2025-09-02 | 南昌智能新能源汽车研究院 | Automobile data file conversion method, system, storage medium and electronic equipment |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102622470A (en) * | 2012-02-21 | 2012-08-01 | 重庆邮电大学 | General car code conversion method |
| CN202772920U (en) * | 2012-06-29 | 2013-03-06 | 惠州天缘电子有限公司 | Peripheral control device of car networking base station |
| CN202979022U (en) * | 2012-06-14 | 2013-06-05 | 百年金海安防科技有限公司 | Integral network framework for cooperative communication of network of vehicle |
| CN103684963A (en) * | 2013-11-18 | 2014-03-26 | 重庆邮电大学 | Framework system and implementation method of middleware applied to car networking |
-
2014
- 2014-11-03 CN CN201410619292.7A patent/CN104331292B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102622470A (en) * | 2012-02-21 | 2012-08-01 | 重庆邮电大学 | General car code conversion method |
| CN202979022U (en) * | 2012-06-14 | 2013-06-05 | 百年金海安防科技有限公司 | Integral network framework for cooperative communication of network of vehicle |
| CN202772920U (en) * | 2012-06-29 | 2013-03-06 | 惠州天缘电子有限公司 | Peripheral control device of car networking base station |
| CN103684963A (en) * | 2013-11-18 | 2014-03-26 | 重庆邮电大学 | Framework system and implementation method of middleware applied to car networking |
Non-Patent Citations (1)
| Title |
|---|
| 基于AutoSAR规范的驱动代码生成工具箱设计与实现;冯辉宗等;《电子技术应用》;20121231;第38卷(第7期);全文 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104331292A (en) | 2015-02-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104331292B (en) | A configuration generation method for protocol conversion of Internet of Vehicles middleware | |
| CN102830951B (en) | A kind of quick satellite multi-parameter instruction notes disposal route | |
| CN110430219A (en) | Method and system of the various protocols internet of things equipment from adaptation | |
| CN103139234B (en) | A kind of device and method of data, services encapsulation | |
| US11536578B2 (en) | Path data for navigation systems | |
| Stahlmann et al. | Starting European field tests for Car-2-X communication: the DRIVE C2X framework | |
| CN108874493A (en) | A kind of ATS method for showing interface and device based on comprehensive monitoring platform | |
| CN110225026A (en) | Protocol converter instrument long-distance configuration method | |
| CN114357672B (en) | A model-based simulation verification method for avionics systems | |
| CN105847041B (en) | A kind of exchange method based on network management system command-line data | |
| CN109116315A (en) | A kind of general purpose radar avionics simulation system | |
| CN113504774B (en) | Train control interlocking integration and dispatching centralized system interface data checking method and device | |
| CN114330246A (en) | Universal data stream analyzing method and system | |
| CN108965293A (en) | Message parsing method and device, electronic equipment | |
| CN106685934A (en) | Method of parameter monitoring and optimization calibration by using mobile phone | |
| CN113591448B (en) | Report generation method, device and storage medium | |
| CN104090768A (en) | Automatic intelligent smart phone form generating system and method | |
| CN107479876A (en) | A kind of five layer architecture design methods for building unmanned aerial vehicle station software | |
| CN115755923B (en) | Interaction method, device, equipment and storage medium of intelligent vehicle map | |
| CN104750468A (en) | Server side topological data conversion method and device | |
| CN205121345U (en) | Multitask load management device | |
| CN104077414B (en) | A kind of decoding apparatus and its coding/decoding method applied to LTE network signal | |
| KR20130050514A (en) | Automatic metar data update method and apparatus for aircraft traffic control | |
| CN114374679A (en) | Method for upgrading vehicle-mounted equipment by using DOIP (data over Internet protocol) through TBOX (tunnel boring machine) | |
| Weinbauer et al. | Taking standardized c-its communication to the next level-lightweight and extensible vehicle-to-everything library |
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 |