Program running method and device for vehicle control unit
By dividing PFlash into two areas in the vehicle control unit, storing application A and application B, and performing effective marking checks at startup, the problem of single point failure of the vehicle control unit application is solved, and the reliability and safety of program operation are improved.
Patent Information
- Application Number
- CN202411275050.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-03-07
AI Technical Summary
The vehicle control unit has a single point of failure when starting the application, resulting in program errors or failure of upgrades, which may cause the assisted driving function to fail and increase safety risks.
By dividing the PFlash of the vehicle control unit into two areas, storing application A and application B respectively, and checking the valid marks of the two applications at startup, if both applications are valid, start from either; if only one party is valid, start from the valid party; if both are invalid, wait for re-flashing.
Through the redundant design of the application, the problem of single point failure is solved, the reliability and safety of program operation is improved, and the stability and safety of assisted driving functions are ensured.
Smart Images

Figure CN119576639A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of vehicle control technology, and in particular to a program running method and device for a vehicle control unit. Background Art
[0002] With the development of engine electronic control technology and assisted driving technology, the importance of vehicle control units has become increasingly prominent. Typically, vehicle control units include electronic control units (ECU) and microcontroller units (MCU). The vehicle control unit is responsible for integrating and managing a variety of assisted driving functions. The stability and reliability of its program are crucial. Once an error occurs in the program of the vehicle control unit or the upgrade fails, the controller may not operate normally, thereby making the assisted driving function invalid and increasing safety risks. Therefore, ensuring the accuracy of program operation and timely updates are important links in ensuring driving safety.
[0003] Currently, when a vehicle control unit starts an application, there is only one application available to run, resulting in a single point of failure. Summary of the invention
[0004] The present disclosure is completed to solve the above-mentioned problems, and its purpose is to provide a program running method and device for a vehicle control unit, which can solve the problem of single point failure of application programs through application redundancy.
[0005] According to one aspect of the present disclosure, a program running method for a vehicle control unit is provided, characterized in that it includes the following steps: dividing the PFlash of the vehicle control unit into a first area and a second area; storing application A in the first area, and storing application B in the second area, application A and application B are two sides of the application and back up each other, wherein the first area is provided with a first valid mark of application A, and the second area is provided with a second valid mark of application B, the first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid; and when starting the application, first check the values of the first valid mark and the second valid mark, if both application A and application B are valid, start from any one of application A and application B, if only one of application A and application B is valid, start from the valid one.
[0006] Preferably, the application A and the application B are of the same version.
[0007] Preferably, the application A and the application B are different versions.
[0008] Preferably, when the application A fails to upgrade or fails to run, the first validity mark is set to an invalid value.
[0009] Preferably, when the application B fails to upgrade or fails to run, the second validity flag is set to an invalid value.
[0010] Preferably, if both the application A and the application B are invalid, then wait for the application A and / or the application B to be rewritten.
[0011] According to another aspect of the present disclosure, a program running device for a vehicle control unit is provided, characterized in that it includes: a division unit, used for dividing the PFlash of the vehicle control unit into a first area and a second area; a storage unit, used for storing application A in the first area, and storing application B in the second area, wherein application A and application B are two sides of the application and back up each other, wherein the first area is provided with a first valid mark of application A, and the second area is provided with a second valid mark of application B, the first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid; and a startup unit, used for checking the values of the first valid mark and the second valid mark when starting the application, if both application A and application B are valid, either application A or application B is started, and if only one of application A and application B is valid, the valid one is started.
[0012] According to another aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method described in the above aspect.
[0013] According to another aspect of the present disclosure, a computer storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded by a processor and executes the method according to the above aspect of claim 1.
[0014] According to another aspect of the present disclosure, a computer program product is provided, comprising at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded by a processor and executes the method according to the above aspect of claim 1 . BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1It is a flowchart of a program running method for a vehicle control unit provided in an embodiment of the present disclosure.
[0016] Figure 2 It is a structural block diagram of a program running device for a vehicle control unit provided in an embodiment of the present disclosure.
[0017] Figure 3 It is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0019] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.
[0020] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0021] The present disclosure provides a program running method and device for a vehicle control unit, which can solve the problem of single point failure of application programs through application program redundancy.
[0022] The evolution of intelligence has greatly increased the importance of software in smart cars, giving rise to the concept of "software-defined cars". Accordingly, since the functions of modern cars are highly dependent on the integration and interconnection of software systems, the failure of a key application may affect the performance of the entire vehicle and even cause safety hazards. For example, if the assisted driving system fails, it may directly affect the vehicle's handling and safety, posing risks to the driver and passengers. In addition, with the widespread use of software updates and cloud services, the risk of single point failures has also increased, because any network delays or service interruptions may cause the corresponding functions to fail to operate normally. Therefore, developing redundant designs and enhancing system recovery capabilities have become key measures to improve the safety and reliability of software-defined cars.
[0023] Figure 1 1 is a flow chart of a program running method for a vehicle control unit provided in an embodiment of the present disclosure. The program running method for a vehicle control unit provided in an embodiment of the present disclosure includes the following steps:
[0024] S101: Divide the PFlash of the vehicle control unit into a first area and a second area.
[0025] First, the memory of the PFlash (Program Flash) of the vehicle control unit is divided into two areas: the first area and the second area. Among them, PFlash is a flash memory area used to store program code, firmware, and read-only data. It usually contains the code of the boot program and application program, which will be loaded and executed when the system starts. During the compilation and linking process, the program will be divided into multiple code segments, and each code segment will be mapped to the appropriate location of PFlash.
[0026] S102: Application A is stored in the first area, and application B is stored in the second area, wherein application A and application B are two sides of an application and serve as backups for each other. The first area is provided with a first valid mark of application A, and the second area is provided with a second valid mark of application B. The first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid.
[0027] After each upgrade of application A is completed, the first valid flag of application A needs to be set. If the upgrade is successfully completed, the first valid flag is set to a preset valid value. If the upgrade fails, the first valid flag is set to a preset invalid value. After each upgrade of application B is completed, the second valid flag of application B needs to be set. If the upgrade is successfully completed, the second valid flag is set to a preset valid value. If the upgrade fails, the second valid flag is set to a preset invalid value.
[0028] In addition, when the application A fails to run, the first valid flag needs to be set to a preset invalid value. When the application B fails to run, the second valid flag needs to be set to a preset invalid value.
[0029] S103: When starting the application, first check the values of the first valid mark and the second valid mark. If both application A and application B are valid, start from either application A or application B. If only one of application A and application B is valid, start from the valid one.
[0030] When starting the application, the values of the first valid flag and the second valid flag are first checked. If both the first valid flag and the second valid flag are valid values, the application is started from either application A or application B. For example, it can be preset that if both application A and application B are valid, application A is started by default. Of course, the present disclosure is not limited to this, and application B can also be started by default.
[0031] If the first valid flag and the second valid flag indicate that only one of application A and application B is valid, the valid one is started.
[0032] If the first valid mark and the second valid mark show that both application A and application B are invalid, the application stops in the Bootloader and waits for re-flashing application A and / or application B. Application A and application B can be flashed at the same time, or one of them can be flashed.
[0033] In addition, the application program A and the application program B may be of the same version, or may be of different versions. When the application program A and the application program B are of different versions, the switching between different software versions may be achieved through commands.
[0034] Figure 2 FIG. 1 shows a structural block diagram of a program running device for a vehicle control unit provided by an embodiment of the present disclosure. Figure 2 As shown, the program running device 200 for a vehicle control unit includes: a dividing unit 201 , a storing unit 202 and a starting unit 203 .
[0035] The division unit 201 is used to divide the PFlash of the vehicle control unit into a first area and a second area. The storage unit 202 is used to store application A in the first area and application B in the second area, wherein application A and application B are two sides of the application and back up each other, wherein the first area is provided with a first valid mark of application A, and the second area is provided with a second valid mark of application B, the first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid. The startup unit 203 is used to check the values of the first valid mark and the second valid mark when starting the application, if both application A and application B are valid, then either application A or application B is started, if only one of application A and application B is valid, then the valid one is started.
[0036] Figure 3 is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 3 As shown, the present disclosure also provides an electronic device 300, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method described in the above embodiment.
[0037] The present disclosure also provides a computer storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or at least one program is loaded by a processor to execute the method described in the above embodiment.
[0038] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0039] The present disclosure also provides a computer program product, including at least one instruction or at least one program segment, characterized in that the at least one instruction or the at least one program segment is loaded by a processor and executes the method described in the above embodiment.
[0040] Those skilled in the art should be able to appreciate that the modules, units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0041] Although the present disclosure has been described with reference to the current specific embodiments, those skilled in the art should recognize that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features disclosed in the present disclosure (but not limited to) with similar functions.
Claims
1. A program running method for a vehicle control unit, characterized in that: The following steps are involved: Divide the PFlash of the vehicle control unit into a first area and a second area; Application A is stored in the first area, and application B is stored in the second area. Application A and application B are two sides of an application and serve as backup for each other. The first area is provided with a first valid mark of application A, and the second area is provided with a second valid mark of application B. The first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid; as well as When starting the application, first check the values of the first valid mark and the second valid mark. If both application A and application B are valid, start from either application A or application B. If only one of application A and application B is valid, start from the valid one.
2. The method according to claim 1, characterized in that The application program A and the application program B are of the same version.
3. The method according to claim 1, characterized in that The application program A and the application program B are different versions.
4. The method according to any one of claims 1 to 3, characterized in that When the application A fails to upgrade or fails to run, the first validity flag is set to an invalid value.
5. The method according to any one of claims 1 to 3, characterized in that: When the application B fails to upgrade or fails to run, the second validity flag is set to an invalid value.
6. The method according to any one of claims 1 to 3, characterized in that: If both the application A and the application B are invalid, wait for the application A and / or the application B to be rewritten.
7. A program running device for a vehicle control unit, characterized in that: include: A division unit, used for dividing the PFlash of the vehicle control unit into a first area and a second area; a storage unit, used to store application A in the first area, and to store application B in the second area, wherein application A and application B are two sides of an application and back up each other, wherein a first valid mark of application A is provided in the first area, and a second valid mark of application B is provided in the second area, wherein the first valid mark is used to mark whether application A is valid, and the second valid mark is used to mark whether application B is valid; and A startup unit is used to check the values of the first valid mark and the second valid mark when starting the application. If both the application A and the application B are valid, either application A or application B is started. If only one of the application A and the application B is valid, the valid one is started.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by a processor and executes the method according to any one of claims 1 to 6.
10. A computer program product, comprising at least one instruction or at least one program, characterized in that: The at least one instruction or the at least one program is loaded by a processor and executes the method according to any one of claims 1 to 6.
