Specific embodiment
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to be able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
Automobile bus data includes controlling the parking assisting system of automobile, Lane Departure Warning System, Motronic control maps control
System processed, anti-blocking brake system, electric boosting steering system, adaptive cruise control system, frontal collisions early warning system etc.
Data, if automobile bus data is attacked, then using by attack to automobile bus data just can control automobile
Above-mentioned various system, thus lead to the safety problem of automobile.
As shown in figure 1, automobile CAN-bus are not only connected with the part of automobile, such as motor control component, Active Suspensions portion
Part, speed Control part, ABS, electric door lock, air bag, motorized window etc., are also associated with vehicle body network communication module (automobile
With cellular network, 3g, the mobile communication module of the network service such as 4g, bluetooth communication, local area network communications module, broadcast communication
Module etc.), OBD (the rear installing that (On-Board Diagnostics OBD), other users access privately
Standby, in CAN, the data of transmission includes the control data of modules, present applicant proposes a kind of utilize in CAN
The new approaches to carry out automotive safety detection for the data of transmission.
The application provides a kind of method detecting vehicle safety based on test case, as shown in Fig. 2 the method includes:
S1. set up communication with automobile CAN-bus to be connected;
S2. gather the message data on automobile CAN-bus and it is stored, according to the mark of the message data being stored
Knowledge information forms test case;
S3. described test case is sent to CAN, move according in response to the vehicle condition of described test case or automobile
Make to determine automobile whether safety.
The method can be carried in a detection platform, and concrete detection platform can be realized by browser.The method can be
Realize on the equipment such as mobile terminal, panel computer, PC, in step sl, set up described equipment before communication is connected with automobile
Set up hardware with automobile bus to be connected, after setting up hardware connection, pass through input system order python in command window
Main.py, to set up the communication port of hardware connecting interface and browser, after setting up this communication port, is inputted by browser
Predetermined network address, just can run this detection platform on equipment, that is, pass through the operation knot by each step above-mentioned for the operation of browser
Fruit is shown in the form of a web page, user's display to message data based on webpage, may be selected which message data is deposited
Storage, also may be selected for message data to be stored in a buffer area or multiple buffer area.After data is cached, according to institute
The identification information of the message data of storage forms test case;One test case corresponds to a state of automobile or moves
Make.Data in Real-time Collection CAN, in general, the data in the CAN related to a state or action has
There is identical mark ID, carry out process based on these data and can form test case.In order to detect the safety of automobile, by institute
The test case being formed re-sends in bus, and automobile is responded according to the test case data being sent in bus, according to
Response just can judge the safety of automobile, if test case is automobile opening the bus data of car door, then the response of automobile
If opening car door, then illustrate that automobile can be completely controlled, safety is very low.
The said method being proposed by the application, can automatically form test case according to the data of Real-time Collection, from
And can the controlled probability of automatic detection automobile, and then be capable of detecting when the security breaches of automobile.
As other embodiments, after being connected with automobile CAN-bus foundation communication, the operating system according to equipment is not
With the window of order can be different, and the order setting up browser with the communication port of hardware connecting interface would also vary from.
And said method also can be realized by application programs such as electronic client, APP, in this implementation, even phase
Same device operating system, because the mode realized is different, communication port will be different, and the order of input would also vary from,
The application here is not done limitation and is limited.
As a kind of specific embodiment, during message data on gathering automobile CAN-bus, current data information is deposited
Store up relief area, this buffer information is the relief area that system automatically determines, relief area is identified with certain sequence number.As
The message data with an identification information ID or the message data with a class mark Information ID are stored in by fruit user determination
One new relief area, can by select gathered message data and pass through predetermined command or trigger predetermined button by its
Save as a new relief area.By such technological means, facilitate user to carry out selection and the lookup of test case, be also convenient for
Carry out the playback of test case in units of buffer area.
As a kind of specific embodiment, during message data on gathering automobile CAN-bus, shown in real time by interface
The current data information being gathered, is particularly shown content and includes message identification information canID, can be identified by column name Mid,
Including message data, specifically can be identified by column name Data, including times of collection, the number of times that is, a message occurs, tool
Body can be identified by column name Count, including time interval, i.e. time interval between every message, specifically can pass through row
Title Interval is identifying.In the situation of explicit message data association message, user may be selected message data to be reset, base
This upper test case at least includes the message data with an identification information ID, such as corresponds to automobile and completes one
The control message data of action, or all control message datas about ABS system, frontal collisions early warning system is all
Control data etc..
Described test case (i.e. the playback of test case) is sent to CAN, specifically may include:
Described test case is sent to CAN according to predetermined interval;Or
Described test case pre-determined number is sent to CAN;Or
Single test case is sent to CAN;Or
CAN is sent with multiple test cases of buffer memory.
Above-mentioned predetermined interval, pre-determined number flexibly can be arranged such that it is able to protect by setup module
Card detects motility, the repeatability of vehicle safety using test case, also helps improve the standard of detection vehicle safety
Exactness.
In a specific embodiment, the method is based on client software or PC execution.Detailed process is:Set described
It is connected for setting up hardware with automobile bus, after setting up hardware connection, pass through input system order python in command window
Main.py setting up the communication port of hardware connecting interface and browser, after setting up this communication port, by starting client
Software, just can run this detection platform on equipment, that is, pass through the operation knot by each step above-mentioned for the operation of client software
Fruit is shown in the form of graphic user interface, user's display to message data based on graphic user interface, and which may be selected
A little message datas are stored, and also may be selected for message data to be stored in a buffer area or multiple buffer area.To data
After entering row cache, the identification information according to the message data being stored forms test case;One test case corresponds to automobile
A state or action.Data in Real-time Collection CAN is in general, related to a state or action
Data in CAN has identical mark ID, carries out process based on these data and can form test case.In order to detect
The safety of automobile, the test case being formed is re-send in bus, and automobile is according to the test case being sent in bus
Data is responded, and just can judge the safety of automobile according to response, if test case is automobile opening the number of buses of car door
According to, then the response of automobile is if open car door, then illustrate that automobile can be completely controlled, safety is very low.
The said method being proposed by the application, can automatically form test case according to the data of Real-time Collection, from
And can the controlled probability of automatic detection automobile, and then be capable of detecting when the security breaches of automobile.
In playback test case, carry out the selection of playback message by predetermined function button or order.As one kind
Specific embodiment, arranges Replay functional module, and under this functional module, setting replay mode sets input frame, input frame
Label can be Replay mode, replay mode be may be selected by this input frame user, selectable replay mode has wall scroll weight
Mode playback (for the playback of wall scroll message), single buffer area replay mode (message in a buffer area is reset), delay more
Deposit area's replay mode (message in several buffer areas is reset).Set by Interval input frame and reset between message
The interval of replay;The number of times that frame sets replay is set by Replay time;Report of resetting is set by Mid input frame
Mark Id of literary composition;Set the data content of message by Data input frame.By this embodiment, user can be to report to be reset
Literary composition is flexibly set such that it is able to concentrating, comprehensively detected so as to vapour to the secure context corresponding to an automobile
The safety detection of car can be carried out according to the wish of user.
As a kind of specific embodiment, set the line rate of collection Can message by control module, can position
125,250,500, can flexibly control the data volume of unit interval collection by such means.For the different time periods or
The different test vehicle of person, can arrange the collection that different line rates carry out Can bus data.
As another specific embodiment, after in the message data in collection CAN and it being stored, to being adopted
The message data of collection is classified according to ID, based on the classification real-time update data classified, according to the data display number of real-time update
According to position change.Concrete as shown in figure 3, classification message identification Information ID with form 0x12D- (301), ox12F- (303),
0x133- (307), 0x1EB- (491), 0x2B6- (694) etc. show, concrete message data content corresponding with above-mentioned id information
As follows:11500010041902FF、48A5110000000030、00310000140200D0、A900000000000000、
0B0312161A000500, corresponding with above-mentioned id information, times of collection is as follows:96,57,48,59,104, with above-mentioned id information
Corresponding, the time interval of collection message is 1000.2532005310059,1000.25296211224268,
999.5129108428955,1024.0538120269775,499.3319511413574.Permissible from several specific examples above
Find out, message data shows situation in real time, can be seen that data bit becomes according to the identification information of message data, concrete data content
Change, the change of data bit can be as accurate as Millisecond in time, thus provide very accurate to the detection of automotive safety leak
True test case data basis.
That is, by the collection to bus message data, can collecting and be related to bus marco safety almost
All of data, and these data, when playback re-sends in CAN, can almost detect nearly all safety and leak
Hole.
In fact, being all the complete message data after gathering and caching of resetting in embodiment described above.As deformation
A kind of embodiment, can also be before replay data message, data be managed, detailed process is:To collection simultaneously
Cache and carry out NAND Logic computing to the message data of buffer area, the identification information ID that NAND Logic computing is directed to message data enters
OK, thus to the packet receiving in front and back negated common factor, new data packets can be got according to identification information ID.Then for
New data packets, carry out duplicate removal computing on data content, and the data content reflection after duplicate removal is for the control of concrete automobile function
Whether information, is reset using the carrying out carrying out the data content single packet after duplicate removal computing, to carry out automobile can be controlled
The test of system, the display interface of the data after duplicate removal can be as shown in Figure 4.
For embodiment of the method, in order to be briefly described, therefore it is all expressed as a series of combination of actions, but this area
Technical staff should know, the embodiment of the present invention is not limited by described sequence of movement, because implementing according to the present invention
Example, some steps can be carried out using other orders or simultaneously.Secondly, those skilled in the art also should know, description
Described in embodiment belong to preferred embodiment, necessary to the involved action not necessarily embodiment of the present invention.
The application also provides a kind of device detecting vehicle safety based on test case, as shown in figure 5, this device bag
Include:
Communication connection member 100, is connected for setting up communication with automobile CAN-bus;
Acquisition component 200, for gathering the message data on automobile CAN-bus and it being stored;
Test case generating means 300, forms test case for the identification information according to the message data being stored;
Reproduction part 400, for sending described test case to CAN, according to the vapour in response to described test case
Car state or automobile action are determining automobile whether safety.
In the apparatus, described communication connection member 100 hardware can be made up of data wire data interface, for setting up
Described device and the data transmission channel of automobile bus.
Described acquisition component 200, test case generating means 300, on reproduction part 400 hardware by mobile terminal, PC,
Realizing, major function is based on browser application or visitor to the processor of the first-class equipment with processing function of panel computer
The Implement of Function Module of family end application software.The described operation setting up described device and the data transmission channel equipment of automobile bus
Command interface in system is realizing.
The said apparatus being proposed by the application, can automatically form test case according to the data of Real-time Collection, and
In time and controllably test case is returned in automobile Can bus so as to the controlled possibility of automatic detection automobile
Property, and then it is capable of detecting when the security breaches of automobile.
If described equipment realizes the collection of message data, display and management by browser application, then with
Described equipment and automobile bus are set up hardware before setting up communication connection and are connected by automobile, after setting up hardware connection, in command window
Mouth sets up the communication port of hardware connecting interface and browser by input system order python main.py, should setting up
After communication port, predetermined network address is inputted by browser, just this detection platform can be run on equipment, that is, by the fortune of browser
The operation result being about to each step above-mentioned is shown in the form of a web page, user's display to message data based on webpage,
May be selected which message data is stored, also may be selected for message data to be stored in a buffer area or multiple buffer area.
After data is cached, the identification information according to the message data being stored forms test case;One test case pair
Should be in automobile a state or action.Data in Real-time Collection CAN, in general, with a state or dynamic
Make the data in related CAN and there is identical mark ID, carry out process based on these data and can form test case.
In order to detect the safety of automobile, the test case being formed is re-send in bus, automobile is according to being sent in bus
Test case data is responded, and just can judge the safety of automobile according to response, if test case is automobile opens car door
Bus data, then the response of automobile is if open car door, then illustrate that automobile can be completely controlled, safety is very
Low.
As other embodiments, after being connected with automobile CAN-bus foundation communication, the operating system according to equipment is not
With the window of order can be different, and the order setting up browser with the communication port of hardware connecting interface would also vary from.
And said method also can be realized by application programs such as electronic client, APP, in this implementation, even phase
Same device operating system, because the mode realized is different, communication port will be different, and the order of input would also vary from,
The application here is not done limitation and is limited.
As a kind of specific embodiment, during message data on gathering automobile CAN-bus, current data information is deposited
Store up relief area, this buffer information is the relief area that system automatically determines, relief area is identified with certain sequence number.As
The message data with an identification information ID or the message data with a class mark Information ID are stored in by fruit user determination
One new relief area, can by select gathered message data and pass through predetermined command or trigger predetermined button by its
Save as a new relief area.By such technological means, facilitate user to carry out selection and the lookup of test case, be also convenient for
Carry out the playback of test case in units of buffer area.
As a kind of specific embodiment, during message data on gathering automobile CAN-bus, shown in real time by interface
The current data information being gathered, is particularly shown content and includes message identification information canID, can be identified by column name Mid,
Including message data, specifically can be identified by column name Data, including times of collection, the number of times that is, a message occurs, tool
Body can be identified by column name Count, including time interval, i.e. time interval between every message, specifically can pass through row
Title Interval is identifying.In the situation of explicit message data association message, user may be selected message data to be reset, base
This upper test case at least includes the message data with an identification information ID, such as corresponds to automobile and completes one
The control message data of action, or all control message datas about ABS system, frontal collisions early warning system is all
Control data etc..
In a specific embodiment, terminal unit is based on client software or PC execution.Detailed process is:Will be described
Equipment is set up hardware with automobile bus and is connected, and after setting up hardware connection, passes through input system order python in command window
Main.py setting up the communication port of hardware connecting interface and browser, after setting up this communication port, by starting client
Software, just can run this detection platform on equipment, that is, pass through the operation knot by each step above-mentioned for the operation of client software
Fruit is shown in the form of graphic user interface, user's display to message data based on graphic user interface, and which may be selected
A little message datas are stored, and also may be selected for message data to be stored in a buffer area or multiple buffer area.To data
After entering row cache, the identification information according to the message data being stored forms test case;One test case corresponds to automobile
A state or action.Data in Real-time Collection CAN is in general, related to a state or action
Data in CAN has identical mark ID, carries out process based on these data and can form test case.In order to detect
The safety of automobile, the test case being formed is re-send in bus, and automobile is according to the test case being sent in bus
Data is responded, and just can judge the safety of automobile according to response, if test case is automobile opening the number of buses of car door
According to, then the response of automobile is if open car door, then illustrate that automobile can be completely controlled, safety is very low.
In playback test case, carry out the selection of playback message by predetermined function button or order.As one kind
Specific embodiment, arranges Replay functional module, and under this functional module, setting replay mode sets input frame, input frame
Label can be Replay mode, replay mode be may be selected by this input frame user, selectable replay mode has wall scroll weight
Mode playback (for the playback of wall scroll message), single buffer area replay mode (message in a buffer area is reset), delay more
Deposit area's replay mode (message in several buffer areas is reset).Set by Interval input frame and reset between message
The interval of replay;The number of times that frame sets replay is set by Replay time;Report of resetting is set by Mid input frame
Mark Id of literary composition;Set the data content of message by Data input frame.By this embodiment, user can be to report to be reset
Literary composition is flexibly set such that it is able to concentrating, comprehensively detected so as to vapour to the secure context corresponding to an automobile
The safety detection of car can be carried out according to the wish of user.
As a kind of specific embodiment, set the line rate of collection Can message by control module, can position
125,250,500, can flexibly control the data volume of unit interval collection by such means.For the different time periods or
The different test vehicle of person, can arrange the collection that different line rates carry out Can bus data.
As another specific embodiment, after in the message data in collection CAN and it being stored, to being adopted
The message data of collection is classified according to ID, based on the classification real-time update data classified, according to the data display number of real-time update
According to position change.The message identification Information ID of classification is with form 0x12D- (301), ox12F- (303), 0x133- (307), 0x1EB-
(491), the display such as 0x2B6- (694), corresponding with above-mentioned id information, concrete message data content is as follows:
11500010041902FF、48A5110000000030、00310000140200D0、A900000000000000、
0B0312161A000500, corresponding with above-mentioned id information, times of collection is as follows:96,57,48,59,104, with above-mentioned id information
Corresponding, the time interval of collection message is 1000.2532005310059,1000.25296211224268,
999.5129108428955,1024.0538120269775,499.3319511413574.Permissible from several specific examples above
Find out, message data shows situation in real time, can be seen that data bit becomes according to the identification information of message data, concrete data content
Change, the change of data bit can be as accurate as Millisecond in time, thus provide very accurate to the detection of automotive safety leak
True test case data basis.
That is, by the collection to bus message data, can collecting and be related to bus marco safety almost
All of data, and these data, when playback re-sends in CAN, can almost detect nearly all safety and leak
Hole.
In fact, being all the complete message data after gathering and caching of resetting in embodiment described above.As deformation
A kind of embodiment, can also be before replay data message, data be managed, detailed process is:To collection simultaneously
Cache and carry out NAND Logic computing to the message data of buffer area, the identification information ID that NAND Logic computing is directed to message data enters
OK, thus to the packet receiving in front and back negated common factor, new data packets can be got according to identification information ID.Then for
New data packets, carry out duplicate removal computing on data content, and the data content reflection after duplicate removal is for the control of concrete automobile function
Whether information, is reset using the carrying out carrying out the data content single packet after duplicate removal computing, to carry out automobile can be controlled
The test of system.Therefore test case generating means 300, has specifically included logical AND non-process unit, for based on message data
Identification information ID logic NAND operation is carried out to data message, thus obtaining the new data packets that collect;Data deduplication unit,
For to duplicate removal computing, renaming unit are carried out on data content, line command can be entered to it for the packet after duplicate removal, and will
Single packet sends and carries out security test to bus.By above-mentioned specific embodiment, can accurately get bus marco
Information, carries out safety test based on bus marco information, further improves the precision of safety detection.
As a kind of specific embodiment, this device also includes:Command window module, for providing order input window to supply
User input predetermined command, to gather the message data on automobile CAN-bus.
Described reproduction part specifically includes:
First test case transmitting element, for sending described test case according to predetermined interval to CAN;Or
Person
Second test case transmitting element, for sending described test case pre-determined number to CAN;Or
3rd test case transmitting element, for sending single test case to CAN;Or
4th test case transmitting element, for sending multiple test cases of buffer memory to CAN.
Above-mentioned predetermined interval, pre-determined number flexibly can be arranged such that it is able to protect by setup module
Card detects motility, the repeatability of vehicle safety using test case, also helps improve the standard of detection vehicle safety
Exactness.
This device also includes, set parts, for the speed of setting collection CAN message.
The method and apparatus of the detection vehicle safety introduced based on the present embodiment, those skilled in the art can
Understand the specific embodiment of electronic equipment and its various change form of the present embodiment, so here is for this electronic equipment
The method making marks how realized in the embodiment of the present application is no longer discussed in detail.As long as those skilled in the art implement this
The device that the method making marks in application embodiment is adopted, broadly falls into the scope that the application to be protected.
In general, in transmission bus data, in order to ensure to transmit safety, can be encrypted end to end, at one end
Verification, the inspection of data and the comparison of timestamp can be carried out when receiving bus data.The application utilizes direct data acquisition bus data,
Again the bus data being gathered is reset transmission to the principle of bus it is only necessary to enter row cache and selection to the data of collection, then
Reset and send to bus, the response according to automobile can detect that the safety of automobile, multiple without carrying out to bus data
The complicated data handling procedure such as miscellaneous deciphering, encryption, verification, comparing, therefore saves substantial amounts of data processing resources.
And because almost all of control data all can be sent by bus, the playback hence with bus data almost can detect
The security breaches of all control aspects.
Method and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use various
Programming language realizes the content of invention described herein, and the description above language-specific done is to disclose this
Bright preferred forms.
In description mentioned herein, illustrate a large amount of details.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case of not having these details.In some instances, known method, structure are not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly it will be appreciated that in order to simplify the disclosure and help understand one or more of each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield more features than the feature being expressly recited in each claim.More precisely, it is such as following
Claims reflected as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
The claims following specific embodiment are thus expressly incorporated in this specific embodiment, wherein each claim itself
All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that and the module in the equipment in embodiment can be carried out adaptively
Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list
Unit or assembly be combined into a module or unit or assembly, and can be divided in addition multiple submodule or subelement or
Sub-component.In addition to such feature and/or at least some of process or unit exclude each other, can adopt any
Combination is to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed
Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can carry out generation by the alternative features providing identical, equivalent or similar purpose
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments in this include institute in other embodiments
Including some features rather than further feature, but the combination of the feature of different embodiment means to be in the scope of the present invention
Within and form different embodiments.For example, in the following claims, embodiment required for protection any it
One can in any combination mode using.
The all parts embodiment of the present invention can be realized with hardware, or to run on one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) come to realize gateway according to embodiments of the present invention, proxy server, in system
Some or all parts some or all functions.The present invention is also implemented as executing side as described herein
Some or all equipment of method or program of device (for example, computer program and computer program).Such
The program realizing the present invention can store on a computer-readable medium, or can have the shape of one or more signal
Formula.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or with any other shape
Formula provides.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference markss between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can come real by means of the hardware including some different elements and by means of properly programmed computer
Existing.If in the unit claim listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.