CN107544473B - A kind of reprogramming method and device - Google Patents
A kind of reprogramming method and device Download PDFInfo
- Publication number
- CN107544473B CN107544473B CN201710951594.8A CN201710951594A CN107544473B CN 107544473 B CN107544473 B CN 107544473B CN 201710951594 A CN201710951594 A CN 201710951594A CN 107544473 B CN107544473 B CN 107544473B
- Authority
- CN
- China
- Prior art keywords
- reprogramming
- diagnostic equipment
- application program
- module
- request message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000008672 reprogramming Effects 0.000 title claims abstract description 304
- 238000000034 method Methods 0.000 title claims abstract description 158
- 230000008569 process Effects 0.000 claims abstract description 119
- 230000004044 response Effects 0.000 claims description 30
- 230000005540 biological transmission Effects 0.000 claims description 14
- 230000007849 functional defect Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 13
- 238000004891 communication Methods 0.000 description 9
- 239000003550 marker Substances 0.000 description 7
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- AIMMVWOEOZMVMS-UHFFFAOYSA-N cyclopropanecarboxamide Chemical compound NC(=O)C1CC1 AIMMVWOEOZMVMS-UHFFFAOYSA-N 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- GOLXNESZZPUPJE-UHFFFAOYSA-N spiromesifen Chemical compound CC1=CC(C)=CC(C)=C1C(C(O1)=O)=C(OC(=O)CC(C)(C)C)C11CCCC1 GOLXNESZZPUPJE-UHFFFAOYSA-N 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a kind of reprogramming method and devices, this method comprises: judging whether to receive power on signal or reset signal;If receiving power on signal or reset signal, before the application program in operation ECU, according to the reprogramming request message that diagnostic equipment is sent, judge whether to enter reprogramming mode;If operation default process reprogramming or the reprogramming of more new technological process reprogram application program into reprogramming mode.It can be seen that, before application program operation, increase the judgement into reprogramming mode, and to enter reprogramming mode decision step instead of the judgement reprogrammed in a manner of the first preset value and the second preset value in the prior art, since the step of entering reprogramming mode, carries out before application program operation, so, reprogramming method and device provided in an embodiment of the present invention not by function of application normally whether influenced, even if there are functional defects for application program, the reprogramming of application program also can be executed normally.
Description
Technical field
The present invention relates to software programming technique fields, more particularly to a kind of reprogramming method and device.
Background technique
The raising required with the development of automotive electronic technology with people safety and amusement function, vehicle electronics control are single
The quantity of first (Electronic Control Unit, ECU) is more and more.ECU is usually by microprocessor (CPU), memory
(including volatile memory and nonvolatile memory), input/output interface (I/O), analog-digital converter (A/D) and whole
The large scale integrated circuits such as shape, driving composition.When needing to upgrade ECU, the application program in nonvolatile memory is rearranged
Journey.
Currently, by the communication of diagnostic equipment and ECU, the reprogramming to the application program in nonvolatile memory is realized.
Specifically, before reprogramming, the reprogramming flag bit in ECU is the first preset value, when in ECU operation nonvolatile memory
After application program, if receiving the reprogramming request of diagnostic equipment, reprogramming flag bit is changed to second by application program and is preset
Value so that triggering pointer jumps the reprogramming process for executing default, and is finally completed by the interaction with diagnostic equipment to using journey
The reprogramming of sequence, wherein when reprogramming flag bit is the first preset value, forbid executing reprogramming process, reprogramming mark is the
When two preset values, allow to execute reprogramming process.
Inventor has found in the research process to the above-mentioned prior art, before being reprogrammed to application program, application
Program must be able to operate normally, and otherwise reprogramming flag bit cannot be changed to the second preset value by the first preset value, also
The reprogramming process of default cannot be executed.Therefore, the coupling of existing reprogramming technology and application program is larger, once using
There are functional defects for program, will lead to reprogramming failure.
Summary of the invention
In order to solve the above technical problems, technical solution is such as the embodiment of the invention provides a kind of reprogramming method and device
Under:
A kind of reprogramming method, comprising:
Judge whether to receive power on signal or reset signal;
If receiving the power on signal or reset signal, before the application program in operation ECU, sent according to diagnostic equipment
Reprogramming request message, judge whether enter reprogramming mode;
If operation default process reprogramming or the reprogramming of more new technological process carry out the application program into reprogramming mode
Reprogramming.
Preferably, the reprogramming request message sent according to diagnostic equipment judges whether to enter reprogramming mode, packet
It includes:
Receive the first reprogramming request message of the request random secret key seed that the diagnostic equipment is sent;
The first reprogramming request message is responded, Xiang Suoshu diagnostic equipment, which is sent, carries the of the random key seed
One response message;
The the second reprogramming request message for carrying key that the diagnostic equipment is sent is received, the key is according to
Random key seed is calculated;
Judge whether the key matches with the random key seed;
If matching, the transmission of Xiang Suoshu diagnostic equipment authenticates successfully message, into reprogramming mode.
Preferably, if into reprogramming mode, operation default process reprogramming or the reprogramming of more new technological process are to the application
Program is reprogrammed, comprising:
The third reprogramming request message that the diagnostic equipment is sent is received, the third reprogramming request message carries weight
Program parameters;
Judge the corresponding default process reprogramming of the reprogramming parameter or the reprogramming of more new technological process;
If corresponding default process reprogramming, executes the step of carrying out default reprogramming to the application program;
If the step of corresponding more new technological process reprogramming, execution is updated reprogramming to the application program.
Preferably, reprogramming is updated to the application program, comprising:
Receive the more new technological process reprogramming that the diagnostic equipment is sent;
More new technological process reprogramming is written in the volatile memory of the ECU, the application program is carried out more
New technological process reprogramming.
Preferably, default reprogramming is carried out to the application program, comprising:
The erasing order that the diagnostic equipment is sent is received, the erasing order carries the storage address of the application program;
The erasing order is responded, Xiang Suoshu diagnostic equipment sends the second response message, and the second response message instruction is
The application program in the storage address is wiped in success;
Receive the data writing commands that the diagnostic equipment is sent, the data writing commands carry data to be written and described
Storage address;
The data writing commands are responded, Xiang Suoshu diagnostic equipment sends third response message, and the third response message refers to
Show and successfully the data to be written are written in the storage address.
Preferably, before the third reprogramming request message for receiving the diagnostic equipment transmission, further includes:
Receive the safety certification request message for carrying diagnostic equipment mark that the diagnostic equipment is sent;
It is identified according to the diagnostic equipment, judges whether the diagnostic equipment has the reprogramming operating right to the ECU;
The 4th response message is sent to the diagnostic equipment, the 4th response message shows that the diagnostic equipment has to described
The reprogramming permission of ECU.
One kind rearranging range device, comprising:
Modular diagnostic protocol stack module receives power on signal or reset signal for judging whether;
Judgment module is reprogrammed, receives the power on signal or reset for modular diagnostic protocol stack module determination
Signal, according to the reprogramming request message that diagnostic equipment is sent, judges whether to enter and rearrange before the application program in operation ECU
Journey mode;
Reprogram program module, for the reprogramming judgment module determine enter reprogramming mode when, operation default stream
Journey reprogramming or the reprogramming of more new technological process reprogram the application program.
Preferably, the reprogramming judgment module, comprising:
First reprogramming request message receiving module, for receiving request random secret key seed that the diagnostic equipment is sent
First reprogramming request message;
First response message sending module, for responding the first reprogramming request message, Xiang Suoshu diagnostic equipment is sent
Carry the first response message of the random key seed;
Second reprogramming request message receiving module, the second weight for carrying key sent for receiving the diagnostic equipment
Request message is programmed, the key is to be calculated according to the random key seed;
Matching judgment module, for judging whether the key matches with the random key seed;
Successfully message sending module is authenticated, for determining the key and institute's random key kind when the matching judgment module
When son matching, the transmission of Xiang Suoshu diagnostic equipment authenticates successfully message, into reprogramming mode.
Preferably, the reprogramming module, comprising:
Third reprograms request message receiving module, the third reprogramming request report sent for receiving the diagnostic equipment
Text, the third reprogramming request message carry reprogramming parameter;
Process judgment module is reprogrammed, for judging the corresponding default process reprogramming of the reprogramming parameter or more new technological process
Reprogramming;
Default reprogramming module, for determining the corresponding default process of the reprogramming parameter when the reprogramming judgment module
Reprogramming executes the step of carrying out default reprogramming to the application program;
Reprogramming module is updated, for determining the corresponding more new technological process of the reprogramming parameter when the reprogramming judgment module
The step of reprogramming, execution is updated reprogramming to the application program.
Preferably, the update reprograms module, comprising:
More new technological process reprograms receiving module, for receiving more new technological process reprogramming described in the diagnostic equipment transmission;
More new technological process reprograms writing module, and the volatibility for the ECU to be written in more new technological process reprogramming is deposited
In reservoir, process reprogramming is updated to the application program.
In a kind of reprogramming method and device provided in an embodiment of the present invention, when ECU is powered on or is resetted, do not transport immediately
Row application program, but judge whether to enter reprogramming mode, if so, operation default process reprogramming or the reprogramming of more new technological process
The application program is reprogrammed.As it can be seen that the judgement into reprogramming mode is increased before application program operation, and
To enter the judgment step of reprogramming mode instead of carrying out in a manner of the first preset value and the second preset value in the prior art
The judgement of reprogramming, the judgment step due to entering reprogramming mode carry out before application program operation, so, the present invention is real
Apply example offer reprogramming method and device not by function of application normally whether influenced, even if there are functions for application program
Defect also can normally execute the reprogramming of application program.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention without any creative labor, may be used also for those of ordinary skill in the art
To obtain other drawings based on these drawings.
Fig. 1 is a kind of a kind of flow diagram of reprogramming method provided by the embodiment of the present invention;
Fig. 2 is a kind of another flow diagram of reprogramming method provided by the embodiment of the present invention;
Fig. 3 is a kind of a kind of structural schematic diagram for rearranging range device provided by the embodiment of the present invention;
Fig. 4 is a kind of another structural schematic diagram for rearranging range device provided by the embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of ECU provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this
Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
Referring to Fig. 1, Fig. 1 is a kind of a kind of flow diagram of reprogramming method provided in an embodiment of the present invention, it is described
Method includes:
Step S101, judge whether to receive power on signal or reset signal, if so, executing step S202, terminate if not
Process;
Step S102, before the application program in operation ECU, according to the reprogramming request message that diagnostic equipment is sent, judgement
Whether reprogramming mode is entered, if so, executing step S103;
In the prior art, before ECU is powered on, the parameter of program pointer is sky, does not indicate the operation of any program, ECU is powered on
Afterwards, program pointer is directed toward the storage address of application program, to start application program;Before ECU resets, program pointer is indicated in ECU
The operation of application program.When the order according to diagnostic equipment, after the first preset value is changed to the second preset value by application program, journey
Sequence pointer is directed toward the storage address of reprogramming process, runs reprogramming process with starting.
In the embodiment of the present invention, when ECU is powered on or is resetted, program pointer is not directed toward to the storage of application program immediately
Address, but the reprogramming determining program in reprogramming judgment module is executed, to judge whether to enter reprogramming mode.
If not receiving the reprogramming request message, answered according to the effective marker position judgement in effective marker memory block
It is whether effective with the application code part in program module memory block, if effectively, program pointer jumps to application program generation
Code part, to enter the normal operation of application code part, otherwise, program pointer jumps to idle routine code section,
Idle routine only supports the service request on basis, such as reset request.
Step S103, the reprogramming of operation default process or the reprogramming of more new technological process reprogram the application program.
Reprogramming mode in the present embodiment includes the reprogramming of default process and the reprogramming of more new technological process, therefore, works as determination
When entering reprogramming mode, program pointer is directed toward to the storage address of reprogramming process or the address of more new technological process reprogramming,
To be reprogrammed to application program.
In technical solution provided in an embodiment of the present invention, when ECU is powered on or is resetted, application program is not run immediately,
But judge whether to enter reprogramming mode, if so, operation default process reprogramming or the reprogramming of more new technological process are to the application
Program is reprogrammed.As it can be seen that the embodiment of the present invention increases the judgement into reprogramming mode before application program operation,
And by enter reprogramming mode judgment step instead of in the prior art in a manner of the first preset value and the second preset value into
The judgement of row reprogramming, the judgment step due to entering reprogramming mode carry out before application program operation, so, the present invention
Embodiment provide reprogramming method not by function of application normally whether influenced, even if application program there are function lack
It falls into, the reprogramming of application program also can be executed normally.
Referring to Fig. 2, Fig. 2 is a kind of another flow diagram of reprogramming method provided in an embodiment of the present invention, institute
The method of stating includes:
Step S201, judge whether to receive power on signal or reset signal, if so, executing step S202;
Step S202, the first reprogramming request message of the request random secret key seed that the diagnostic equipment is sent is received;
Step S203, the first reprogramming request message is responded, the transmission of Xiang Suoshu diagnostic equipment carries described with secret
First response message of key seed;
Step S204, the second reprogramming request message for carrying key that the diagnostic equipment is sent is received;
The key is to be calculated according to the random key seed.
Step S205, judge whether the random seed key matches with the random key seed, if matching, executes step
Rapid S206;
Step S206, Xiang Suoshu diagnostic equipment hair authenticates successfully message, into reprogramming mode;
Before entering reprogramming mode, there may also be the pre-programmed preparation stages, before which is substantially carried out reprogramming
Preparation, such as close non-diagnostic message, close diagnostic trouble code record.
Step S202- step S206 be accomplished that whether enter reprogramming mode judgement, wherein first reprogramming ask
Ask message (message 1 in corresponding table), the first response message (message 2 in corresponding table), the second reprogramming request message (corresponding
Message 3 in table), the second response message (corresponding message 4 in table) format it is as shown in the table:
Wherein:
Message 1, message 2, message 3 and message 4 shared " byte 1 "-" byte 4 " are capitalization " GTRM
(GoToReprogrammingMode) " ASCII coded representation;
" byte 5 "-" byte 8 " of message 1 is the ASCII coded representation of capitalization " REQS (RequestSeed) ";
" byte 5 "-" byte 8 " of message 2 is the random key seed that ECU is returned;
" byte 5 "-" byte 8 " of message 3 is the code key that diagnostic equipment is generated according to random key seed;
" byte 5 "-" byte 8 " of message 4 is the ASCII coded representation of capitalization " VLDK (ValidKey) ".
Step S207, the safety certification request message for carrying diagnostic equipment mark that diagnostic equipment is sent is received;
The mark of diagnostic equipment can be realized with the number of diagnostic equipment.
Step S208, it is identified according to the diagnostic equipment, judges whether the diagnostic equipment has the behaviour of the reprogramming to the ECU
Make permission, if so, executing step S209;
In order to prevent to the illegal reprogramming of ECU, the reliability of ECU reprogramming is improved, enters reprogramming mode determining
Afterwards, the reprogramming operating right of diagnostic equipment is verified.
Specifically, it is previously stored with the mark to it with the diagnostic equipment of reprogramming operating right in ECU, judges to recognize safely
Diagnostic equipment in card request message identifies whether match with the mark of pre-stored diagnostic equipment, if so, indicate with safely
The corresponding diagnostic equipment of authentication request packet has the operating right to ECU.
Step S209, Xiang Suoshu diagnostic equipment sends the 4th response message, and the 4th response message shows the diagnostic equipment
With the reprogramming permission to the ECU;
Step S210, it receives the third that the diagnostic equipment is sent and reprograms request message, the third reprogramming request report
Text carries reprogramming parameter;
Step S211, the corresponding default process reprogramming of the reprogramming parameter or the reprogramming of more new technological process are judged, if corresponding
Default process reprogramming, execute step S212, if corresponding more new technological process reprogramming, executes step S220;
The reprogramming parameter is third preset value or the 4th preset value, when the reprogramming parameter is third preset value
When, corresponding default process reprogramming, when the reprogramming parameter is four preset value, corresponding more new technological process reprogramming.
Step S212, the erasing order that the diagnostic equipment is sent is received, the erasing order carries the application program
Storage address;
Step S213, the erasing order is responded, Xiang Suoshu diagnostic equipment sends the second response message, the second response report
The application program in the storage address has successfully been wiped in text instruction;
Step S214, the data writing commands that the diagnostic equipment is sent are received, the data writing commands carry to be written
Data and the storage address;
Step S215, the data writing commands are responded, Xiang Suoshu diagnostic equipment sends third response message, and the third is rung
Answer message instruction that successfully the data to be written are written in the storage address;
Step S216, the integrity checking commands that the diagnostic equipment is sent are received, the integrity checking commands are for referring to
Show and CRC check is carried out to the data in the storage address;
CRC check is most common a kind of data transmission error-detecting mode in data communication field, and specific implementation process can join
See the prior art, the present embodiment is not elaborated.
Step S217, the response integrity checking commands, Xiang Suoshu diagnostic equipment the 5th response message of transmission, the described 5th
Response message indicates that the data in the storage address are complete;
Step S218, the finger print information that the diagnostic equipment is sent is received and stored, the finger print information includes at least described
The mark of diagnostic equipment and reprogramming time;
For the ease of the backtracking of professional, storage this time reprograms relevant finger print information in ECU.
Step S219, according to version number, whether the application program after judgement is rearranged is incompatible, if it is not, executing step S222;
The application program being reprogrammed in the embodiment of the present invention may include two parts, and a part is deposited for application program module
Application code part in storage area, another part are the nominal data part in nominal data module memory block, demarcate number
It is the necessary data of the application program operation in fit applications program module memory block according to part.
When practical reprogramming, both only program code sections can be reprogrammed as needed, it can also be only to calibration
Data portion is reprogrammed, naturally it is also possible to both be reprogrammed to program code sections, while also to nominal data part
It is reprogrammed.
Which kind of either above-mentioned reprogramming mode can also detect program code portion after receiving and storing finger print information
Point and/or nominal data part whether be all successfully written into, and when being successfully written, detect the version number of program code sections with
And whether the version number of nominal data part is compatible with, if compatible, updates the effective marker position in effective marker memory block.
Wherein, it includes upward-compatible and backward compatible two kinds of situations that version number is compatible, upward-compatible to refer to compared with new edition
The procedure set of this compiling can execute in older version, and backward compatible then opposite.
Step S220, the more new technological process reprogramming that the diagnostic equipment is sent is received;
Step S221, more new technological process reprogramming is written in the volatile memory of the ECU, applies journey to described
Sequence is updated process reprogramming;
Step S222, the reset signal that the diagnostic equipment is sent is received, to reset the ECU;
If reprogramming parameter is the 4th preset value, illustrate to need to run the reprogramming of more new technological process.Since more new technological process is rearranged
Journey is stored in volatile memory, and the needs reprogrammed by user according to this are written immediately, so, when reprogramming parameter is
When four preset values, ECU receives the more new technological process reprogramming that diagnostic equipment is sent, and the more new technological process is reprogrammed write-in volatibility
In memory, more new technological process reprogramming is executed to be jumped by program pointer.
Due to the reprogramming of more new technological process be written immediately as needed by user, so, more new technological process reprogramming and silent
It is different to recognize process reprogramming.
Wherein, more new technological process reprogramming with default process reprogramming it is different can both refer to more new technological process reprogram content and
The content for defaulting process reprogramming is different, can also refer to the content and the content phase of default process reprogramming of the reprogramming of more new technological process
Together, the sequence for but specifically executing step is different.
In technical solution provided in an embodiment of the present invention, when ECU is powered on or is resetted, application program is not run immediately,
But it is made whether the judgement into reprogramming mode, if so, operation default process reprogramming or the reprogramming of more new technological process are to institute
Application program is stated to be reprogrammed.As it can be seen that the embodiment of the present invention is increased before application program operation into reprogramming mode
Judgement, and to enter the judgment step of reprogramming mode instead of in the prior art with the side of the first preset value and the second preset value
The judgement that formula is reprogrammed, the judgment step due to entering reprogramming mode carry out before application program operation, so, this
Inventive embodiments provide reprogramming method not by function of application normally whether influenced, even if there are functions for application program
Defect also can normally execute the reprogramming of application program.In addition, it is using default process reprogramming pair that user, which can choose,
ECU is reprogrammed, or selection be written according to their needs into ECU more new technological process reprogramming ECU is reprogrammed, with
This improves diagnostic equipment and ECU to the compatibility of different reprogramming processes, improves user experience.
Referring to Fig. 3, Fig. 3 is a kind of structural schematic diagram provided in an embodiment of the present invention for rearranging range device, the reprogramming
The course of work of each module in apparatus structure schematic diagram referring to Fig.1 in corresponding embodiment method implementation procedure, the device
Include:
Diagnosing protocol stack module 301 receives power on signal or reset signal for judging whether;
Judgment module 302 is reprogrammed, receives the power on signal or reset for diagnosing protocol stack module determination
Signal, according to the reprogramming request message that diagnostic equipment is sent, judges whether to enter and rearrange before the application program in operation ECU
Journey mode;
Reprogramming program module 303 determines that operation is defaulted when entering reprogramming mode for the reprogramming judgment module
Process reprogramming or the reprogramming of more new technological process reprogram the application program.
In technical solution provided in an embodiment of the present invention, when diagnosing protocol stack module determines that ECU is powered on or resetted, rearrange
Journey program module does not run application program immediately, but judges whether to enter reprogramming mode by reprogramming judgment module,
If so, operation default process reprogramming or the reprogramming of more new technological process reprogram the application program.As it can be seen that the present invention is real
Example is applied before application program operation, increases the judgement into reprogramming mode, and to enter the judgment step of reprogramming mode
Instead of the judgement reprogrammed in a manner of the first preset value and the second preset value in the prior art, reprogrammed due to entering
The judgment step of mode carries out before application program operation, so, range device provided in an embodiment of the present invention of rearranging is not answered
Influence whether with program function normally also can be normal to the reprogramming of application program even if there are functional defects for application program
It executes.
Referring to Fig. 4, Fig. 4 is another structural schematic diagram provided in an embodiment of the present invention for rearranging range device, this is rearranged
Implementation procedure of the course of work of each module in range device structural schematic diagram referring to method in the corresponding embodiment of Fig. 2, the dress
It sets and includes:
Diagnosing protocol stack module 401 receives power on signal or reset signal for judging whether;
First reprogramming request message receiving module 402, the request random secret key kind sent for receiving the diagnostic equipment
First reprogramming request message of son;
First response message sending module 403, for responding the first reprogramming request message, Xiang Suoshu diagnostic equipment hair
Send the first response message for carrying the random key seed;
Second reprogramming request message receiving module 404, carry key for receiving that the diagnostic equipment sends
Two reprogramming request messages, the key are to be calculated according to the random key seed;
Matching judgment module 405, for judging whether the key matches with the random key seed;
Successfully message sending module 406 is authenticated, for determining the key with institute with secret when the matching judgment module
When key seed matches, the transmission of Xiang Suoshu diagnostic equipment authenticates successfully message, into reprogramming mode;
Third reprograms request message receiving module 407, the third reprogramming request sent for receiving the diagnostic equipment
Message, the third reprogramming request message carry reprogramming parameter;
Flow path match module 408 is reprogrammed, for judging the corresponding default process reprogramming of the reprogramming parameter or updating
Process reprogramming;
Default reprogramming module 409, for determining the corresponding default of the reprogramming parameter when the reprogramming judgment module
Process reprogramming executes the step of carrying out default reprogramming to the application program;
More new technological process reprograms receiving module 410, for receiving more new technological process reprogramming described in the diagnostic equipment transmission;
More new technological process reprograms writing module 411, for more new technological process reprogramming to be written to the volatibility of the ECU
In memory, process reprogramming is updated to the application program.
In technical solution provided in an embodiment of the present invention, when diagnosing protocol stack module determines that ECU is powered on or resetted, rearrange
Journey program module does not run application program immediately, but judges whether to enter reprogramming mode by reprogramming judgment module, if
It is that operation default process reprogramming or the reprogramming of more new technological process reprogram the application program.As it can be seen that the present invention is implemented
Example increases the judgement into reprogramming mode before application program operation, and is taken with entering the judgment step of reprogramming mode
For the judgement reprogrammed in a manner of the first preset value and the second preset value in the prior art, mould is reprogrammed due to entering
The judgment step of formula carries out before application program operation, so, range device provided in an embodiment of the present invention of rearranging is not applied
Program function normally whether influence the reprogramming of application program also can normally be held even if there are functional defects for application program
Row.In addition, the more new technological process reprogramming that the embodiment of the present invention can be written immediately according to user reprograms application program, improve
Selection of the user to reprogramming process, increases the flexibility of reprogramming.
Referring to Fig. 5, Fig. 5 is a kind of structural schematic diagram of ECU provided in an embodiment of the present invention, comprising:
Interactive module 51 is communicated, for realizing the data interaction of diagnostic equipment and ECU;
Reprogramming of the realization to the application program in ECU, practical application interacts by diagnostic equipment and ECU in the present invention
In, the communication of diagnostic equipment and ECU can be realized by multiple network, such as controller local area network's (CAN network), local internet
Network (LIN network), Ethernet etc..
When the communication network difference of diagnostic equipment and ECU, the type of message transmitted between diagnostic equipment and ECU also not phase
Together.The data that communication interactive module 51 is interacted are the network message for meeting the communication network of diagnostic equipment and ECU.
The diagnosing protocol stack module 52 communicated with the communication interactive module 51, for parsing the function class of the data
Type;
The function that diagnostic equipment and the data of ECU interaction represent may be different, power on or reset signal, again such as whether receiving
Request command, completeness check order etc. are programmed, diagnosing protocol stack module is used to parse the concrete function of data.
The reprogramming program module 53 communicated with the diagnosing protocol stack module 52, for determining that running default process rearranges
Still more new technological process reprograms journey.
The reprogramming judgment module 54 or memory modules 55 communicated with the reprogramming program module 53;
Wherein:
The reprogramming judgment module 54 is used to be made whether the judgement into reprogramming mode;
Memory modules 55 include nonvolatile memory 551 and volatile memory 552;
Volatile memory 551 includes reprogramming flow storage area 5511 and system scratchpad area (SPA) 5512, reprogramming stream
Journey memory block 5511 is stored with the reprogramming of more new technological process, and system scratchpad area (SPA) 5512 reprograms process for storing more new technological process
In ephemeral data variable;
Nonvolatile memory 552 includes default process memory block 5521, application program module memory block 5522, calibration number
According to module memory block 5523 and effective marker position memory block 5524, defaults process memory block 5521 and rearranged for storing default process
Journey, the ordinal relation between the process step and each step of the reprogramming of default process comprising default process reprogramming;
The application program being reprogrammed in the present embodiment may include two parts, and a part is application program module memory block
Application code part in 5522, another part are the nominal data part in nominal data module memory block 5523, mark
Determine the necessary data that data portion is the application program operation in application program module memory block;
Effective marker position in effective marker memory block 5524 is for judging whether application code part is effective.
Finally, can also include power supply module 56 in ECU, for providing electric power support for the operation of ECU;
52 volts of power supplys are widely used in the input of power supply module 56 in the car.
It should be noted that Fig. 5 is only the preferred structural schematic diagram of ECU in the present invention, in practical application, however it is not limited to
This, any ECU for rearranging range device contained in the present invention belongs to the range that the present invention is protected.
Term " first ", " second ", " third " " the 4th " in description and claims of this specification and attached drawing etc.
(if present) is to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that this
The data that sample uses are interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein for example can in addition to
Here the sequence other than those of diagram or description is implemented.In addition, term " includes " and " having " and their any deformation,
Be intended to cover it is non-exclusive include, for example, containing the process, method of series of steps or module, system, product or setting
It is standby those of to be not necessarily limited to be clearly listed step or module, but may include be not clearly listed or for these mistakes
Journey, method, product or equipment intrinsic other steps or module.
For device or system embodiments, since it essentially corresponds to embodiment of the method, thus related place referring to
The part of embodiment of the method illustrates.Device or system embodiment described above is only schematical, wherein described
Module may or may not be physically separated as illustrated by the separation member, and the component shown as module can be with
It is or may not be physical module, it can it is in one place, or may be distributed on multiple network modules.It can
It is achieved the purpose of the solution of this embodiment with selecting some or all of the modules therein according to the actual needs.This field is common
Technical staff can understand and implement without creative efforts.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method are not having
It has more than in the spirit and scope of the present invention, can realize in other way.Current embodiment is a kind of demonstration
Example, should not be taken as limiting, given particular content should in no way limit the purpose of the present invention.For example, the module or
The division of submodule, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple moulds
Block or multiple submodule combine.In addition, multiple modules can with or component may be combined or can be integrated into another and be
System, or some features can be ignored or not executed.
In addition, described system, the schematic diagram of device and method and different embodiments, without departing from the scope of the present invention
It is interior, it can be with other systems, module, techniques or methods combination or integrated.Another point, shown or discussed mutual coupling
It closes or direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or module can be with
It is electrically mechanical or other forms.
The above is only a specific embodiment of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (8)
1. a kind of reprogramming method characterized by comprising
Judge whether to receive power on signal or reset signal;
If receiving the power on signal or reset signal, before the application program in operation ECU, according to the weight of diagnostic equipment transmission
Request message is programmed, judges whether to enter reprogramming mode;
If the application program is rearranged in operation default process reprogramming or the reprogramming of more new technological process into reprogramming mode
Journey;
Wherein, the reprogramming request message sent according to diagnostic equipment judges whether to enter reprogramming mode, comprising:
Receive the first reprogramming request message of the request random secret key seed that the diagnostic equipment is sent;
The first reprogramming request message is responded, Xiang Suoshu diagnostic equipment sends the first sound for carrying the random key seed
Answer message;
The the second reprogramming request message for carrying key that the diagnostic equipment is sent is received, the key is according to described random
Key seed is calculated;
Judge whether the key matches with the random key seed;
If matching, the transmission of Xiang Suoshu diagnostic equipment authenticates successfully message, into reprogramming mode.
2. the method according to claim 1, wherein if operation default process reprograms into reprogramming mode
Or the reprogramming of more new technological process reprograms the application program, comprising:
The third reprogramming request message that the diagnostic equipment is sent is received, the third reprogramming request message carries reprogramming
Parameter;
Judge the corresponding default process reprogramming of the reprogramming parameter or the reprogramming of more new technological process;
If corresponding default process reprogramming, executes the step of carrying out default reprogramming to the application program;
If the step of corresponding more new technological process reprogramming, execution is updated reprogramming to the application program.
3. according to the method described in claim 2, it is characterized in that, being updated reprogramming to the application program, comprising:
Receive the more new technological process reprogramming that the diagnostic equipment is sent;
More new technological process reprogramming is written in the volatile memory of the ECU, stream is updated to the application program
Journey reprogramming.
4. according to the method described in claim 2, it is characterized in that, carrying out default reprogramming to the application program, comprising:
The erasing order that the diagnostic equipment is sent is received, the erasing order carries the storage address of the application program;
The erasing order is responded, Xiang Suoshu diagnostic equipment sends the second response message, and the second response message instruction has succeeded
Wipe the application program in the storage address;
The data writing commands that the diagnostic equipment is sent are received, the data writing commands carry data to be written and the storage
Address;
The data writing commands are responded, Xiang Suoshu diagnostic equipment sends third response message, and the third response message instruction is
The data to be written are written in the storage address for success.
5. according to the method described in claim 2, it is characterized in that, the third reprogramming for receiving the diagnostic equipment transmission is asked
Before seeking message, further includes:
Receive the safety certification request message for carrying diagnostic equipment mark that the diagnostic equipment is sent;
It is identified according to the diagnostic equipment, judges whether the diagnostic equipment has the reprogramming operating right to the ECU;
The 4th response message is sent to the diagnostic equipment, the 4th response message shows that the diagnostic equipment has to the ECU
Reprogramming permission.
6. one kind rearranges range device characterized by comprising
Diagnosing protocol stack module receives power on signal or reset signal for judging whether;
Judgment module is reprogrammed, determines to receive the power on signal or reset for the modular diagnostic protocol stack module and believe
Number, before the application program in operation ECU, according to the reprogramming request message that diagnostic equipment is sent, judge whether to enter reprogramming
Mode;
Reprogramming program module determines that process weight is defaulted in operation when entering reprogramming mode for the reprogramming judgment module
Programming or the reprogramming of more new technological process reprogram the application program;
Wherein, the reprogramming judgment module, comprising:
First reprogramming request message receiving module, for receiving the first of the request random secret key seed that the diagnostic equipment is sent
Reprogram request message;
First response message sending module, for responding the first reprogramming request message, Xiang Suoshu diagnostic equipment, which is sent, to be carried
There is the first response message of the random key seed;
Second reprogramming request message receiving module, the second reprogramming for carrying key sent for receiving the diagnostic equipment
Request message, the key are to be calculated according to the random key seed;
Matching judgment module, for judging whether the key matches with the random key seed;
Successfully message sending module is authenticated, for determining the key and institute's random key seed when the matching judgment module
Timing, the transmission of Xiang Suoshu diagnostic equipment authenticate successfully message, into reprogramming mode.
7. device according to claim 6, which is characterized in that the reprogramming program module, comprising:
Third reprograms request message receiving module, reprograms request message, institute for receiving the third that the diagnostic equipment is sent
It states third reprogramming request message and carries reprogramming parameter;
Flow path match module is reprogrammed, for judging that the corresponding default process of the reprogramming parameter reprograms or more new technological process is rearranged
Journey;
Default reprogramming module, for determining that the corresponding default process of the reprogramming parameter is rearranged when the reprogramming judgment module
Journey executes the step of carrying out default reprogramming to the application program;
Reprogramming module is updated, for determining that the corresponding more new technological process of the reprogramming parameter is rearranged when the reprogramming judgment module
The step of journey, execution is updated reprogramming to the application program.
8. device according to claim 7, which is characterized in that the update reprograms module, comprising:
More new technological process reprograms receiving module, for receiving more new technological process reprogramming described in the diagnostic equipment transmission;
More new technological process reprograms writing module, for more new technological process reprogramming to be written to the volatile memory of the ECU
In, process reprogramming is updated to the application program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710951594.8A CN107544473B (en) | 2017-10-13 | 2017-10-13 | A kind of reprogramming method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710951594.8A CN107544473B (en) | 2017-10-13 | 2017-10-13 | A kind of reprogramming method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107544473A CN107544473A (en) | 2018-01-05 |
CN107544473B true CN107544473B (en) | 2019-08-30 |
Family
ID=60967831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710951594.8A Active CN107544473B (en) | 2017-10-13 | 2017-10-13 | A kind of reprogramming method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107544473B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795159B (en) * | 2019-10-30 | 2023-07-21 | 福建省汽车工业集团云度新能源汽车股份有限公司 | Method for preventing vehicle-mounted ECU from being updated by mistake and being incapable of being re-brushed and storage device |
CN112148312A (en) * | 2020-09-15 | 2020-12-29 | 中国第一汽车股份有限公司 | Firmware upgrading management method, device, equipment and medium for electronic controller |
CN113434163B (en) * | 2021-05-24 | 2022-10-28 | 瑞浦兰钧能源股份有限公司 | Online calibration method, system, device and medium suitable for electronic control unit |
CN115809078A (en) * | 2021-09-13 | 2023-03-17 | 长城汽车股份有限公司 | Flash method of vehicle ECU, vehicle and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103511A (en) * | 2011-02-25 | 2011-06-22 | 北京经纬恒润科技有限公司 | Method and system for refreshing application program |
CN103019792A (en) * | 2012-12-21 | 2013-04-03 | 北京经纬恒润科技有限公司 | Application reprogramming method and application reprogramming system |
CN103294511A (en) * | 2013-05-31 | 2013-09-11 | 哈尔滨工业大学 | Bootloader software updating method based on CAN (controller area network) bus |
CN103713932A (en) * | 2014-01-21 | 2014-04-09 | 北京经纬恒润科技有限公司 | Method and device for updating application program in electronic control unit |
CN104834286A (en) * | 2015-03-30 | 2015-08-12 | 北京经纬恒润科技有限公司 | Reprogramming method, reprogramming system, reprogramming device and electronic control unit |
CN106843979A (en) * | 2017-01-24 | 2017-06-13 | 北京经纬恒润科技有限公司 | The update method and device of a kind of application program |
-
2017
- 2017-10-13 CN CN201710951594.8A patent/CN107544473B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102103511A (en) * | 2011-02-25 | 2011-06-22 | 北京经纬恒润科技有限公司 | Method and system for refreshing application program |
CN103019792A (en) * | 2012-12-21 | 2013-04-03 | 北京经纬恒润科技有限公司 | Application reprogramming method and application reprogramming system |
CN103294511A (en) * | 2013-05-31 | 2013-09-11 | 哈尔滨工业大学 | Bootloader software updating method based on CAN (controller area network) bus |
CN103713932A (en) * | 2014-01-21 | 2014-04-09 | 北京经纬恒润科技有限公司 | Method and device for updating application program in electronic control unit |
CN104834286A (en) * | 2015-03-30 | 2015-08-12 | 北京经纬恒润科技有限公司 | Reprogramming method, reprogramming system, reprogramming device and electronic control unit |
CN106843979A (en) * | 2017-01-24 | 2017-06-13 | 北京经纬恒润科技有限公司 | The update method and device of a kind of application program |
Also Published As
Publication number | Publication date |
---|---|
CN107544473A (en) | 2018-01-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107544473B (en) | A kind of reprogramming method and device | |
CN111201510A (en) | Information updating device and information updating method | |
US9557981B2 (en) | Method and apparatus for automatic module upgrade | |
CN106444568B (en) | A kind of data-updating method and device | |
CN111679836B (en) | Automobile ECU flashing system and method | |
CN103152402A (en) | Method and system for logging in through mobile terminal and cloud server | |
CN111381844A (en) | Method and device for updating vehicle ECU firmware | |
US6684152B2 (en) | Method of initializing a system for open/closed-loop control of the operational sequences of a motor vehicle and a system for carrying out the method | |
CN110554937B (en) | Software diagnostic system for vehicle and method of operating the same | |
KR20140146718A (en) | System for electric control unit upgrade with security functions and method thereof | |
CN109788033A (en) | Unmanned vehicle remote debugging method, device, system and storage medium | |
CN109086058A (en) | Onboard program upgrade-system | |
CN109150514A (en) | A kind of wiring method and equipment of key | |
CN112073500B (en) | Vehicle controller upgrading method, device, storage medium and device | |
KR20070109578A (en) | Navigation apparatus for updating application program of vehicle and updating method thereof | |
CN114827183A (en) | Vehicle diagnosis method, system, device and storage medium | |
CN109386936A (en) | Burning, remote control method, air-conditioning, remote controler and the system of air conditioner electric control plate | |
KR101744998B1 (en) | Re-programming control module and re-programming system and method using the re-programming control module | |
CN113885907A (en) | Firmware upgrading system and method | |
CN113438264B (en) | Wearable massager connection method, device, computer equipment and storage medium | |
US10803163B2 (en) | Method of modular verification of a configuration of a device | |
JP2006244164A (en) | Software update device, software update system, software update method and apparatus management device | |
CN114281374A (en) | Remote flash method and system for vehicle electronic control unit and storage medium | |
CN114546450A (en) | System and method for online writing of vehicle controller configuration | |
CN105334840B (en) | Vehicle network child node collocation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 4 / F, building 1, No.14 Jiuxianqiao Road, Chaoyang District, Beijing 100020 Patentee after: Beijing Jingwei Hirain Technologies Co.,Inc. Address before: 8 / F, block B, No. 11, Anxiang Beili, Chaoyang District, Beijing 100101 Patentee before: Beijing Jingwei HiRain Technologies Co.,Ltd. |