CN111679846A - Application updating method and device - Google Patents

Application updating method and device Download PDF

Info

Publication number
CN111679846A
CN111679846A CN202010428798.5A CN202010428798A CN111679846A CN 111679846 A CN111679846 A CN 111679846A CN 202010428798 A CN202010428798 A CN 202010428798A CN 111679846 A CN111679846 A CN 111679846A
Authority
CN
China
Prior art keywords
application
instruction
ecu
ecus
upper computer
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
CN202010428798.5A
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.)
Beijing Hyperstrong Technology Co Ltd
Original Assignee
Beijing Hyperstrong Technology Co Ltd
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 Beijing Hyperstrong Technology Co Ltd filed Critical Beijing Hyperstrong Technology Co Ltd
Priority to CN202010428798.5A priority Critical patent/CN111679846A/en
Publication of CN111679846A publication Critical patent/CN111679846A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application provides an application updating method and device. The method comprises the following steps: whether the application in the ECU needs to be updated or not is judged, the ECU is set to enter two different states respectively based on the judgment result, the ECU which does not need to be updated can receive the instruction which is sent by the upper computer and is used for updating but does not execute the updating operation corresponding to the instruction in one state, and the ECU which needs to be updated can receive the instruction which is sent by the upper computer and is used for updating and executes the updating operation corresponding to the instruction in the other state. After the configuration of the states of the ECUs is completed, the upper computer may broadcast updated instructions to all the ECUs, and the ECUs perform corresponding operations based on the updated instructions in combination with the states of themselves. Thus, the upgrading efficiency of the application of the ECU is improved.

Description

Application updating method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application updating method and apparatus.
Background
With the rapid development of economy, the demand for electric power is rapidly increased, and energy storage power stations are also in operation. The energy storage power station consists of an upper computer and a plurality of battery clusters, and each battery cluster comprises a plurality of single batteries and an electronic control unit ECU (electronic control unit) corresponding to each single battery. The single battery is used for storing electric energy, and the ECU is used for controlling the single battery and communicating with the upper computer.
In practical use, the version updating speed of the application of the ECU is high, and the application of all ECUs of the energy storage power station needs to be updated frequently. In the prior art, an upper computer updates the application of one ECU of an energy storage power station at a time. If the application of all the ECUs of the energy storage power station needs to be operated, the upper computer needs to be used, and the application of the ECUs is updated one by one.
However, the above method has a problem that the application of the ECU is inefficient to update.
Disclosure of Invention
The application provides an application updating method and device, which are used for solving the problem that in the prior art, the updating efficiency of the application of an ECU is low.
In a first aspect, the present invention provides a method for updating an application, where the method includes:
the method comprises the steps that an upper computer obtains updated first version information of an application, first information of hardware for installing the application, second version information of the application and second information of the hardware for installing the application of M Electronic Control Units (ECUs), wherein M is a positive integer;
the upper computer determines the ECUs with the first information different from the second information or the ECUs with the first information same as the second information and the first version information same as the second version information as P ECUs, and determines the ECUs with the first information same as the second information and the first version information different from the second version information as Q ECUs, wherein the sum of P and Q is equal to M, and P and Q are positive integers;
the upper computer sends first instructions to the P ECUs respectively, wherein the first instructions are used for indicating that the ECUs cannot execute updating operation;
the upper computer broadcasts a second instruction to the M ECUs, wherein the second instruction is used for instructing the M ECUs to execute the updating operation of the application, Q ECUs respectively execute the updating operation of the application, and P ECUs do not execute the updating operation of the application;
and the upper computer broadcasts a third instruction to the M ECUs, wherein the third instruction is used for indicating the M ECUs to restart.
Optionally, the obtaining, by the upper computer, second version information of the application and second information of the hardware on which the application is installed of the M electronic control unit ECUs includes:
the upper computer broadcasts a fourth instruction to the M ECUs, wherein the fourth instruction is used for instructing the M ECUs to send the second version information and the second information to the upper computer;
the upper computer receives fifth instructions from the M ECUs respectively, wherein each fifth instruction comprises: an identification of an ECU, second version information of an application of the ECU, and second information of hardware in which the application is installed.
Optionally, the second instruction includes: update data of the application.
Optionally, the method further comprises:
the upper computer broadcasts a sixth instruction to the M ECUs, wherein the sixth instruction is used for instructing the M ECUs to send third version information of the application to the upper computer;
the upper computer receives seventh instructions from the M ECUs respectively, wherein each seventh instruction comprises: an identification of an ECU and third version information of an application of the ECU;
and the upper computer determines the updating results of the M ECUs based on the first version information and the M pieces of third version information.
Optionally, the method further comprises:
and the upper computer outputs the updating result.
In a second aspect, the present invention provides an update method of an application, applied to a first ECU in which first information of hardware in which the application is installed is different from second information of hardware in which the application is installed, or the first information of hardware in which the application is installed is the same as the second information of hardware in which the application is installed and the first version information of the application is the same as the second version information of the application;
the method comprises the following steps:
the first ECU receives a first instruction from an upper computer, wherein the first instruction is used for indicating that the first ECU can not execute updating operation;
the first ECU receives a second instruction from the upper computer, wherein the second instruction is used for instructing the first ECU to execute the updating operation of the application;
the first ECU does not execute the update operation of the application based on the first instruction and the second instruction;
the first ECU receives a third instruction from the upper computer, wherein the third instruction is used for instructing the first ECU to restart;
the first ECU restarts based on the third instruction.
Optionally, the method further comprises:
the first ECU receives a fourth instruction from the upper computer, wherein the fourth instruction is used for instructing the first ECU to send the second version information and the second information to the upper computer;
the first ECU sends a fifth instruction to the upper computer, wherein the fifth instruction comprises: the identity of the first ECU, the second version information, and the second information.
Optionally, the method further comprises:
the first ECU receives a sixth instruction from the upper computer, wherein the sixth instruction is used for instructing the first ECU to send third version information of the application to the upper computer;
the first ECU sends a seventh instruction to the upper computer, wherein the seventh instruction comprises: an identification of the first ECU and the third version information.
In a third aspect, the present invention provides an update method of an application, applied to a second ECU in which first information of hardware in which the application is installed is the same as second information of hardware in which the application is installed and the first version information of the application is different from the second version information of the application;
the method comprises the following steps:
the second ECU receives a second instruction from an upper computer, wherein the second instruction is used for instructing the second ECU to execute the updating operation of the application;
the second ECU executes the update operation of the application based on the second instruction;
the second ECU receives a third instruction from the upper computer, wherein the third instruction is used for instructing the second ECU to restart;
the second ECU restarts based on the third instruction.
Optionally, the second instruction includes: when the application updates the data, the second ECU executes an update operation of the application based on the second instruction, including:
the second ECU sequentially executes operations of restart, decryption of the hardware, update of the application, and verification of the application based on the update data of the application.
Optionally, the second ECU performs an operation of decryption of the hardware based on the update data of the application, including:
the second ECU sends target parameters to the upper computer when receiving the updated data of the application;
the second ECU calculates the target parameters based on a preset algorithm to obtain a first result;
the second ECU receives a second result from the upper computer, and the second result is obtained by the upper computer through calculation of the target parameter according to the preset algorithm;
the second ECU compares the first result and the second result to determine whether the decryption of the hardware is successful.
Optionally, the method further comprises:
the second ECU receives a fourth instruction from the upper computer, wherein the fourth instruction is used for instructing the second ECU to send the second version information and the second information to the upper computer;
the second ECU sends a fifth instruction to the upper computer, wherein the fifth instruction comprises: an identification of the second ECU, the second version information, and the second information.
Optionally, the method further comprises:
the second ECU receives a sixth instruction from the upper computer, wherein the sixth instruction is used for instructing the second ECU to send the third version information to the upper computer;
the second ECU sends a seventh instruction to the upper computer, wherein the seventh instruction comprises: an identification of the second ECU and the third version information.
In a fourth aspect, the present application provides an update device for an application, for an upper computer, the device comprising:
an obtaining module, configured to obtain first version information of an updated application, first information of hardware on which the application is installed, and second version information of the application and second information of the hardware on which the application is installed of each of M electronic control unit ECUs, where M is a positive integer;
a determining module, configured to determine, as P ECUs, ECUs in which the first information is different from the second information, or ECUs in which the first information is the same as the second information and the first version information is the same as the second version information, and determine, as Q ECUs, ECUs in which the first information is the same as the second information and the first version information is different from the second version information, where the sum of P and Q is equal to M, and P and Q are positive integers;
the device comprises a sending module, a judging module and a judging module, wherein the sending module is used for respectively sending first instructions to P ECUs, and the first instructions are used for indicating that the ECUs cannot execute updating operation;
the sending module is further configured to broadcast a second instruction to the M ECUs, where the second instruction is used to instruct the M ECUs to perform the update operation of the application, the Q ECUs respectively perform the update operation of the application, and the P ECUs do not perform the update operation of the application;
the sending module is further configured to broadcast a third instruction to the M ECUs, where the third instruction is used to instruct the M ECUs to restart.
The sending module is further configured to broadcast a fourth instruction to the M ECUs, where the fourth instruction is used to instruct the M ECUs to send the second version information and the second information to the upper computer;
the acquiring module is configured to receive fifth instructions from the M ECUs, respectively, where each fifth instruction includes: an identification of the ECU, second version information of an application of the ECU, and second information of hardware of the ECU.
Optionally, the second instruction includes: update data of the application.
The sending module is further configured to broadcast a sixth instruction to the M ECUs, where the sixth instruction is used to instruct the M ECUs to send the third version information of the application to the upper computer;
the acquiring module is further configured to receive seventh instructions from the M ECUs, respectively, where each seventh instruction includes: an identification of an ECU and third version information of an application of the ECU;
the determining module is further configured to determine update results of the M ECUs based on the first version information and the M third version information.
Optionally, the apparatus further comprises:
and the output module is used for outputting the updating result.
In a fifth aspect, the present application provides an update apparatus for an application, which is applied to a first ECU, in which first information of hardware in which the application is installed is different from second information of the hardware in which the application is installed, or the first information of the hardware in which the application is installed is the same as the second information of the hardware in which the application is installed and the first version information of the application is the same as the second version information of the application;
the device comprises:
the first receiving module is used for receiving a first instruction from an upper computer, wherein the first instruction is used for indicating that the first ECU can not execute updating operation;
the first receiving module is further configured to receive a second instruction from the upper computer, where the second instruction is used to instruct the first ECU to execute an update operation of the application;
the first execution module is used for not executing the updating operation of the application based on the first instruction and the second instruction;
the first receiving module is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the first ECU to restart;
the first execution module is further configured to restart based on the third instruction.
The first receiving module is further configured to receive a fourth instruction from the upper computer, where the fourth instruction is used to instruct the first ECU to send the second version information and the second information to the upper computer;
the first sending module is configured to send a fifth instruction to the upper computer, where the fifth instruction includes: the identity of the first ECU, the second version information, and the second information.
The first receiving module is further configured to receive a sixth instruction from the upper computer, where the sixth instruction is used to instruct the first ECU to send third version information of the application to the upper computer;
the first sending module is further configured to send a seventh instruction to the upper computer, where the seventh instruction includes: an identification of the first ECU and the third version information.
In a sixth aspect, the present application provides an update apparatus for an application, applied to a second ECU, in which first information of hardware in which the application is installed is the same as second information of hardware in which the application is installed and the first version information of the application is different from the second version information of the application;
the device comprises:
the second receiving module is used for receiving a second instruction from the upper computer, wherein the second instruction is used for instructing the second ECU to execute the updating operation of the application;
the second execution module is used for executing the updating operation of the application based on the second instruction;
the second receiving module is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the second ECU to restart;
the second execution module is further configured to restart based on the third instruction.
Optionally, the second instruction includes: when the application updates the data, the second ECU executes an update operation of the application based on the second instruction, including:
and the second execution module is used for sequentially executing the operations of restarting, decrypting the hardware, updating the application and verifying the application based on the update data of the application.
Optionally, the apparatus performs an operation of decrypting the hardware based on the update data of the application, including:
the second sending module is used for sending the target parameters to the upper computer when receiving the update data of the application;
the second execution module is used for calculating the target parameter based on a preset algorithm to obtain a first result;
the second receiving module is used for receiving a second result from the upper computer, and the second result is obtained by calculating the target parameter by the upper computer according to the preset algorithm;
the second execution module is configured to compare the first result and the second result, and determine whether the decryption of the hardware is successful.
Optionally, the apparatus further comprises:
the second receiving module is further configured to receive a fourth instruction from the upper computer, where the fourth instruction is used to instruct the second ECU to send the second version information and the second information to the upper computer;
the second sending module is further configured to send a fifth instruction to the upper computer, where the fifth instruction includes: an identification of the second ECU, the second version information, and the second information.
Optionally, the apparatus further comprises:
the second receiving module is further configured to receive a sixth instruction from the upper computer, where the sixth instruction is used to instruct the second ECU to send the third version information to the upper computer;
the second sending module is further configured to send a seventh instruction to the upper computer, where the seventh instruction includes: the identity of the second ECU and the third version information
In a seventh aspect, the present application provides a system comprising: the update device of the application according to the fourth aspect and the fourth aspect, the update device of the application according to the fifth aspect and the fifth aspect, and the update device of the application according to the sixth aspect and the sixth aspect are described above.
In an eighth aspect, the present application provides a host computer, including: a memory, a processor, a display, and a communication interface;
the memory is used for storing program instructions;
the display is used for displaying the processing result of the processor;
the communication interface is used for receiving or sending an execution instruction according to the instruction of the processor;
the processor is arranged to call program instructions in the memory to perform the method of updating the application in the first aspect and any one of the possible designs of the first aspect.
In a ninth aspect, the present application provides an ECU comprising: a memory, a processor, a sensor, and a communication interface;
the memory is used for storing program instructions;
the sensor is used for acquiring information such as temperature, voltage and current of the battery;
the communication interface is used for receiving or sending an execution instruction according to the instruction of the processor;
the processor is used for calling the program instructions in the memory to execute the updating method of the application in the second aspect and any one of the possible designs of the second aspect; alternatively, the processor is configured to call program instructions in the memory to perform the method for updating an application in the third aspect and any possible design of the third aspect.
In a tenth aspect, the present application provides a readable storage medium, where an execution instruction is stored in the readable storage medium, and when at least one processor of an electronic device executes the execution instruction, the electronic device executes the method for updating an application in any one of the possible designs of the first aspect and the first aspect; or, the electronic device executes the updating method of the application in the second aspect and any one of the possible designs of the second aspect; alternatively, the electronic device performs the method for updating an application in the third aspect and any one of the possible designs of the third aspect.
According to the application updating method and device, whether the application of each ECU needs to be updated or not is judged by acquiring the first version information and the first information of the updated application and the second version information and the second information of the M ECUs. According to the judgment result, the upper computer respectively sets M ECUs to enter two different states, wherein one state enables P ECUs which do not need to be updated to receive the command for updating sent by the upper computer but not to execute the updating operation corresponding to the command, and the other state enables M ECUs which need to be updated to receive the command for updating sent by the upper computer and execute the updating operation corresponding to the command. After the configuration of the states of the ECUs is completed, the upper computer may broadcast an update instruction to the M ECUs, where the P ECUs do not execute the second instruction when receiving the second instruction, and the Q ECUs respectively execute an update operation according to the second instruction when receiving the second instruction. The upper computer can broadcast a third instruction to the M ECUs. And the M ECUs respectively complete the restarting operation of the M ECUs according to the third instruction, so that the updating process of the application is realized, the updating efficiency of the application is improved, and the consumption of manpower resources and time resources in the updating process is reduced.
In addition, further, in the application, the Q ECUs can also respectively send target parameters to the upper computer. And calculating to obtain a first result by the Q ECUs according to respective target parameters through a preset algorithm. And the upper computer calculates a second result of each target parameter according to a preset algorithm and sends the second result to the corresponding ECU. The Q ECUs compare the first result and the second result respectively and determine whether the decryption of the hardware of the ECU is successful. By the method, illegal operation of the ECU by an illegal upper computer is avoided, and updating safety of application of the ECU is improved. Further, the upper computer confirms the update result of the application of the ECU by acquiring the third information of each ECU after the update, and then, according to the update result, the administrator confirms the effect of the update.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic view of a scenario of an application update system according to an embodiment of the present application;
fig. 2 is a flowchart of an application update method according to an embodiment of the present application;
fig. 3 is a signaling interaction diagram of an update method of an application according to an embodiment of the present application;
fig. 4 is a flowchart of an update method for an application according to an embodiment of the present application;
FIG. 5 is a schematic interface diagram of an update system for an application according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application;
fig. 9 is a schematic diagram of a hardware structure of an upper computer according to an embodiment of the present application;
fig. 10 is a schematic diagram of a hardware structure of an ECU according to an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 shows a scene diagram of an update system of an application. As shown in fig. 1, the update system 10 of the application includes: host computer 11, M ECU12 and M battery 13, M is the positive integer.
The upper computer 11 is connected with the M ECUs 12, is used for communicating with the M ECUs 12, and can respectively send commands to part or all of the M ECUs 12 or broadcast the commands to the M ECUs. The upper computer 11 can also be used for receiving response information sent by the M ECUs 12 respectively. In the applied updating system 10, at least one upper computer 11 is included.
The instruction may be a control instruction, a request instruction, or an update instruction, which is not limited in this embodiment.
The response information may include an execution condition of an instruction of the ECU, or information requested by the upper computer to the ECU.
The upper computer 11 may also generate a corresponding result according to the response information after receiving the response information, and send the result to the administrator. When the upper computer 11 includes a screen, the upper computer 11 may display the result to the administrator through the screen. The upper computer can also send the result to the administrator through mails, short messages and the like.
In the present embodiment, the update system 10 is applied with M ECUs 12. Typically, one ECU12 is connected to one battery 13, and in this case, M batteries 13 are used in the update system 10. One ECU12 may also be connected to a plurality of batteries 13. The ECU12 may be configured to send instructions to one or more batteries 13, and one battery 13 performs corresponding operations according to the instructions.
The command may be used to instruct one of the batteries 13 to perform operations such as power-up, power-down, power storage, power discharge, battery equalization, battery thermal management, and the like.
An ECU12 is connected to the host computer 11 and is configured to receive commands from the host computer 11 and send response messages to the host computer 11.
Typically, each ECU12 has an application disposed thereon. The application can be used to perform corresponding operations according to instructions sent by the upper computer 11. The operation may be sending instructions to the battery 13, and may also be used to control the ECU 12.
In the actual application process, the application update speed is relatively fast, and in order to ensure the normal operation of one ECU, frequent update of the application of the ECU is required. Typically, an administrator controls the host computer to update one ECU at a time. In the updating process, an administrator is required to control the upper computer to update the application of the ECU one by one, so that the defects of high human resource consumption and high time cost exist. In the updating process, due to excessive manual intervention, the unmeasured risk in the updating process is increased, and the workload in the later period is increased indirectly.
Aiming at the problems, the ECU in the list can be updated one by one according to the preset ECU list, so that the unmeasured risk caused by manual operation is reduced, and the labor cost is reduced. However, because the number of ECUs is large in the update system of the application of the energy storage power station, when all the applications of the ECUs are updated by using the method, the problems of long time consumption and low update efficiency still exist.
In order to solve the above problems, the present application provides an application updating method and apparatus, and based on a result of determining whether an application in each ECU needs to be updated, the ECU is set to enter two different states, wherein one state enables an ECU that does not need to be updated to receive an instruction for updating sent by an upper computer but not to execute an updating operation corresponding to the instruction, and the other state enables an ECU that needs to be updated to receive an instruction for updating sent by the upper computer and execute an updating operation corresponding to the instruction. After the setting of the states of the ECUs is completed, the upper computer may broadcast updated instructions to all the ECUs, and each ECU performs a corresponding operation based on the updated instructions in conjunction with its own state. According to the method and the device, each ECU is set to enter a corresponding state, so that each ECU executes different operations after receiving the updated instruction. After receiving the updating command, the ECU needing to be updated executes the corresponding updating operation of the command according to the command, so that the updating efficiency of the application of the ECU is improved, and the consumption of manpower resources and time resources in the updating process is reduced.
Next, a specific implementation process of the update method applied in the present application is described in detail with reference to fig. 2 by using the upper computer and M ECUs in fig. 1 as execution subjects and using a specific embodiment.
Fig. 2 shows a flowchart of an update method of an application according to an embodiment of the present application. As shown in fig. 2, the method of this embodiment may include:
s101, the upper computer acquires first version information of the updated application, first information of hardware for installing the application, second version information of the application of each of the M ECUs and second information of the hardware for installing the application, wherein M is a positive integer.
Before updating the application of each ECU, the upper computer may acquire first version information of the application and first information of hardware in which the application is installed, based on the update file of the application.
The first version information of the application may be software version information of the application, which is used to indicate a software version of the application. In the present application, the first version information may be represented by a character string, for example, QQ-2007-Beta, V1.2.1, etc.
The first information may be version information of hardware on which the application is installed, and is used for indicating a version requirement of the hardware on which the application is installed. Version information of one or more pieces of hardware may be included in the first information. When the first information includes version information of a plurality of pieces of hardware, the application can be installed on the plurality of pieces of hardware. When the first information contains hardware version information, the application can be installed on the hardware of the version. In this application, the first information may be represented by a character string, such as TL-WR841N-V12, Ver1.8, etc.
In addition, for each application of the M ECUs, the upper computer may further acquire second version information of the application of each ECU and second information of hardware on which the application is installed.
Wherein the second version information of the application of each ECU, similar to the first version information, may be software version information of the application for indicating the software version of the application.
Wherein the second information of the hardware of the installation application of each ECU is version information of the hardware of the ECU. The second information is represented in a manner similar to the first information.
S102, the upper computer determines the ECUs with the first information and the second information different from each other, or the ECUs with the first information and the second information being the same and the first version information and the second version information being the same as each other to be P ECUs, and determines the ECUs with the first information and the second information being the same and the first version information and the second version information being different from each other to be Q ECUs, wherein the sum of P and Q is equal to M, and P and Q are positive integers.
The upper computer determines whether the application of each ECU needs to be updated based on the first version information and the first information, and the second version information and the second information acquired in S101.
When the first information is different from the second information, the hardware version of the application installed with the update does not match the hardware version of the ECU, and therefore, the upper computer may determine that the application cannot be installed in the ECU, and thus, the application of the ECU cannot be updated.
When the first information is the same as the second information and the first version information is the same as the second version information, the hardware version required for installing the updated application is described to be matched with the hardware version of the ECU, but the software version of the current application of the ECU is the latest version and does not need to be updated again, that is, the application of the ECU does not need to be updated.
Wherein, the P ECUs are the two ECUs which do not need to be updated.
When the first information is the same as the second information and the first version information is different from the second version information, the hardware version required for installing the updated application is matched with the hardware version of the ECU, and the software version of the current application of the ECU is lower than the software version of the updated application, that is, the application of the ECU needs to be updated.
Wherein, Q ECUs are the ECUs which need to be updated.
According to whether the application of the ECUs needs to be updated or not, the upper computer divides the M ECUs into P ECUs which do not need to be updated and Q ECUs which need to be updated, and the sum of P and Q is equal to M.
S103, the upper computer sends first instructions to the P ECUs respectively, wherein the first instructions are used for indicating that the ECUs cannot execute updating operation.
After determining whether each ECU needs to be updated or not in S102, the upper computer sends first instructions to P ECUs which do not need to be updated respectively, so that the P ECUs enter a state capable of receiving the instructions sent by the upper computer for updating, but do not execute corresponding updating operation of the instructions. And each ECU in the P ECUs sends response information to the upper computer after the state setting is finished, and informs the upper computer of finishing the state setting.
And for the Q ECUs which do not receive the first instruction, each ECU enters a state capable of receiving an instruction which is sent by the upper computer and used for updating, and executes corresponding updating operation of the instruction.
S104, the upper computer broadcasts a second instruction to the M ECUs, wherein the second instruction is used for instructing the M ECUs to execute the updating operation of the application, the Q ECUs execute the updating operation of the application respectively, and the P ECUs do not execute the updating operation of the application.
The upper computer broadcasts a second instruction to the M ECUs, and the M ECUs all receive the second instruction. Because, P ECUs have all entered the state that can receive the command sent by the upper computer for updating, but do not execute the corresponding updating operation of the command. Therefore, the P ECUs receive the second command transmitted from the host computer, but do not perform the update operation corresponding to the second command.
And all the Q ECUs receive a second instruction sent by the upper computer and execute corresponding updating operation with the second instruction. And updating the application of the ECU by the Q ECUs according to the second command. And each ECU in the Q ECUs sends response information to the upper computer after the updating operation is completed, and informs the upper computer of completing the updating operation.
And S105, broadcasting a third instruction to the M ECUs by the upper computer, wherein the third instruction is used for instructing the M ECUs to restart.
And the upper computer broadcasts a third instruction to the M ECUs, and the M ECUs are respectively restarted according to the third instruction to complete the updating operation of the application. And when the Q ECUs are restarted, the loaded application is an updated application.
In a specific embodiment, assuming that an update system of an application comprises a host computer and three ECUs, namely ECU _1, ECU _2 and ECU _3, the update method of the application comprises the following specific steps:
step 1: the upper computer obtains updated first version information of the application, first information of hardware for installing the application, second version information of the application of each of the 3 ECUs and second information of the hardware for installing the application.
Step 2: and the upper computer compares the first information with the second information of the ECU _ 1. When the first information is different from the second information, the upper computer considers that the hardware version of the updated application does not match the hardware version of the ECU _1, and therefore, the upper computer may determine that the application cannot be installed in the ECU _1, and thus, the application of the ECU _1 cannot be updated
And step 3: and the upper computer compares the first information with the second information of the ECU _2 and determines that the updated application can be installed on the ECU _ 2. The upper computer compares the first version information with second version information of hardware of the application on which the ECU _2 is installed. When the first version information is consistent with the second version information, the upper computer considers that the application on the ECU _2 is the application with the latest software version, so that the ECU _2 is judged not to need to be updated.
And 4, step 4: and the upper computer compares the first information with the second information of the ECU _3 and determines that the updated application can be installed on the ECU _ 3. The upper computer compares the first version information with second version information of hardware of the application on which the ECU _3 is installed. When the first version information is inconsistent with the second version information, the upper computer determines that the application of the ECU _3 needs to be updated.
And 5: according to the comparison result in the step 2-4, the upper computer can send a first instruction to the ECU _1 and the ECU _2 respectively to enable the ECU _1 and the ECU _2 to enter a monitoring state. ECU _3 does not receive the first instruction and enters the update state by default. The monitoring state is used for indicating the ECU _1 and the ECU _2 to enter a state which can receive an instruction sent by the upper computer for updating, but does not execute the corresponding updating operation of the instruction. The updating state is used for indicating the ECU _3 to enter a state capable of receiving an instruction sent by the upper computer and used for updating, and executing corresponding updating operation of the instruction.
Step 6: and the upper computer broadcasts a second instruction to the 3 ECUs. Among them, ECU _1 and ECU _2 are in the monitoring state, and therefore, ECU _1 and ECU _2 receive the second instruction, but do not execute it. And after receiving the second instruction, the ECU _3 executes corresponding updating operation according to the second instruction, and updates the application of the ECU _ 3.
And 7: and the upper computer broadcasts a third instruction to the 3 ECUs. And 3 ECUs respectively execute restarting operation according to the third instruction and end the updating of the application. And after the ECU _1 and the ECU _2 are restarted, the monitoring state is exited, and the updating is completed. When the ECU _3 is restarted, the loaded application is an updated application.
According to the application updating method provided by the application, whether the application of each ECU needs to be updated or not is judged by acquiring the first version information and the first information of the updated application and the second version information and the second information of the M ECUs. According to the judgment result, the upper computer sends a first instruction to the P ECUs which do not need to be updated, so that the P ECUs can all enter a state of receiving the instruction sent by the upper computer for updating, but do not execute the updating operation corresponding to the instruction. And Q ECUs are in a state of receiving an updating instruction sent by the upper computer and executing corresponding updating operation of the instruction. And the upper computer sends a second instruction to the M ECUs in a broadcasting mode. And the Q ECUs receive the second instruction sent by the upper computer, execute the operation of the second instruction and complete the updating. And the P ECUs receive the second command sent by the upper computer, but do not execute the updating operation of the second command. And the M ECUs respectively restart the ECUs according to the third instruction to finish the updating operation of the application. According to the method and the device, each ECU is set to enter a corresponding state, so that each ECU executes different operations after receiving the updated instruction. After receiving the updating command, the ECU needing to be updated executes the corresponding updating operation of the command according to the command, so that the updating efficiency of the application of the ECU is improved, and the consumption of manpower resources and time resources in the updating process is reduced.
Before judging whether each ECU needs to be updated or not, the upper computer needs to acquire second version information and second information of each ECU. The manner of acquiring the second version information and the second information of each ECU by the upper computer includes multiple manners, and two feasible implementation manners are adopted for example in the following.
In a possible implementation manner, the upper computer may obtain the second version information and the second information of each ECU through the memory. The memory may be a memory provided in the upper computer, or may be an external memory communicatively connected to the upper computer.
In another feasible implementation manner, the upper computer can send query instructions to the M ECUs respectively, the query instructions enable the M ECUs to send response information to the upper computer respectively, and the response information includes second version information and second information of the ECUs.
Next, with reference to fig. 3, a detailed description will be given of a specific implementation process of the upper computer obtaining the second version information and the second information from the M ECUs, respectively.
Fig. 3 shows a signaling interaction diagram of an update method of an application according to an embodiment of the present application. As shown in fig. 3, the updating method of the application may include, by using the upper computer and the M ECUs as execution subjects:
s2001, the upper computer broadcasts a fourth instruction to the M ECUs, wherein the fourth instruction is used for instructing the M ECUs to send second version information and second information to the upper computer.
In the application, the upper computer broadcasts a fourth instruction to the M ECUs, wherein the fourth instruction can be a query instruction and is used for requesting second version information and second information to each ECU.
S2002, the M ECUs respectively send fifth instructions to the upper computer, wherein each fifth instruction comprises: an identification of the ECU, second version information of an application of the ECU, and second information of hardware of the ECU.
In the application, when the M ECUs receive a fourth instruction sent by the upper computer, the M ECUs send a fifth instruction to the upper computer respectively according to the fourth instruction.
The fifth instruction is response information generated by each ECU according to the fourth instruction, wherein the response information comprises second version information of the application of the ECU, second information of hardware for installing the application and the identifier of the ECU.
Wherein the identification of the ECU may be used to uniquely identify the ECU, e.g., ECU _ 1.
S201, the upper computer acquires first version information of the updated application, first information of hardware for installing the application, second version information of the application of each of the M Electronic Control Units (ECUs) and second information of the hardware of the ECUs, wherein M is a positive integer.
S202, the upper computer determines the ECUs with the first information and the second information different from each other, or the ECUs with the first information and the second information being the same and the first version information and the second version information being the same as each other to be P ECUs, and determines the ECUs with the first information and the second information being the same and the first version information and the second version information being different from each other to be Q ECUs, wherein the sum of P and Q is equal to M, and P and Q are positive integers.
And S2003, respectively sending first instructions to the P ECUs by the upper computer, wherein the first instructions are used for indicating that the ECUs cannot execute the updating operation.
And S2004, the upper computer broadcasts a second instruction to the M ECUs, wherein the second instruction is used for instructing the M ECUs to execute the updating operation of the application.
S203, Q ECUs respectively execute the updating operation of the application, and P ECUs do not execute the updating operation of the application.
And S2005, broadcasting a third instruction to the M ECUs by the upper computer, wherein the third instruction is used for instructing the M ECUs to restart.
S201, S202, S2003, S2004, S203, and S2005 are similar to the implementation manners of S101, S102, S103, S104, and S105 in the embodiment of fig. 2, respectively, and are not described again in this embodiment.
In the application, the upper computer reads the second version information and the second information of each ECU from the memory, or acquires the second version information and the second information of the ECU from each ECU. And the upper computer compares the first information with the second information and the first version information with the second version information and judges whether the application of each ECU needs to be updated. According to the judgment result, the upper computer sends a first instruction to P ECUs which do not need to update the application, so that the P ECUs can enter the instruction which can be sent by the upper computer and is used for updating, but do not execute the updating operation corresponding to the instruction, and Q ECUs can enter the state which receives the instruction which is sent by the upper computer and is used for updating and execute the updating operation corresponding to the instruction. And the upper computer sends a second command to the M ECUs in a broadcasting mode. And the Q ECUs receive the second instruction sent by the upper computer, execute the updating operation of the second instruction and finish the updating. And the M ECUs respectively complete the restarting operation of the ECUs according to the third instruction so as to complete the updating of the application. According to the method and the device, each ECU is set to enter a corresponding state, so that each ECU executes different operations after receiving the updated instruction. After receiving the updating command, the ECU needing to be updated executes the corresponding updating operation of the command according to the command, so that the updating efficiency of the application of the ECU is improved, and the consumption of manpower resources and time resources in the updating process is reduced.
In the application updating system, M ECUs are included, wherein P ECUs are ECUs which do not need to be updated on the application and are named as first ECUs. And Q ECUs are ECUs which need to update the application and are named as second ECUs.
And after receiving the second instruction, the second ECU executes updating operation according to the second instruction. Wherein, the second instruction comprises: when the application updates the data, the second ECU executes the update operation of the application based on the second instruction. The second ECU sequentially executes operations of restart, decryption of hardware, update of the application, and verification of the application based on the update data of the application.
And after receiving the second command, the second ECU respectively acquires the updating data from the second command. The second ECUs perform update operations of the applications, respectively, according to the update data. The update data is used for performing operations such as restarting, hardware decryption, application update, and application verification on the second ECU, respectively. Based on data flexibility, the update data can be implemented by various methods, and the following examples adopt three possible implementation manners.
In one possible implementation, the update data includes an instruction for instructing each of the second ECUs to perform operations of restarting, decrypting hardware, updating an application, and verifying the application, and the instruction instructs the updating step to be as follows:
step 1, the upper computer broadcasts a restart instruction and instructs the second ECU to restart.
In this step, after receiving the restart instruction, the second ECU executes a restart operation according to the restart instruction. After being restarted, each ECU enters a bootloader state. Each ECU needs to read and write the application data in the bootloader state to update the application.
And after each ECU completes the restart and enters a bootloader state, sending response information to the upper computer to inform the upper computer that the ECU completes the restart operation.
And 2, broadcasting a decryption instruction by the upper computer, and instructing hardware of the second ECU to decrypt.
In this step, an ECU decrypts hardware of the ECU by obtaining a decryption instruction sent by the upper computer, so that the hardware enters a readable and writable state, and in this state, the upper computer can perform operations such as erasing flash, writing in upgrade data, and the like on the hardware of the ECU. The operation of the decryption of the hardware comprises the following specific steps:
and 2.1, sending the target parameters to the upper computer by the second ECU when receiving the update data of the application.
In this step, an ECU generates a target parameter when receiving the update data, and sends the target parameter to the upper computer.
The target parameter may be a value calculated by using a random algorithm, a value randomly acquired from a preset fixed data set, or a preset value, which is not limited in this embodiment.
And 2.2, calculating the target parameter by the second ECU based on a preset algorithm to obtain a first result.
In this step, an ECU decrypts the target parameter using a preset algorithm according to the target parameter obtained in step 2.1.
The preset algorithm is a preset algorithm, and the preset algorithm may be a fixed algorithm, an algorithm that is periodically updated and replaced, or an algorithm that is dynamically changed, which is not limited in this embodiment.
The first result is a decryption result obtained after the ECU decrypts the target parameter by using a preset algorithm.
And 2.3, the second ECU receives a second result from the upper computer, wherein the second result is obtained by calculating the target parameter by the upper computer according to a preset algorithm.
And the upper computer decrypts the received target parameters by using the same algorithm as the second ECU to obtain a second result, and sends the decrypted second result to the second ECU corresponding to the target parameters.
And 2.4, comparing the first result with the second result by the second ECU, and determining whether the hardware decryption is successful.
Each of the second ECUs compares the first result and the second result. And if the first result is consistent with the second result, the upper computer is a correct upper computer matched with the ECU. At this time, the ECU decrypts the hardware so that it can perform operations such as erasing the flash, receiving upgrade data, and the like. If the first result is inconsistent with the second result, the upper computer is possibly an illegal upper computer, and the updating operation is stopped and ended, so that the illegal updating operation of the ECU by the illegal upper computer is avoided.
And step 3: the upper computer broadcasts the upgrade data and instructs the second ECU to receive the updated application data.
In this step, an ECU enters a bootloader state by means of restarting, and the hardware of the ECU completes decryption, and can execute operations such as erasing flash, receiving upgrade data, and the like. And after receiving the updated application data sent by the upper computer, the ECU erases the flash of the original application data and writes the updated application data.
And after receiving the updated application data, the ECU sends response information to the upper computer to indicate that the data reception of the updated application of the upper computer is finished.
And 4, step 4: and the upper computer broadcasts a verification instruction and instructs the second ECU to verify the updated application data.
In this step, an ECU verifies the updated application data received by the ECU when receiving a verification instruction sent by the upper computer. And if the verification is passed, the ECU confirms that the data is used as the new application data, sends response information to the upper computer, indicates the upper computer that the verification of the updated application data is successful, and completes the execution of the second instruction. Otherwise, the software version applied in the ECU returns and sends response information to the upper computer to indicate the upper computer that the application of the ECU fails to be updated.
The verification method includes, but is not limited to, a CRC32 verification method, which is not limited in this embodiment.
In another possible implementation, the instructions in the update data may be sent in the form of a combination of partial instructions. For example, the execution of the instructions may include:
step 1, the upper computer broadcasts a restart instruction and instructs the second ECU to restart.
And 2, broadcasting a decryption instruction by the upper computer, and instructing hardware of the second ECU to decrypt.
And step 3: the upper computer broadcasts the upgrade data, instructs the second ECU to receive the updated application data, and verifies the upgrade data.
In another possible implementation, the instructions in the update data may be sent in the form of a combination of all instructions. For example, the update data may be a script file that includes all instructions.
In summary, the above examples illustrate three implementations of the instruction for updating data. The update data includes operation instructions such as restart, decryption of hardware, update of application, and verification of application. The operation instruction may be sent to each second ECU to be executed by sending the instruction one by one, or may also be sent to each second ECU to be executed by sending some or all of the instructions in combination. When a large number of repeated instructions exist in the updated data or the interaction requirement on the instructions is low, the frequency of information receiving and sending of the upper computer and the ECU can be reduced, the instruction execution efficiency of the ECU is improved, and the updating efficiency of the application of the ECU is improved.
In the application, after the second ECU receives the second instruction, each ECU in the second ECU acquires the update data from the second instruction, and sequentially executes operations such as restart, decryption of hardware, update of an application, and verification of the application according to the update data. The decryption instruction calculates the target parameter by using a preset algorithm, compares whether a second result of the upper computer is consistent with a first result of the ECU, and determines whether decryption of hardware of the ECU is successful. Through the decryption process of the hardware, the updating safety of the ECU is improved, the illegal operation of the ECU by an illegal upper computer is avoided, the data of the application of the ECU are effectively prevented from being erased by mistake, and the ECU is prevented from being damaged maliciously.
On the basis of the above-described embodiment, a method in which the host computer verifies the update result of the application of each ECU is exemplified with reference to fig. 4.
Fig. 4 is a flowchart illustrating an update method of an application. As shown in fig. 4, with the upper computer and M ECUs as executing subjects, the method of the embodiment may include:
s301, broadcasting a sixth instruction to the M ECUs by the upper computer, wherein the sixth instruction is used for indicating the M ECUs to send third version information of the application to the upper computer.
And after the updating operation of all the ECUs is finished, the upper computer acquires the third version information of the ECU from each ECU, and determines whether the ECU is updated successfully or not according to the first version information and the third version information of the ECU.
Wherein the sixth instruction may be a request instruction for requesting the third version information from each ECU.
Wherein the third version information may be software version information indicating software version information of an application of the ECU.
S302, the upper computer receives seventh instructions from the M ECUs respectively, wherein each seventh instruction comprises: identification of the ECU and third version information of the application of the ECU.
And after receiving the sixth instruction sent by the upper computer, each ECU sends a seventh instruction to the upper computer according to the sixth instruction.
And S303, the upper computer determines the updating results of the M ECUs based on the first version information and the M pieces of third version information.
And after receiving the third version information sent by each ECU, the upper computer compares the third version information with the first version information, if the two versions are consistent, the ECU is determined to be successfully updated, and if not, the ECU fails to be updated.
And S304, the upper computer outputs an updating result.
In this embodiment, the upper computer obtains the update results of the M ECUs by comparison in S303, and outputs the update results. The administrator can know the update of the M ECUs based on the output update result.
When the upper computer comprises a display, the output mode of the updating result can be that the updating result is output in the display of the upper computer. In the update result, the ECU whose update is successful and the ECU whose update is not successful may be marked separately, so that the administrator can obtain the update result.
The updating result can also be output by means of mails, short messages or web pages and the like, and the updating result is displayed in a form or list mode.
Wherein step S304 is optional.
Fig. 5 shows an interface diagram of an update system of an application provided by an embodiment of the present application. With reference to fig. 5, an example is given in which the update result is displayed on the display of the upper computer.
As shown in fig. 5, by clicking a button, a list of update results of the ECU can be acquired. The button may be "update result of ECU", "ECU update success", or "ECU update failure", and the name of the button is not limited in the present application. By clicking the three buttons shown in fig. 5, a list of the update results of all the ECUs, a list of the update results of the ECUs whose update was successful, and a list of the update results of the ECUs whose update was failed can be obtained, respectively. In the present application, the number of buttons and the content of the list corresponding to the buttons are not limited.
As shown in fig. 5, when the selected button is "update result of ECU", the page displays the number of pieces displayed per page, the number of all ECUs, the current page number, and the total number of pages. When there are 57 ECUs in total and 6 pieces are displayed per page, in the first page, the first 6 pieces of the update results of all the ECUs can be seen. The updating results of all the ECUs may be sorted from small to large according to the ECU identifier. The number of displayed information pieces per page and/or the current page number can be selectable, and the number of displayed information pieces per page and/or the current page number can be dynamically adjusted. The update results of all the ECUs in the list may also be sorted by using a random sorting, sorting according to the update results, or dynamically selecting a sorting field, which is not limited in the present application.
As shown in fig. 5, the update result is output in a field manner in the list. The fields may include serial numbers, ECU identifiers, whether updating is required, updating results, reasons for updating failure, and the like, and the field names, the field contents, the field numbers, and the like are not limited in the present application. For convenience of representation, hereinafter, each field in the list is represented using a first field, a second field, a third field, a fourth field, and a fifth field.
Wherein the first field may be a serial number indicating a serial number of an update result of one ECU in the list. The second field may be an ECU identification for outputting an identification of the ECU. A third field may be used to indicate whether the ECU needs to be updated, which outputs "yes" when the ECU needs to be updated, and "no" otherwise. The fourth field may be used to indicate the update result of the ECU, and outputs "yes" when the ECU update is successful, and "no" otherwise. A fifth field may be used to indicate the reason for the ECU update failure, which outputs "none" when the ECU update is successful, and outputs the reason for the ECU update failure otherwise. The reasons for the update failure include, but are not limited to, inconsistent hardware version, failure of hardware decryption, failure of data verification, and the like.
In the application, after the upper computer finishes updating each ECU, the upper computer sends a sixth instruction to each ECU, and third version information of each ECU after updating is obtained. And the upper computer compares the third version information with the first version information and confirms the updating result of each ECU. The upper computer can also output a list of the updating results of the ECU so that an administrator can obtain the updating results conveniently.
Fig. 6 shows a schematic structural diagram of an application updating apparatus according to an embodiment of the present application, and as shown in fig. 6, an application updating apparatus 20 according to this embodiment is used to implement operations corresponding to an upper computer in any of the method embodiments described above, where the application updating apparatus 20 according to this embodiment may include:
an obtaining module 21, configured to obtain first version information of an updated application, first information of hardware in which the application is installed, and second version information of applications and second information of hardware in M electronic control units ECUs, where M is a positive integer;
a determining module 22, configured to determine, as P ECUs, ECUs whose first information is different from the second information, or ECUs whose first information is the same as the second information and whose first version information is the same as the second version information, and determine, as Q ECUs, ECUs whose first information is the same as the second information and whose first version information is different from the second version information, where the sum of P and Q is equal to M, and P and Q are positive integers;
the sending module 23 is configured to send first instructions to the P ECUs, respectively, where the first instructions are used to indicate that the ECUs cannot perform the updating operation;
the sending module 23 is further configured to broadcast a second instruction to the M ECUs, where the second instruction is used to instruct the M ECUs to perform update operations of the application, where the Q ECUs perform the update operations of the application respectively, and the P ECUs do not perform the update operations of the application;
the sending module 23 is further configured to broadcast a third instruction to the M ECUs, where the third instruction is used to instruct the M ECUs to restart.
The sending module 23 is further configured to broadcast a fourth instruction to the M ECUs, where the fourth instruction is used to instruct the M ECUs to send second version information and second information to the upper computer;
an obtaining module 21, configured to receive fifth instructions from the M ECUs, respectively, where each of the fifth instructions includes: an identification of the ECU, second version information of an application of the ECU, and second information of hardware of the ECU.
Optionally, the second instruction includes: update data of the application.
The sending module 23 is further configured to broadcast a sixth instruction to the M ECUs, where the sixth instruction is used to instruct the M ECUs to send the third version information of the application to the upper computer;
the output module 21 is further configured to receive seventh instructions from the M ECUs, respectively, where each seventh instruction includes: identification of the ECU and third version information of an application of the ECU;
the determining module 22 is further configured to determine update results of the M ECUs based on the first version information and the M third version information.
Optionally, the updating apparatus of the application further includes:
an output module 24 for outputting the updated result
The updating apparatus 20 for application provided in the embodiment of the present application may implement the method embodiment, and for details of implementation principles and technical effects, reference may be made to the method embodiment, which is not described herein again.
Fig. 7 is a schematic structural diagram of an application updating apparatus provided in an embodiment of the present application, and as shown in fig. 7, an application updating apparatus 30 of the present embodiment is used for implementing an operation corresponding to a first ECU in any one of the method embodiments, where first information of hardware in which an application is installed is different from second information of hardware in which the application is installed, or the first information of hardware in which the application is installed is the same as the second information of hardware in which the application is installed and the first version information of the application is the same as the second version information of the application, and the application updating apparatus 30 of the present embodiment may include:
the first receiving module 31 is configured to receive a first instruction from the upper computer, where the first instruction is used to indicate that the first ECU cannot perform the update operation;
the first receiving module 31 is further configured to receive a second instruction from the upper computer, where the second instruction is used to instruct the first ECU to perform an update operation of the application;
a first execution module 32, configured to, based on the first instruction and the second instruction, not perform an update operation of the application;
the first receiving module 31 is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the first ECU to restart;
the first execution module 32 is further configured to restart based on the third instruction.
The first receiving module 31 is further configured to receive a fourth instruction from the upper computer, where the fourth instruction is used to instruct the first ECU to send the second version information and the second information to the upper computer;
the first sending module 33 is configured to send a fifth instruction to the upper computer, where the fifth instruction includes: the identification of the first ECU, the second version information, and the second information.
The first receiving module 31 is further configured to receive a sixth instruction from the upper computer, where the sixth instruction is used to instruct the first ECU to send the third version information of the application to the upper computer;
the first sending module 33 is further configured to send a seventh instruction to the upper computer, where the seventh instruction includes: an identification of the first ECU and third version information.
The updating apparatus 30 for application provided in the embodiment of the present application may implement the method embodiment, and for details of implementation principles and technical effects, reference may be made to the method embodiment, which is not described herein again.
Fig. 8 is a schematic structural diagram of an application updating apparatus provided in an embodiment of the present application, and as shown in fig. 8, an application updating apparatus 40 of the present embodiment is configured to implement an operation corresponding to a second ECU in any one of the method embodiments, where first information of hardware in which an application is installed is the same as second information of hardware in which the application is installed and the first version information of the application is different from the second version information of the application, and the application updating apparatus 40 of the present embodiment may include:
a second receiving module 41, configured to receive a second instruction from the upper computer, where the second instruction is used to instruct the second ECU to perform an update operation of the application;
a second execution module 42, configured to execute an update operation of the application based on the second instruction;
the second receiving module 41 is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the second ECU to restart;
and the second execution module 42 is further configured to restart based on the third instruction.
Optionally, the second instruction includes: when updating data of the application, the second ECU executes an update operation of the application based on the second instruction, including:
and a second execution module 42, configured to execute, based on the update data of the application, operations of restarting, decrypting the hardware, updating the application, and checking the application in sequence.
The second sending module 43 is used for sending the target parameters to the upper computer when receiving the update data of the application;
the second execution module 42 is configured to calculate the target parameter based on a preset algorithm to obtain a first result;
the second receiving module 41 is configured to receive a second result from the upper computer, where the second result is obtained by calculating the target parameter according to a preset algorithm by the upper computer;
and a second execution module 42, configured to compare the first result and the second result, and determine whether the decryption of the hardware is successful.
The second receiving module 41 is further configured to receive a fourth instruction from the upper computer, where the fourth instruction is used to instruct the second ECU to send second version information and second information to the upper computer;
the second sending module 43 is further configured to send a fifth instruction to the upper computer, where the fifth instruction includes: an identification of the second ECU, second version information, and second information.
The second receiving module 41 is further configured to receive a sixth instruction from the upper computer, where the sixth instruction is used to instruct the second ECU to send third version information to the upper computer;
the second sending module 43 is further configured to send a seventh instruction to the upper computer, where the seventh instruction includes: identification and third version information of second ECU
The updating apparatus 40 for an application provided in the embodiment of the present application may implement the method embodiment, and for details of implementation principles and technical effects, reference may be made to the method embodiment, which is not described herein again.
In the present application, the update apparatus of the application may be divided into functional modules according to the above method, for example, each functional module may be divided for each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that the division of the modules in the embodiments of the present application is schematic, and is only one division of logic functions, and there may be another division manner in actual implementation.
Fig. 9 shows a hardware structure schematic diagram of an upper computer according to an embodiment of the present application. As shown in fig. 9, the upper computer 50 is configured to implement the operation corresponding to the upper computer in any of the above method embodiments, and the upper computer 50 of this embodiment may include: memory 51, processor 52, communication interface 54, and display 55.
A memory 51 for storing program instructions;
a display 55 for displaying the processing result of the processor;
a communication interface 54 for receiving or sending execution instructions according to instructions of the processor, the communication interface may be through a wireless connection, such as bluetooth or a wireless network, or the communication interface may be through a wired connection, such as can bus;
a processor 52 for executing the computer program stored in the memory to implement the updating method of the application in the above-described embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 51 may be separate or integrated with the processor 52.
When the memory 51 is a device independent from the processor 52, the upper computer 50 may further include:
a bus 53 for connecting the memory 51 and the processor 52.
The upper computer provided in this embodiment may be used to execute the update method of the application, and the implementation manner and the technical effect are similar, which are not described herein again.
Fig. 10 shows a hardware configuration diagram of an ECU provided in an embodiment of the present application. As shown in fig. 10, the ECU60 for implementing the operations of the ECU corresponding to any one of the above method embodiments, the ECU60 of the present embodiment may include: memory 61, processor 62, communication interface 64, and sensors 65.
A memory 61 for storing program instructions;
a sensor 65 for receiving information such as temperature, voltage, and current of the battery;
a communication interface 64 for receiving or sending execution instructions according to instructions of the processor, the communication interface may be through a wireless connection, such as bluetooth or a wireless network, or the communication interface may be through a wired connection, such as can bus;
a processor 62 for executing the computer program stored in the memory to implement the updating method of the application in the above-described embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 61 may be separate or integrated with the processor 62.
When the memory 61 is a device separate from the processor 62, the ECU60 may further include:
a bus 63 for connecting the memory 61 and the processor 62.
The ECU provided in this embodiment may be used to execute the update method of the application, and its implementation manner and technical effect are similar, and this embodiment is not described herein again.
The present application further provides an application update system, which includes: the update system applied to the upper computer shown in fig. 9 and the ECU shown in fig. 10 is shown in fig. 1. The application updating system is used for implementing the application updating method in the embodiments shown in fig. 2 to fig. 5, and the implementation manner and the technical effect are similar, and details are not repeated here.
The present application also provides a computer-readable storage medium including a computer program for implementing the update method of an application as in the above embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is only one logical division, and the actual implementation may have another division, for example, a plurality of modules may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The unit formed by the modules can be realized in a hardware form, and can also be realized in a form of hardware and a software functional unit.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the processor may be a Central Processing Unit (CPU), other general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The computer-readable storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. Which when executed performs steps comprising the method embodiments described above. And the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: it is also possible to modify the solutions described in the previous embodiments or to substitute some or all of them with equivalents. And the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (17)

1. A method for updating an application, the method comprising:
the method comprises the steps that an upper computer obtains first version information of an application, first information of hardware for installing the application, second version information of the application and second information of the hardware for installing the application of M Electronic Control Units (ECUs), wherein M is a positive integer;
the upper computer determines the ECUs of the M ECUs, of which the first information is different from the second information, or the ECUs of the M ECUs, of which the first information is the same as the second information and the first version information is the same as the second version information, as P ECUs, and determines the ECUs of the M ECUs, of which the first information is the same as the second information and the first version information is different from the second version information, as Q ECUs, wherein the sum of P and Q is equal to M, and P and Q are positive integers;
the upper computer sends first instructions to the P ECUs respectively, wherein the first instructions are used for indicating that the ECUs cannot execute updating operation;
the upper computer broadcasts a second instruction to the M ECUs, wherein the second instruction is used for instructing the M ECUs to execute the updating operation of the application, Q ECUs respectively execute the updating operation of the application, and P ECUs do not execute the updating operation of the application;
and the upper computer broadcasts a third instruction to the M ECUs, wherein the third instruction is used for indicating the M ECUs to restart.
2. The method according to claim 1, wherein the upper computer acquiring second version information of the application and second information of hardware on which the application is installed for each of the M electronic control unit ECUs includes:
the upper computer broadcasts a fourth instruction to the M ECUs, wherein the fourth instruction is used for instructing the M ECUs to send the second version information and the second information to the upper computer;
the upper computer receives fifth instructions from the M ECUs respectively, wherein each fifth instruction comprises: an identification of an ECU, second version information of an application of the ECU, and second information of hardware of the application in which the ECU is installed.
3. The method of claim 1, wherein the second instructions comprise: update data of the application.
4. The method according to any one of claims 1-3, further comprising:
the upper computer broadcasts a sixth instruction to the M ECUs, wherein the sixth instruction is used for instructing the M ECUs to send third version information of the application to the upper computer;
the upper computer receives seventh instructions from the M ECUs respectively, wherein each seventh instruction comprises: an identification of an ECU and third version information of an application of the ECU;
and the upper computer determines the updating results of the M ECUs based on the first version information and the M pieces of third version information.
5. The method of claim 4, further comprising:
and the upper computer outputs the updating result.
6. An update method of an application, characterized in that it is applied to a first ECU in which first information of hardware in which an application is installed is different from second information of hardware in which the application is installed, or in which the first information of hardware in which an application is installed is the same as the second information of hardware in which the application is installed and the first version information of the application is the same as the second version information of the application;
the method comprises the following steps:
the first ECU receives a first instruction from an upper computer, wherein the first instruction is used for indicating that the first ECU can not execute updating operation;
the first ECU receives a second instruction from the upper computer, wherein the second instruction is used for instructing the first ECU to execute the updating operation of the application;
the first ECU does not execute the update operation of the application based on the first instruction and the second instruction;
the first ECU receives a third instruction from the upper computer, wherein the third instruction is used for instructing the first ECU to restart;
the first ECU restarts based on the third instruction.
7. The method of claim 6, further comprising:
the first ECU receives a fourth instruction from the upper computer, wherein the fourth instruction is used for instructing the first ECU to send the second version information and the second information to the upper computer;
the first ECU sends a fifth instruction to the upper computer, wherein the fifth instruction comprises: the identity of the first ECU, the second version information, and the second information.
8. The method according to claim 6 or 7, characterized in that the method further comprises:
the first ECU receives a sixth instruction from the upper computer, wherein the sixth instruction is used for instructing the first ECU to send third version information of the application to the upper computer;
the first ECU sends a seventh instruction to the upper computer, wherein the seventh instruction comprises: an identification of the first ECU and the third version information.
9. An update method of an application, characterized by being applied to a second ECU in which first information of hardware in which the application is installed is the same as second information of hardware in which the application is installed and first version information of the application is different from the second version information of the application;
the method comprises the following steps:
the second ECU receives a second instruction from an upper computer, wherein the second instruction is used for instructing the second ECU to execute the updating operation of the application;
the second ECU executes the update operation of the application based on the second instruction;
the second ECU receives a third instruction from the upper computer, wherein the third instruction is used for instructing the second ECU to restart;
the second ECU restarts based on the third instruction.
10. The method of claim 9, wherein the second instructions comprise: when the application updates the data, the second ECU executes an update operation of the application based on the second instruction, including:
the second ECU sequentially executes operations of restart, decryption of the hardware, update of the application, and verification of the application based on the update data of the application.
11. The method of claim 10, wherein the second ECU performs operations of decryption of the hardware based on the update data of the application, comprising:
the second ECU sends target parameters to the upper computer when receiving the updated data of the application;
the second ECU calculates the target parameters based on a preset algorithm to obtain a first result;
the second ECU receives a second result from the upper computer, and the second result is obtained by the upper computer through calculation of the target parameter according to the preset algorithm;
the second ECU compares the first result and the second result to determine whether the decryption of the hardware is successful.
12. The method according to claim 9 or 11, characterized in that the method further comprises:
the second ECU receives a fourth instruction from the upper computer, wherein the fourth instruction is used for instructing the second ECU to send the second version information and the second information to the upper computer;
the second ECU sends a fifth instruction to the upper computer, wherein the fifth instruction comprises: an identification of the second ECU, the second version information, and the second information.
13. The method of claim 12, further comprising:
the second ECU receives a sixth instruction from the upper computer, wherein the sixth instruction is used for instructing the second ECU to send third version information to the upper computer;
the second ECU sends a seventh instruction to the upper computer, wherein the seventh instruction comprises: an identification of the second ECU and third version information.
14. An updating device of an application, which is applied to an upper computer, the device comprising:
an obtaining module, configured to obtain first version information of an updated application, first information of hardware on which the application is installed, and second version information of the application and second information of the hardware of M electronic control units ECUs, where M is a positive integer;
a determining module, configured to determine, as P ECUs, ECUs in which the first information is different from the second information, or ECUs in which the first information is the same as the second information and the first version information is the same as the second version information, and determine, as Q ECUs, ECUs in which the first information is the same as the second information and the first version information is different from the second version information, where the sum of P and Q is equal to M, and P and Q are positive integers;
the device comprises a sending module, a judging module and a judging module, wherein the sending module is used for respectively sending first instructions to P ECUs, and the first instructions are used for indicating that the ECUs cannot execute updating operation;
the sending module is further configured to broadcast a second instruction to the M ECUs, where the second instruction is used to instruct the M ECUs to perform the update operation of the application, the Q ECUs respectively perform the update operation of the application, and the P ECUs do not perform the update operation of the application;
the sending module is further configured to broadcast a third instruction to the M ECUs, where the third instruction is used to instruct the M ECUs to restart.
15. An update apparatus of an application, characterized by being applied to a first ECU in which first information of hardware in which the application is installed is different from second information of hardware in which the application is installed, or in which the first information of hardware in which the application is installed is the same as the second information of hardware in which the application is installed and the first version information of the application is the same as the second version information of the application;
the device comprises:
the first receiving module is used for receiving a first instruction from an upper computer, wherein the first instruction is used for indicating that the first ECU can not execute updating operation;
the first receiving module is further configured to receive a second instruction from the upper computer, where the second instruction is used to instruct the first ECU to execute an update operation of the application;
the first execution module is used for not executing the updating operation of the application based on the first instruction and the second instruction;
the first receiving module is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the first ECU to restart;
the first execution module is further configured to restart based on the third instruction.
16. An update apparatus of an application, characterized by being applied to a second ECU in which first information of hardware in which the application is installed is the same as second information of hardware in which the application is installed and first version information of the application is different from the second version information of the application;
the device comprises:
the second receiving module is used for receiving a second instruction from the upper computer, wherein the second instruction is used for instructing the second ECU to execute the updating operation of the application;
the second execution module is used for executing the updating operation of the application based on the second instruction;
the second receiving module is further configured to receive a third instruction from the upper computer, where the third instruction is used to instruct the second ECU to restart;
and the second execution module is also used for restarting the second ECU based on the third instruction.
17. A system, comprising: updating means of an application according to claim 14, updating means of P applications according to claim 15 and updating means of Q applications according to claim 16, the sum of P and Q being M, P, Q, M being positive integers.
CN202010428798.5A 2020-05-20 2020-05-20 Application updating method and device Pending CN111679846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010428798.5A CN111679846A (en) 2020-05-20 2020-05-20 Application updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010428798.5A CN111679846A (en) 2020-05-20 2020-05-20 Application updating method and device

Publications (1)

Publication Number Publication Date
CN111679846A true CN111679846A (en) 2020-09-18

Family

ID=72452402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010428798.5A Pending CN111679846A (en) 2020-05-20 2020-05-20 Application updating method and device

Country Status (1)

Country Link
CN (1) CN111679846A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110197187A1 (en) * 2010-02-08 2011-08-11 Seung Hyun Roh Vehicle software download system and method thereof
CN103377057A (en) * 2012-04-20 2013-10-30 上海通用汽车有限公司 System and method for refreshing software of user vehicle electronic control module
CN205899529U (en) * 2016-06-30 2017-01-18 武汉英泰斯特电子技术有限公司 Long -range renewal device of vehicle ECU
CN106528240A (en) * 2016-11-18 2017-03-22 安徽江淮汽车集团股份有限公司 ECU application program write-in method and system
CN108388441A (en) * 2017-12-29 2018-08-10 北京智行鸿远汽车有限公司 Teleprogram update method, system and computer readable storage medium
US20180336026A1 (en) * 2016-02-11 2018-11-22 Hyundai Motor Company Method and device for wirelessly updating software for vehicle
CN108920168A (en) * 2018-06-15 2018-11-30 先进储能材料国家工程研究中心有限责任公司 It supports multiple similar ECU while upgrading and having the Bootloader method that anti-program mismatches function
CN109828935A (en) * 2019-01-17 2019-05-31 重庆菲斯塔新能源汽车科技有限公司 It is a kind of that method is write with a brush dipped in Chinese ink based on CAN FD bus parallel
CN110032382A (en) * 2019-03-25 2019-07-19 深圳猛犸电动科技有限公司 A kind of vehicle electronic control unit upgrade method, system and terminal device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110197187A1 (en) * 2010-02-08 2011-08-11 Seung Hyun Roh Vehicle software download system and method thereof
CN103377057A (en) * 2012-04-20 2013-10-30 上海通用汽车有限公司 System and method for refreshing software of user vehicle electronic control module
US20180336026A1 (en) * 2016-02-11 2018-11-22 Hyundai Motor Company Method and device for wirelessly updating software for vehicle
CN205899529U (en) * 2016-06-30 2017-01-18 武汉英泰斯特电子技术有限公司 Long -range renewal device of vehicle ECU
CN106528240A (en) * 2016-11-18 2017-03-22 安徽江淮汽车集团股份有限公司 ECU application program write-in method and system
CN108388441A (en) * 2017-12-29 2018-08-10 北京智行鸿远汽车有限公司 Teleprogram update method, system and computer readable storage medium
CN108920168A (en) * 2018-06-15 2018-11-30 先进储能材料国家工程研究中心有限责任公司 It supports multiple similar ECU while upgrading and having the Bootloader method that anti-program mismatches function
CN109828935A (en) * 2019-01-17 2019-05-31 重庆菲斯塔新能源汽车科技有限公司 It is a kind of that method is write with a brush dipped in Chinese ink based on CAN FD bus parallel
CN110032382A (en) * 2019-03-25 2019-07-19 深圳猛犸电动科技有限公司 A kind of vehicle electronic control unit upgrade method, system and terminal device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆泳;徐伟卿;裴飞飞;: "仿真技术在硬件加密技术的开发应用", 北京汽车, no. 06, 25 December 2017 (2017-12-25) *

Similar Documents

Publication Publication Date Title
EP1519268B1 (en) Communication terminal and communication network for partially updating software, software update method, and software creation device and method therefor
US20170255459A1 (en) Embedded device and program updating method
CN106250192B (en) Software upgrading method and system of upper computer
CN104915219A (en) Single chip microcomputer program upgrading method and device
CN106020875B (en) Firmware update management method and device of embedded terminal
CN107341003B (en) Customization system implementing method, computer device and storage medium
US20170220355A1 (en) System for programmably configuring a motherboard
WO2016062146A1 (en) Serial number information update method, device and terminal
CN112000358B (en) Upgrading method of charging pile and intelligent charging pile
CN105045640A (en) Software upgrading method and device and intelligent equipment
CN110163012A (en) Mainboard powering method, apparatus and system based on programming device
CN109002305B (en) Method and system for updating equipment program
CN113672270A (en) Upgrading method, computer system and remote upgrading device
CN105677409A (en) System upgrading method and device
CN105045671A (en) Method and device for upgrading systems of intelligent terminals
CN111459524A (en) Software upgrading method, device and system
CN109375953B (en) Operating system starting method and device
CN103455750A (en) High-security verification method and high-security verification system for embedded devices
CN113238790A (en) Firmware program updating method and system based on SD card and EEPROM
CN111679846A (en) Application updating method and device
CN111984287A (en) Equipment upgrading method and system
CN116431186A (en) Upgrading method, device and medium of vehicle-mounted ECU
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN114546537B (en) Starting sequence deployment method and related device for multiple operating systems
CN109684026A (en) APP replacing skins method, apparatus, electronic equipment and storage medium

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