Summary of the invention
In view of this, the application provides the program flow monitoring method and apparatus of a kind of vehicle complete vehicle controller,
When mistake occurs in the program flow of entire car controller, Full Vehicle System is protected, prevents automobile from occurring
Serious accident.
To achieve these goals, it is proposed that scheme as follows:
A kind of program flow monitoring method of vehicle complete vehicle controller, including:
Obtain program flow monitoring input data;
The default fixed number corresponding based on described program flow monitoring input data, each program and each
The current run sequence of program, exports the first program flow monitoring output data according to preset algorithm;
Judge whether described first program flow monitoring output data export data with default second program flow monitoring
Match, wherein said second program flow monitoring output data be based on described program flow monitoring export data,
Described default fixed number that each program is corresponding and the normal run sequence of each program, according to described
The program flow monitoring output data of preset algorithm output;
Wherein, if coupling, determine program flow normal operation, otherwise determine program flow operation exception.
Preferably, described based on described program flow monitoring input data, each program corresponding preset fixing
Numbering and the current run sequence of each program, export the first program flow monitoring output according to preset algorithm
Data, including:
The monitoring of described program flow is inputted the data calculating input data as first program, by any journey
The calculating output data of sequence are as the calculating input data of next program;
Utilize pre-imputationCalculate successively respectively according to the current run sequence of each program
The calculating output data of individual program;
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR;
The calculating of last program is exported data as described first program flow monitoring output data.
Preferably, the calculating process of described second program flow monitoring output data is:
The monitoring of described program flow is inputted the data calculating input data as first program, by any journey
The calculating output data of sequence are as the calculating input data of next program;
Utilize pre-imputationCalculate successively respectively according to the normal run sequence of each program
The calculating output data of individual program;
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR;
The calculating of last program is exported data as described first program flow monitoring output data.
Preferably, described default fixed number is each program sequence when running according to normal run sequence
Number.
Preferably, described determine program flow operation exception after, also include: close entire car controller CAN
Communication and outside output, and recording exceptional information.
A kind of program flow supervising device of vehicle complete vehicle controller, including:
Data acquisition unit, is used for obtaining program flow monitoring input data;
First computing unit, for based on corresponding pre-of described program flow monitoring input data, each program
If fixed number and the current run sequence of each program, export the first program flow prison according to preset algorithm
Control output data;
Judging unit, be used for judging described first program flow monitoring output data whether with default second program
Flow monitoring output data match, wherein said second program flow monitoring output data are based on described program
Described default fixed number and the normal of each program that flow monitoring output data, each program are corresponding are transported
Line order arranges, the program flow monitoring output data exported according to described preset algorithm;
Wherein, if coupling, determine program flow normal operation, otherwise determine program flow operation exception.
Preferably, described first computing unit specifically for:
The monitoring of described program flow is inputted the data calculating input data as first program, by any journey
The calculating output data of sequence are as the calculating input data of next program;
Utilize pre-imputationCalculate successively respectively according to the current run sequence of each program
The calculating output data of individual program;
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR;
The calculating of last program is exported data as described first program flow monitoring output data.
Preferably, also include:
Second computing unit, described second computing unit specifically for:
The monitoring of described program flow is inputted the data calculating input data as first program, by any journey
The calculating output data of sequence are as the calculating input data of next program;
Utilize pre-imputationCalculate successively respectively according to the normal run sequence of each program
The calculating output data of individual program;
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR;
The calculating of last program is exported data as described first program flow monitoring output data.
Preferably, also including: when determining program flow operation exception, the CAN closing entire car controller leads to
Letter and the control unit of outside output.
Preferably, also include: when determining program flow operation exception, the memory element of recording exceptional information.
Through as shown from the above technical solution, this application discloses the program flow prison of a kind of vehicle complete vehicle controller
Control method and apparatus.When program flow is monitored, the method based on program flow monitoring input data,
Default fixed number that each program is corresponding and the current run sequence of each program, according to preset algorithm
Export program flow monitoring output data, the i.e. first program flow monitoring output data.And then, it is judged that should
Whether the first program flow monitoring output data export data match with default second program flow monitoring, due to
The computing formula of the second program flow monitoring output data and the computing formula phase of the first program flow monitoring data
Be that the computation sequence to each program is different with, its difference, the first program monitoring output data be by
Calculating output according to current run sequence, the second program monitoring output data are according to normal run sequence meter
Calculate output, thus when the first program monitoring exports data with the second program monitoring output data match,
Then explanation present procedure stream runs according to normal run sequence.As can be seen here, the present invention can realize car load
The monitoring of director demon stream, when mistake occurs in the program flow of entire car controller, to enter Full Vehicle System
Row protection, prevents automobile from serious accident occur.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out
Clearly and completely describe, it is clear that described embodiment is only a part of embodiment of the present invention, and
It is not all, of embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not doing
Go out the every other embodiment obtained under creative work premise, broadly fall into the scope of protection of the invention.
See Fig. 1 and show the program flow of a kind of vehicle complete vehicle controller disclosed in one embodiment of the invention
The schematic flow sheet of monitoring method.
As shown in Figure 1, the method includes:
S11: obtain program flow monitoring input data.
This program flow monitoring input data are preset data, and user can be according to needing program flow in reality
Monitoring input data are configured.
S12: the default fixed number corresponding based on described program flow monitoring input data, each program and
The current run sequence of each program, exports the first program flow monitoring output data according to preset algorithm.
First arranging different fixed number for each program, the fixed number corresponding to program difference is different.
As, serial number when can run according to normal run sequence according to each program arranges each program pair
The fixed number answered.
Serial number when program A, B, C, D, E run according to normal run sequence is respectively 1,2,3,
4,5, i.e. program A be first run program, program B be second run program, program C be
3rd run program, program D be the 4th run program, program E be the 5th run program.
And then, calculate according to preset algorithm successively according to the current run sequence of each program, thus
Export the first program flow monitoring output data.
As, when program A, B, C, D, E run according to the sequence of B, A, C, D, E, then basis
The corresponding fixed number (2,1,3,4,5) of program flow monitoring input data and each program calculates defeated
Go out described first program flow monitoring output data.
S13: judge whether described first program flow monitoring output data export with default second program flow monitoring
Data match.
It should be noted that described second program flow monitoring output data are when each program is according to normal fortune
When line order row run, the preset algorithm identical with step S12 is used to calculate the data of output.
As, serial number when program A, B, C, D, E run according to normal run sequence be respectively 1,2,
3,4,5, i.e. program A be first run program, program B be second run program, program C
Be the 3rd run program, program D be the 4th run program, program E be the 5th run journey
Sequence.
Using 1,2,3,4,5 as the fixed number of each program, when program is according to properly functioning sequence
Row run time, according to program flow monitoring input data and each program corresponding fixed number (1,2,3,
4,5) output the second program flow monitoring output data are calculated.
S14: if coupling, determine program flow normal operation, otherwise determine program flow operation exception.
Above example this application discloses a kind of program flow monitoring method of vehicle complete vehicle controller.Right
When program flow is monitored, the method is based on program flow monitoring input data, corresponding the presetting of each program
Fixed number and the current run sequence of each program, export a program flow monitoring according to preset algorithm
Output data, the i.e. first program flow monitoring output data.And then, it is judged that the monitoring output of this first program flow
Whether data export data match with default second program flow monitoring, due to the second program flow monitoring output
The computing formula of data is identical with the computing formula of the first program flow monitoring data, and its difference is respectively
The computation sequence of individual program is different, and the first program monitoring output data are to calculate defeated according to current run sequence
Going out, the second program monitoring output data calculate output according to normal run sequence, thus when first
When program monitoring output data and the second program monitoring output data match, then explanation present procedure stream is pressed
Run according to normal run sequence.As can be seen here, the present invention can realize the monitoring to entire car controller program flow,
When mistake occurs in the program flow of entire car controller, Full Vehicle System is protected, prevents automobile from occurring
Serious accident.
See Fig. 2 and show the program of a kind of vehicle complete vehicle controller disclosed in another embodiment of the present invention
The schematic flow sheet of flow monitoring method.
In the present embodiment, the method specifically includes:
S21: obtain program flow monitoring input data.
S22: the default fixed number corresponding based on described program flow monitoring input data, each program and
The current run sequence of each program, exports the first program flow monitoring output data according to preset algorithm.
Optional, the calculating process of the most described first program flow monitoring output data is specific as follows:
The program flow monitoring input data got in step S21 are run program as current first
Calculate input data.
Utilize pre-imputationCalculate first calculating output data running program, and
That runs program using first calculates output data as second calculating input data running program, ginseng
With to second run program calculating in.
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR.
According to above-mentioned method, the calculating output data of any one operation program are run journey as the next one
The technology input data of sequence, during participating in the calculating of next service data, thus complete whole
The calculating of individual operation program.
Finally the output data that calculate of last program are exported number as the first above-mentioned program flow monitoring
According to.
S23: judge whether described first program flow monitoring output data export with default second program flow monitoring
Data match.
It should be noted that the second program flow monitoring in step S23 exports calculation and the step of data
The calculation of the first program flow monitoring output data described in S22 is identical, and its difference is step
In S23, each program is run according to normal run sequence.
S24: if coupling, determine program flow normal operation, otherwise determine program flow operation exception
S25: when program flow operation exception, close entire car controller CAN (controller local area network,
Controller Area Network) communication exports with outside, and recording exceptional information.
See Fig. 3 and show the program of a kind of vehicle complete vehicle controller disclosed in another embodiment of the present invention
The structural representation of flow monitoring device.
From the figure 3, it may be seen that the method includes: data acquisition unit the 1, first computing unit 2 and judging unit 3.
Data acquisition unit 1 is used for obtaining program flow monitoring input data and by this program flow monitoring input number
According to sending to the first computing unit 2.
First computing unit 2 receive data acquisition unit 1 send program flow monitoring input data, and based on
Default fixed number that this program flow monitoring input data, each program is corresponding and each program current
Running process, exports the first program flow monitoring output data according to preset algorithm.
Optionally, serial number when can run according to normal run sequence according to each program arranges each journey
The fixed number that ordered pair is answered.
Judging unit 3 compares the first program flow monitoring output data of the first computing unit 2 output and prestores
The second program flow monitoring data, with judge described first program flow monitoring output data whether with preset the
Two program flow monitoring output data match.
It should be noted that above-mentioned second program flow monitoring output data are defeated based on the monitoring of described program flow
Go out described default fixed number corresponding to data, each program and the normal run sequence of each program,
The program flow monitoring output data exported according to described preset algorithm.It is to say, the second program flow monitoring
The computing formula of output data is identical with the computing formula of the first program flow monitoring data, and its difference is
Different to the computation sequence of each program, the first program monitoring output data are according to current run sequence meter
Calculating output, the second program monitoring output data calculate output according to normal run sequence.
When judging unit 3 determines the first program flow monitoring output data and the second program flow monitoring output data
During coupling, determine that each program is run according to normal run sequence, otherwise determine program flow operation exception.
See Fig. 4 and show the program of a kind of vehicle complete vehicle controller disclosed in another embodiment of the present invention
The structural representation of flow monitoring device.
Unlike a upper device embodiment, this device is except above-mentioned data acquisition in the present embodiment
Outside collection unit the 1, first computing unit 2 and judging unit 3, also include the second computing unit 4, control list
Unit 5 and memory element 6.
Wherein, described computing unit 4 data acquisition unit 1 respectively is connected with judging unit 3, for according to number
The program flow monitoring input data collected according to collecting unit 1 calculate the second program flow monitoring output data, and
Calculated second program flow monitoring output data are sent to judging unit 3.
Described control unit 2 is connected with described judging unit 3, for receiving the judgement knot of judging unit 3 output
Really, the first program flow monitoring output data and the second program flow are shown when the judged result of judging unit 3 output
Monitoring output data are not mated, and during the most current program flow operation exception, control unit 2 closes full-vehicle control
The CAN communication of device and outside output, to protect the operation safety of automobile.
Meanwhile, the memory element 3 being connected with judging unit 3 when determining current program flow operation exception,
Current abnormal information is stored, in order to follow-up maintenance personnel safeguard program.
It should be noted that the first computing unit 2 and calculating of the second computing unit 3 in the present embodiment
Journey is substantially the same, and its difference is that the second computing unit 3 enters according to the normal run sequence of each program
Row calculates.
The concrete calculating process of above-mentioned first computing unit 2 and the second computing unit 3 is as follows:
The program flow monitoring input data got are inputted number as current first calculating running program
According to.
Utilize pre-imputationCalculate first calculating output data running program, and
That runs program using first calculates output data as second calculating input data running program, ginseng
With to second run program calculating in.
Wherein, the calculating input data of A representation program, the described default fixed number that B representation program is corresponding,Represent XOR.
According to above-mentioned method, the calculating output data of any one operation program are run journey as the next one
The technology input data of sequence, during participating in the calculating of next service data, thus complete whole
The calculating of individual operation program.
Finally the calculating of last program is exported data as program flow monitoring output data.
It should be noted that this device embodiment is corresponding with embodiment of the method, it performs process and performs former
Managing identical, therefore not to repeat here.
Finally, in addition it is also necessary to explanation, in this article, the relational terms of such as first and second or the like
It is used merely to separate an entity or operation with another entity or operating space, and not necessarily requires
Or imply relation or the order that there is any this reality between these entities or operation.And, art
Language " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, thus
Make to include that the process of a series of key element, method, article or equipment not only include those key elements, and
Also include other key elements being not expressly set out, or also include for this process, method, article or
The key element that person's equipment is intrinsic.In the case of there is no more restriction, by statement " including ... "
The key element limited, it is not excluded that also deposit in including the process of described key element, method, article or equipment
In other identical element.
In this specification, each embodiment uses the mode gone forward one by one to describe, and each embodiment stresses
Being the difference with other embodiments, between each embodiment, identical similar portion sees mutually.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses
The present invention.Multiple amendment to these embodiments will be aobvious and easy for those skilled in the art
See, generic principles defined herein can without departing from the spirit or scope of the present invention,
Realize in other embodiments.Therefore, the present invention is not intended to be limited to the embodiments shown herein,
And it is to fit to the widest scope consistent with principles disclosed herein and features of novelty.