CN107977220A - A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program - Google Patents

A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program Download PDF

Info

Publication number
CN107977220A
CN107977220A CN201711257495.6A CN201711257495A CN107977220A CN 107977220 A CN107977220 A CN 107977220A CN 201711257495 A CN201711257495 A CN 201711257495A CN 107977220 A CN107977220 A CN 107977220A
Authority
CN
China
Prior art keywords
renewal
application program
code information
user segment
write
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.)
Pending
Application number
CN201711257495.6A
Other languages
Chinese (zh)
Inventor
赵锦涛
李亮
张文皓
颜丙杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN201711257495.6A priority Critical patent/CN107977220A/en
Publication of CN107977220A publication Critical patent/CN107977220A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

This application provides a kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program, the level of resources utilization can be lifted.Including:Guiding application program loading is run, judges whether that receiving the user segment application program update sent by Controller Area Network BUS instructs;If receiving the instruction of user segment application program update, the renewal code information that the corresponding renewal code information of the user segment application program update instruction is concentrated is received, the renewal code information of reception is write into random access memory;Judge whether the renewal code information collection writes and finish, if the renewal code information collection write-in finishes, run the renewal code information of write-in to obtain the user segment application program of corresponding renewal;The user segment application program of the renewal of acquisition is write into flash memory, destination object is controlled with the user segment application program according to the renewal.

Description

A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program
Technical field
This application involves application program to write with a brush dipped in Chinese ink technical field, in particular to a kind of method for writing with a brush dipped in Chinese ink application program, dress Put and system.
Background technology
In embedded OS, guiding application program loading (BootLoader) is that operating system performs after the power-up First segment program code segments, be that hardware or application call are grasped to initialize hardware device, establish memory headroom mapping Make system kernel and prepare proper environment.
With increasingly paying attention to automotive performance, safety, energy conservation and environmental protection, for the automobile control being controlled to automotive performance The update speed of system strategy is getting faster, thus, it is necessary to often to electronics in the debugging of actual vehicle, production and maintenance Automatically controlled vehicle body stability contorting (ESC, the Electronic of storage in control unit (ECU, Electronic Control Unit) Stability Control) application program reconfigured, updated and upgraded, i.e., write with a brush dipped in Chinese ink ESC application programs into ECU.
At present, when writing with a brush dipped in Chinese ink ESC application programs, using the BootLoader sections being solidificated in ECU chips, RS232 is passed through The mode of serial communication carries out application program and writes with a brush dipped in Chinese ink, and each application program corresponds to a RS232 serial ports.But the application program side of writing with a brush dipped in Chinese ink Method, due to needing that the RS232 serial ports write with a brush dipped in Chinese ink is reserved for ECU, waste and the operation of serial-port for being easy to cause serial ports hardware resource are empty Between deficiency so that resource utilization is not high;Further, RS232 serial communication baud rates are limited by, for larger application Program, it is slower to write with a brush dipped in Chinese ink speed so that writes with a brush dipped in Chinese ink inefficient;Moreover, reserved serial ports may be illegally used, to ECU and ESC Application program brings potential threat.
The content of the invention
In view of this, the purpose of the application is to provide the method, apparatus for writing with a brush dipped in Chinese ink application program and system, can lift money Source utilization ratio.
In a first aspect, the present invention provides the method for writing with a brush dipped in Chinese ink application program, including:
Guiding application program loading is run, judges whether that receiving the user segment sent by Controller Area Network BUS answers With program more new command;
If receiving the instruction of user segment application program update, it is corresponding more to receive the user segment application program update instruction The renewal code information that fresh code information is concentrated, random access memory is write by the renewal code information of reception;
Judge whether the renewal code information collection writes to finish, if the renewal code information collection write-in finishes, run The renewal code information of write-in is to obtain the user segment application program of corresponding renewal;
The user segment application program of the renewal of acquisition is write into flash memory, with the user segment application journey according to the renewal Ordered pair destination object is controlled.
With reference to first aspect, the present invention provides the first possible embodiment of first aspect, wherein, the reception The renewal code information that the user segment application program update instructs corresponding renewal code information to concentrate includes:
Receive the more fresh code write instruction sent by Controller Area Network BUS;
Receive the renewal code information sent after said write instruction by Controller Area Network BUS.
With reference to first aspect, the present invention provides second of possible embodiment of first aspect, wherein, the operation The renewal code information of write-in is included with obtaining the user segment application program of corresponding renewal:
Pseudo-static random access memory is jumped to, runs the renewal code information of said write, and to sending the renewal generation The terminal device of code information returns to response;
The flash memory erasing instruction that the terminal device is sent is received, carries out flash memory erasing;
The user segment application program for the renewal that the terminal device is sent is received, carries out cyclic redundancy check;
If cyclic redundancy check to the terminal device by sending cyclic redundancy check by response, execution is described will The step of user segment application program write-in flash memory of the renewal obtained.
Second of possible embodiment with reference to first aspect, the third the present invention provides first aspect are possible Embodiment, wherein, the flash memory erasing is carried out using sector erasing mode, using single page writing mode by described in acquisition more New user segment application program write-in flash memory.
Second of possible embodiment or the third possible embodiment with reference to first aspect, the present invention provides 4th kind of possible embodiment of first aspect, the method further include:
If cyclic redundancy check to the terminal device by not sending cyclic redundancy check not by response, so that institute State terminal device and resend the cyclic redundancy check not by the user segment application program of the corresponding renewal of response.
With reference to first aspect, the possible embodiment of the first of first aspect or second of possible embodiment, this Invention provides the 5th kind of possible embodiment of first aspect, wherein, the user segment of the renewal by acquisition should With program write flash memory, with the user segment application program according to the renewal destination object is controlled including:
The user segment application program of the renewal of reception is write into flash memory, returns to write-in successful respond;
Judge whether the flash memory write operation of the user segment application program of all renewals terminates, if terminating, reception redirects finger Order, is resetted;
Operation control instruction is received, the user segment application program that flash memory reads renewal is jumped to, according to the renewal read User segment application program is controlled destination object.
With reference to first aspect, the possible embodiment of the first of first aspect or second of possible embodiment, this Invention provides the 6th kind of possible embodiment of first aspect, wherein, the method further includes:
If being not received by the instruction of user segment application program update, the user segment of the renewal of write-in in the flash memory is read Application program, the user segment application program according to the renewal are controlled destination object.
Second aspect, the present invention provides the device for writing with a brush dipped in Chinese ink application program, including:Guide load-on module, more fresh code letter Writing module, renewal code information operation module and control parameter writing module are ceased, wherein,
Load-on module is guided, for running guiding application program loading, judges whether to receive and passes through controller LAN The user segment application program update instruction that bus is sent;
Code information writing module is updated, if receiving the instruction of user segment application program update, receiving the user segment should The renewal code information concentrated with the corresponding renewal code information of program more new command, by the renewal code information of reception write-in with Machine memory;
Update code information operation module, for judging whether the renewal code information collection writes and finish, if it is described more The write-in of fresh code information collection finishes, and runs the renewal code information of write-in to obtain the user segment application program of corresponding renewal;
Control parameter writing module, for the user segment application program of the renewal of acquisition to be write flash memory, with foundation The user segment application program of the renewal is controlled destination object.
With reference to second aspect, the present invention provides the first possible embodiment of second aspect, wherein, the renewal Code information operation module includes:Judging unit, jump-transfer unit, erasing unit, verification unit and checking treatment unit, its In,
Judging unit, finishes for judging whether renewal code information collection writes, if the renewal code information collection write-in Finish, notify jump-transfer unit;
Jump-transfer unit, for jumping to pseudo-static random access memory, runs the renewal code information of said write, and to hair The terminal device of the renewal code information is sent to return to response;
Unit is wiped, the flash memory erasing instruction sent for receiving the terminal device, carries out flash memory erasing;
Verification unit, the user segment application program of the renewal sent for receiving the terminal device, carries out cyclic redundancy Verification;
Checking treatment unit, if cyclic redundancy check to the terminal device by sending cyclic redundancy check by answering Answer, notify control parameter writing module.
The third aspect, the present invention provides the system for writing with a brush dipped in Chinese ink application program, including:Electronic control unit, controller local Network bus protocol conversion device and terminal device, wherein,
Terminal device is connected by Universal Serial Bus Interface with Controller Area Network BUS protocol conversion device, controller Local area network bus protocol conversion device is connected by Controller Area Network BUS with electronic control unit;
Terminal device, need carry out application program write with a brush dipped in Chinese ink when, by Controller Area Network BUS protocol conversion device to Electronic control unit sends the instruction of user segment application program update, and, it is corresponding to send the instruction of user segment application program update Update code information;Receive electronic control unit and redirect operation more by what Controller Area Network BUS protocol conversion device returned Fresh code information answer, renewal code information is sent by Controller Area Network BUS protocol conversion device to electronic control unit The user segment application program of corresponding renewal;
Electronic control unit, operation guiding application program loading, judges whether to receive and passes through Controller Area Network BUS The user segment application program update instruction of transmission;If receiving the instruction of user segment application program update, receiving the user segment should The renewal code information concentrated with the corresponding renewal code information of program more new command, by the renewal code information of reception write-in with Machine memory;Judge whether the renewal code information collection writes to finish, if the renewal code information collection write-in finishes, run The renewal code information of write-in is to obtain the user segment application program of corresponding renewal;Should by the user segment of the renewal of acquisition Flash memory is write with program, destination object is controlled with the user segment application program according to the renewal.
The method, apparatus and system provided by the embodiments of the present application for writing with a brush dipped in Chinese ink application program, by running guiding application program Loading, judges whether that receiving the user segment application program update sent by Controller Area Network BUS instructs;If receive User segment application program update instructs, and receives what the corresponding renewal code information of the user segment application program update instruction was concentrated Code information is updated, the renewal code information of reception is write into random access memory;Judge whether the renewal code information collection is write Enter to finish, if the renewal code information collection write-in finishes, run the renewal code information of write-in to obtain corresponding renewal User segment application program;The user segment application program of the renewal of acquisition is write into flash memory, with the user according to the renewal Section application program is controlled destination object.In this way, using Controller Area Network BUS carry out application program write with a brush dipped in Chinese ink, without for Electronic control unit reserves the serial ports write with a brush dipped in Chinese ink, and can lift the level of resources utilization.
To enable the above-mentioned purpose of the application, feature and advantage to become apparent, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Brief description of the drawings
, below will be to needed in the embodiment attached in order to illustrate more clearly of the technical solution of the embodiment of the present application Figure is briefly described, it will be appreciated that the following drawings illustrate only some embodiments of the application, therefore be not construed as pair The restriction of scope, for those of ordinary skill in the art, without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 be the invention relates to a kind of method flow schematic diagram for writing with a brush dipped in Chinese ink application program;
Fig. 2 be the invention relates to electronic control unit memory space structure diagram;
Fig. 3 is the method flow schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application one is related to;
Fig. 4 is the method flow schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application two is related to;
Fig. 5 is the apparatus structure schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application three is related to;
Fig. 6 is the system structure diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application four is related to.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application Middle attached drawing, is clearly and completely described the technical solution in the embodiment of the present application, it is clear that described embodiment is only It is some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is real Applying the component of example can be arranged and designed with a variety of configurations.Therefore, below to the application's for providing in the accompanying drawings The detailed description of embodiment is not intended to limit claimed scope of the present application, but is merely representative of the selected reality of the application Apply example.Based on embodiments herein, institute that those skilled in the art are obtained on the premise of creative work is not made There is other embodiment, shall fall in the protection scope of this application.
Controller LAN (CAN, Controller Area Network) bus is a kind of communication for applying in real time Protocol bus, is one of widely applied fieldbus.Wherein, SAE J1939 are that american car engineering association (SAE) is based on The proposed standard of CAN, can reach the communication speed of 250Kbps, be a kind of network application layer for describing heavy vehicle fieldbus Agreement.
In the present embodiment, consider that transmitting data using CAN bus mode realizes writing with a brush dipped in Chinese ink for application program, thus avoid for ECU, which is reserved, writes with a brush dipped in Chinese ink serial ports, reduces the waste of hardware resource, lifts resource utilization.Further, since serial ports need not be reserved, It is safe.Moreover, CAN bus mode message transmission rate is high, it is fast to write with a brush dipped in Chinese ink speed, writes with a brush dipped in Chinese ink efficient.
Fig. 1 be the invention relates to a kind of method flow schematic diagram for writing with a brush dipped in Chinese ink application program.As shown in Figure 1, should Method includes:
Step 101, guiding application program loading is run, judges whether to receive what is sent by Controller Area Network BUS User segment application program update instructs;
In the present embodiment, needing to carry out the destination object write with a brush dipped in Chinese ink of application program, for example, the electronic control unit of vehicle opens After dynamic, operation is solidificated in the guiding application program loading (BootLoader) in electronic control unit, is set to initialize hardware It is standby, establish memory headroom mapping, be that hardware or application call operating system nucleus prepare proper environment.
Received in the present embodiment, it is necessary to carry out the electronic control unit that application program is write with a brush dipped in Chinese ink by Controller Area Network BUS User segment application program update instructs.Wherein, as an alternative embodiment, the instruction of user segment application program update can be by user Terminal device, for example, PC ends are sent to CAN bus protocol conversion device (for example, II analyzers of ANalyst- forward), CAN The information of reception is converted to the information for meeting CAN bus agreement by bus protocol conversion equipment, passes through Controller Area Network BUS Send to electronic control unit, the communication of terminal device and electronic control unit and carried out by CAN bus protocol conversion device Conversion process.
In the present embodiment, II analyzers of ANalyst-, which are integrated with 2 tunnels and meet the independent CAN bus of ISO11898 standards, to be led to Road, is connected using USB interface with terminal device, is established and connected with electronic control unit by instruction of shaking hands in terminal device Afterwards, after the information that terminal device is sent is changed according to CAN bus agreement, sent by CAN bus single to electronic control Member, in this way, user easily can initiate application program using terminal device writes with a brush dipped in Chinese ink flow.
In the present embodiment, as an alternative embodiment, the instruction of user segment application program update includes but not limited to:User segment Application program installation instruction, the instruction of user segment application program updating, the instruction of user segment application modification etc., are respectively used to indicate Electronic control unit installation user segment application program, upgrading user segment application program and modification user segment application program.
Step 102, if receiving the instruction of user segment application program update, the user segment application program update instruction is received The renewal code information that corresponding renewal code information is concentrated, random access memory is write by the renewal code information of reception;
In the present embodiment, random access memory includes but not limited to:Static RAM (SRAM, Static Random Access Memory), pseudo-static random access memory (PSRAM, Pseudo SRAM) etc..As an alternative embodiment, preferentially adopt Use PSRAM.
In the present embodiment, as an alternative embodiment, receive the user segment application program update and instruct corresponding renewal The renewal code information that code information is concentrated includes:
A11, receives the more fresh code write instruction sent by Controller Area Network BUS;
In the present embodiment, as an alternative embodiment, pass through receiving terminal device under CAN bus protocol conversion device After the user segment application program update instruction of hair, it is also necessary to which what receiving terminal apparatus issued is used to notify electronic control unit to carry out Data receiver and the more fresh code write instruction of write-in, could perform follow-up process.
A12, receives the renewal code information sent after said write instruction by Controller Area Network BUS.
In the present embodiment, terminal device sends user segment using II analyzers of ANalyst- by Controller Area Network BUS After application program update instruction, write instruction is retransmited by II analyzers of ANalyst-, after write instruction is sent, sending needs Write with a brush dipped in Chinese ink the renewal code information of application program, electronic control unit after renewal code information is received, be stored in it is pseudo- it is static with In machine memory.
Step 103, judge whether the renewal code information collection writes to finish, if the renewal code information collection has write Finish, run the renewal code information of write-in to obtain the user segment application program of corresponding renewal;
In the present embodiment, finish, can transport if all renewal code informations that renewal code information is concentrated all write The renewal code information that row write enters, to obtain the user segment application program for the renewal for needing to write with a brush dipped in Chinese ink, the user segment application journey of renewal Sequence includes parameter and code.
In the present embodiment, the user segment application program of renewal can according to the destination object of application program controlling difference and It is specific to set.
Step 104, the user segment application program of the renewal of acquisition is write into flash memory, with the user according to the renewal Section application program is controlled destination object.
In the present embodiment, as an alternative embodiment, the renewal code information of write-in is run to obtain corresponding renewal User segment application program includes:
A21, jumps to pseudo-static random access memory, runs the renewal code information of said write, and to described in sending more The terminal device of fresh code information returns to response;
In the present embodiment, the flash memory of electronic control unit from operation guiding application program loading jumps to pseudo- static random and deposits In reservoir after operation renewal code information, response, CAN bus agreement are returned to CAN bus protocol conversion device by CAN bus After conversion equipment carries out protocol conversion to response, sent by USB interface to terminal device.
A22, receives the flash memory erasing instruction that the terminal device is sent, and carries out flash memory erasing;
In the present embodiment, as an alternative embodiment, the flash area of erasing and the sudden strain of a muscle of storage guiding application program loading It is different flash partitions to deposit region.
A23, receives the user segment application program for the renewal that the terminal device is sent, and carries out cyclic redundancy check;
In the present embodiment, user segment application program to the CAN bus agreement that terminal device sends renewal by USB interface turns Exchange device, after CAN bus protocol conversion device carries out protocol conversion, is sent by CAN bus to electronic control unit.
In the present embodiment, as an alternative embodiment, by the user segment application program of renewal to be sent, according to 8 bytes The form of one message is packed, and during the user segment application transfer of renewal, every 16 messages carry out one cycle Redundancy (CRC, Cyclic Redundancy Check) verifies.
A24, if cyclic redundancy check is by sending cyclic redundancy check by response to the terminal device, performing institute State the step of user segment application program of the renewal of acquisition is write into flash memory.
In the present embodiment, as an alternative embodiment, flash memory erasing is carried out using sector erasing mode, is write using single page The user segment application program of the renewal of acquisition is write flash memory by mode.
In the present embodiment, as another alternative embodiment, this method further includes:
If cyclic redundancy check to the terminal device by not sending cyclic redundancy check not by response, so that institute State terminal device and resend the cyclic redundancy check not by the user segment application program of the corresponding renewal of response.
In the present embodiment, as an alternative embodiment, the user segment application program of the renewal of acquisition is write into flash memory, With the user segment application program according to the renewal destination object is controlled including:
A31, flash memory is write by the user segment application program of the renewal of reception, returns to write-in successful respond;
A32, judges whether the flash memory write operation of the user segment application program of all renewals terminates, if terminating, receives and jumps Turn instruction, resetted;
In the present embodiment, terminal device is connect after the correct end of transmission of user segment application program of all renewals by USB Mouth sends write-in END instruction and jump instruction to CAN bus protocol conversion device successively, CAN bus protocol conversion device into After row protocol conversion, sent by CAN bus to electronic control unit, electronic control unit receives write-in END instruction, confirms Whether flash memory write operation terminates.Terminate in confirmation flash memory write operation, after jump instruction is received, be reset to direct application Program loads.
A33, receives operation control instruction, jumps to the user segment application program that flash memory reads renewal, and foundation is read more New user segment application program is controlled destination object.
In the present embodiment, user is if necessary to be controlled vehicle according to the application program write with a brush dipped in Chinese ink, for example, foundation is write with a brush dipped in Chinese ink Oil gas valve opening control parameter adjust oil gas valve opening in real time, then to electronic control unit send carry out oil gas valve open Spend the operation control instruction adjusted so that electronic control unit reads corresponding oil gas valve opening control parameter from flash memory, Oil gas valve opening is adjusted in real time.
In the present embodiment, as an alternative embodiment, this method further includes:
If being not received by the instruction of user segment application program update, the user segment of the renewal of write-in in the flash memory is read Application program, the user segment application program according to the renewal are controlled destination object.
In the present embodiment, as an alternative embodiment, the total addressable space of electronic control unit (memory space) is 16MB, divides 256 sections, every section of size is 64KB.
Fig. 2 be the invention relates to electronic control unit memory space structure diagram.It is as shown in Fig. 2, electric The memory space of sub-control unit includes:First reserved storage, guiding application program load store area, user's control parameter are deposited Storage area, renewal code information memory block and the second reserved storage, wherein,
Guiding application program load store area and user's control parameter memory block are flash memory, user's control parameter memory block For storing the user segment application program of application program and renewal, renewal code information memory block is that pseudo- static random stores Device, updates code information, the first reserved storage and the second reserved storage are reserved for storing.
In the present embodiment, as an alternative embodiment, the addressable space of the first reserved storage is 0x000000- 0xC00000, the addressable space in guiding application program load store area is 0xC00000-0xC10000, and user's control parameter is deposited The addressable space of storage area is 0xC10000-0xE00000, and the addressable space of renewal code information memory block is 0xE00000- 0xE08000, the addressable space of the second reserved storage is 0xE08000-0xFFFFFF.
A specific embodiment is lifted below, and the application is described in detail.
Fig. 3 is the method flow schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application one is related to.As shown in figure 3, with end End equipment is PC, and electronic control unit is XC2364 memories exemplified by XC2364 memories (CAN bus protocol conversion device is not shown) Including:Guiding application program load store area (Bootloader), user's control parameter memory block (user segment) and renewal generation Code information storage area (PSRAM), this method includes:
Step 31, guiding application program load store area receives the instruction of shaking hands that PC is sent and is connected with establishing;
Step 32, after the instruction of user segment application program update is received, renewal code information is received;
Step 33, by the renewal code information write-in renewal code information memory block of reception;
Step 34, renewal code information memory block is jumped to;
Step 35, operation renewal code information, receives user's segment data;
In the present embodiment, user's segment data is needs the user segment application journey of renewal obtained after operation renewal code information Ordinal number evidence.
Step 36, by user's segment data write-in user's control parameter memory block of reception;
Step 37, reset;
Step 38, jump to user's control parameter memory block, the data stored in operation user's control parameter memory block with Control travel condition of vehicle.
Fig. 4 is the method flow schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application two is related to.As shown in figure 4, with end End equipment is PC, and electronic control unit is exemplified by microcontroller (CAN bus protocol conversion device is not shown), this method includes:
Step 401, start the embodiment of the present application by writing with a brush dipped in Chinese ink the software of the method editor of application program, microcontroller is carried out Reset;
Step 402, treat the application program write with a brush dipped in Chinese ink and carry out Hex decodings, guiding application program loading initialization;
Step 403, PC sends firmware upgrade instruction;
In the present embodiment, firmware upgrade instruction instructs for user segment application program update.
Step 404, PC sends write instruction;
In the present embodiment, write instruction is more fresh code write instruction.
Step 405, microcontroller judges whether to receive firmware upgrade instruction, if so, step 406 is performed, if not, just Often operation application program;
In the present embodiment, normal operation application program refers to jump to user's control parameter memory block.
Step 406, the write instruction to be received such as microcontroller;
Step 407, PC carries out the transmission of PSRAM segment datas and sends data transfer instruction;
In the present embodiment, PSRAM data are renewal code information.
Step 408, microcontroller carries out PSRAM data write-ins;
Step 409, judge whether the write-in of PSRAM data terminates, if so, step 410 is performed, if not, return to step 406;
Step 410, operation PSRAM is redirected;
Step 411, response is returned to PC;
Step 412, PC issues FLASH erasing instructions;
Step 413, microcontroller carries out FLASH erasings;
Step 414, PC sends FLASH data and CRC check value;
In the present embodiment, FLASH data are the user segment application program of renewal.
Step 415, microcontroller receives FLASH data;
Step 416, judge CRC check whether by if not, return to step 415, if so, performing step 417 and step 418;
Step 417, CRC responses are returned to PC;
Step 418, FLASH data are write into FLASH;
Step 419, write-in response is returned to PC;
Step 420, PC judges whether the write-in of FLASH data terminates, if so, step 421 and step 422 are performed, if not, Return to step 414;
Step 421, jump instruction is sent;
Step 422, write-in END instruction is sent;
Step 423, microcontroller judges whether write-in terminates, if it is not, step 415 is performed, if so, performing step 424;
Step 424, monolithic processor resetting, return to step 401.
In the present embodiment, by the use of CAN bus protocol conversion device as relay device, to from terminal device and electronics The information of control unit carries out interface protocol conversion so that electronic control unit can be based on CAN bus protocol conversion device CAN bus mode transmits data, and serial ports is write with a brush dipped in Chinese ink without being reserved for electronic control unit, reduces the waste of hardware resource, electronics Each module shares CAN bus in control unit, effectively improves resource utilization.
Fig. 5 is the apparatus structure schematic diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application three is related to.As shown in figure 5, the dress Microcontroller or electronic control unit are set to, including:Guide load-on module 51, renewal code information writing module 52, more fresh code Information runs module 53 and control parameter writing module 54, wherein,
Load-on module 51 is guided, for running guiding application program loading, judges whether to receive by controller local The user segment application program update instruction that network bus is sent;
Code information writing module 52 is updated, if receiving the instruction of user segment application program update, receives the user segment The renewal code information that the corresponding renewal code information of application program update instruction is concentrated, the renewal code information of reception is write Random access memory;
In the present embodiment, as an alternative embodiment, renewal code information writing module 52 includes:Instruction reception unit, Code information receiving unit and renewal code information writing unit (not shown) are updated, wherein,
Instruction reception unit, for receiving the more fresh code write instruction sent by Controller Area Network BUS;
Code information receiving unit is updated, is sent for receiving after said write instructs by Controller Area Network BUS Renewal code information;
Code information writing unit is updated, for the renewal code information of reception to be write random access memory.
Code information operation module 53 is updated, is finished for judging whether the renewal code information collection writes, if described Renewal code information collection write-in finishes, and runs the renewal code information of write-in to obtain the user segment application journey of corresponding renewal Sequence;
In the present embodiment, as an alternative embodiment, renewal code information operation module 53 includes:Judging unit, redirect Unit, erasing unit, verification unit and checking treatment unit, wherein,
Judging unit, finishes for judging whether renewal code information collection writes, if the renewal code information collection write-in Finish, notify jump-transfer unit;
In the present embodiment, as an alternative embodiment, finish, continue to if the renewal code information collection does not write Renewal code information simultaneously writes pseudo-static random access memory.
Jump-transfer unit, for jumping to pseudo-static random access memory, runs the renewal code information of said write, and to hair The terminal device of the renewal code information is sent to return to response;
Unit is wiped, the flash memory erasing instruction sent for receiving the terminal device, carries out flash memory erasing;
Verification unit, the user segment application program of the renewal sent for receiving the terminal device, carries out cyclic redundancy Verification;
Checking treatment unit, if cyclic redundancy check to the terminal device by sending cyclic redundancy check by answering Answer, notify control parameter writing module.
In the present embodiment, as an alternative embodiment, the flash memory erasing is carried out using sector erasing mode, using single page The user segment application program of the renewal of acquisition is write flash memory by writing mode.
In the present embodiment, as another alternative embodiment, if checking treatment unit be additionally operable to cyclic redundancy check not by, Cyclic redundancy check is sent not by response to the terminal device, so that the terminal device resends the cyclic redundancy Verification does not pass through the user segment application program of the corresponding renewal of response.
Control parameter writing module 54, for the user segment application program of the renewal of acquisition to be write flash memory, with according to Destination object is controlled according to the user segment application program of the renewal.
In the present embodiment, as an alternative embodiment, control parameter writing module 54 includes:Memory writing unit, reset Unit and reading unit, wherein,
Memory writing unit, for the user segment application program of the renewal of reception to be write flash memory, return, which writes, successfully should Answer;
Reset unit, for judging whether the flash memory write operation of user segment application program of all renewals terminates, if knot Beam, receives jump instruction, is resetted;
Reading unit, control instruction is run for receiving, and jumps to the user segment application program that flash memory reads renewal, foundation The user segment application program of the renewal of reading is controlled destination object.
In the present embodiment, as an alternative embodiment, if renewal code information writing module 52 is additionally operable to be not received by User segment application program update instructs, and reads the user segment application program of the renewal of write-in in the flash memory, according to described in more New user segment application program is controlled destination object.
Fig. 6 is the system structure diagram for writing with a brush dipped in Chinese ink application program that the embodiment of the present application four is related to.As shown in fig. 6, this is System includes:Electronic control unit, CAN bus protocol conversion device and terminal device, wherein,
Terminal device is connected by Universal Serial Bus Interface with CAN bus protocol conversion device, carries out USB communications, CAN Bus protocol conversion equipment is connected by CAN bus with electronic control unit, carries out CAN communication;
Terminal device, it is single to electronic control by CAN bus protocol conversion device when needing progress application program to write with a brush dipped in Chinese ink Member sends the instruction of user segment application program update, and, send user segment application program update and instruct corresponding more fresh code letter Breath;Receive electronic control unit and redirect operation renewal code information response by what CAN bus protocol conversion device returned, pass through CAN bus protocol conversion device sends the user segment application program of the corresponding renewal of renewal code information to electronic control unit;
Electronic control unit, operation guiding application program loading, judges whether to receive and passes through Controller Area Network BUS The user segment application program update instruction of transmission;If receiving the instruction of user segment application program update, receiving the user segment should The renewal code information concentrated with the corresponding renewal code information of program more new command, by the renewal code information of reception write-in with Machine memory;Judge whether the renewal code information collection writes to finish, if the renewal code information collection write-in finishes, run The renewal code information of write-in is to obtain the user segment application program of corresponding renewal;Should by the user segment of the renewal of acquisition Flash memory is write with program, destination object is controlled with the user segment application program according to the renewal.
In the present embodiment, as an alternative embodiment, CAN bus protocol conversion device include II analyzers of ANalyst- with And USBCAN analyzers.
In the present embodiment, as an alternative embodiment, the structure of electronic control unit is as shown in figure 5, details are not described herein.
In embodiment provided herein, it should be understood that disclosed apparatus and method, can be by others side Formula is realized.Device embodiment described above is only schematical, for example, the division of the unit, is only that one kind is patrolled Function division is collected, there can be other dividing mode when actually realizing, in another example, multiple units or component can combine or can To be integrated into another system, or some features can be ignored, or not perform.Another, shown or discussed is mutual Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit Connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple In network unit.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in the embodiment that the application provides can be integrated in a processing unit, also may be used To be that unit is individually physically present, can also two or more units integrate in a unit.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, the technical solution of the application is substantially in other words The part to contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server, or network equipment etc.) perform each embodiment the method for the application all or part of step. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
It should be noted that:Similar label and letter represents similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing, in addition, term " the One ", " second ", " the 3rd " etc. are only used for distinguishing description, and it is not intended that instruction or hint relative importance.
Finally it should be noted that:Embodiment described above, is only the embodiment of the application, to illustrate the application Technical solution, rather than its limitations, the protection domain of the application is not limited thereto, although with reference to the foregoing embodiments to this Shen It please be described in detail, it will be understood by those of ordinary skill in the art that:Any one skilled in the art In the technical scope that the application discloses, it can still modify the technical solution described in previous embodiment or can be light It is readily conceivable that change, or equivalent substitution is carried out to which part technical characteristic;And these modifications, change or replacement, do not make The essence of appropriate technical solution departs from the spirit and scope of the embodiment of the present application technical solution.The protection in the application should all be covered Within the scope of.Therefore, the protection domain of the application answers the scope of the claims of being subject to.

Claims (10)

  1. A kind of 1. method for writing with a brush dipped in Chinese ink application program, it is characterised in that this method includes:
    Guiding application program loading is run, judges whether to receive the user segment application journey sent by Controller Area Network BUS Sequence more new command;
    If receiving the instruction of user segment application program update, receive the user segment application program update and instruct corresponding renewal generation The renewal code information that code information is concentrated, random access memory is write by the renewal code information of reception;
    Judge whether the renewal code information collection writes to finish, if the renewal code information collection write-in finishes, operation write-in Renewal code information to obtain the user segment application program of corresponding renewal;
    The user segment application program of the renewal of acquisition is write into flash memory, with the user segment application program pair according to the renewal Destination object is controlled.
  2. 2. the method as described in claim 1, it is characterised in that described to receive the user segment application program update instruction correspondence Renewal code information concentrate renewal code information include:
    Receive the more fresh code write instruction sent by Controller Area Network BUS;
    Receive the renewal code information sent after said write instruction by Controller Area Network BUS.
  3. 3. the method as described in claim 1, it is characterised in that the renewal code information of the operation write-in is corresponding to obtain The user segment application program of renewal includes:
    Pseudo-static random access memory is jumped to, runs the renewal code information of said write, and believe to more fresh code described in transmission The terminal device of breath returns to response;
    The flash memory erasing instruction that the terminal device is sent is received, carries out flash memory erasing;
    The user segment application program for the renewal that the terminal device is sent is received, carries out cyclic redundancy check;
    If cyclic redundancy check is by sending cyclic redundancy check by response to the terminal device, performing described by acquisition The renewal user segment application program write-in flash memory the step of.
  4. 4. method as claimed in claim 3, it is characterised in that the flash memory erasing is carried out using sector erasing mode, is used The user segment application program of the renewal of acquisition is write flash memory by single page writing mode.
  5. 5. the method as described in claim 3 or 4, it is characterised in that the method further includes:
    If cyclic redundancy check to the terminal device by not sending cyclic redundancy check not by response, so that the end End equipment resends the cyclic redundancy check not by the user segment application program of the corresponding renewal of response.
  6. 6. such as claims 1 to 3 any one of them method, it is characterised in that the user segment of the renewal by acquisition Application program write flash memory, with the user segment application program according to the renewal destination object is controlled including:
    The user segment application program of the renewal of reception is write into flash memory, returns to write-in successful respond;
    Judge whether the flash memory write operation of the user segment application program of all renewals terminates, if terminating, receive jump instruction, into Row resets;
    Operation control instruction is received, jumps to the user segment application program that flash memory reads renewal, the user according to the renewal read Section application program is controlled destination object.
  7. 7. such as claims 1 to 3 any one of them method, it is characterised in that the method further includes:
    If being not received by the instruction of user segment application program update, the user segment application of the renewal of write-in in the flash memory is read Program, the user segment application program according to the renewal are controlled destination object.
  8. 8. a kind of device for writing with a brush dipped in Chinese ink application program, it is characterised in that the device includes:Guide load-on module, renewal code information Writing module, renewal code information operation module and control parameter writing module, wherein,
    Load-on module is guided, for running guiding application program loading, judges whether to receive and passes through Controller Area Network BUS The user segment application program update instruction of transmission;
    Code information writing module is updated, if receiving the instruction of user segment application program update, receives the user segment application journey The renewal code information that the corresponding renewal code information of sequence more new command is concentrated, the renewal code information write-in of reception is deposited at random Reservoir;
    Code information operation module is updated, is finished for judging whether the renewal code information collection writes, if the renewal generation Code information collection write-in finishes, and runs the renewal code information of write-in to obtain the user segment application program of corresponding renewal;
    Control parameter writing module, for the user segment application program of the renewal of acquisition to be write flash memory, with according to described in The user segment application program of renewal is controlled destination object.
  9. 9. device as claimed in claim 8, it is characterised in that the renewal code information operation module includes:Judging unit, Jump-transfer unit, erasing unit, verification unit and checking treatment unit, wherein,
    Judging unit, finishes for judging whether renewal code information collection writes, if the renewal code information collection write-in finishes, Notify jump-transfer unit;
    Jump-transfer unit, for jumping to pseudo-static random access memory, runs the renewal code information of said write, and to sending institute The terminal device for stating renewal code information returns to response;
    Unit is wiped, the flash memory erasing instruction sent for receiving the terminal device, carries out flash memory erasing;
    Verification unit, the user segment application program of the renewal sent for receiving the terminal device, carries out cyclic redundancy check;
    Checking treatment unit, if cyclic redundancy check is by sending cyclic redundancy check by response to the terminal device, leading to Know control parameter writing module.
  10. 10. a kind of system for writing with a brush dipped in Chinese ink application program, it is characterised in that the system includes:Electronic control unit, controller LAN Bus protocol conversion equipment and terminal device, wherein,
    Terminal device is connected by Universal Serial Bus Interface with Controller Area Network BUS protocol conversion device, controller local Network bus protocol conversion device is connected by Controller Area Network BUS with electronic control unit;
    Terminal device, when needing to carry out application program to write with a brush dipped in Chinese ink, by Controller Area Network BUS protocol conversion device to electronics Control unit sends the instruction of user segment application program update, and, send user segment application program update and instruct corresponding renewal Code information;Receive electronic control unit and redirect operation renewal generation by what Controller Area Network BUS protocol conversion device returned Code information answer, sends renewal code information to electronic control unit by Controller Area Network BUS protocol conversion device and corresponds to Renewal user segment application program;
    Electronic control unit, operation guiding application program loading, judges whether to receive and is sent by Controller Area Network BUS User segment application program update instruction;If receiving the instruction of user segment application program update, the user segment application journey is received The renewal code information that the corresponding renewal code information of sequence more new command is concentrated, the renewal code information write-in of reception is deposited at random Reservoir;Judge whether the renewal code information collection writes to finish, if the renewal code information collection write-in finishes, operation write-in Renewal code information to obtain the user segment application program of corresponding renewal;By the user segment application journey of the renewal of acquisition Sequence writes flash memory, and destination object is controlled with the user segment application program according to the renewal.
CN201711257495.6A 2017-12-04 2017-12-04 A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program Pending CN107977220A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711257495.6A CN107977220A (en) 2017-12-04 2017-12-04 A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711257495.6A CN107977220A (en) 2017-12-04 2017-12-04 A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program

Publications (1)

Publication Number Publication Date
CN107977220A true CN107977220A (en) 2018-05-01

Family

ID=62009036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711257495.6A Pending CN107977220A (en) 2017-12-04 2017-12-04 A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program

Country Status (1)

Country Link
CN (1) CN107977220A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110244972A (en) * 2019-06-20 2019-09-17 阳光电源股份有限公司 A kind of controller method for refreshing and diagnostic device
CN110297608A (en) * 2019-06-28 2019-10-01 潍柴动力股份有限公司 Processing method, device and the storage medium of data
CN111475179A (en) * 2019-01-23 2020-07-31 北京新能源汽车股份有限公司 Software online flashing method and device, electronic control unit and upper computer
CN112667265A (en) * 2021-01-20 2021-04-16 北京经纬恒润科技股份有限公司 Method and device for updating bootstrap program
CN112925547A (en) * 2021-03-22 2021-06-08 珞石(北京)科技有限公司 Method for updating DSP program through EtherCAT bus
CN113407218A (en) * 2021-07-07 2021-09-17 广州医软智能科技有限公司 Method for upgrading program on line and electronic equipment
CN114047715A (en) * 2021-09-30 2022-02-15 黄冈普赫氢能商用车有限公司 Control method of peripheral device during software update of ECU application layer and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885791A (en) * 2012-12-20 2014-06-25 北汽福田汽车股份有限公司 Programming device of vehicle controller
DE102016201769A1 (en) * 2016-01-20 2017-07-20 Robert Bosch Gmbh Method for updating software of a control unit, preferably for a motor vehicle

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103885791A (en) * 2012-12-20 2014-06-25 北汽福田汽车股份有限公司 Programming device of vehicle controller
DE102016201769A1 (en) * 2016-01-20 2017-07-20 Robert Bosch Gmbh Method for updating software of a control unit, preferably for a motor vehicle

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
罗成娥等: "《基于CAN总线的在线升级系统设计与实现》", 《数字通信》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111475179A (en) * 2019-01-23 2020-07-31 北京新能源汽车股份有限公司 Software online flashing method and device, electronic control unit and upper computer
CN111475179B (en) * 2019-01-23 2023-10-03 北京新能源汽车股份有限公司 Online software refreshing method and device, electronic control unit and upper computer
CN110244972A (en) * 2019-06-20 2019-09-17 阳光电源股份有限公司 A kind of controller method for refreshing and diagnostic device
CN110297608A (en) * 2019-06-28 2019-10-01 潍柴动力股份有限公司 Processing method, device and the storage medium of data
CN110297608B (en) * 2019-06-28 2023-05-23 潍柴动力股份有限公司 Data processing method, device and storage medium
CN112667265A (en) * 2021-01-20 2021-04-16 北京经纬恒润科技股份有限公司 Method and device for updating bootstrap program
CN112667265B (en) * 2021-01-20 2024-05-07 北京经纬恒润科技股份有限公司 Method and device for updating bootstrap program
CN112925547A (en) * 2021-03-22 2021-06-08 珞石(北京)科技有限公司 Method for updating DSP program through EtherCAT bus
CN113407218A (en) * 2021-07-07 2021-09-17 广州医软智能科技有限公司 Method for upgrading program on line and electronic equipment
CN114047715A (en) * 2021-09-30 2022-02-15 黄冈普赫氢能商用车有限公司 Control method of peripheral device during software update of ECU application layer and storage medium
CN114047715B (en) * 2021-09-30 2023-11-03 黄冈普赫氢能商用车有限公司 Control method and storage medium for peripheral device during ECU application layer software update

Similar Documents

Publication Publication Date Title
CN107977220A (en) A kind of method, apparatus and system for writing with a brush dipped in Chinese ink application program
CN103559066B (en) Embedded software upgrade method based on CANOPEN agreement
CN103685399B (en) A kind of methods, devices and systems for logging in class Unix virtual containers
US8738815B2 (en) System and method for virtualizing the peripherals in a terminal device to enable remote management via removable portable media with processing capability
CN101776994B (en) System and method for integrated hardware platform for Flash applications with distributed objects
CN109391649A (en) The methods, devices and systems of page load
CN109848985B (en) Robot graphic programming method and device and intelligent terminal
CN103530167A (en) Virtual machine memory data migration method and relevant device and cluster system
CN109783374A (en) Code process method, apparatus, equipment and the computer storage medium in automatic Pilot field
CN103455363B (en) Command processing method, device and physical host of virtual machine
CN109086058A (en) Onboard program upgrade-system
CN106452835B (en) The method and device thereof that the terminal software of particular hardware configuration updates
CN109981360A (en) Internet of things equipment website activating method, device, system and storage medium
CN102984124A (en) Method and system capable of fast embedding client-side game program to browser
CN106817259A (en) The upgrade method and device of VSM systems
CN105488000A (en) Method and system for achieving rapid accessing of USB devices
CN106598668A (en) Method for carrying out remote upgrade on AGV (Automatic Guided Vehicle) logistic transportation system on basis of dispatching system
CN205490673U (en) System for auxiliary vehicle carries terminal equipment and upgrades
CN102736936B (en) Method for remotely interacting console programs
CN106850554A (en) The method and apparatus of dual system orientation connection
CN111610977B (en) Compiling method and related device
CN108694052A (en) A kind of firmware upgrade method, device for upgrading firmware and firmware upgrade system
CN109002306A (en) Method for upgrading software, upgrading terminals, laser marking machine and laser marking system
CN106161501A (en) The data sharing method of virtual desktop and device
CN116382115A (en) Safety platform simulation system and application method thereof

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180501