One kind being used for vehicular data acquisition equipmentTechnical field
The present invention relates to a kind of vehicular data acquisition equipment more particularly to a kind of adaptation OBDII interface and various automobiles are totalThe terminal device of line and diagnosing protocol.
Background technique
With the high speed development of automobile industry, the continuous of family car is popularized, and the Related product lived after automobile is also formedGreat market.Most important components of the automobile failure diagnosis class product as life Related product after automobile, as automobile producesThe development of industry and obtain rapid proliferation.
Existing automobile failure diagnosis class product has two big weakness: first is that such product is all in known OBDII mouthpieceFoot could use in the case where defining;Second is that such product substantially only supports the compatibility vehicle of OBDII/EOBD agreement, forThe OBD interface signal of different automobile types accordingly modifies interface circuit, cumbersome.
Summary of the invention
It is an object of the invention to overcome disadvantages mentioned above, by carrying out the survey that identification signal defines to OBDII total interfaceExamination, finally knows all signal definitions on 16 interfaces of OBDII, to can carry out automobile information to unknown bus interfaceAcquisition and diagnostic service.
A main aspect according to the present invention, provides a kind of vehicular data acquisition equipment comprising: program-controlled variable connectorSwitching module, auxiliary division module, bus transceiver module one, bus transceiver module two, the miniature control unit of MCU, it is non-easilyThe property lost memory, GPS positioning module, wireless communication module and power supply conversion and control module;The program-controlled variable connector switchingModule is used to receive the switching instruction that miniature control unit is issued, and assists dividing according to the switching commands directThe gating and bus transceiver module of module control OBD II manufacturer's self defined interface and the miniature control unit pin of MCU connectThe gating of mouth and the defined interface of OBD II realizes that miniature control unit reads the function of real-time bus data and diagnostic data;The bus transceiver module one is that miniature control unit transmits real-time bus data and diagnostic data;The bus transceiver mouldBlock two is that miniature control unit transmits real-time bus data and diagnostic data;The miniature control unit is for controlling program-controlled multichannelSwitching switch, read the defined interface of OBD II bus data and diagnostic data, storage obtain data, communication control module intoThe wireless transmission of row data, control locating module obtain position data, control program-controlled variable connector switching module, bus transceiver mouldBlock one, bus transceiver module two, nonvolatile memory, GPS positioning module, the on/off of wireless communication module;It is describedPower supply convert and control module into program-controlled variable connector switching module, bus transceiver module one, bus transceiver module two,The miniature control unit of MCU, nonvolatile memory, GPS positioning module, wireless communication module provide operating voltage.
Preferably, the auxiliary division module suitably divides unknown interface, is that the miniature control unit judgement of MCU is totalLine type provides adaptation level.
Preferably, the bus transceiver module one is integrated with CAN high speed, and low speed/fault-tolerant bus transceiver, SCAN are mono-Line bus transceiver, K/L bus transceiver and PWM/VPW bus transceiver.
Preferably, the bus transceiver module two be integrated with CAN high-speed bus transceiver, K/L bus transceiver andPWM/VPW bus transceiver.
Preferably, the K/L bus transceiver is integrated with logic level switching and mixed logic switching circuit, and then realizesThe level logic of K/L bus transceiver switches.
Preferably, the CAN high speed, low speed/fault-tolerant bus transceiver, SCAN single bus transceiver energy supporting bus listDuplexing transmission-receiving function, miniature control unit send Reverse Turning Control order by CAN bus transceiver, it is desirable that part electronic module is heldRow control function.
Preferably, the power supply is converted and the input service voltage of control module is 12V.
Preferably, wherein power supply conversion portion is adjusted input voltage by the low pressure difference linear voltage regulator, in turnFor program-controlled variable connector switching module, bus transceiver module one, bus transceiver module two, the miniature control unit of MCU, non-Volatile memory, GPS positioning module, wireless communication module provide operating voltage.Another control module is matched with miniature control unitWork is closed, and then controls the on-off of above each module working power.
Preferably, the program-controlled variable connector switching module uses SPI mouthfuls of standard communication modes, which cutsThe input data rate for changing the mold block is 1Mb/s.
Preferably, the program-controlled variable connector switching module includes several analog switch array, and each analog switch wrapsSeveral pins are included, the decoding result control that the program-controlled variable connector switching module is instructed according to microcontroller input control shouldThe gating of a little each pins of analog switch and the vehicle diagnosis interface, and then realize bus transfer device, bus interface circuit and vapourThe communication connection of vehicle diagnosis interface.
Preferably, the non-volatile memory devices are for storing the bus real time data for failing timely upload serverAnd diagnostic data.
Preferably, the wireless communication module is counted for bus real time data and diagnostic data to be uploaded to serverAccording to analysis.
Preferably, the locating module provides the real-time position information of vehicle, and microcontroller obtains this information and passes throughWireless communication module is uploaded to server and carries out data analysis.
Preferably, the microcontroller communication control module carries out data wireless transmission, and control locating module obtains positionData are set, and carry out the self-management of terminal work mode according to bus virtual condition and power level signal, in different workProgram-controlled variable connector switching module, bus transceiver module one, bus transceiver module two, non-volatile can be controlled under mode respectivelyProperty memory, GPS positioning module, the on/off of wireless communication module, so reduce special applications under quiescent dissipation.
Preferably, the interface that definition is used as communication in ISO DIS 15031-3 is confirmed, it is customized to manufacturerInterface carries out intelligent measurement, determines the signal definition of each interface.
Another main aspect according to the present invention provides a kind of method that vehicle-mounted OBD terminal is adapted to certainly, described vehicle-mountedOBD terminal includes the miniature control unit of MCU, further includes multiple manufacturer's self defined interfaces and multiple international standard interfaces, the sideMethod the following steps are included:
(a) the signal validity of each international standard interface is determined;
(b) the multiple manufacturer's self defined interface is detected with a variety of vehicles rule communication protocol, each manufacturer is customized with determinationThe definition of interface;For that can not determine manufacturer's self defined interface of definition, it is determined that be null interface.
Preferably, with SAEJ1850 PWM communications protocol to one or more of the multiple international standard interface firstInterface sends diagnostic command, to determine whether the one or more first interface is J1850 PWM interface.
Preferably, if one or more of first interfaces are not J1850 PWM interfaces, with SAEJ1850 VPWCommunications protocol to one or more of first interfaces send diagnostic command, with determine the one or more first interface whether beJ1850 VPW interface.
Preferably, by one or more second interfaces in the multiple international standard interface through K/L bus transceiver withThe Serial Peripheral Interface (SPI) of the miniature control unit of MCU connects, and by ISO9141-2, ISO14230-4 communications protocol sends initialization lifeIt enables, to determine whether the one or more second interface is K/L bus interface.
Preferably, by the miniature control unit of the MCU by one or more of the multiple international standard interfaceThree interfaces access the CANH of CAN high-speed transceiver, and the control of the CAN in the MCU is arranged by ISO15765-4 communications protocol in CANL lineMolding block is listening mode, to determine whether the one or more third interface is high-speed CAN bus.
Preferably, in the step of detecting the multiple manufacturer's self defined interface with a variety of vehicles rule communication protocol, to eachManufacturer's self defined interface is tested by the way of cyclic polling, to determine the definition of its interface.
Preferably, is adopted including successively making by oneself to each manufacturer the step of testing to each manufacturer's self defined interfaceAdopted interface carries out analog-to-digital conversion scanning, to obtain the level change data of each manufacturer's self defined interface.
Preferably, the possibility corresponding to the interface is judged according to the level change value of each manufacturer's self defined interfaceBus signals.
Preferably, if detecting the signal of J1850 PWM or J1850 VPW in manufacturer's self defined interface,Further determine that signal authenticity.
Preferably, it is made by oneself if there are one or more manufacturers without level change in the multiple manufacturer's self defined interfaceAdopted interface then carries out the judgement of K/L line bus to the one or more without manufacturer's self defined interface of level change.
It is according to the present invention to have a main aspect, it provides a kind of for vehicular data acquisition equipment, comprising: program-controlled multichannelSwitching module, bus transceiver module one, bus transceiver module two and the miniature control unit of MCU;The busTransceiver module one and the bus transceiver module two are connected to the program-controlled variable connector switching module and the MCUBetween miniature control unit;The program-controlled variable connector switching module is for receiving the switching that miniature control unit is issuedInstruction;The bus transceiver module one is made by oneself by the program-controlled variable connector switching module with the manufacturer in OBD II interfaceAdopted orifice is that the miniature control unit of the MCU transmits real-time bus data and diagnostic data;The bus transceiver moduleInternational standard interface in two interface and OBD II interface gates, and is that the miniature control unit of the MCU transmits real-time bus numberAccording to and diagnostic data;The miniature control unit for controlling program-controlled multi-channel switch, read in OBD II interface reallyThe bus data and diagnostic data of the interface defined, storage obtain data, control program-controlled variable connector switching module, bus is receivedSend out the on/off of device module one, bus transceiver module two.
Preferably, the equipment further include auxiliary division module, be connected to the program-controlled variable connector switching module withBetween the miniature control unit of MCU, the program-controlled variable connector switching module is assisted according to the switching commands directDivision module controls the gating of manufacturer's self defined interface and the miniature control unit pin of MCU in OBD II interface.
Preferably, the auxiliary division module suitably divides the unknown interface in OBD II interface, is that MCU is miniatureControl unit judges that bus type provides adaptation level.
Preferably, the bus transceiver module one is integrated with CAN high speed, and low speed/fault-tolerant bus transceiver, SCAN are mono-Line bus transceiver, K/L bus transceiver and PWM/VPW bus transceiver.
Preferably, the bus transceiver module two be integrated with CAN high-speed bus transceiver, K/L bus transceiver andPWM/VPW bus transceiver.
Preferably, the K/L bus transceiver is integrated with logic level switching and mixed logic switching circuit, and then realizesThe level logic of K/L bus transceiver switches.
Preferably, the CAN high speed, low speed/fault-tolerant bus transceiver, SCAN single bus transceiver supporting bus Dan ShuanWork transmission-receiving function, miniature control unit send Reverse Turning Control order by CAN bus transceiver, it is desirable that part electronic module executesControl function.
Preferably, the program-controlled variable connector switching module uses SPI mouthfuls of standard communication modes.
Preferably, the input data rate of the program-controlled variable connector switching module is 1Mb/s.
Preferably, the program-controlled variable connector switching module includes several analog switch array, and each analog switch wrapsSeveral pins are included, the decoding result control that the program-controlled variable connector switching module is instructed according to microcontroller input control shouldThe gating of a little each pins of analog switch and the vehicle diagnosis interface, and then realize bus transfer device, bus interface circuit and vapourThe communication connection of vehicle diagnosis interface.
Detailed description of the invention
With reference to the accompanying drawing, by the way that detailed description of specific embodiments of the present invention, technical solution of the present invention will be madeIt is simple and clear.It is noted that following description is exemplary, without limiting the invention.
Fig. 1 is the hardware module schematic diagram that the present invention is used for vehicular data acquisition equipment.
Fig. 2 is to confirm that national standard defines the flow diagram of pin signal.
Fig. 3 is the flow diagram for detecting self defined interface signal definition.
Fig. 4 is to further confirm that the flow chart that interface signal defines when self defined interface is bus interface.
Specific embodiment
Below with reference to attached drawing, preferred embodiments of the present invention will be described.These embodiments are for explaining thisInvention, and non-present invention is construed as limiting.
According to embodiment of the present invention, which includes program-controlled variable connector switching module103, division module 108, bus transceiver module 1, bus transceiver module 2 102, the miniature control unit of MCU are assisted109, nonvolatile memory 110, GPS positioning module 111, wireless communication module 112 and power supply conversion and control module 104.
Program-controlled variable connector switching module 103 is opened by CPLD, multiplexer and simulation in this automobile information acquisition equipmentPowered-down road composition, CPLD control the top of analog switching circuit connection bleeder circuit, and it is multiple that the tap of series resistance can connect multichannelWith the input terminal of device, multiplexer exports analog-to-digital conversion port and the time catch end that can connect miniature control unit 109Mouthful, bus transceiver module 1 can execute process according to specific, by program-controlled variable connector 103 and auxiliary division module 108Work is dynamically selected, and miniature control unit 109 sends a command to CPLD, and it is logical to control the different partial pressures of multiplexer selectionRoad, and then obtain undefined port level value.CPLD model EPM1270.
The auxiliary division module 108 of this terminal is by eight concatenated resistance OBDI I pin signal customized to manufacturer pointPressure, can be adapted to 109 interface of MCU microcontroller.
The bus transceiver module 1 of this terminal includes high-speed CAN, and low speed/fault-tolerant CAN bus transceiver, SCAN are mono-Line bus transceiver, K/L bus transceiver and PWM/VPW bus transceiver, high-speed CAN transceiver uses NXPTJA1042, lowSpeed/fault-tolerant CAN bus transceiver uses NXP TJA1050, and SCAN single bus transceiver uses MCZ33897, and K/L bus is receivedHair device and PWM/VPW bus transceiver are made of discrete component.
The bus transceiver module 2 102 of this terminal includes high-speed CAN, and K/L bus transceiver and PWM/VPW bus are receivedDevice is sent out, high-speed CAN transceiver uses NXP TJA1042, and K/L bus transceiver and PWM/VPW bus transceiver are by discrete componentIt constitutes.
The miniature control unit 109 of the MCU of this terminal uses NXP LPC17XX.
This terminal determines that the specific execution process of all of the port signal definition is as follows:
According to related content in ISO DIS15031-3,1,3,8,9,11,12,13 to leave automobile vendor for customized, and 2,6,7,10,14,15 are generally international standard interface, it is also possible to make diagnosis communication.
Below to the interface for being used as diagnosis communication according to 2,6,7,10,14,15, determines the validity of its signal, see Fig. 2.To 1,3,8,9,11,12, the 13 customized interface of manufacturer, its interface features is detected, it is determined whether be bus interface, see Fig. 3.
1.MCU microcontroller unit 109 instructs the program-controlled control of variable connector switching module 103 2,10 by SPI interfacePin is connect through J1850 PWM interface in bus transceiver module 2 102 with the SPI module of the miniature control unit 109 of MCU, is pressedSAE J1850 PWM communications protocol sends diagnostic command, requires if any replying and meeting communications protocol definition, it may be determined that 2,10 areJ1850 PWM interface.Into step 3, no reply enters step 2.
The miniature control unit 109 of 2.MCU is by 2 SPI through SAE J1850 VPW interface Yu the miniature control unit 109 of MCUConnection sends diagnostic command by SAE J1850 VPW communications protocol, requires if any replying and meeting communications protocol definition, can be trueFixed 2 be J1850 VPW interface, and no reply 2 is no defining interface.Into step 3.
The miniature control unit 109 of 3.MCU connects 7,10 SPI through K/L bus transceiver and the miniature control unit 109 of MCUIt connects, by ISO9141-2, ISO14230-4 communications protocol sends initialization command, wants if any replying and meeting communications protocol definitionIt asks, it may be determined that 7,10 be K/L bus interface, and no reply 7,10 is no defining interface.Into step 4.
4.MCU microcontroller unit 109 accesses CAN high-speed transceiver CANH, CANL line for 6,14, by ISO15765-4It is listening mode that CAN control module in MCU, which is arranged, in communications protocol, and baud rate is successively decreased since 1M, receives interruption when entering CANShi Jilu current setting baud rate, is confirmed as high-speed CAN bus.It not can enter CAN after baud rate traversal and receive interruption, 6,14 are notIt is CAN bus.
5. completing to confirm work to the signal definition of 2,6,7,10,14,15 interfaces.Particular content is seen below.
6. the customized interface of pair manufacturer detects, determine that its interface signal defines.Detection process is as follows:
During detecting self defined interface level, the miniature control unit 109 of MCU is to program-controlled variable connector switching module103 send control instruction, connect the interface 3 of OBDII to the head of bleeder circuit, bleeder circuit tail portion ground connection, selection partial pressureMinimum point is connected to the analog-to-digital conversion interface of the miniature control unit 109 of MCU as tap, continuously to the interface scans several seconds, such asThere is level change, calculated using analog-digital conversion result and intrinsic standoff ratio and records level maximum and minimum value, no level changeSame record.Same analog-to-digital conversion scanning successively is carried out to customized port.It is successively scanned by same procedure customizedPort obtains the level change data of each port.The possible bus letter in each port can be prejudged according to the level change value of each portNumber.See attached drawing Fig. 4, respectively to high-speed CAN bus voltage, low speed/fault-tolerant CAN bus voltage, single line CAN bus voltage showsMeaning.In addition, the high potential of J1850 PWM is 5V, the high potential of low potential 0V, J1850 VPW are 12V, low potential 0V.CauseAfter K/L line needs to send initialization command in bus, communication can just be carried out, therefore put aside.
7. it is cooperated after completing step 6 using timer in the miniature control unit 109 of MCU and D/A converter module,The pairing relationship between existing level change port can be found out.For example, according to known port voltage value, the miniature control unit of MCU109 control auxiliary division modules 108 by port voltage adjust to appropriate value connect MCU control unit 109 analog-to-digital conversion interface andTimer capture port, the duration of the hopping edge triggering timer statistics low and high level of port signal, meanwhile, signal jumpEdge can trigger analog-digital conversion function, for high-speed CAN bus, low speed/fault-tolerant CAN bus, and J1850 PWM bus three classes agreementDetermine the matching relationship between port.
8., by the method for step 4, need to determine high-speed CAN bus, low speed/fault-tolerant CAN bus, single line after completing step 7The baud rate of CAN bus, configuration CAN functional module are listening mode, and miniature control unit 109 controls program-controlled variable connector mouldBlock 103 is connected to corresponding port, and baud rate is successively decreased from 1Mbit/s, is successfully entered when reception is interrupted and records current baud rate.
9. the signal port as detected J1850 PWM or J1850 VPW in manufacturer's self defined interface, miniature control listThe program-controlled variable connector module 103 of 109 pairs of member sends control command, is connected to the signal port of J1850 PWM or J1850 VPW, alwaysThe corresponding interface of line transceiver module 1 and miniature control unit 109 determines J1850 in the way of step 1 and step 2The port signal authenticity of PWM or J1850 VPW.
10. the port in pair manufacturer's self defined interface without level change carries out the judgement of K/L line bus, miniature control unit109 pairs of program-controlled 103 modules of variable connector send control command, are connected to the signal port without level change, bus transceiver module1 and the corresponding interface of miniature control unit 109 determine in unallocated port in the way of the 3rd step with the presence or absence of K/LBus.
After to the confirmation of OBDII all of the port signal, data acquisition and diagnostic service are carried out.It is connect according to OBDII the 16thThe power level signal of mouth and the state of all of the port bus signals, when meeting every switching condition, the operating mode of terminal is cutIt changes, the power consumption of dynamic regulation itself.Normal mode: all electronic modules work normally.Abnormal voltage mode: the miniature control of MCUUnit 109 monitors power supply, and bus acquisition stops working with diagnostic service, GPS module 111, the normal work of wireless communication module 112Make, reports abnormal voltage situation.Bus suspend mode: the miniature control unit 109 of MCU enters suspend mode ready mode, bus acquisitionIt stops working with diagnostic service, GPS module 111, wireless communication module 112 works normally, reporting position information.Sleep pattern:The miniature control unit 109 of MCU enters sleep pattern, and bus acquisition stops working with diagnostic service, GPS module 111, wireless communicationModule 112 stops working, and the miniature control unit 109 of MCU can have bus signals wake-up or automated periodic to wake up, and acquisition port is totalLine signal, monitoring voltage value, and report a data.Deep sleep: in a sleep mode when periodic wakeup under monitoring voltageLimit value is dropped to, MCU enters deep power down mode, and periodic wakeup, only monitoring voltage value.Terminal is closed: voltage value is lower thanLimit value, entire terminal stop working.
Terminal, can be by special diagnostic instruction to finished vehicle electronic control module while bus acquisition is with diagnostic serviceControl command is sent, Reverse Turning Control is carried out to vehicle, such as long-range starting, switch gate and window etc..
It should be noted that specification of the invention and its a better embodiment of the invention is given in the attached drawing, still,The present invention can be realized by many different forms, however it is not limited to this specification described embodiment, these embodimentsNot as the additional limitation to the content of present invention, purpose of providing these embodiments is makes understanding to the disclosureIt is more thorough and comprehensive.Also, above-mentioned each technical characteristic continues to be combined with each other, and forms the various embodiments not being enumerated above,It is considered as the range of description of the invention record;It further, for those of ordinary skills, can be according to the above descriptionIt is improved or converted, and all these modifications and variations should all belong to the protection domain of appended claims of the present invention.