A kind of parallel method for refreshing based on vehicle-mounted Ethernet
Technical field
The present invention relates to car data more frontier more particularly to a kind of parallel method for refreshing based on vehicle-mounted Ethernet.
Background technique
In recent years, automotive technology development is rapid.Advanced driving assistance system, Unmanned Systems, interconnecting function, intelligent seat
These new technologies of cabin are integrated into automobile.These new technologies bring increasing substantially for size of code, show on file just
It is file size generally up to 10,000,000 ranks or even 100,000,000 ranks.This brings challenge to the update of Full Vehicle System.It is traditional based on
Technology of the CAN communication as trunk, since the traffic rate of CAN is commonly 500kpbs, transmission rate is slow, it is difficult to meet increasingly
The data volume of growth.
Since ethernet communication rate is up to 100M even 1000M, and since ethernet communication rate is logical much larger than CAN
Letter.It theoretically may be implemented to refresh parallel.Refresh time can be significantly reduced, to reduce the vehicle software upgrading time, is given
User preferably experiences.
Summary of the invention
In order to solve the above-mentioned technical problem the application, proposes a kind of parallel method for refreshing based on vehicle-mounted Ethernet, packet
Include following steps:
S1, setting refresh the parallel refresh frame in file, and CAN controller selects the corresponding channel CAN and by the refreshing file
It unpacks;
S2 receives the parallel C AN that Ethernet strapping tool uploads and refreshes packaged data;
S3 is issued to the corresponding channel CAN after parallel C AN refreshing packaged data are unpacked;
S4 receives the response message of the CAN controller;
S5 updates corresponding ACK bit data, judges whether that the ACK bit data in all parallel refresh frames are correct
Update, if judging result be it is no, re-execute the step S1.
In above-mentioned technical proposal, the 100M even communication speed of 1000M are up to based on too net, vehicle complete vehicle is realized parallel
Refresh, significantly reduce refresh time, reduces the vehicle software upgrading time, preferably experienced to user;The channel CAN is at least
It is communicated with an ECU, realizes the parallel refreshing to multiple ECU.
Preferably, the step S1 includes:
S1.1, the parameter of claim frame in parallel refresh frame described in the CAN bus quantity configuration supported according to vehicle framework;
S1.2 selects the corresponding CAN controller according to the claim frame;
S1.3, the CAN controller select the corresponding channel CAN refresh process and unpack to the refreshing file.
Preferably, the control head format of the claim frame are as follows:
Number of CAN messages=X
Wherein, X is the positive integer for the CAN bus quantity supported less than or equal to vehicle framework.
Preferably, the data according to contained by the claim frame select using position number be 1 to X the channel CAN, it is remaining own
The channel CAN does not use.
Preferably, information data includes Used data, Update data, ACK in the control head of the claim frame
Position data.
Preferably, before the step S2 further include:
S2.1, the Ethernet strapping tool obtain the parallel C AN data in the channel CAN, and according to the parallel refresh frame
Format is packaged the parallel C AN data;
S2.2, the Ethernet strapping tool upload the parallel C AN and refresh packaged data.
Preferably, the step S3 includes:
S3.1 obtains a plurality of CAN message after parallel C AN refreshing packaged data are unpacked;
The a plurality of CAN message is issued to the CAN controller in the corresponding channel CAN by S3.2.
Preferably, including: before the step S4
S4.1, the CAN controller carry out response to the CAN message and generate the response message;
S4.2, the CAN controller upload the response message in the corresponding channel CAN.
Preferably, the response message in the step S4.1 includes acknowledgement frame, the acknowledgement frame and the request
Frame format is consistent;
Information data includes Used data, Update data, ACK bit data in the control head of the acknowledgement frame.
Preferably, the step S5 includes:
S5.1 updates the ACK bit data, the response message if it is the correspondence channel CAN is judged, if judging result
To be corresponding correct, then be updated to the ACK bit data is assigned a value of 1;If judging result is corresponding mistake, it is updated to described
ACK bit data are assigned a value of 0;
S5.2 judges whether that the assignment of all ACK bit data is 1, if judging result be it is no, re-execute described
Step S1.
In conclusion the technical program has the beneficial effect that
1, the 100M even communication speed of 1000M are up to based on Ethernet, parallel refreshing is realized to vehicle complete vehicle, is significantly reduced
Refresh time reduces the vehicle software upgrading time, preferably experiences to user.
2, in order to realize parallel refreshing, the parallel refresh frame based on ethernet frame, the data portion in ethernet frame are designed
Control head is defined, the control head includes Used data, Update data, ACK bit data, determines and specifically executes brush
The channel CAN of new task and controller.
3, each at least to be communicated with an ECU using the channel CAN for executing refresh tasks, a plurality of CAN channel parallel
Refresh, realizes the parallel refreshing to multiple ECU.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the parallel method for refreshing based on vehicle-mounted Ethernet of the present invention;
Fig. 2 is the parallel schematic diagram for refreshing frame format of the present invention;
Fig. 3 is the flow chart of step S1 of the present invention;
The flow chart of Fig. 4 step S2 of the present invention;
Fig. 5 is the flow chart of step S3 of the present invention;
Fig. 6 is the flow chart of step S4 of the present invention;
Fig. 7 is the flow chart of step S4 of the present invention;
Fig. 8 is the physical connection signal in refresh process of the present invention.
Specific embodiment
Term used herein is used only for the purpose of describing specific embodiments, and is not intended to limit the present invention.Unless in addition
Definition, otherwise all terms used herein have normally understood identical with those skilled in the art
Meaning.It will be further appreciated that essential term should be interpreted as having and it is in related fields and present disclosure
The consistent meaning of meaning.The disclosure will be considered as example of the invention, and is not intended to and limits the invention to particular implementation
Example.
Embodiment
As shown in figures 1-8, a kind of parallel method for refreshing based on vehicle-mounted Ethernet, comprising the following steps:
S1, setting refresh the parallel refresh frame in file, and CAN controller selects the corresponding channel CAN and by the refreshing file
It unpacks.
As shown in figure 8, host computer connects central gateway by Ethernet, in central gateway first by vehicle complete vehicle
The parallel refresh frame refreshed in file is set, that is, selects the director demon file for needing to refresh parallel, chooses 4 controller phases
The program file answered, preferably ECU11, ECU21, ECU31 in the present embodiment, this four refreshings files of ECU41, each is corresponded to
With an ECU, as CAN controller, what is illustrated hereby is that every channel CAN can correspond to the multiple ECU of direction connection.CAN
The corresponding CAN refresh process of refresh control process control, and unpack to file is refreshed.
The step S1 includes:
S1.1, the parameter of claim frame in parallel refresh frame described in the CAN bus quantity configuration supported according to vehicle framework.
Wherein, in order to realize parallel refreshing, need to design a kind of parallel refresh frame based on ethernet frame.As shown in Fig. 2,
The present invention refreshes the schematic diagram of frame format parallel.The present embodiment is preferably that the CAN bus quantity of vehicle framework support is 8 lines
Road.Control head is defined in the data portion of ethernet frame, control head length is 8 bytes.It is below the CAN frame of CAN1-CAN8,
Each CAN frame length is also 8 bytes.
The control head format of the claim frame are as follows:
Number of CAN messages=X
Wherein, X is the positive integer for the CAN bus quantity supported less than or equal to vehicle framework.The number according to contained by the claim frame
According to select using position number be 1 to the X channel CAN, remaining all channels CAN do not use.Believe in the control head of the claim frame
Ceasing data includes Used data, Update data, ACK bit data.For example, messages=4 Number of CAN, table
Show that CAN1-CAN4 is used only in CAN1-CAN8, CAN5-CAN8 is not used.Corresponding Used5-Used8, Update5-Update8,
ACK5-ACK8 is not used yet.
S1.2 selects the corresponding CAN controller according to the claim frame.
S1.3, the CAN controller select the corresponding channel CAN refresh process and unpack to the refreshing file.
S2.1, the Ethernet strapping tool obtain the parallel C AN data in the channel CAN, and according to the parallel brush
New frame format is packaged the parallel C AN data.Ethernet packing manner is parallel to 4 tunnels according to the format of the parallel refresh frame
CAN data are packaged.Wherein, the Ethernet strapping tool is to carry out the soft of package packing to data by programming language
Part tool.
S2.2, the Ethernet strapping tool upload the parallel C AN and refresh packaged data.
S2 receives the parallel C AN that Ethernet strapping tool uploads and refreshes packaged data.Wherein, the central gateway passes through
Ethernet protocol is connect with the Ethernet strapping tool, receives the parallel C AN brush that the Ethernet strapping tool uploads
New packaged data.
S3 is issued to the corresponding channel CAN after parallel C AN refreshing packaged data are unpacked.The central gateway is torn open
According to corresponding relationship after packet, corresponding CAN1-CAN4 message is sent into the corresponding channel CAN1-CAN4, the CAN controller is answered
Answer message
The step S3 includes:
S3.1 obtains a plurality of CAN message after parallel C AN refreshing packaged data are unpacked;
The a plurality of CAN message is issued to the CAN controller in the corresponding channel CAN by S3.2.
S4 receives the response message of the CAN controller.
The CAN controller response message is sent respectively to the central gateway by the channel CAN1-CAN4, it is described in
Four response messages are packaged by centre gateway.
Include: before the step S4
S4.1, the CAN controller carry out response to the CAN message and generate the response message.In the step S4.1
The response message include acknowledgement frame, the acknowledgement frame is consistent with the request frame format;In the control head of the acknowledgement frame
Information data includes Used data, Update data, ACK bit data.
S4.2, the CAN controller upload the response message in the corresponding channel CAN.
S5 updates corresponding ACK bit data, judges whether ACK bit data in all parallel refresh frames
It is correct to update, if judging result be it is no, re-execute the step S1.
The step S5 includes:
S5.1 updates the ACK bit data, the response message if it is the correspondence channel CAN is judged, if judging result
To be corresponding correct, then be updated to the ACK bit data is assigned a value of 1;If judging result is corresponding mistake, it is updated to described
ACK bit data are assigned a value of 0.
S5.2 judges whether that the assignment of all ACK bit data is 1, if judging result be it is no, re-execute
The step S1.So interaction is completed until ECU11, ECU21, ECU31, ECU41 refresh.
Although the embodiments of the invention are described in conjunction with the attached drawings, but those of ordinary skill in the art can be in appended power
Benefit makes various deformations or amendments in the range of requiring.