Summary of the invention
The purpose of the application is, provides a kind of CAN bus test macro and CAN bus test method based on UDS, energy
Canoe hardware testing system of arranging in pairs or groups using high-cost Germany's Vector software is enough avoided, testing cost is effectively reduced, and
Test effect is accurate, success rate is high, test macro erection be simple and convenient to operate it is understandable, while guarantee realize with Germany
The same test function of Vector software collocation canoe hardware testing system, guarantees the working performance of product.
In order to solve the above technical problems, the application provides a kind of CAN bus test method based on UDS, wherein described
CAN bus test method includes:
ECU to be tested is connected to PCAN hardware by CAN bus;
By PCAN hardware by ECU to be tested by USB in the way of be connected to external test arrangements;
Start the ECU to be tested, the working performance of the ECU to be tested is tested by the external test arrangements.
Wherein, it is described by PCAN hardware by ECU to be tested by USB in the way of be connected to external test arrangements the step of,
The external test arrangements are equipped with PCAN Explorer and its series of tests software.
Wherein, the CAN bus test method further include:
Secondary development is carried out to the PCAN Explorer and its series of tests software of external test arrangements installation, is adopted
Test program is worked out with VB script language.
Wherein, the step of establishment test program using VB script language, specifically includes:
The security certificate algorithm of key is generated using the request of VB script language establishment seed, seed and sends key.
Wherein, it described the step of ECU to be tested is connected to PCAN hardware by CAN bus, specifically includes:
The ECU to be tested is connected respectively to the CAN_H and CAN_L of the PCAN hardware by CAN_H and CAN_L.
Wherein, the step of working performance that the ECU to be tested is tested by the external test arrangements is specific to wrap
It includes:
The secure access service of the ECU to be tested is tested by the external test arrangements.
In order to solve the above technical problems, the application also provides a kind of CAN bus test macro based on UDS, wherein described
CAN bus test macro includes:
PCAN hardware, for being connected to ECU to be tested by CAN bus;
External test arrangements for being connected to the PCAN hardware by USB mode, and then are connected by the PCAN hardware
It is connected to the ECU to be tested, to test by the external test arrangements described to be tested when starting the ECU to be tested
The working performance of ECU.
Wherein, the external test arrangements are equipped with PCAN Explorer and its series of tests software.
Wherein, the PCAN Explorer and its series of tests software of the external test arrangements installation pass through secondary development,
Test program is worked out using VB script language, wherein key is generated using the request of VB script language establishment seed, seed
Security certificate algorithm and send key.
Wherein, the CAN_H and CAN_L of the PCAN hardware are connected respectively to the CAN_H and CAN_L of the ECU to be tested.
Wherein, the external test arrangements are used to test the secure access service of the ECU to be tested.
CAN bus test macro and CAN bus test method of the application based on UDS, ECU to be tested is total by CAN
Line is connected to PCAN hardware, by PCAN hardware by ECU to be tested by USB in the way of be connected to external test arrangements, start institute
ECU to be tested is stated, the working performance of the ECU to be tested is tested by the external test arrangements.By the above-mentioned means, this Shen
It please can be avoided using high-cost Germany's Vector software collocation canoe hardware testing system, it can be using several hundred members or so
Low cost substitute tens of thousands of first costs of existing testing scheme, be effectively reduced testing cost, and test effect is accurate, successfully
Rate is high, and test macro erection is simple and convenient to operate understandable, while guaranteeing to realize and Germany Vector software collocation canoe
The same test function of hardware testing system, guarantees the working performance of product.
Above description is only the general introduction of technical scheme, in order to better understand the technological means of the application,
And it can be implemented in accordance with the contents of the specification, and in order to allow the above and other objects, features and advantages of the application can
It is clearer and more comprehensible, it is special below to lift preferred embodiment, and cooperate attached drawing, detailed description are as follows.
Specific embodiment
Further to illustrate that the application is the technical means and efficacy reaching predetermined application purpose and being taken, below in conjunction with
Attached drawing and preferred embodiment, to according to the specific of CAN bus test macro and CAN bus test method of the application based on UDS
Embodiment, method, step, feature and its effect, detailed description are as follows.
Aforementioned and other technology contents, feature and effect in relation to the application refer to the preferable reality of schema in following cooperation
Applying in the detailed description of example can clearly appear from.By the explanation of specific embodiment, when can be that reach predetermined mesh to the application
The technological means taken and effect be able to more deeply and it is specific understand, however institute's accompanying drawings are only to provide with reference to and say
It is bright to be used, not it is used to limit the application.
Referring to Fig. 1, Fig. 1 is the flow diagram of CAN bus test method one embodiment of the application based on UDS.
In the present embodiment, the CAN bus test method includes but is not limited to the following steps.
ECU to be tested is connected to PCAN hardware by CAN bus by step S101;It should be noted that in this embodiment party
In formula, PCAN hardware, that is, PCAN-USB or CAN card may be implemented CAN and turn USB interface, can will be on CAN bus network
Message is transferred on PC PC by USB interface, is seen CAN message by relevant software to produce, be may be implemented to survey with this
The correlation functions such as examination.
Step S102, by PCAN hardware by ECU to be tested by USB in the way of be connected to external test arrangements;It needs
Bright, in the present embodiment, USB can also be by the way of usb hub, to realize more test function online simultaneously
Can, in addition, external test arrangements can be PC, can be further connected to for the connection of proximal wire road or by USB
Until the mode of cloud server exists, the application is not construed as limiting for local area network or wide area network.
Step S103 starts the ECU to be tested, the work of the ECU to be tested is tested by the external test arrangements
Make performance.It should be noted that in the present embodiment, the ECU to be tested can direct electrifying startup, vehicle can also be passed through
Master controller, which is uniformly controlled, to be started or is closed, and then carries out operation test according to different control strategies.
It is noted that the application can be used for ECU test, such as anti-lock braking system ECU, four-wheel drive system
ECU, electronic automatic transmission ECU, active suspension system ECU, air bag system ECU, multidirectional adjustable electronic control seat ECU etc.,
In other embodiments, specifically can be also used for test engine ECU, motor MCU, battery BMS, automatic transmission TCU with
And hybrid controller HCU etc..
In the present embodiment, described the step of ECU to be tested is connected to PCAN hardware by CAN bus, specifically may be used
To include: the CAN_H and CAN_L that the ECU to be tested is connected respectively to the PCAN hardware by CAN_H and CAN_L.
It should be noted that it is described by PCAN hardware by ECU to be tested by USB in the way of be connected to external test arrangements
The step of, the external test arrangements are equipped with PCAN Explorer, and (one of German PEAK company exploitation is for monitoring CAN
The general utility tool of network data) and its series of tests software.
Correspondingly, the CAN bus test method can be comprising steps of the PCAN installed to the external test arrangements
Explorer and its series of tests software carry out secondary development, work out test program using VB script language.
For example, the step of establishment test program using VB script language, can specifically include: using VB
Script language works out seed request, seed generates the security certificate algorithm of key and sends key.
Correspondingly, the step of working performance that the ECU to be tested is tested by the external test arrangements, specifically
It may include: the secure access service that the ECU to be tested is tested by the external test arrangements.Referring specifically to Fig. 3 institute
The test effect figure shown.
In addition to the test for above-mentioned secure access service, the application uses CAN bus, PCAN hardware and PCAN
Explorer builds completion, additionally it is possible to meet car room, outdoor environment test, plateau Polar Experiment, endurance test and a variety of
The requirement of roadway experiment under harsh environment.The application can acquire the various parameters on automobile, cover speed, revolving speed, temperature, pressure
Power, flow, wind speed, humidity, temperature, voltage, electric current, pulse, acceleration, angular speed, angle, strain and CAN bus etc. are each
Kind signal.The application external test arrangements can monitor the signal in CAN bus in real time by PCAN-Explore software,
Visualization display, data record and analysis etc..Entire test system structure is compact, modularization, high-protection level, performance are stablized.
In addition, the application PCAN Explorer can be using PCAN-Explore5 (abbreviation PE5) series.All Files and
Element can be with preservation and management in engineering project, and engineering project component such as CAN connection, packet sending and receiving window, chart are shown
Plug-in unit, instrument board show that plug-in unit can also be clearly shown in engineering project;Integrated data logger can store CAN bus
On message and data information.The application test method can also include the baud rate and object type, configuration of configuration CAN bus
The operating process such as the parameters of test data collection.
The application is easy to operate, reliable and stable, can be analyzed according to the data and parameter of test automotive system, be counted
It calculates and studies, developing speed, shortening the development cycle for automotive system can be greatlyd improve.
The application PE5 (can contain a kind of text of associated binary file Debugging message with customized symbol file
Part), CAN message can be resolved to actual physical quantity, naturally it is also possible to import dbc file (database file), Er Qieke
To be embedded in VB script (scripting language that Microsoft produces), script can be created with Automatic dispatching complex task.In addition, PE5
The data that can integrate data recording function, therefore transmit in CAN bus can be recorded by PE5, analyzed and be saved, also
It can remotely be controlled by writing script.
For the application by using the mode of PCAN Explorer, purchase is convenient and at low cost, and can connect simultaneously multiple
The channel CAN, configurable data recording function, the integration standard that can also be integrated be macro and VB script, achievable each by script
Kind automation task, in addition can be while monitoring CAN network, running background script, while can be with the report in statistics network
Literary mistake and bus load etc..
ECU to be tested is connected to PCAN hardware by CAN bus by the application, is led to ECU to be tested using PCAN hardware
Cross USB mode and be connected to external test arrangements, start the ECU to be tested, by external test arrangements test it is described to
Test the working performance of ECU.It is arranged in pairs or groups by the above-mentioned means, the application can be avoided using high-cost Germany's Vector software
Canoe hardware testing system can substitute tens of thousands of first costs of existing testing scheme, effectively using the low cost of several hundred members or so
Ground reduces testing cost, and test effect is accurate, success rate is high, and test macro erection is simple and convenient to operate understandable, protects simultaneously
Card can be realized test function same as Germany's Vector software collocation canoe hardware testing system, guarantee the work of product
Performance.
Incorporated by reference to above embodiment referring to Fig.2, Fig. 2 is CAN bus test macro one embodiment party of the application based on UDS
The structural schematic diagram of formula.
In the present embodiment, the CAN bus test macro includes but is not limited to PCAN hardware 21 and external testing dress
Set 22.
The PCAN hardware 21, for being connected to ECU to be tested by CAN bus;
The external test arrangements 22, for being connected to the PCAN hardware 21 by USB mode, and then by described
PCAN hardware 21 is connected to the ECU to be tested, to pass through the external test arrangements 22 when starting the ECU to be tested
Test the working performance of the ECU to be tested.
It should be noted that in the present embodiment, PCAN hardware 21 is PCAN-USB or CAN card, may be implemented
CAN turns USB interface, the message on CAN bus network can be transferred on PC PC by USB interface, pass through correlation
Software see CAN message to produce, with this may be implemented test etc. correlation functions.
In the present embodiment, USB can also be by the way of usb hub, to realize more test function online simultaneously
Can, in addition, external test arrangements 22 can be PC, USB connection can be passed through for the connection of proximal wire road or further
To local area network or wide area network until the mode of cloud server exists, the application is not construed as limiting.
In the present embodiment, the ECU to be tested can direct electrifying startup, can also be united by vehicle main control device
One control is started or is closed, and then carries out operation test according to different control strategies.
It should be noted that the CAN_H and CAN_L of the PCAN hardware 21 can be connected respectively to the ECU to be tested
CAN_H and CAN_L.
Furthermore, the external test arrangements 22 are equipped with PCAN Explorer and its series of tests software.
It is noted that PCAN Explorer and its series of tests the software warp that the external test arrangements 22 are installed
Secondary development is crossed, test program is worked out using VB script language, wherein requested using VB script language establishment seed,
Seed generates the security certificate algorithm of key and sends key.
In the present embodiment, the external test arrangements 22 are used to test the secure access service of the ECU to be tested.
In addition to the test for above-mentioned secure access service, the application uses CAN bus, PCAN hardware 21 and PCAN
Explorer builds completion, additionally it is possible to meet car room, outdoor environment test, plateau Polar Experiment, endurance test and a variety of
The requirement of roadway experiment under harsh environment.The application can acquire the various parameters on automobile, cover speed, revolving speed, temperature, pressure
Power, flow, wind speed, humidity, temperature, voltage, electric current, pulse, acceleration, angular speed, angle, strain and CAN bus etc. are each
Kind signal.The application external test arrangements 22 can supervise in real time the signal in CAN bus by PCAN-Explore software
Control, visualization display, data record and analysis etc..Entire test system structure is compact, modularization, high-protection level, performance are steady
It is fixed.
In addition, the application PCAN Explorer can be using PE5 series.All Files and element can be with preservation and management
In engineering project, engineering project component such as CAN connection, packet sending and receiving window, chart show that plug-in unit, instrument board show plug-in unit
It can also be clearly shown in engineering project;Integrated data logger can store message and data information in CAN bus.
The application test method can also include the baud rate and object type, the items for configuring test data collection of configuration CAN bus
The operating process such as parameter.
The application is easy to operate, reliable and stable, can be analyzed according to the data and parameter of test automotive system, be counted
It calculates and studies, developing speed, shortening the development cycle for automotive system can be greatlyd improve.
CAN message can be resolved to actual physical quantity, certainly with customized symbol file by the application PE5
Dbc file can be imported, and VB script can be embedded in, script can be created with Automatic dispatching complex task.In addition, PE5 can
With integrated data writing function, therefore the data transmitted in CAN bus can be recorded by PE5, analyzed and be saved, and may be used also
Remotely to be controlled by writing script.
For the application by using the mode of PCAN Explorer, purchase is convenient and at low cost, and can connect simultaneously multiple
The channel CAN, configurable data recording function, the integration standard that can also be integrated be macro and VB script, achievable each by script
Kind automation task, in addition can be while monitoring CAN network, running background script, while can be with the report in statistics network
Literary mistake and bus load etc..
ECU to be tested is connected to PCAN hardware 21 by CAN bus by the application, will be to be tested using PCAN hardware 21
ECU is connected to external test arrangements 22 by USB mode, starts the ECU to be tested, is surveyed by the external test arrangements 22
Try the working performance of the ECU to be tested.Use high-cost Germany Vector soft by the above-mentioned means, the application can be avoided
Part is arranged in pairs or groups canoe hardware testing system, can be substituted using the low cost of several hundred members or so tens of thousands of members of existing testing scheme at
This, is effectively reduced testing cost, and test effect is accurate, success rate is high, and test macro erection is simple and convenient to operate easily
Understand, while guaranteeing to realize test function same as Germany's Vector software collocation canoe hardware testing system, guarantees to produce
The working performance of product.
In this application, above-mentioned CAN bus test macro and method based on UDS, can be used and has vehicle
In the Vehicular system of TBOX.
In the present embodiment, CAN may include three network channels CAN_1, CAN_2 and CAN_3, and vehicle can also be set
An ethernet network channel is set, wherein three CAN network channels can be logical by two car networking gateways and ethernet network
Road is connected, and for example, wherein CAN_1 network channel includes hybrid drive train, and wherein CAN_2 network channel includes
Running guarantee system, wherein CAN_3 network channel includes electric dynamometer system, and ethernet network channel includes higher management system
System, the higher management system include the people-Che-road simulation system being connected on ethernet network channel as node and comprehensive
Close information acquisition unit, the car networking gateway of the CAN_1 network channel, CAN_2 network channel and ethernet network channel
It can integrate in integrated information acquisition unit;CAN_3 network channel and the car networking gateway in ethernet network channel can collect
At in people-Che-road simulation system.
Furthermore, the node of the described CAN_1 network channel connection has: Engine ECU, motor MCU, battery BMS,
Automatic transmission TCU and hybrid controller HCU;The node of CAN_2 network channel connection has: rack TT&C system, oil
Door sensor group, power analyzer, instant oil consumption instrument, DC power cabinet, engine water temperature control system, engine motor oil temperature
Cold temperature control system in control system, motor water temperature control system and engine;The node of CAN_3 network channel connection
Have: electric dynamometer controller.
The rate of the preferred CAN_1 network channel is 250Kbps, using J1939 agreement;CAN_2 network channel
Rate be 500Kbps, using CANopen agreement;The rate of CAN_3 network channel is 1Mbps, using CANopen agreement;With
Too the rate of net network channel is 10/100Mbps, using ICP/IP protocol.
In the present embodiment, the car networking gateway can connect equipped with IEEE802.3 interface, DSPI interface, eSCI
Mouth, CAN interface, MLB interface, LIN interface and/or I2C interface.
In the present embodiment, it for example, IEEE802.3 interface can be used for connecting wireless router, is provided for vehicle
WIFI network;DSPI (supplier's manager component) interface is suitable for connecting Bluetooth adapter and NFC (close range wireless communication)
Orchestration can provide bluetooth connection and connect with NFC;ESCI interface is for connecting 4G/5G module, with internet communication;CAN interface
For connecting vehicle CAN bus;MLB interface is used to connect interior MOST (the system transmission towards media) bus, LIN interface
For connecting interior LIN (local interconnect network) bus;IC interface is for connecting DSRC (dedicated short range communication) module and fingerprint
Identification module.In addition, the application can mutually convert each different agreement by using MPC5668G chip, it will be different
Network merged.
In addition, present embodiment vehicle TBOX system, Telematics-BOX, referred to as vehicle-mounted TBOX or telematics
Device.
Present embodiment Telematics is the telecommunications (Telecommunications) and information science of telecommunication
(Informatics) synthesis is defined as leading by the computer system, wireless communication technique, satellite that are built on vehicle
Boat device exchanges the Internet technologies of information such as text, voice and provides the service system of information.Briefly just by wireless
Vehicle is accessed internet (car networking system) by network, provides various information necessary to driving, life for car owner.
In addition, present embodiment Telematics is wireless communication technique, satellite navigation system, network communication technology and vehicle
The synthesis for carrying computer when breaking down in vehicle driving, connects service centre by wireless communication, carries out remote vehicle and examines
Disconnected, built-in computer on the engine can recorde the state of vehicle main component, and provide accurately for maintenance personal at any time
Abort situation and reason.Information is received by user communication terminal and checks traffic map, road conditions introduction, traffic information, peace
Entirely with public security service and entertainment information service etc., in addition, the vehicle of present embodiment can also back seat be arranged electronic game
And network application.It can be appreciated that present embodiment provides service by Telematics, it can be convenient user and understand traffic letter
The parking situation in parking lot is ceased, closed on, current location is confirmed, can also be connect with the network server in family, understand house in time
In electric appliance working order, security situation and guest come to visit situation etc..
Present embodiment vehicle also settable ADAS (Advanced Driver Assistant System, advanced driving
Auxiliary system), it can use the above-mentioned various sensors being installed on vehicle, the environment number inside and outside first time collecting cart
According to the technical processing such as quiet, dynamic object identification, detecting and tracking being carried out, so as to allow driver when most fast
Between discover may generation danger, to arouse attention and improve safety.Accordingly, the application ADAS can also using radar,
The sensors such as laser and ultrasonic wave can detect light, heat, pressure or other for monitoring the variable of vehicle-state, be usually located at
The front/rear collision bumper of vehicle, side-view mirror, inside control stick or on windshield.It is not difficult to find out that above-mentioned ADAS function is used
Various Intelligent hardwares, can be accessed by way of ethernet link car networking system realize communication connection, interaction.
The host of present embodiment vehicle may include logical device, circuit and/or code appropriate for realizing OSI mould
Type (Open System Interconnection, inventionthe open systems interconnection reference model) five layers of operation above and/or
Feature operation.Therefore, host can be generated for the data packet of network transmission and/or be handled these data packets, and also
The data packet received from network can be handled.Meanwhile host can be by executing command adapted thereto and/or running a kind of or more
Application program is planted to provide service for local user and/or one or more remote users or network node.The application not
With in embodiment, one or more security protocols are can be used in host.
In this application, for realizing car networking system network connection can be interchanger, can have AVB function
(Audio Video Bridging, meet the standard set of IEEE802.1), and/or include that one or more unmasked is double
Twisted wire, every one end can have 8P8C modular connector.
In a preferred embodiment, car networking system can specifically include car body control module BCM, power bus P-
CAN, Vehicle Body Bus I-CAN, combination instrument CMIC, chassis control device and vehicle body control.
In the present embodiment, car body control module BCM can integrate the function of car networking gateway, carry out different segment,
That is signal conversion and message forwarding between power bus P-CAN and Vehicle Body Bus I-CAN etc., for example, being articulated in power bus
On controller as need communicated with the controller being articulated on Vehicle Body Bus I-CAN, then to pass through car body control module
BCM carries out signal conversion and forwarding between the two etc..
Power bus P-CAN and Vehicle Body Bus I-CAN are connected with car body control module BCM respectively.
Combination instrument CMIC is connected with power bus P-CAN, and combination instrument CMIC is connected with Vehicle Body Bus I-CAN.It is excellent
Selection of land, the combination instrument CMIC of present embodiment and different buses, as power bus P-CAN and Vehicle Body Bus I-CAN are homogeneous
Even, when combination instrument CMIC, which needs to obtain, is articulated in the controller information in any bus, without passing through Body Control mould
Block BCM carries out signal conversion and message forwarding, therefore, can reduce gateway pressure, reduces network load, and improve combination instrument
The speed of CMIC acquisition information.
Chassis control device is connected with power bus P-CAN.Vehicle body control is connected with Vehicle Body Bus I-CAN.One
In a little examples, chassis control device and vehicle body control can be carried out on power bus P-CAN and Vehicle Body Bus I-CAN respectively
The data broadcastings such as information, so as to equipment such as other Vehicle Controllers for being articulated on power bus P-CAN or Vehicle Body Bus I-CAN
The information of the broadcast is obtained, to realize the communication between the mobile units such as different controllers.
In addition, the car networking system of present embodiment vehicle, can be used two CAN bus, i.e. power bus P-CAN and
Vehicle Body Bus I-CAN, it is using car body control module BCM as gateway, combination instrument CMIC and power bus P-CAN and vehicle body is total
Line I-CAN connected structure can eliminate on one that combination instrument CMIC in traditional approach is articulated in two buses
When chassis control device or vehicle body control information by gateway forwards to the operation of combination instrument CMIC, subtract as a result,
Light pressure of the car body control module BCM as gateway, reduces network load, and more convenient by multiple bus, such as power
The information of the mobile unit mounted on bus P-CAN and Vehicle Body Bus I-CAN, which is sent on combination instrument CMIC, to be shown, is believed
Breath transmission strong real-time.
CAN bus test macro and method of the application based on UDS can be tested for above-mentioned many and diverse vehicle,
Corresponding provide more improves thorough testing service, while making Vehicular system development in an all-round way, can be realized corresponding comprehensive system
Unified test examination, avoids using high-cost testing tool, and can guarantee test result, generally pushes away conducive in vehicle manufacturers
It is wide to use.
The above is only the preferred embodiment of the application, not makes any form of restriction to the application, though
Right the application has been disclosed in a preferred embodiment above, however is not limited to the application, any technology people for being familiar with this profession
Member, is not departing within the scope of technical scheme, when the technology contents using the disclosure above make a little change or modification
For the equivalent embodiment of equivalent variations, but all technical spirits pair without departing from technical scheme content, according to the application
Any simple modification, equivalent change and modification made by above embodiments, in the range of still falling within technical scheme.