Method and device for guiding loading program, electronic equipment and storage medium
By logically segmenting the application firmware and enabling parallel handling of multiple main controllers, the problem of slow ECU startup speed is solved, and faster system startup and better sleep wake-up performance is achieved.
Patent Information
- Application Number
- CN202411816890.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In the prior art, when ECU powers on, restarts and wakes up sleep, the application firmware loads from nonvolatile Flash Memory to Static RAM slow, affecting the system startup speed.
By logically segmenting the application firmware according to the size of the application firmware and the number of main controllers involved in segment handling, multiple main controllers are configured and enabled to transport logical segments in parallel, quickly loading the application firmware to static random access memory.
Without affecting other functions of the vehicle, the speed of handling application firmware is significantly improved, and the ECU is faster startup system is realized, providing guarantees for the entire vehicle to sleep and quickly wake up.
Smart Images

Figure CN119759433A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of automotive electronics technology, and in particular to a method, device, electronic device, and storage medium for booting a loader. Background Art
[0002] ECU (Electronic Control Unit) power-on, restart and sleep wake-up all involve the Bootloader loading the application firmware from the non-volatile Flash Memory to the faster Static RAM (Static Random Access Memory) for execution. Since fetching instructions from Static RAM is much faster than fetching instructions directly from Flash, the Bootloader improves the performance of the application when it is running. However, the speed of transferring application firmware is usually slow through a single main controller (for example: single CPU or single DMA), which affects the speed of ECU power-on, restart and sleep wake-up.
[0003] Therefore, how to improve the transfer speed of application firmware and enable the ECU to start the system faster has become a technical problem that needs to be solved urgently.
[0004] Application Contents
[0005] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for booting a loader to increase the transfer speed of application firmware and enable the ECU to start the system faster.
[0006] According to a first aspect of an embodiment of the present application, a method for booting a loader is provided, the method comprising: logically segmenting the application firmware according to the size of the application firmware and the number of main controllers participating in segment transport to obtain multiple logical segments; configuring and enabling the multiple main controllers participating in the segment transport to transport corresponding logical segments in parallel; configuring and enabling the multiple main controllers not participating in the segment transport to complete other functional logics in parallel; if the main controller participating in the segment transport and the main controller not participating in the segment transport both complete the corresponding tasks, the application firmware is loaded into a static random access memory.
[0007] In some embodiments of the present application, the application firmware is logically segmented according to the size of the application firmware and the number of main controllers involved in segment transfer to obtain multiple logical segments, including: if the main controllers are of the same type, the size of the logical segment is: Logical Segment Size = max_fw_size / num_master; wherein Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of the main controllers; if the main controllers are of different types, the size of the logical segment is determined based on experimental data.
[0008] In some embodiments of the present application, the configuration information of the main controller involved in the segment transfer includes: a logical segment source address, a logical segment destination address, a clock frequency of the main controller, and a transfer enable.
[0009] In some embodiments of the present application, the configuration information of the main controller that does not participate in the segment transport includes at least one of: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.
[0010] In some embodiments of the present application, if the main controller participating in the segment transport and the main controller not participating in the segment transport have both completed corresponding tasks, the application firmware is loaded into the static random access memory, including: setting status flags for both the main controller participating in the segment transport and the main controller not participating in the segment transport, and the status flags are used to indicate whether their corresponding tasks are completed; if the status flags of the main controller participating in the segment transport and the main controller not participating in the segment transport both indicate that their corresponding tasks have been completed, then the application firmware is loaded into the static random access memory.
[0011] In some embodiments of the present application, if the status flags of the main controller participating in the segment transport and the main controller not participating in the segment transport both indicate that their corresponding tasks have been completed, the application firmware is loaded into the static random access memory, and also includes: performing verification processing on the application firmware in the static random access memory; if the verification processing passes, starting the application firmware.
[0012] According to a second aspect of an embodiment of the present application, a device for booting a loader is provided, the device comprising: a segmentation module, for logically segmenting the application firmware according to the size of the application firmware and the number of main controllers participating in segment transport to obtain multiple logical segments; a first configuration module, for configuring and enabling the multiple main controllers participating in the segment transport to transport corresponding logical segments in parallel; a second configuration module, for configuring and enabling the multiple main controllers not participating in the segment transport to complete other functional logics in parallel; a management module, for loading the application firmware into a static random access memory if the main controller participating in the segment transport and the main controller not participating in the segment transport both complete corresponding tasks.
[0013] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method of booting the loader as described in the first aspect.
[0014] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for booting a loader as described in the first aspect is implemented.
[0015] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the diagnostic method based on a service-oriented architecture as described in the first aspect of the embodiment.
[0016] According to the above technical solution, the solution of the boot loader of the embodiment of the present application logically segments the application firmware according to the size of the application firmware and the number of main controllers involved in the segment transport to obtain multiple logical segments. Configure and enable multiple main controllers involved in the segment transport to transport the corresponding logical segments in parallel; configure and enable multiple main controllers not involved in the segment transport to complete other functional logics in parallel. When the main controllers involved in the segment transport and the main controllers not involved in the segment transport complete the corresponding tasks, the application firmware is loaded into the static random access memory. The embodiment of the present application improves the transport speed of the application firmware without affecting other functions of the vehicle, enables the ECU to start the system faster, and provides a guarantee for the sleep and fast wake-up of the entire vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A schematic diagram of the implementation of a single host controller boot loader;
[0019] Figure 2 A flowchart of a method for booting a loader applicable to an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a method for implementing a boot loader program applicable to an embodiment of the present application;
[0021] Figure 4 A flowchart of step S4 of a method for booting a loader program applicable to an embodiment of the present application;
[0022] Figure 5 The present invention is a structural diagram of a device for booting a loader applicable to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0024] See also Figure 1 ECU power-on, restart and sleep wake-up all involve the Bootloader using a single main controller to load application firmware from non-volatile Flash Memory to faster Static RAM for execution. The transfer speed is very slow, which affects the speed of ECU power-on, restart and sleep wake-up.
[0025] In order to solve the above technical problems, the present application embodiment provides a method for booting a loader, see Figure 2 , methods include:
[0026] Step S1: logically segment the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer to obtain multiple logical segments.
[0027] Step S2: configure and enable multiple main controllers involved in segment transport to transport corresponding logical segments in parallel.
[0028] Step S3: configure and enable multiple main controllers that are not involved in segment handling to complete other functional logics in parallel.
[0029] Step S4: If the main controllers participating in the segment transfer and the main controllers not participating in the segment transfer have completed the corresponding tasks, the application firmware is loaded into the static random access memory.
[0030] See also Figure 3 The embodiment of the present application configures and enables multiple master controllers (Master 1, Master 2) that participate in segment transport, and transports the corresponding logic segments (Logical Segment 1, Logic Segment 2) in parallel, and configures and enables multiple master controllers (Master x1, Master x 2) that do not participate in segment transport, and completes other functional logics in parallel. Thus, without affecting other functions of the vehicle, the transport speed of the application firmware is improved, the ECU can start the system faster, and the whole vehicle can be dormant and quickly awakened. Provides a guarantee.
[0031] In some specific implementations of the embodiments of the present application, step S1 includes:
[0032] If the main controllers are of the same type, the size of the logical segment is:
[0033] Logical Segment Size=max_fw_size / num_master, (Formula 1).
[0034] Among them, Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of master controllers.
[0035] During the design phase of the memory layout, the maximum storage space for the application firmware, that is, the size of the application firmware max_fw_size, is planned.
[0036] In the Bootloader stage, most of the main controllers are idle, and a large number of main controllers can participate in the transfer of logic segments, such as each core of a multi-core system, a DMA instance, etc. The type and number of main controllers involved in the transfer can be determined based on the boot time requirements.
[0037] If the master controllers are of the same type, the number of the master controllers is recorded as num_master, and the logical segment size of the application firmware logical segment can be calculated by formula 1.
[0038] If the main controller is of different types, since the segment transfer rates of different types of main controllers are also different, the size of the logic segment of the application program may be different, and the size of the logic segment is determined based on experimental data.
[0039] In some other specific implementations of the embodiments of the present application, the configuration information of the main controller involved in the segment transport includes:
[0040] Logical segment source address, logical segment destination address, main controller clock frequency, and transport enable.
[0041] In some specific implementations of the embodiments of the present application, the configuration information of the main controller that does not participate in the segment transport includes:
[0042] At least one of the following: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.
[0043] In addition, in addition to the main controllers participating in the segment transport and the main controllers not participating in the segment transport, unused main controllers are also included, that is, the main controllers do not need to be configured and enabled.
[0044] Specifically, the configuration information of the main controller is shown in Table 1 below.
[0045] Table 1
[0046]
[0047]
[0048] In some specific implementations of the embodiments of the present application, see Figure 4 , step S4, comprising:
[0049] Step S41: Setting a status flag (Completion Flag) on both the main controller participating in the segment transport and the main controller not participating in the segment transport. The status flag is used to indicate whether the corresponding task is completed.
[0050] Specifically, the embodiment of the present application provides synchronization management of the master controllers (Master 1, Master 2) participating in the segment transfer and the master controllers (Master x1, Master x 2) not participating in the segment transfer in each time line (Time line 1, Time line 2, Time line 3, Time line 4) as shown in Table 2 below. The initial value of the status flag is Uncompleted; if the corresponding task is completed, the status flag is modified to Completed.
[0051] Table 2
[0052]
[0053] Step S42: If the status flags of the master controllers participating in the segment transfer and the master controllers not participating in the segment transfer both indicate that their corresponding tasks have been completed, the application firmware is loaded into the static random access memory.
[0054] As shown in Table 2 above, Time Line 4 means that the master controllers participating in the segment transport (Master 1, Master 2) and the master controllers not participating in the segment transport (Master x1, Master x 2) have completed the corresponding tasks.
[0055] Additionally, no synchronization management is required for unused master controllers.
[0056] In some specific implementations of the embodiments of the present application, step S42 further includes:
[0057] Performing verification processing on the application firmware in the static random access memory;
[0058] If the verification process passes, the application firmware is started.
[0059] Specifically, the application firmware in the target Static RAM is subjected to a CRC32 check. Finally, after the check passes, the Bootloader starts the application firmware from the target Static RAM to implement the ECU startup system.
[0060] Device
[0061] See also Figure 5 , an embodiment of the present application further provides a device for booting a loader, the device comprising:
[0062] The segmentation module 501 is used to logically segment the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer to obtain multiple logical segments.
[0063] The first configuration module 502 is used to configure and enable the multiple main controllers involved in the segment transfer to transfer the corresponding logical segments in parallel.
[0064] The second configuration module 503 is used to configure and enable multiple main controllers that are not involved in the segment transport to complete other functional logics in parallel.
[0065] The management module 504 is configured to load the application firmware into a static random access memory if the main controller participating in the segment transport and the main controller not participating in the segment transport complete corresponding tasks.
[0066] The embodiment of the present application improves the transfer speed of application firmware without affecting other functions of the vehicle, enables the ECU to start the system faster, and provides a guarantee for the sleep and quick wake-up of the entire vehicle.
[0067] Computer storage media
[0068] In this embodiment, a computer-readable storage medium is provided, storing instructions for causing a machine to execute the diagnostic method based on a service-oriented architecture as described herein. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device is enabled to read and execute the program code stored in the storage medium.
[0069] In this case, the program code read from the storage medium itself can implement the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute part of the present application.
[0070] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0071] Computer program product
[0072] In this embodiment, a computer program product is provided, including computer instructions, which instruct a computing device to perform any corresponding operation in the above-mentioned multiple method embodiments.
[0073] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0074] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.
[0075] It should be noted that in the description of this application, the terms "first" and "second" are only used to facilitate the description of different components or names, and cannot be understood as indicating or implying a sequential relationship, relative importance, or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0077] It should be noted that although the specific embodiments of the present application are described in detail in conjunction with the accompanying drawings, this should not be construed as limiting the scope of protection of the present application. Within the scope described in the claims, various modifications and variations that can be made by those skilled in the art without creative work still fall within the scope of protection of the present application.
[0078] The examples of the embodiments of the present application are intended to concisely illustrate the technical features of the embodiments of the present application so that those skilled in the art can intuitively understand the technical features of the embodiments of the present application, and are not intended to be improper limitations of the embodiments of the present application.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for booting a loader, the method comprising: According to the size of the application firmware and the number of main controllers involved in the segment transfer, the application firmware is logically segmented to obtain a plurality of logical segments; Configure and enable the multiple main controllers involved in the segment transport to transport the corresponding logical segments in parallel; Configuring and enabling multiple main controllers that are not involved in the segment handling to complete other functional logics in parallel; If the main controller participating in the segment transport and the main controller not participating in the segment transport both complete corresponding tasks, the application firmware is loaded into the static random access memory.
2. The method according to claim 1, wherein: The step of logically segmenting the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer to obtain multiple logical segments includes: If the main controllers are of the same type, the size of the logic segment is: Logical Segment Size = max_fw_size / num_master; wherein Logical Segment Size is the size of the logical segment, max_fw_size is the size of the application firmware, and num_master is the number of the master controllers; If the main controller is a main controller of a different type, the size of the logic segment is determined according to experimental data.
3. The method according to claim 1 or 2, wherein: The configuration information of the main controller involved in segment handling includes: Logical segment source address, logical segment destination address, main controller clock frequency, and transport enable.
4. The method according to claim 1 or 2, wherein: The configuration information of the main controller not involved in the segment transport includes: At least one of the following: peripheral initialization, hardware version number detection, serial port printing, and dog feeding.
5. The method according to claim 4, wherein: If the main controller participating in the segment transport and the main controller not participating in the segment transport both complete corresponding tasks, the application firmware is loaded into the static random access memory, including: Setting status flags on both the main controller involved in the segment transport and the main controller not involved in the segment transport, wherein the status flags are used to indicate whether the corresponding tasks are completed; If the status flags of the main controller participating in the segment transport and the main controller not participating in the segment transport both indicate that their corresponding tasks have been completed, the application firmware is loaded into the static random access memory.
6. The method according to claim 5, wherein: If the status flags of the main controller participating in the segment transport and the main controller not participating in the segment transport both indicate that their corresponding tasks have been completed, then the application firmware is loaded into the static random access memory, further comprising: Performing verification processing on the application firmware in the static random access memory; If the verification process passes, the application firmware is started.
7. A device for booting a loader, the device comprising: A segmentation module, used for logically segmenting the application firmware according to the size of the application firmware and the number of main controllers involved in segment transfer, to obtain multiple logical segments; A first configuration module is used to configure and enable the multiple main controllers involved in the segment transport to transport the corresponding logical segments in parallel; A second configuration module is used to configure and enable multiple main controllers that are not involved in the segment transport to complete other functional logics in parallel; The management module is used to load the application firmware into the static random access memory if the main controller participating in the segment transport and the main controller not participating in the segment transport both complete corresponding tasks.
8. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for booting a loader according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for booting a loader according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to execute operations corresponding to the method of booting a loader according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for loading multi-core firmware by controller, computer equipment and storage medium
CN109901890A
Segmented dual-redundancy boot loading method for DSP
CN112559071A
Operation method and system of system control software, computer equipment and storage medium
CN113961260A
Firmware boot task distribution for implementing low latency boot performance
CN114296750A
Loading starting method, chip, electronic device and storage medium
CN114924803A