Application program flashing method and device, equipment and storage medium
By responding to user commands in the ECU to enter an extended session mode, the bootloader corresponding to the user identifier is identified and flashed. This solves the problem of incorrect distribution of controller device numbers in the ECU flashing process, enables users to make their own choices, and improves the accuracy and security of flashing.
Patent Information
- Application Number
- CN202410962739.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-08
AI Technical Summary
In the existing technology, the ECU program flashing process cannot meet the personalized needs of users, resulting in incorrect distribution of controller part numbers, causing security risks and affecting user experience.
By responding to user commands and entering extended session mode, the system determines the new version of the bootloader corresponding to the user identifier and flashes the target controller in the offline detection program, reducing the risk of incorrect controller device number distribution and enabling users to choose the appropriate bootloader.
It improves the accuracy and efficiency of ECU programming, reduces safety risks, and enhances the user experience.
Smart Images

Figure CN118916053A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of vehicle control technology, and in particular to an application flashing method, device, equipment and storage medium. Background Art
[0002] With the development of automotive electronic technology, the need to upgrade the automotive electronic control unit (ECU) program has become increasingly important, and the stability and timeliness of the flashing process have also become increasingly stringent. By setting a bootloader in the microcontroller, it is possible to implement functions that require software flashing system updates or normal startup. Microcontroller software often needs to be refreshed due to the need to update bugs or update functions, and BootLoader meets the software refresh requirements.
[0003] At present, BootLoader is divided into the first sub-bootloader (BTA) and the second sub-bootloader (BTM), and saved in the offline detection program. Among them, BTM is used to flash BTA, and BTA is used to flash the application (Application, APP) in the ECU. When facing multiple users, since the flashing process of each customer is different, it is necessary to develop multiple BTAs according to the different flashing processes of the users. The ECU manages multiple control device numbers and distributes the corresponding control device number to each user, that is, each user corresponds to a control device number, and each control device number corresponds to a BTA. When the controller is offline, the ECU can only flash the current BTA to the BTA corresponding to the control device number distributed by the ECU, and use the BTA corresponding to the control device number to flash the APP in the ECU. If the control device number distributed by the ECU to the current user is wrong, the BTA may be flashed to the BTA of other users, not the BTA of the current user, thereby causing certain security risks due to using the BTA of other users to flash the APP in the ECU. Therefore, the user cannot choose the BTA to flash the APP in the ECU according to his own wishes, which affects the user experience. Summary of the invention
[0004] The present disclosure provides an application flashing method, apparatus, device and storage medium, which enable a user to flexibly select an appropriate boot loader to flash an application in a controller, thereby improving user experience.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for flashing an application is provided, the method comprising:
[0006] In response to an extended session request instruction triggered by a user, causing the target controller to be flashed to enter an extended session mode;
[0007] In response to a first flashing instruction triggered by a user, based on a user identifier in the first flashing instruction, determining a new version of a first boot loader corresponding to the user identifier;
[0008] Flashing an old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller as the first boot loader, wherein the offline detection program includes second boot loader corresponding to multiple different user identifiers;
[0009] Based on the first boot loader in the offline detection program, the application program in the target controller is flashed.
[0010] In the disclosed embodiment, in response to an extended session request instruction triggered by a user, the target controller to be flashed enters an extended session mode, and in response to a first flashing instruction triggered by the user, a new version of the first boot loader corresponding to the user identifier is determined based on the user identifier in the first flashing instruction. Since the offline detection program includes second boot loaders corresponding to multiple different user identifiers, the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller is flashed as the first boot loader, and based on the first boot loader in the offline detection program, the application in the target controller is flashed, thereby reducing the target controller's distribution operation of the control device number, reducing the security risk caused by using other users' BTA to flash the APP in the ECU due to errors in the distribution of the control device number, and enabling users to flexibly select an appropriate boot loader to flash the application in the controller, thereby improving user experience.
[0011] In a possible implementation, before responding to the extended session request instruction triggered by the user, the method further includes:
[0012] After detecting that the target controller is offline, the offline detection program is used to determine that the performance of the target controller is normal.
[0013] In the embodiment of the present disclosure, after detecting that the target controller is offline, the target controller is detected by using an offline detection program to ensure that the performance of the target controller is normal.
[0014] In a possible implementation, the method further includes:
[0015] For any one user, based on the requirement information of the any one user, generating a second boot loader corresponding to the user identification of the any one user;
[0016] The generated second boot loader program is saved in the offline detection program.
[0017] In the disclosed embodiment, based on the demand information of any user, a second boot loader corresponding to the user identification of any user is generated and saved in the offline detection program, so that the offline detection program includes second boot loaders corresponding to multiple different user identifications.
[0018] In a possible implementation, the step of flashing the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller to the first boot loader includes:
[0019] Based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a flash memory storage area of the target controller;
[0020] Erasing the second boot loader in the target location area using an erase routine of a flash driver FlashDriver in the target controller;
[0021] The first boot loader is flashed into the target location area using the write routine of the FlashDriver in the target controller.
[0022] In the embodiment of the present disclosure, based on the program identifier of the second boot loader, the target location area of the second boot loader in the Flash storage area of the target controller is determined, the second boot loader in the target location area is erased using the FlashDriver in the target controller, and the first boot loader is flashed to the target location area, thereby improving the flashing accuracy and efficiency of the second boot loader.
[0023] In a possible implementation, after responding to the first flash instruction triggered by the user, the method further includes:
[0024] In response to a flash status request instruction triggered by a user, determining a flash status of the second boot loader;
[0025] A first response message is obtained based on the flashing status of the second boot loader, and the first response message is sent to the user.
[0026] In an embodiment of the present disclosure, in response to a flash status request instruction triggered by a user, the flash status of the second boot loader is determined, and a first response message including the flash status of the second boot loader is sent to the user, so that the user can accurately determine the flash status of the second boot loader.
[0027] In a possible implementation manner, after sending the first response message to the user, the method further includes:
[0028] In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
[0029] In the embodiment of the present disclosure, in response to the flashing end instruction, the flashing process is ended, and a second response message including information indicating that the boot loader flashing process has ended is sent to the user, so that the user can determine that the boot loader flashing process has ended.
[0030] In a possible implementation, the flashing of the application program in the target controller based on the first boot loader in the offline detection program includes:
[0031] Based on the first boot loader, obtaining a new version of the application program from a first application storage area in the Flash storage area of the target controller;
[0032] The old version of the application program stored in the second application storage area in the Flash storage area of the target controller is flashed to the new version of the application program.
[0033] In the disclosed embodiment, based on the first boot loader in the offline detection program, the application program in the target controller is flashed, thereby improving the accuracy and efficiency of flashing the application program.
[0034] According to a second aspect of an embodiment of the present disclosure, there is provided an application flashing device, the device comprising:
[0035] A response module, used for responding to an extended session request instruction triggered by a user, so that the target controller to be flashed enters an extended session mode;
[0036] a determination module, configured to respond to a first flashing instruction triggered by a user and determine, based on a user identifier in the first flashing instruction, a new version of a first boot loader corresponding to the user identifier;
[0037] A first flashing module, used for flashing an old version of a second boot loader corresponding to the user identifier in an offline detection program of the target controller to the first boot loader, wherein the offline detection program includes second boot loaders corresponding to a plurality of different user identifiers;
[0038] The second flashing module is used to flash the application program in the target controller based on the first boot loader in the offline detection program.
[0039] In a possible implementation, before responding to the extended session request instruction triggered by the user, the response module is further configured to:
[0040] After detecting that the target controller is offline, the offline detection program is used to determine that the performance of the target controller is normal.
[0041] In a possible implementation manner, the device further includes:
[0042] A generating module, configured to generate, for any one user, a second boot loader corresponding to a user identifier of the any one user based on the requirement information of the any one user;
[0043] A saving module is used to save the generated second boot loader program into the offline detection program.
[0044] In a possible implementation, the first flashing module is used to:
[0045] Based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a flash memory storage area of the target controller;
[0046] Erasing the second boot loader in the target location area using an erase routine of a flash driver FlashDriver in the target controller;
[0047] The first boot loader is flashed into the target location area using the write routine of the FlashDriver in the target controller.
[0048] In a possible implementation, after responding to the first flash instruction triggered by the user, the determining module is further configured to:
[0049] In response to a flash status request instruction triggered by a user, determining a flash status of the second boot loader;
[0050] A first response message is obtained based on the flashing status of the second boot loader, and the first response message is sent to the user.
[0051] In a possible implementation manner, after sending the first response message to the user, the determining module is further configured to:
[0052] In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
[0053] In a possible implementation, the second flashing module is used to:
[0054] Based on the first boot loader, obtaining a new version of the application program from a first application storage area in the Flash storage area of the target controller;
[0055] The old version of the application program stored in the second application storage area in the Flash storage area of the target controller is flashed to the new version of the application program.
[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0057] A memory for storing program instructions;
[0058] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.
[0059] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.
[0060] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0062] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0063] Figure 2 is a flow chart of an application flashing method provided by an embodiment of the present disclosure;
[0064] Figure 3 is a flow chart of a method for flashing an application in a target controller provided by an embodiment of the present disclosure;
[0065] Figure 4 is a detailed flow chart of an application flashing method provided by an embodiment of the present disclosure;
[0066] Figure 5is a schematic diagram of various instructions provided by an embodiment of the present disclosure;
[0067] Figure 6 It is a structural diagram of the offline detection program in the prior art;
[0068] Figure 7 is a flow chart of generating a second boot loader provided by an embodiment of the present disclosure;
[0069] Figure 8 It is a structural diagram of an offline detection program provided by an embodiment of the present disclosure;
[0070] Fig. 9 is a flow chart of a flash status request method provided by an embodiment of the present disclosure;
[0071] Fig.10 is a flow chart of flashing a second boot loader provided by an embodiment of the present disclosure;
[0072] Fig.11 is a schematic diagram of an application flashing device provided by an embodiment of the present disclosure;
[0073] Fig.12 It is a schematic diagram of an electronic device for an application flashing method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the protection scope of the present disclosure.
[0075] The following are explanations of some of the terms that appear in the text:
[0076] 1. In the embodiments of the present disclosure, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0077] 2. The terms "first", "second", etc. in the specification and claims of the present disclosure 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 terms used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.
[0078] The application scenarios described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems. In the description of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more.
[0079] With the development of automotive electronic technology, the need to upgrade ECU programs has become increasingly important, and the stability and timeliness of the flashing process have also become increasingly stringent. By setting up a bootloader in the microcontroller, it is possible to implement functions that require software flashing system updates or normal startup. Microcontroller software often needs to be refreshed due to the need to update bugs or update functions, and BootLoader meets the software refresh requirements.
[0080] At present, BootLoader is divided into the first sub-bootloader (BTA) and the second sub-bootloader (BTM), and saved in the offline detection program. Among them, BTM is used to flash BTA, and BTA is used to flash the APP in the ECU. When facing multiple users, since the flashing process of each customer is different, it is necessary to develop multiple BTAs according to the different flashing processes of the users. The ECU manages multiple control device numbers and distributes the corresponding control device number to each user, that is, each user corresponds to a control device number, and each control device number corresponds to a BTA. When the controller is offline, the ECU can only flash the current BTA to the BTA corresponding to the control device number distributed by the ECU, and use the BTA corresponding to the control device number to flash the APP in the ECU. If the control device number distributed by the ECU to the current user is wrong, the BTA may be flashed to the BTA of other users, not the BTA of the current user, thereby causing certain security risks due to using the BTA of other users to flash the APP in the ECU. Therefore, the user cannot choose BTA to flash the APP in the ECU according to his own wishes, which affects the user experience.
[0081] Therefore, in order to solve the above problems, the present disclosure provides an application flashing method, apparatus, device and storage medium, which can enable users to flexibly select an appropriate boot loader to flash the application in the controller, thereby improving user experience.
[0082] First reference Figure 1, which is a schematic diagram of an application scenario of an embodiment of the present disclosure, including a user device 11 and a controller 12, wherein the user device 11 and the controller 12 are connected to each other through a network, and the network may be a local area network, a wide area network, etc. The user device 11 may be a convenient device (e.g., a mobile phone, a tablet, a laptop, etc.), or a personal computer (PC), and the controller 12 may be an ECU. The user 10 logs in to the controller 12 through a client installed in the user device 11, wherein the client may be a web browser, or an application client installed in a mobile user device, such as a mobile phone, a tablet, etc.
[0083] In the embodiment of the present disclosure, as an optional implementation, the controller 12 responds to the extended session request instruction triggered by the user 10 on the client of the user device 11, so that the target controller to be flashed enters the extended session mode. The controller 12 responds to the first flash instruction triggered by the user 10 on the user device 11, and based on the user identifier in the first flash instruction, determines the new version of the first boot loader corresponding to the user identifier; flashes the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller to the first boot loader, wherein the offline detection program includes multiple second boot loaders corresponding to different user identifiers; and flashes the application in the target controller based on the first boot loader in the offline detection program.
[0084] In some embodiments, a method for flashing an application provided by the present disclosure is described below through a specific embodiment. Figure 2 As shown, including:
[0085] Step 201, in response to an extended session request instruction triggered by a user, causing the target controller to be flashed to enter an extended session mode;
[0086] Step 202, in response to a first flashing instruction triggered by a user, determining a new version of a first boot loader corresponding to the user identifier based on a user identifier in the first flashing instruction;
[0087] Each user corresponds to each user identifier, and the user identifier can be set according to actual conditions. For example, the user identifier can be 0001. The boot loader in the controller includes a first sub-boot loader (BTA) and a second sub-boot loader (BTM). The first boot loader in the embodiment of the present disclosure is BTA.
[0088] Step 203, flashing the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller to the first boot loader;
[0089] The end of line detection program (End Of Line, EOL) is used to perform end of line detection when the controller is assembled and off the assembly line to ensure that there is no abnormality in the controller hardware function. The end of line detection program includes a second boot loader corresponding to multiple different user identifiers, and the end of line detection program also includes a BTM and a detection program. In the embodiment of the present disclosure, the second boot loader is BTA.
[0090] Step 204: flashing the application program in the target controller based on the first boot loader program in the offline detection program.
[0091] Figure 3 is a flow chart of a method for flashing an application in a target controller provided by an embodiment of the present disclosure, such as Figure 3 As shown, the above step 204 at least includes the following steps 301-302:
[0092] Step 301, based on the first boot loader, obtain a new version of the application from the first application storage area in the flash storage area of the target controller;
[0093] Step 302: Flash an old version of the application program stored in the second application storage area in the Flash storage area of the target controller to a new version of the application program.
[0094] The Flash storage area of the target controller includes an application storage area, which includes a first application storage area and a second application storage area. The first application storage area is used to store a preset new version of an application program, and the second application storage area is used to store an old version of an application program.
[0095] In the disclosed embodiment, in response to an extended session request instruction triggered by a user, the target controller to be flashed enters an extended session mode, and in response to a first flashing instruction triggered by the user, a new version of the first boot loader corresponding to the user identifier is determined based on the user identifier in the first flashing instruction. Since the offline detection program includes second boot loaders corresponding to multiple different user identifiers, the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller is flashed as the first boot loader, and based on the first boot loader in the offline detection program, the application in the target controller is flashed, thereby reducing the target controller's distribution operation of the control device number, reducing the security risk caused by using other users' BTA to flash the APP in the ECU due to errors in the distribution of the control device number, and enabling users to flexibly select an appropriate boot loader to flash the application in the controller, thereby improving user experience.
[0096] The specific steps of the application flashing method provided above are described in detail below. Figure 4 As shown:
[0097] Step 401: In response to an extended session request instruction triggered by a user, a target controller to be flashed enters an extended session mode.
[0098] After the target controller to be flashed enters the extended session mode, a third response message is sent to the user, where the third response message includes information for indicating that the target controller has entered the extended session mode.
[0099] Figure 5 is a schematic diagram of various instructions provided by the embodiments of the present disclosure, such as Figure 5 As shown, each instruction includes a message identification number (Identity Document, ID), and the extended session request instruction can be 021003, wherein 02 represents the length of the data field, that is, the next two bytes are the data content, 10 represents the service identifier (Service Identifier, SID), representing the diagnostic session control service, and 03 represents the session mode request, representing the extended session (Extended Diagnostic Session).
[0100] Optionally, before responding to the extended session request instruction triggered by the user, the method further includes:
[0101] After detecting that the target controller is offline, an offline detection program is used to determine whether the performance of the target controller is normal.
[0102] Specifically, after detecting that the target controller is offline, the offline detection program stored in the Flash storage area can be controlled to run to perform performance detection on the target controller. The offline detection program is an internal test software that includes functions such as collecting controller input and controlling controller output.
[0103] Figure 6 It is a structural diagram of the offline detection program in the prior art, such as Figure 6 As shown, the offline detection program includes a BTM, a BTA and a detection program. When the controller is offline, the controller can rewrite the current BTA to the BTA corresponding to the control device number distributed by the controller, and use the BTA corresponding to the control device number to rewrite the APP in the ECU.
[0104] Since each user's requirement information is different, the second boot loader generated based on the requirement information is different, that is, the flashing process is different. Therefore, before the target controller goes offline, if the requirement information sent by the user is received, the corresponding second boot loader needs to be generated based on the user's requirement information and saved in the offline detection program. Figure 7is a flowchart of generating a second boot loader provided by an embodiment of the present disclosure, such as Figure 7 As shown, at least the following steps 701-702 are included:
[0105] Step 701, for any user, based on the demand information of any user, generating a second boot loader corresponding to the user identifier of any user;
[0106] Specifically, based on the demand information of any user, a user identification of any user is generated, and a second boot loader corresponding to the user identification of any user is generated.
[0107] In the embodiment of the present disclosure, a user identification of any user can be generated by setting rules. The specific process of generating a second boot loader corresponding to the user identification of any user based on the demand information of any user is prior art and will not be described in detail here.
[0108] Step 702: Save the generated second boot loader program into the offline detection program.
[0109] The offline detection program includes second boot loader programs corresponding to multiple different user identifiers.
[0110] Figure 8 is a schematic diagram of the structure of an offline detection program provided by an embodiment of the present disclosure, such as Figure 8 As shown, the offline detection program includes BTAs corresponding to three different user identifiers. Specifically, based on the demand information of user 1, a second boot loader BTA1 corresponding to the user identifier 0001 of user 1 is generated, and the generated BTA1 is saved in the offline detection program; based on the demand information of user 2, a second boot loader BTA2 corresponding to the user identifier 0002 of user 2 is generated, and the generated BTA2 is saved in the offline detection program; based on the demand information of user 3, a second boot loader BTA3 corresponding to the user identifier 0003 of user 3 is generated, and the generated BTA3 is saved in the offline detection program.
[0111] Step 402: In response to a first flashing instruction triggered by a user, based on a user identifier in the first flashing instruction, determining a new version of a first boot loader corresponding to the user identifier.
[0112] like Figure 5As shown, the first flash instruction can be 053101000101, where, in order from front to back, 05 represents the length of the data field, that is, the next five bytes are the data content, 31 represents the routine control service (RoutineControlService), 01 represents the routine corresponding to the execution routine control, 0001 represents the user identifier, and 01 represents the start of the flash.
[0113] In the embodiment of the present disclosure, after responding to the first flashing instruction triggered by the user, the user may send a flashing status request instruction to the controller to obtain the flashing status of the second boot loader sent by the controller. Fig. 9 is a flowchart of a flash status request method provided by an embodiment of the present disclosure, such as Fig. 9 As shown, at least the following steps 901-902 are included:
[0114] Step 901, in response to a flashing status request instruction triggered by a user, determining a flashing status of a second boot loader;
[0115] like Figure 5 As shown, the flash status request instruction can be 053103000101, where, in order from front to back, 05 represents the length of the data field, that is, the next five bytes are the data content, 31 represents the routine control service, 03 represents the running result of the routine corresponding to the request routine control, 0001 represents the user ID, and 01 represents the start of flashing.
[0116] Step 902: obtain a first response message based on the flashing status of the second boot loader, and send the first response message to the user.
[0117] If the flashing state of the second boot loader is in the flashing state, a first response message including a first identifier is obtained; if the flashing state of the second boot loader is in the flashing completed state, a first response message including a second identifier is obtained. The first identifier and the second identifier can be set according to actual conditions, for example, the first identifier can be 1 and the second identifier can be 2.
[0118] Optionally, after sending the first response message to the user, the method further includes:
[0119] In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
[0120] Specifically, in response to the user receiving the first response message including the second identifier, the flashing end instruction is triggered, the flashing process is ended, and a second response message is sent to the user, wherein the second identifier is used to indicate that the flashing status of the second boot loader is the flashing completion status.
[0121] like Figure 5 As shown, the flash end instruction can be 0431020001, where, in order from front to back, 04 represents the length of the data field, that is, the next four bytes are the data content, 31 represents the routine control service, 02 represents the routine corresponding to the stop running routine control, and 0001 represents the user ID.
[0122] Step 403: Flash the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller as the first boot loader.
[0123] The offline detection program includes second boot loader programs corresponding to multiple different user identifiers.
[0124] Fig.10 is a flowchart of flashing a second boot loader provided by an embodiment of the present disclosure, such as Fig.10 As shown, the above step 403 at least includes the following steps 101-103:
[0125] Step 101, based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a Flash storage area of a target controller;
[0126] The program identifier of the second boot loader may be the program name of the second boot loader, or may be the icon of the second boot loader, or may be any other identifier that can uniquely identify the second boot loader. The Flash storage area of the target controller stores the offline detection program and the application program. In the disclosed embodiment, the Flash storage area may be divided, the offline detection program may be stored in a detection storage area in the Flash storage area, and the application program may be stored in an application storage area in the Flash storage area.
[0127] Step 102, using an erase routine of the flash driver FlashDriver in the target controller to erase the second boot loader in the target location area;
[0128] Among them, FlashDriver is a driver for accessing and managing flash memory devices. It interacts with the computer system to provide functions such as reading, writing, erasing, and copying flash memory devices. It is usually used as part of the operating system or application to process storage access requests of flash memory devices. FlashDriver is generally stored in the flashing host computer. Before each flashing, the ECU calls the erase routine and write routine of FlashDriver to flash the program stored in the Flash.
[0129] Step 103: Use the write routine of FlashDriver in the target controller to flash the first boot loader into the target location area.
[0130] The specific processes of the above steps 102 and 103 are prior art and will not be described in detail here.
[0131] Step 404 : Based on the first boot loader, obtain a new version of the application program from the first application storage area in the Flash storage area of the target controller.
[0132] Optionally, based on the first boot loader, obtaining a new version of the application program from a first application storage area in a Flash storage area of the target controller includes:
[0133] In response to the second flashing instruction triggered after the user receives the second response message, a new version of the application program is obtained from the first application storage area in the Flash storage area of the target controller based on the first boot loader.
[0134] Step 405 : Flashing the old version of the application program stored in the second application storage area in the Flash storage area of the target controller to the new version of the application program.
[0135] The specific process of flashing the old version of the application stored in the second application storage area in the Flash storage area of the target controller to the new version of the application is prior art and will not be described in detail here.
[0136] In some embodiments, based on the same inventive concept, the embodiments of the present disclosure also provide an application flashing device. Since the device is the device in the method in the embodiments of the present disclosure, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0137] like Fig.11 As shown, the above device includes the following modules:
[0138] A response module 111, configured to respond to an extended session request instruction triggered by a user and enable the target controller to be flashed to enter an extended session mode;
[0139] A determination module 112, configured to respond to a first flashing instruction triggered by a user and determine, based on a user identifier in the first flashing instruction, a new version of a first boot loader corresponding to the user identifier;
[0140] A first flashing module 113, configured to flash an old version of a second boot loader corresponding to the user identifier in an offline detection program of the target controller to the first boot loader, wherein the offline detection program includes second boot loaders corresponding to a plurality of different user identifiers;
[0141] The second flashing module 114 is used to flash the application program in the target controller based on the first boot loader in the offline detection program.
[0142] As an optional implementation manner, before responding to the extended session request instruction triggered by the user, the response module 111 is further configured to:
[0143] After detecting that the target controller is offline, the offline detection program is used to determine that the performance of the target controller is normal.
[0144] As an optional implementation, the device further includes:
[0145] A generating module, configured to generate, for any one user, a second boot loader corresponding to a user identifier of the any one user based on the requirement information of the any one user;
[0146] A saving module is used to save the generated second boot loader program into the offline detection program.
[0147] As an optional implementation manner, the first flashing module 113 is used to:
[0148] Based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a flash memory storage area of the target controller;
[0149] Erasing the second boot loader in the target location area using an erase routine of a flash driver FlashDriver in the target controller;
[0150] The first boot loader is flashed into the target location area using the write routine of the FlashDriver in the target controller.
[0151] As an optional implementation manner, after responding to the first flashing instruction triggered by the user, the determining module 112 is further configured to:
[0152] In response to a flash status request instruction triggered by a user, determining a flash status of the second boot loader;
[0153] A first response message is obtained based on the flashing status of the second boot loader, and the first response message is sent to the user.
[0154] As an optional implementation manner, after sending the first response message to the user, the determining module 112 is further configured to:
[0155] In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
[0156] As an optional implementation, the second flashing module 704 is used to:
[0157] Based on the first boot loader, obtaining a new version of the application program from a first application storage area in the Flash storage area of the target controller;
[0158] The old version of the application program stored in the second application storage area in the Flash storage area of the target controller is flashed to the new version of the application program.
[0159] In some embodiments, based on the same inventive concept, an application flashing device is also provided in the embodiments of the present disclosure. The device can implement the application flashing function discussed above. Please refer to Fig.12 , the device comprises a processor 121 and a memory 122, wherein the memory 122 is used to store program instructions;
[0160] The processor 121 calls the program instructions stored in the memory and executes the program instructions to implement:
[0161] In response to an extended session request instruction triggered by a user, causing the target controller to be flashed to enter an extended session mode;
[0162] In response to a first flashing instruction triggered by a user, based on a user identifier in the first flashing instruction, determining a new version of a first boot loader corresponding to the user identifier;
[0163] Flashing an old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller as the first boot loader, wherein the offline detection program includes second boot loader corresponding to multiple different user identifiers;
[0164] Based on the first boot loader in the offline detection program, the application program in the target controller is flashed.
[0165] As an optional implementation manner, before responding to the extended session request instruction triggered by the user, the processor 121 is further configured to execute:
[0166] After detecting that the target controller is offline, the offline detection program is used to determine that the performance of the target controller is normal.
[0167] As an optional implementation manner, the processor 121 is further configured to execute:
[0168] For any one user, based on the requirement information of the any one user, generating a second boot loader corresponding to the user identification of the any one user;
[0169] The generated second boot loader program is saved in the offline detection program.
[0170] As an optional implementation manner, the step of flashing the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller to the first boot loader includes:
[0171] Based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a flash memory storage area of the target controller;
[0172] Erasing the second boot loader in the target location area using an erase routine of a flash driver FlashDriver in the target controller;
[0173] The first boot loader is flashed into the target location area using the write routine of the FlashDriver in the target controller.
[0174] As an optional implementation manner, after responding to the first flash instruction triggered by the user, the processor 121 is further configured to execute:
[0175] In response to a flash status request instruction triggered by a user, determining a flash status of the second boot loader;
[0176] A first response message is obtained based on the flashing status of the second boot loader, and the first response message is sent to the user.
[0177] As an optional implementation manner, after sending the first response message to the user, the processor 121 is further configured to execute:
[0178] In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
[0179] As an optional implementation manner, the flashing of the application program in the target controller based on the first boot loader in the offline detection program includes:
[0180] Based on the first boot loader, obtaining a new version of the application program from a first application storage area in the Flash storage area of the target controller;
[0181] The old version of the application program stored in the second application storage area in the Flash storage area of the target controller is flashed to the new version of the application program.
[0182] In some embodiments, based on the same inventive concept, a computer-readable storage medium is also provided in the embodiments of the present disclosure, and a computer program product includes: a computer program code, and when the computer program code is run on a computer, the computer executes any of the application flashing methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the application flashing method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0183] In some embodiments, based on the same inventive concept, a computer program product is also provided in the embodiments of the present disclosure, the computer program product comprising: computer program code, when the computer program code is run on a computer, the computer executes any of the application flashing methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the application flashing method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0184] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0185] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.
[0186] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0188] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0189] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for flashing an application, characterized in that: The method includes: In response to an extended session request instruction triggered by a user, causing the target controller to be flashed to enter an extended session mode; In response to a first flashing instruction triggered by a user, based on a user identifier in the first flashing instruction, determining a new version of a first boot loader corresponding to the user identifier; Flashing an old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller as the first boot loader, wherein the offline detection program includes second boot loader corresponding to multiple different user identifiers; Based on the first boot loader in the offline detection program, the application program in the target controller is flashed.
2. The method according to claim 1, characterized in that: Before responding to the extended session request instruction triggered by the user, the method further includes: After detecting that the target controller is offline, the offline detection program is used to determine that the performance of the target controller is normal.
3. The method according to claim 1, characterized in that The method further comprises: For any one user, based on the requirement information of the any one user, generating a second boot loader corresponding to the user identification of the any one user; The generated second boot loader program is saved in the offline detection program.
4. The method according to claim 1, characterized in that The step of flashing the old version of the second boot loader corresponding to the user identifier in the offline detection program of the target controller to the first boot loader includes: Based on the program identifier of the second boot loader program, determining a target location area of the second boot loader program in a flash memory storage area of the target controller; Erasing the second boot loader in the target location area using an erase routine of a flash driver FlashDriver in the target controller; The first boot loader is flashed into the target location area using the write routine of the FlashDriver in the target controller.
5. The method according to claim 1, characterized in that: After responding to the first flashing instruction triggered by the user, the method further includes: In response to a flash status request instruction triggered by a user, determining a flash status of the second boot loader; A first response message is obtained based on the flashing status of the second boot loader, and the first response message is sent to the user.
6. The method according to claim 5, characterized in that After sending the first response message to the user, the method further includes: In response to the flashing end instruction, the flashing process is ended, and a second response message is sent to the user, wherein the second response message includes information for indicating that the boot loader flashing process has ended.
7. The method according to any one of claims 1 to 6, characterized in that: The flashing of the application program in the target controller based on the first boot loader program in the offline detection program includes: Based on the first boot loader, obtaining a new version of the application program from a first application storage area in the Flash storage area of the target controller; The old version of the application program stored in the second application storage area in the Flash storage area of the target controller is flashed to the new version of the application program.
8. An application flashing device, characterized in that: The device includes: A response module, used for responding to an extended session request instruction triggered by a user, so that the target controller to be flashed enters an extended session mode; a determination module, configured to respond to a first flashing instruction triggered by a user and determine, based on a user identifier in the first flashing instruction, a new version of a first boot loader corresponding to the user identifier; A first flashing module, used for flashing an old version of a second boot loader corresponding to the user identifier in an offline detection program of the target controller to the first boot loader, wherein the offline detection program includes second boot loaders corresponding to a plurality of different user identifiers; The second flashing module is used to flash the application program in the target controller based on the first boot loader in the offline detection program.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.
Citation Information
Cited By
Information updating method and device for differentially-configured electronic control units
CN121187270A
