Program updating method and device, equipment, medium and product

By leveraging dual application partitioning technology in electronic controllers, running backup applications at startup and updating target applications at restart, the problem of waiting after application updates is solved, improving the user experience.

CN119248312APending Publication Date: 2025-01-03FAW JIEFANG AUTOMOTIVE CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411277133.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the prior art, users need to wait for the update to complete before they can run normally after the application is updated, resulting in a long wait time and affecting the user experience.

Method used

When the electronic controller is started, the valid partition is determined as the target application partition, and the backup application is generated when the auxiliary application partition is assisted. After the update is completed, the backup application is run at the restart. The dual application partition is used to achieve the simultaneous update and operation.

Benefits of technology

It greatly shortens the user's waiting time, improves the application's user experience, and realizes the application update and operation simultaneous progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248312A_ABST
    Figure CN119248312A_ABST
Patent Text Reader

Abstract

The invention discloses a program updating method and device, equipment, a medium and a product, and relates to the technical field of computers.The program updating method comprises the steps that first program updating data for a target application program is obtained, and a backup application program corresponding to the target application program is generated in an auxiliary application partition; changing the partition validity of the target application partition into an invalid partition, and changing the partition validity of the auxiliary application partition into an effective partition; and when the electronic controller is restarted, determining the auxiliary application partition of which the partition validity is an effective partition, running the backup application program stored in the auxiliary application partition, and updating the target application program in the target application partition according to the first program updating data. According to the method and the device, the effect of simultaneously updating and running the application program is realized by utilizing the double application partitions, the problem that the application program cannot normally run during updating is solved, the waiting time of a user is greatly shortened, and the use experience of the user on the application program is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a program updating method, device, equipment, medium and product. Background Art

[0002] With the development of automotive electronic technology, the complexity of automotive software functions has increased, and the frequency of software updates has also increased accordingly, among which application updates are particularly frequent.

[0003] In the prior art, when any application is updated, the application cannot be run normally and needs to wait until the application is updated before it can run normally, resulting in a long waiting time for the user, which affects the user's experience of using the application. Summary of the invention

[0004] The present invention provides a program update method, device, equipment, medium and product to solve the problem that the prior art requires waiting for the application program to be updated before it can run normally, resulting in a long waiting time for users.

[0005] According to one aspect of the present invention, there is provided a method for updating a program, comprising:

[0006] When the electronic controller is started, determining the candidate application partition whose partition validity is a valid partition as a target application partition, and running the target application stored in the target application partition;

[0007] Acquire first program update data for the target application, and generate a backup application corresponding to the target application in an auxiliary application partition; wherein the auxiliary application partition is any candidate application partition whose partition validity is an invalid partition;

[0008] Changing the partition validity of the target application partition to an invalid partition, and changing the partition validity of the auxiliary application partition to a valid partition;

[0009] When the electronic controller is restarted, the partition validity is determined to be the auxiliary application partition of the valid partition, the backup application stored in the auxiliary application partition is run, and the target application is updated in the target application partition according to the first program update data.

[0010] According to another aspect of the present invention, there is provided a program updating device, comprising:

[0011] a target application program running module, for determining, when the electronic controller is started, a candidate application partition whose partition validity is a valid partition as a target application partition, and running a target application program stored in the target application partition;

[0012] a backup application generation module, configured to obtain first program update data for the target application, and generate a backup application corresponding to the target application in an auxiliary application partition; wherein the auxiliary application partition is any of the candidate application partitions whose partition validity is an invalid partition;

[0013] A partition validity changing module, used to change the partition validity of the target application partition to an invalid partition, and change the partition validity of the auxiliary application partition to a valid partition;

[0014] An application update module is used to determine the partition validity of the auxiliary application partition as a valid partition when the electronic controller is restarted, run the backup application stored in the auxiliary application partition, and update the target application in the target application partition according to the first program update data.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the program updating method described in any one of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any one of the program update methods of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the program updating methods of the present invention.

[0021] The present invention generates a backup application corresponding to the target application in the auxiliary application partition, and when the electronic controller is restarted, runs the backup application stored in the auxiliary application partition, and updates the target application in the target application partition according to the first program update data, thereby utilizing dual application partitions to achieve the effect of simultaneous application update and operation, solves the problem of the application not being able to run normally when updated, greatly shortens the user's waiting time, and improves the user's experience of using the application.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A flowchart of a program update method provided in Embodiment 1 of the present invention;

[0025] Figure 2 A flowchart of a program updating method provided in Embodiment 2 of the present invention;

[0026] Figure 3 A schematic diagram of the structure of a program update device provided in Embodiment 3 of the present invention;

[0027] Figure 4 It is a schematic diagram of the structure of an electronic device for implementing the program updating method of an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "target", "candidate", "auxiliary", "to be selected", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 This is a flowchart of a program update method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the application program installed in the electronic controller is synchronously run and updated. The method can be executed by a program update device, which can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:

[0032] S101. When the electronic controller is started, a candidate application partition whose partition validity is a valid partition is determined as a target application partition, and a target application program stored in the target application partition is run.

[0033] The electronic controller is also called ECU (Electronic Control Unit), which is a miniature computer management center. It takes signal acquisition, calculation processing, analysis and judgment, and decision-making as input, and then issues control instructions and directs the actuator to work as output. Sometimes, it also provides a stable power supply or reference voltage to the sensor. All its functions are completed by the sum of various hardware and software, and its core is a microcomputer system with a single-chip microcomputer as the main body. In this embodiment, the electronic controller can be configured in any terminal device, such as a vehicle-mounted electronic controller.

[0034] The candidate application partition refers to a storage area pre-divided in a storage device of the electronic controller, such as a hard disk or a memory, for storing application data corresponding to each application. An application refers to a computer program that completes one or more specific tasks, such as a system application or a third-party application, such as a navigation application, a multimedia application, or a game application. In this embodiment, the number of candidate application partitions is at least two, and different candidate application partitions can store application data corresponding to the same version of the application or application data corresponding to different versions of the application.

[0035] Partition validity reflects whether the electronic controller can normally access a candidate application partition to run the application stored in the candidate application partition. Partition validity includes valid partitions and invalid partitions. It can be understood that when the partition validity of any candidate application partition is a valid partition, it means that the electronic controller can normally access the candidate application partition, that is, it can run the application stored in the candidate application partition; when the partition validity of any candidate application partition is an invalid partition, it means that the electronic controller cannot normally access the candidate application partition, that is, it cannot run the application stored in the candidate application partition.

[0036] In one embodiment, when the electronic controller is started, the boot management module (also called BootManager) in the electronic controller reads the validity flag value of each candidate application partition, and determines the partition validity of each candidate application partition according to the validity flag value, and further uses the candidate application partition whose partition validity is a valid partition as the target application partition. Among them, there will only be one candidate application partition whose partition validity is a valid partition among each candidate application partition, or there will be no candidate application partition whose partition validity is a valid partition. In other words, there are only the following two situations: 1) The partition validity of each candidate application partition is an invalid partition, that is, any candidate application partition cannot be accessed normally. 2) There is a candidate application partition whose partition validity is a valid partition, that is, among each candidate application partition, only this candidate application partition is allowed to be accessed normally.

[0037] After determining the target application partition by starting the boot management module, the target application partition is further accessed by starting the boot management module and a data copy operation is performed to copy the target application data corresponding to the target application stored in the target application partition to the RAM to run the target application stored in the target application partition.

[0038] S102: Acquire first program update data for a target application, and generate a backup application corresponding to the target application in an auxiliary application partition.

[0039] The first program update data refers to data used to update the target application program, that is, the target application program can be updated according to the first program update data. The auxiliary application partition is a candidate application partition whose partition validity is an invalid partition. The backup application refers to a backup program generated by performing a backup operation on the target application. It can be understood that the backup application corresponds to the same application data as the target application.

[0040] In one embodiment, during the operation of the target application, a program update request transmitted by the target host computer through an external CAN bus is received through a boot download program module in the electronic controller, and first program update data for the target application is parsed according to the program update request. Further, a backup operation is performed on the target application, and the generated backup application is stored in the auxiliary application partition.

[0041] S103: Change the partition validity of the target application partition to an invalid partition, and change the partition validity of the auxiliary application partition to a valid partition.

[0042] Among them, since the target application in the target application partition is updated, it is necessary to set the target application partition to be inaccessible, and the partition validity of the target application partition is changed from a valid partition to an invalid partition. In addition, in order to ensure that the target application can continue to run, it is necessary to set the auxiliary application partition to be accessible, and the partition validity of the auxiliary application partition is changed from an invalid partition to a valid partition.

[0043] In one embodiment, the validity flag value of the target application partition is changed to change the partition validity of the target application partition to an invalid partition; correspondingly, the validity flag value of the auxiliary application partition is changed to change the partition validity of the auxiliary application partition to a valid partition.

[0044] S104. When the electronic controller is restarted, determine that the partition validity is an auxiliary application partition of a valid partition, run the backup application stored in the auxiliary application partition, and update the target application in the target application partition according to the first program update data.

[0045] In one embodiment, after S103 is executed, the electronic controller restarts itself, and when the electronic controller restarts, the validity flag value of each candidate application partition is read again by the boot management module, and the partition validity of each candidate application partition is determined according to the validity flag value. Since the partition validity of the target application partition is changed to an invalid partition, and the partition validity of the auxiliary application partition is changed to a valid partition in S103, the candidate application partition with a partition validity of a valid partition is used as an auxiliary application partition by the boot management module at this time. Further, by jumping to access the auxiliary application partition and executing a data copy action by booting the boot management module, the backup application data corresponding to the backup application stored in the auxiliary application partition is copied to the RAM to run the backup application stored in the auxiliary application partition.

[0046] At the same time, the target application program is updated in the target application partition according to the first program update data by guiding the download program module.

[0047] Exemplarily, S101 to S104 are explained by taking the candidate application partitions including the candidate application partition 1 and the candidate application partition 2 as an example:

[0048] When the electronic controller is started, the partition validity of candidate application partition 1 and candidate application partition 2 is determined respectively. Assuming that the partition validity of candidate application partition 1 is a valid partition and the partition validity of candidate application partition 2 is an invalid partition, candidate application partition 1 is used as the target application partition, candidate application partition 2 is used as the auxiliary application partition, and the target application stored in candidate application partition 1 is run.

[0049] The first program update data for the target application is obtained, and a backup application corresponding to the target application is generated in the candidate application partition 2, thereby changing the partition validity of the candidate application partition 1 to an invalid partition, and changing the partition validity of the candidate application partition 2 to a valid partition.

[0050] When the electronic controller is restarted, the partition validity is determined to be the candidate application partition 2 of the valid partition, and the backup application stored in the candidate application partition 2 is run, and the target application is updated in the candidate application partition 1 according to the first program update data.

[0051] The present invention generates a backup application corresponding to the target application in the auxiliary application partition, and when the electronic controller is restarted, runs the backup application stored in the auxiliary application partition, and updates the target application in the target application partition according to the first program update data, thereby utilizing dual application partitions to achieve the effect of simultaneous application update and operation, solves the problem of the application not being able to run normally when updated, greatly shortens the user's waiting time, and improves the user's experience of using the application.

[0052] Embodiment 2

[0053] Figure 2 This is a flowchart of a program update method provided in Embodiment 2 of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementation modes. Figure 2 As shown, the method includes:

[0054] S201. When the electronic controller is started, the validity flag value of each candidate application partition is determined, and each validity flag value is matched with a standard flag value corresponding to the valid partition.

[0055] The validity flag value indicates the partition validity of the candidate application partition in a numerical manner. In this embodiment, a corresponding standard flag value is set in advance for the "valid partition" to jointly determine the partition validity of each candidate application partition based on the validity flag value of each candidate application partition and the standard flag value corresponding to the "valid partition".

[0056] In one implementation, the validity flag value of each candidate application partition is determined by starting the boot management module, and each validity flag value is matched with a standard flag value corresponding to the valid partition.

[0057] S202: If the validity flag value of any candidate application partition matches the standard flag value, the partition validity of the candidate application partition is determined to be a valid partition, and the candidate application partition is used as a target application partition.

[0058] In one embodiment, if the validity flag value of any candidate application partition does not match the standard flag value, the partition validity of the candidate application partition is determined to be an invalid partition; if the validity flag value of any candidate application partition matches the standard flag value, the partition validity of the candidate application partition is determined to be a valid partition, and the candidate application partition is used as the target application partition.

[0059] By determining the validity flag value of each candidate application partition, and matching each validity flag value with the standard flag value corresponding to the valid partition; if the validity flag value of any candidate application partition matches the standard flag value, the partition validity of the candidate application partition is determined to be a valid partition, and the candidate application partition is used as the target application partition, thereby using the numerical validity flag value to determine the partition validity, which can not only ensure the accuracy of the partition validity determination and avoid the problem of partition validity determination errors; it can also ensure the efficiency of the partition validity determination and speed up the overall process processing rate.

[0060] S203: Obtain a program update request sent by the target host computer, and determine a data update address carried in the program update request.

[0061] The target host computer refers to the host computer that sends the program update request to the electronic controller. The program update request can be understood as an OTA (Over The Air) request for the target application. The program update request carries a data update address, which is used to reflect the storage address in the electronic controller where the program update request acts, that is, reflects the storage address in which the program is updated.

[0062] S204: If the data update address is the target partition address corresponding to the target application partition, then obtain the program update data carried in the program update request as first program update data for the target application program.

[0063] In one embodiment, the data update address is compared with the target partition address corresponding to the target application partition. If it is determined that the data update address is the same as the target partition address, indicating that the update object is the target application, the program update data carried in the program update request is parsed as the first program update data for the target application.

[0064] By obtaining the program update request sent by the target host computer and determining the data update address carried in the program update request; if the data update address is the target partition address corresponding to the target application partition, the program update data carried in the program update request is obtained as the first program update data for the target application, thereby achieving the effect of identifying the update object based on the data update address, so that only when the data update address is the target partition address, the program update data carried in the program update request will be used as the first program update data, thereby ensuring the compatibility between the first program update data and the target application, and further ensuring that the first program update data can be used to smoothly update the target application.

[0065] Optionally, obtaining program update data carried in the program update request as first program update data for the target application program includes:

[0066] 1) Send a first key seed to a target host computer, and obtain a first key to be verified sent by the target host computer.

[0067] The first key to be verified is calculated by the target host computer according to the first key seed.

[0068] In one implementation, a first key seed is sent to a target host computer. After receiving the first key seed, the target host computer performs key calculation based on the first key seed to generate a first key to be verified, and feeds it back to the electronic controller. The electronic controller receives the first key to be verified.

[0069] 2) Matching the first key to be verified with the first standard key corresponding to the application program update, and if the match is successful, obtaining the program update data carried in the program update request as the first program update data for the target application program.

[0070] In one embodiment, the electronic controller matches the first key to be verified with the pre-stored first standard key. If the match fails, that is, the first key to be verified is different from the first standard key, indicating that the identity authentication of the target host computer has failed, the program update data will be refused to be obtained. If the match is successful, that is, the first key to be verified is the same as the first standard key, indicating that the identity authentication of the target host computer has passed, the program update data carried in the program update request will be obtained as the first program update data for the target application.

[0071] By sending a first key seed to a target host computer and obtaining a first key to be verified sent by the target host computer; wherein the first key to be verified is calculated by the target host computer based on the first key seed; matching the first key to be verified with a first standard key corresponding to an application program update, and if the match is successful, obtaining program update data carried in a program update request as first program update data for a target application program, achieving an effect of authenticating the target host computer that initiates a program update request when updating the target application program, thereby triggering a program update to the target application program only if the identity authentication of the target host computer is passed, thereby ensuring the security of the target application program update.

[0072] S205. Generate a backup application corresponding to the target application in the auxiliary application partition, change the partition validity of the target application partition to an invalid partition, and change the partition validity of the auxiliary application partition to a valid partition.

[0073] S206. When the electronic controller is restarted, determine that the partition validity is an auxiliary application partition of a valid partition, run the backup application stored in the auxiliary application partition, and update the target application in the target application partition according to the first program update data.

[0074] Optionally, also include:

[0075] A1. If the data update address is another partition address, the program update data carried in the program update request is obtained as second program update data for the boot loader.

[0076] Among them, other partition addresses are addresses of other partitions storing boot loaders. Boot loaders, also known as Bootloader programs, are programs used to update application programs in electronic controllers. With the rapid development of technology today, the complexity of boot loaders is increasing, and there is a demand for updating boot loaders.

[0077] In one embodiment, the data update address is compared with other partition addresses corresponding to other partitions. If it is determined that the data update address is the same as the other partition addresses, it means that the update object is the boot loader, and the program update data carried in the program update request is parsed as the second program update data for the boot loader.

[0078] B1. Update the boot loader in other partitions according to the second program update data, and run the target application stored in the target application partition when the electronic controller is restarted.

[0079] In one embodiment, the boot loader is updated in other partitions according to the second program update data through the boot download program module, and the electronic controller restarts itself after the update is completed. When the electronic controller restarts, the validity flag value of each candidate application partition is read again through the boot management module, and the partition validity of each candidate application partition is determined according to the validity flag value. Since the partition validity of the target application partition is not changed, the candidate application partition with the partition validity as the valid partition is used as the target application partition through the boot management module at this time. Further, the target application partition is accessed by jumping to the boot management module and performing a data copy action, and the target application data corresponding to the target application stored in the target application partition is copied to the RAM to run the target application stored in the target application partition.

[0080] If the data update address is the address of other partitions, the program update data carried in the program update request is obtained as the second program update data for the boot loader; wherein the other partition address is the address of other partitions storing the boot loader; the boot loader is updated in other partitions according to the second program update data, and when the electronic controller is restarted, the target application stored in the target application partition is run, the beneficial effect is:

[0081] First, the program update data carried in the program update request will only be used as the second program update data when the data update address is the address of other partitions, thereby ensuring the compatibility between the second program update data and the boot loader, and further ensuring that the boot loader can be updated smoothly using the second program update data.

[0082] Secondly, when the electronic controller is restarted, the target application stored in the target application partition is run again, ensuring that the update of the boot loader will not affect the partition validity of the application partition, so that when the electronic controller is restarted, it will still jump to access the target application partition accessed last time, ensuring the continuity of the application operation.

[0083] Optionally, obtaining the program update data carried in the program update request as second program update data for the boot loader includes:

[0084] A11. Send a second key seed to the target host computer, and obtain a second key to be verified sent by the target host computer.

[0085] Among them, the second key to be verified is calculated by the target host computer based on the second key seed, and the second key seed is different from the first key seed, that is, the first key seed for identity verification of the target host computer when the application is updated is different from the second key seed for identity verification of the target host computer when the boot loader is updated.

[0086] In one implementation, a second key seed is sent to a target host computer. After receiving the second key seed, the target host computer performs key calculation based on the second key seed to generate a second key to be verified, and feeds it back to the electronic controller. The electronic controller receives the second key to be verified.

[0087] A12. Match the second key to be verified with the second standard key corresponding to the boot loader update, and if the match is successful, obtain the program update data carried in the program update request as the second program update data for the boot loader.

[0088] In one embodiment, the electronic controller matches the second key to be verified with the pre-stored second standard key. If the match fails, that is, the second key to be verified is different from the second standard key, indicating that the identity authentication of the target host computer has failed, the program update data is refused to be obtained; if the match is successful, that is, the second key to be verified is the same as the second standard key, indicating that the identity authentication of the target host computer has passed, the program update data carried in the program update request is obtained as the second program update data for the boot loader.

[0089] By sending a second key seed to the target host computer and obtaining a second key to be verified sent by the target host computer; wherein the second key to be verified is calculated by the target host computer according to the second key seed, and the second key seed is different from the first key seed; the second key to be verified is matched with a second standard key corresponding to the boot loader update, and when the match is successful, the program update data carried in the program update request is obtained as the second program update data for the boot loader, thereby achieving the effect of authenticating the target host computer that initiates the program update request when updating the boot loader, so that the program update of the boot loader will be triggered only when the identity authentication of the target host computer is passed, thereby ensuring the security of the boot loader update.

[0090] Optionally, also include:

[0091] C1. If the validity flag value of each candidate application partition does not match the standard flag value, first program update data for the target application is obtained from the target host computer, and the target application is updated in the candidate application partition according to the first program update data.

[0092] If the validity flag value of each candidate application partition does not match the standard flag value, it means that the partition validity of each candidate application partition is an invalid partition, that is, the electronic controller cannot normally access each candidate application partition. At this time, it is necessary to trigger the update operation of the application program to ensure that the electronic controller can successfully access the candidate application partition and run the application program. The candidate application partition is any candidate application partition.

[0093] In one embodiment, if the validity flag value of each candidate application partition does not match the standard flag value, the electronic controller generates a program update data acquisition request and sends the program update data acquisition request to the target host computer. The target host computer responds to the program update data acquisition request and sends the first program update data for the target application to the electronic controller. The electronic controller obtains the first program update data for the target application from the target host computer, and updates the target application in the candidate application partition according to the first program update data.

[0094] Optionally, the application partition to be selected is determined from the candidate application partitions according to the order of their partition numbers. For example, the candidate application partition with the highest partition number can be used as the application partition to be selected. If the partition numbers of the candidate application partitions are the first partition, the second partition, the third partition, etc., then the candidate application partition with the partition number of the first partition is used as the application partition to be selected.

[0095] D1. Change the validity flag value of the candidate application partition to a standard flag value, and when the electronic controller is restarted, determine the candidate application partition whose validity flag value is the standard flag value, and run the target application stored in the candidate application partition.

[0096] In one embodiment, the validity flag value of the candidate application partition is changed to a standard flag value, so that the partition validity of the candidate application partition is changed from an invalid partition to a valid partition. The electronic controller restarts itself, and when the electronic controller restarts, the validity flag value of each candidate application partition is read again by the boot management module, and the partition validity of each candidate application partition is determined according to the validity flag value. Since the partition validity of the candidate application partition is changed to a valid partition, the partition validity of the candidate application partition is determined to be a valid partition by the boot management module at this time. Further, the boot management module is used to jump to access the candidate application partition and run the target application stored in the candidate application partition.

[0097] If the validity flag value of each candidate application partition does not match the standard flag value, the first program update data for the target application is obtained from the target host computer, and the target application is updated in the candidate application partition according to the first program update data; wherein the candidate application partition is any candidate application partition; the validity flag value of the candidate application partition is changed to the standard flag value, and when the electronic controller is restarted, the candidate application partition whose validity flag value is the standard flag value is determined, and the target application stored in the candidate application partition is run, so that when the application cannot be run normally in any candidate application partition, the update operation of the application is actively triggered, the problem of being unable to run the application is solved in time, and the user experience is further guaranteed.

[0098] Embodiment 3

[0099] Figure 3 This is a schematic diagram of the structure of a program update device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0100] A target application running module 31 is used to determine, when the electronic controller is started, a candidate application partition whose partition validity is a valid partition as a target application partition, and run a target application stored in the target application partition;

[0101] A backup application generation module 32, configured to obtain first program update data for the target application, and generate a backup application corresponding to the target application in an auxiliary application partition; wherein the auxiliary application partition is any of the candidate application partitions whose partition validity is an invalid partition;

[0102] A partition validity changing module 33, configured to change the partition validity of the target application partition to an invalid partition, and change the partition validity of the auxiliary application partition to a valid partition;

[0103] The application update module 34 is used to determine the partition validity of the auxiliary application partition as a valid partition when the electronic controller is restarted, run the backup application stored in the auxiliary application partition, and update the target application in the target application partition according to the first program update data.

[0104] Optionally, the target application program running module 31 is specifically used for:

[0105] Determine the validity flag value of each candidate application partition, and match each validity flag value with a standard flag value corresponding to a valid partition;

[0106] If the validity flag value of any candidate application partition matches the standard flag value, the partition validity of the candidate application partition is determined to be a valid partition, and the candidate application partition is used as the target application partition.

[0107] Optionally, the backup application generating module 32 is specifically used for:

[0108] Obtaining a program update request sent by a target host computer, and determining a data update address carried in the program update request;

[0109] If the data update address is the target partition address corresponding to the target application partition, the program update data carried in the program update request is obtained as first program update data for the target application program.

[0110] Optionally, the backup application generating module 32 is further configured to:

[0111] Sending a first key seed to the target host computer, and obtaining a first key to be verified sent by the target host computer; wherein the first key to be verified is calculated by the target host computer according to the first key seed;

[0112] The first key to be verified is matched with a first standard key corresponding to the application program update, and if the match is successful, the program update data carried in the program update request is obtained as the first program update data for the target application program.

[0113] Optionally, the device further includes a boot loader update module, specifically configured to:

[0114] If the data update address is another partition address, then obtaining the program update data carried in the program update request as second program update data for the boot loader; wherein the other partition address is the address of another partition storing the boot loader;

[0115] The boot loader is updated in the other partitions according to the second program update data, and the target application stored in the target application partition is run when the electronic controller is restarted.

[0116] Optional, bootloader update module, specifically also used to:

[0117] Sending a second key seed to the target host computer, and obtaining a second key to be verified sent by the target host computer; wherein the second key to be verified is calculated by the target host computer according to the second key seed, and the second key seed is different from the first key seed;

[0118] The second key to be verified is matched with a second standard key corresponding to the boot loader program update, and if the match is successful, the program update data carried in the program update request is obtained as second program update data for the boot loader program.

[0119] Optionally, the device further includes an active update module, specifically configured to:

[0120] If the validity flag value of each candidate application partition does not match the standard flag value, first program update data for the target application is obtained from the target host computer, and the target application is updated in the candidate application partition according to the first program update data; wherein the candidate application partition is any of the candidate application partitions;

[0121] The validity flag value of the to-be-selected application partition is changed to the standard flag value, and when the electronic controller is restarted, the to-be-selected application partition whose validity flag value is the standard flag value is determined, and the target application stored in the to-be-selected application partition is run.

[0122] The program updating device provided in the embodiment of the present invention can execute the program updating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0123] Embodiment 4

[0124] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0125] like Figure 4As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0126] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0127] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a program update method.

[0128] In some embodiments, the program update method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the program update method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the program update method in any other appropriate manner (e.g., by means of firmware).

[0129] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0130] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0131] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0132] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0133] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0134] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0136] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for updating a program, characterized in that: include: When the electronic controller is started, determining the candidate application partition whose partition validity is a valid partition as a target application partition, and running the target application stored in the target application partition; Acquire first program update data for the target application, and generate a backup application corresponding to the target application in an auxiliary application partition; wherein the auxiliary application partition is any candidate application partition whose partition validity is an invalid partition; Changing the partition validity of the target application partition to an invalid partition, and changing the partition validity of the auxiliary application partition to a valid partition; When the electronic controller is restarted, the partition validity is determined to be the auxiliary application partition of the valid partition, the backup application stored in the auxiliary application partition is run, and the target application is updated in the target application partition according to the first program update data.

2. The method according to claim 1, characterized in that: The step of determining the candidate application partition whose partition validity is a valid partition as a target application partition includes: Determine the validity flag value of each candidate application partition, and match each validity flag value with a standard flag value corresponding to a valid partition; If the validity flag value of any candidate application partition matches the standard flag value, the partition validity of the candidate application partition is determined to be a valid partition, and the candidate application partition is used as the target application partition.

3. The method according to claim 1, characterized in that The obtaining of first program update data for the target application program includes: Obtaining a program update request sent by a target host computer, and determining a data update address carried in the program update request; If the data update address is the target partition address corresponding to the target application partition, the program update data carried in the program update request is obtained as first program update data for the target application program.

4. The method according to claim 3, characterized in that The obtaining the program update data carried in the program update request as first program update data for the target application program includes: Sending a first key seed to the target host computer, and obtaining a first key to be verified sent by the target host computer; wherein the first key to be verified is calculated by the target host computer according to the first key seed; The first key to be verified is matched with a first standard key corresponding to the application program update, and if the match is successful, the program update data carried in the program update request is obtained as the first program update data for the target application program.

5. The method according to claim 4, further comprising: If the data update address is another partition address, then obtaining the program update data carried in the program update request as second program update data for the boot loader; wherein the other partition address is the address of another partition storing the boot loader; The boot loader is updated in the other partitions according to the second program update data, and the target application stored in the target application partition is run when the electronic controller is restarted.

6. The method according to claim 5, characterized in that The obtaining the program update data carried in the program update request as second program update data for the boot loader includes: Sending a second key seed to the target host computer, and obtaining a second key to be verified sent by the target host computer; wherein the second key to be verified is calculated by the target host computer according to the second key seed, and the second key seed is different from the first key seed; The second key to be verified is matched with a second standard key corresponding to the boot loader program update, and if the match is successful, the program update data carried in the program update request is obtained as second program update data for the boot loader program.

7. The method according to claim 2, further comprising: If the validity flag value of each candidate application partition does not match the standard flag value, first program update data for the target application is obtained from the target host computer, and the target application is updated in the candidate application partition according to the first program update data; wherein the candidate application partition is any of the candidate application partitions; The validity flag value of the to-be-selected application partition is changed to the standard flag value, and when the electronic controller is restarted, the to-be-selected application partition whose validity flag value is the standard flag value is determined, and the target application stored in the to-be-selected application partition is run.

8. A program updating device, characterized in that: include: a target application program running module, for determining, when the electronic controller is started, a candidate application partition whose partition validity is a valid partition as a target application partition, and running a target application program stored in the target application partition; a backup application generation module, configured to obtain first program update data for the target application, and generate a backup application corresponding to the target application in an auxiliary application partition; wherein the auxiliary application partition is any of the candidate application partitions whose partition validity is an invalid partition; A partition validity changing module, used to change the partition validity of the target application partition to an invalid partition, and change the partition validity of the auxiliary application partition to a valid partition; An application update module is used to determine the partition validity of the auxiliary application partition as a valid partition when the electronic controller is restarted, run the backup application stored in the auxiliary application partition, and update the target application in the target application partition according to the first program update data.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the program updating method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the program updating method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the program update method according to any one of claims 1 to 7.