Bootloader flashing method, device, equipment and medium
By configuring and using preset stability testing and error injection tools, abnormal situations during Bootloader flashing process are automatically handled, and the problem of waste of labor and time in repetitive work in the existing technology is solved, and efficient Bootloader flashing and stability testing is achieved.
Patent Information
- Application Number
- CN202410253279.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-03-06
AI Technical Summary
When testing the stability of Bootloader, repetitive work wastes a lot of manpower and time, and market tools are powerless in dealing with unexpected situations and controlling the time of writing, resulting in cumbersome work.
By configuring the software and hardware environment for Bootloader flash writing, using preset stability tests and error injection tools to record mouse and keyboard actions, determine whether it is interrupt test, dynamically obtain target coordinates and random numbers, trigger the flash writing interrupt operation, and automatically handle software and hardware exceptions in abnormal situations.
It effectively improves the efficiency of Bootloader flashing, realizes the automation of flashing, automatically tests the stability of Bootloader, and realizes automatic identification and processing in emergencies, reducing the waste of manpower and time resources.
Smart Images

Figure CN118152277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automotive electronics, and in particular to a Bootloader flashing method, device, equipment and medium. Background Art
[0002] With the development of automotive electronic technology, the need to upgrade the automotive ECU (Electronic Control Unit) program has become increasingly important, and the stability and timeliness of the flashing process have also become increasingly stringent. By setting a Bootloader (a boot program in a fixed position in the ECU, the basis for upgrading automotive electronic functions) 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 the Bootloader meets the software refresh requirements.
[0003] Bootloader is the first code executed after the system is reset. Therefore, the loading and starting task of the entire system is completely completed by Bootloader. It first completes the initialization of the system hardware, including clock setting, memory mapping, etc. It also sets the stack pointer and then jumps to the entry of the operating system kernel. For example, when the system is powered on or reset, it usually starts execution from address 0x00000000, and the system's Bootloader program is usually stored at this address. In this way, the system's hardware and software environment is brought to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel.
[0004] In order to test the stability of the Bootloader, after the Bootloader program is developed, several test apps (applications) need to be used to test the stability of the current Bootloader. This part of the work is originally done by the software test engineer who develops the Bootloader program, but thousands of repetitive work wastes a lot of manpower and time. There are tools such as Keyboard Wizard on the market that can complete repetitive work, but they are powerless in dealing with unexpected situations, flash pop-up errors, and controlling the start and stop time of flashing. Testers who use such tools have to stop the program running frequently and flash manually, which not only fails to achieve the goal of saving manpower, but makes the work more cumbersome. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a Bootloader flashing method, device, equipment and medium, which can effectively improve the efficiency of flashing. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a Bootloader flashing method, which is applied to a preset stability test and error injection tool, including:
[0007] Configure the software and hardware environment for Bootloader flashing;
[0008] During the current round of Bootloader flashing, the preset stability test and error injection tool are started to record the mouse and keyboard actions, and it is determined whether the current test is an interruption test;
[0009] If yes, dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing;
[0010] If not, after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, the software abnormal situation is automatically processed or the hardware abnormal situation is automatically processed through the digital IO and the programmed power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing results and the current round of stress test results; wherein, the hardware abnormal situation includes voltage mutation and excessive bus load.
[0011] Optionally, after obtaining the corresponding flashing result and the stress test result of the current round, the process further includes:
[0012] Jump back to the step of starting the local automatic flashing program, start the next round of stress testing, and complete the preset round of stress testing.
[0013] Optionally, after obtaining the corresponding flashing result and the stress test result of the current round, the process further includes:
[0014] Jump back to the step of configuring the software and hardware environment for Bootloader flashing to start the next round of stress testing until the preset round of stress testing is completed.
[0015] Optionally, recording mouse and keyboard actions by starting the preset stability test and error injection tool includes:
[0016] The preset stability test and error injection tool is started by running a preset command line or a preset script in a preset interactive interface, and mouse and keyboard action recording is performed based on the preset stability test and error injection tool.
[0017] Optionally, the method further includes:
[0018] Select to perform normal flashing or interrupt testing through the preset interactive interface;
[0019] The preset interactive interface records and displays in real time the corresponding number of flashing times, number of flashing failures, flashing failure rate, total number of flashing times, interruption test success rate, and stress test success rate.
[0020] Optionally, obtaining a corresponding target random number according to the target coordinates to trigger a corresponding flash interrupt operation based on the target random number and start the next round of Bootloader flashing includes:
[0021] By converting the target coordinates into absolute coordinates, a target random number within a preset range is obtained according to the absolute coordinates, so that during the flashing process, a corresponding flashing interruption operation is triggered at every preset time unit of the target random number, and the next round of Bootloader flashing is started.
[0022] Optionally, the automatic identification and processing of abnormal situations based on the preset image recognition interface includes:
[0023] Automatically identify and process error reminders or error pop-up windows based on the preset image recognition interface by periodically creating a new thread.
[0024] In a second aspect, the present application provides a Bootloader flashing device, which is applied to a preset stability test and error injection tool, including:
[0025] Environment configuration module, used to configure the software and hardware environment for Bootloader flashing;
[0026] A judgment result acquisition module is used to record the mouse and keyboard actions by starting the preset stability test and error injection tool during the current round of Bootloader flashing, and to judge whether the current test is an interruption test;
[0027] The first result processing module is used to dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing;
[0028] The second result processing module is used to start the local automatic flashing program after the recording is completed, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, automatically process the software abnormal situation or automatically process the hardware abnormal situation through the digital IO and the programmed power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein, the hardware abnormal situation includes voltage mutation and excessive bus load.
[0029] In a third aspect, the present application provides an electronic device, including:
[0030] Memory, used to store computer programs;
[0031] The processor is used to execute the computer program to implement the steps of the aforementioned Bootloader flashing method.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the steps of the aforementioned Bootloader flashing method when executed by a processor.
[0033] It can be seen that in this application, the software and hardware environment of Bootloader flashing is configured; in the current round of Bootloader flashing, the mouse and keyboard actions are recorded by starting the preset stability test and error injection tool, and it is determined whether the current is an interruption test; if so, the target coordinates in the current flashing page are dynamically obtained based on the preset image recognition interface, and the corresponding target random number is obtained according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing; if not, after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that there is a preset abnormal situation, the software abnormal situation is automatically processed or the hardware abnormal situation is automatically processed through the digital IO and the program power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein the hardware abnormal situation includes voltage mutation and excessive bus load. That is to say, this application first configures the software and hardware environment of flashing, and then records the mouse and keyboard actions in the current round of flashing by starting the preset stability test and error injection tool, and determines whether it is an interruption test. If yes, then determine the corresponding target random number to trigger the corresponding interruption test process based on the target random number; if not, automatically flash after the recording is completed, and automatically identify and handle software anomalies in this process as well as hardware anomalies including voltage mutation, excessive bus load, etc. In this way, on the one hand, it can effectively reduce unnecessary waste of human resources and time resources, improve the efficiency of Bootloader flashing, and realize the automation of flashing. On the other hand, through interruption testing and stress testing, the stability of the Bootloader during flashing is automatically tested, and automatic identification and handling of emergencies are realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention 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 only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A flowchart of a Bootloader flashing method provided in this application;
[0036] Figure 2 A partial code segment schematic diagram provided for this application;
[0037] Figure 3 A partial code segment schematic diagram provided for this application;
[0038] Figure 4 A partial code segment schematic diagram provided for this application;
[0039] Figure 5 A partial code segment schematic diagram provided for this application;
[0040] Figure 6 A partial code segment schematic diagram provided for this application;
[0041] Figure 7 A partial code segment schematic diagram provided for this application;
[0042] Figure 8 A partial code segment schematic diagram provided for this application;
[0043] Fig. 9 A schematic diagram of the structure of a Bootloader flashing device provided in this application;
[0044] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In order to test the stability of the Bootloader, after the Bootloader program is developed, it is necessary to use several test apps to test the stability of the current Bootloader. This part of the work is originally done by the software test engineer who develops the Bootloader program, but thousands of repeated work wastes a lot of manpower and time. There are tools such as Keyboard Wizard on the market that can complete repetitive work, but they are powerless in dealing with unexpected situations, flashing pop-up errors, and controlling the start and stop time of flashing. Testers using such tools have to often stop the program from running and flash manually, which not only fails to achieve the goal of saving manpower, but makes the work more cumbersome. To this end, the present application provides a Bootloader flashing solution that can effectively improve the efficiency of Bootloader flashing.
[0047] See also Figure 1 As shown, an embodiment of the present invention discloses a Bootloader flashing method, which is applied to a preset stability test and an error injection tool, including:
[0048] Step S11, configuring the software and hardware environment for Bootloader flashing.
[0049] In this embodiment, the software and hardware environment required for the current Bootloader flashing needs to be configured first, so that a series of operations can be performed in the configured environment later.
[0050] Step S12: During the current round of Bootloader flashing, the preset stability test and error injection tool are started to record the mouse and keyboard actions, and it is determined whether the current test is an interruption test.
[0051] Specifically, in this embodiment, it is necessary to understand that the preset stability test and error injection tool needs to be started for recording while the normal process is manually flashed once. The recorded content can be specifically recorded in a txt (short for text) document, which realizes the capture and recording of a single action. At the same time, the current txt document can be edited and modified. If some functions need to be changed later, there is no need to re-record the txt script. And there are two ways to start the tool, that is, the recording of mouse and keyboard actions by starting the preset stability test and error injection tool, including: starting the preset stability test and error injection tool by running a preset command line or a preset script in a preset interactive interface, and recording mouse and keyboard actions based on the preset stability test and error injection tool. Among them, regarding the preset script in the preset interactive interface, the preset script is directly run by running the exe file in the preset interactive interface to start the tool. During this process, you need to start the user interaction page of pyqt (a toolkit for creating GUI applications). The user interaction page is more intuitive. Selecting a project on the page requires a script. Script editing is also reflected in the page, and you can directly open a txt document on the page to edit the script. The page provides an error image upload function, through which you can read error pop-ups or correct pop-ups. There is a dynamic box on the page to dynamically display the console parameters during the project operation. The mouse precision can be controlled by changing the mouse precision to control the accuracy of mouse clicks or mouse movements during the project operation, and the mouse precision can be adjusted according to different needs.
[0052] Regarding the command line, there may specifically be the following code segments:
[0053] parser=argparse.argumentParser()
[0054] parser.add_argument
[0055] In this way, the scripts that need to be parsed in this project, the number of times the project needs to be looped, the execution speed and other parameters are added to the project. Since the command line does not need to start the user interaction page, the command line does not need to start the UI (User Interface) page function, so in theory it can save more computer performance.
[0056] Furthermore, in this embodiment, it also includes: selecting to perform normal flashing or interruption test through the preset interactive interface; recording and displaying the corresponding flashing times, flashing failure times, flashing failure rate, total flashing times, interruption test success rate, and stress test success rate in real time through the preset interactive interface. In this way, the failure rate can be obtained more intuitively than using the command line.
[0057] Step S13: If yes, dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing.
[0058] Specifically, in this embodiment, the target random number is obtained according to the target coordinates, so as to trigger the corresponding flash interruption operation based on the target random number and start the next round of Bootloader flashing, including: converting the target coordinates into absolute coordinates, obtaining the target random number within the preset range according to the absolute coordinates, so as to trigger the corresponding flash interruption operation at each preset time unit of the target random number in the flashing process, and start the next round of Bootloader flashing. Among them, the preset range can be configured and adjusted in advance based on actual needs, and the preset time unit can be configured and adjusted in advance based on actual needs. That is to say, in this embodiment, the stability of the Bootloader is tested through the interruption test of the Bootloader, and the target coordinates in the flashing page can be dynamically obtained through OpenCv (Open Source Computer Vision Library, open source computer vision library)-python (a Python wrapper implemented in C++ of the OpenCV library) through the preset image recognition interface, and the relative coordinates are converted into absolute coordinates. Through this coordinate, a random number within a specified range is generated in each interruption test, so as to achieve interruption at each interval of the corresponding random time in each automated test.
[0059] It should be understood that the stability of the Bootloader needs to be tested in the Bootloader test, because in actual use, there may be a sudden power outage or other uncertain factors during the flashing process. If the stability of the Bootloader is not enough, the next time the power is turned on again and the flashing is done again, there will be uncontrollable results such as program disorder and inability to start. Therefore, the stability of the Bootloader needs to be guaranteed before mass production, which requires the test engineer to perform an interruption test. In this embodiment, the interruption test is performed by generating a random number, and this interruption time can also be manually set in the UI page of the tool. Further, regarding the generation of random numbers, since an interruption test is required when testing the stability of the Bootloader, and such an interruption is uncertain in the actual Bootloader flashing process, it is necessary to use a method to interrupt the Bootloader with an uncertain interruption time. This interruption time is generated by a random number generator. In this embodiment, the input of the interruption time is added to the user UI, and then a random number is generated within this time range. This random number is used as the interruption time, which not only simulates the interruption test but also realizes the randomness of the interruption.
[0060] Step S14, if not, then after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, the software abnormal situation is automatically processed, or the hardware abnormal situation is automatically processed through the digital IO and the programmed power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein, the hardware abnormal situation includes voltage mutation and excessive bus load.
[0061] In this embodiment, the automatic identification and processing of abnormal situations based on the preset image recognition interface includes: automatically identifying and processing error reminders or error pop-ups based on the preset image recognition interface by creating a new thread at a fixed time. Specifically, by parsing the recorded txt script, and then calling pywinnk and win32api to execute the results of the parsed script, the script can be repeatedly executed. After that, the script is run by obtaining the results of the script parsing, and in the process of running the script, image recognition (opencv) is used to monitor the various error messages that appear on the screen in real time, and reset to a suitable state after automatic processing, so as to handle several abnormal conditions without affecting the next flash. In addition, this embodiment automatically detects the system category at the program startup time by writing the API (Application Programming Interface) of different operating systems into the function, and then automatically calls the API of different operating systems, so that the software applied to this embodiment is compatible with different operating systems.
[0062] It is necessary to further understand that after obtaining the corresponding flashing results and the current round of stress test results, it also includes: jumping back to the step of starting the local automatic flashing program, starting the next round of stress testing, until the preset round of stress testing is completed. Or, jumping back to the step of configuring the software and hardware environment for Bootloader flashing, starting the next round of stress testing, until the preset round of stress testing is completed. It is understandable that when changing the operating system, it is necessary to jump back to the step of configuring the software and hardware environment for Bootloader flashing for the next round.
[0063] In addition, since abnormal situations may occur in the actual Bootloader flashing process, they are specifically divided into two types: software abnormal situations and hardware abnormal situations. Among them, software abnormal situations are abnormal situations caused by problems with the Bootloader itself; hardware abnormal situations include but are not limited to device power failure, excessive bus load, and voltage mutation. Since the previous test tools can only realize software-level simulation, when circuit problems occur, they can only be solved manually by test engineers, which not only affects the timeliness of the work but also increases the workload of test engineers. If the bus load is too high, it can only be solved manually by engineers. However, in this embodiment, various abnormal situations that may occur in the actual flashing of the Bootloader can be automatically realized by the preset stability test and error injection tool. For hardware abnormal situations, the specific implementation method is to use digital IO (Input / Output) and system control to automatically control the circuit through a program power supply connected to the preset stability test and error injection tool to complete the corresponding hardware abnormal situation processing.
[0064] It can be seen that in the embodiment of the present application, the software and hardware environment of the Bootloader flashing is configured; in the current round of the Bootloader flashing process, the mouse and keyboard actions are recorded by starting the preset stability test and error injection tool, and it is determined whether the current is an interruption test; if so, the target coordinates in the current flashing page are dynamically obtained based on the preset image recognition interface, and the corresponding target random number is obtained according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing; if not, after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that there is a preset abnormal situation, the software abnormal situation is automatically processed or the hardware abnormal situation is automatically processed through the digital IO and the program power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein the hardware abnormal situation includes voltage mutation and excessive bus load. That is to say, the present application first configures the software and hardware environment of the flashing, and then records the mouse and keyboard actions in the current round of the flashing process by starting the preset stability test and error injection tool, and determines whether it is an interruption test. If yes, then determine the corresponding target random number to trigger the corresponding interruption test process based on the target random number; if not, automatically flash after the recording is completed, and automatically identify and handle software anomalies in this process as well as hardware anomalies including voltage mutation, excessive bus load, etc. In this way, on the one hand, it can effectively reduce unnecessary waste of human resources and time resources, improve the efficiency of Bootloader flashing, and realize the automation of flashing. On the other hand, through interruption testing and stress testing, the stability of the Bootloader during flashing is automatically tested, and automatic identification and handling of emergencies are realized.
[0065] Combine the following Figure 2-Figure 8 The code segments disclosed in the text further illustrate the technical solutions of the embodiments of the present application.
[0066] In this embodiment, firstly, the preset stability test and error injection tool are compatible with different operating systems, a) Windows system; b) Linux or Darwin system. Specifically, the Linux or Darwin system can be configured with the following code segment.
[0067]
[0068] At the same time, the default region can be set to China, and the default language can be set to Chinese, which can be adjusted if necessary. And if the required script does not exist, this embodiment can automatically create a txt document named current time, which can be implemented by configuring the code segment shown below.
[0069]
[0070] Afterwards, in this embodiment, the running project can be controlled by the set hotkeys, which can be specifically configured as follows: Figure 2 as well as Figure 3 In this embodiment, after recording is completed, when parsing the recorded script, the delay function time, event type, coordinate point in the script are parsed and stored in the variable ScriptEvent; due to the format of the script, the comments and separators in the script need to be removed first, and the final required data is obtained before transferring. The specific implementation code segment can be seen in Figure 4 and Figure 5 As shown. Regarding running scripts, the parsed content of the script is stored in ScriptEvent. The script is run by reading the data in ScriptEvent. The control function that needs to delay a random time in the interrupt test is also written in the function of running the script. The flashing project is interrupted by a random number; the information of the running script and the pause, start and stop status are displayed on the page. Users can see the current flashing process and the remaining times in real time. For the specific implementation code snippet, please refer to Figure 6 and Figure 7 As shown. In this embodiment, abnormal situations during code execution are also monitored in real time. Specifically, a new thread can be created for image recognition. The thread starts running when the project is started. The thread can be set to start at a specific time in the preset stability test and error injection tool. On the one hand, starting multiple threads at the same time will affect part of the computer's performance. On the other hand, controlling the start and stop time of the thread can determine the real-time nature of different error pop-ups or success pop-ups, avoiding monitoring errors caused by monitoring the thread for too long. Specifically, a timing function can be triggered at fixed intervals to monitor the correct pop-ups or error pop-ups that appear on the screen in real time. For the specific implementation code snippet, see Figure 8 shown.
[0071] See also Fig. 9 As shown, the embodiment of the present application also discloses a Bootloader flashing device, which is applied to a preset stability test and error injection tool, including:
[0072] The environment configuration module 11 is used to configure the software and hardware environment for Bootloader flashing;
[0073] The judgment result acquisition module 12 is used to record the mouse and keyboard actions by starting the preset stability test and error injection tool during the current round of Bootloader flashing, and to judge whether the current test is an interruption test;
[0074] The first result processing module 13 is used to dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing;
[0075] The second result processing module 14 is used to start the local automatic flashing program after the recording is completed, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, automatically process the software abnormal situation or automatically process the hardware abnormal situation through the digital IO and the programmed power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein, the hardware abnormal situation includes voltage mutation and excessive bus load.
[0076] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0077] It can be seen that the embodiment of the present application configures the software and hardware environment for Bootloader flashing; in the current round of Bootloader flashing, the mouse and keyboard actions are recorded by starting the preset stability test and error injection tool, and it is determined whether the current is an interruption test; if so, the target coordinates in the current flashing page are dynamically obtained based on the preset image recognition interface, and the corresponding target random number is obtained according to the target coordinates, so as to trigger the corresponding flash interruption operation based on the target random number and start the next round of Bootloader flashing; if not, after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that there is a preset abnormal situation, the software abnormal situation is automatically processed or the hardware abnormal situation is automatically processed through the digital IO and the program power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein the hardware abnormal situation includes voltage mutation and excessive bus load. That is to say, the present application first configures the software and hardware environment for flashing, and then records the mouse and keyboard actions in the current round of flashing by starting the preset stability test and error injection tool, and determines whether it is an interruption test. If yes, then determine the corresponding target random number to trigger the corresponding interruption test process based on the target random number; if not, automatically flash after the recording is completed, and automatically identify and handle software anomalies in this process as well as hardware anomalies including voltage mutation, excessive bus load, etc. In this way, on the one hand, it can effectively reduce unnecessary waste of human resources and time resources, improve the efficiency of Bootloader flashing, and realize the automation of flashing. On the other hand, through interruption testing and stress testing, the stability of the Bootloader during flashing is automatically tested, and automatic identification and handling of emergencies are realized.
[0078] In some specific embodiments, the Bootloader flashing device may further include:
[0079] The first step jump unit is used to jump back to the step of starting the local automatic flashing program to start the next round of stress testing until the preset round of stress testing is completed.
[0080] In some specific embodiments, the Bootloader flashing device may further include:
[0081] The second step is a jump unit, which is used to jump back to the step of configuring the software and hardware environment for flashing the Bootloader, and start the next round of stress testing until the preset round of stress testing is completed.
[0082] In some specific embodiments, the judgment result acquisition module 12 may specifically include:
[0083] An action recording unit is used to start the preset stability test and error injection tool by running a preset command line or a preset script in a preset interactive interface, and to record mouse and keyboard actions based on the preset stability test and error injection tool.
[0084] In some specific embodiments, the Bootloader flashing device may further include:
[0085] An interface selection unit, used for selecting normal flashing or interrupting the test through the preset interactive interface;
[0086] The interface display unit is used to record and display in real time the corresponding number of flashing times, number of flashing failures, flashing failure rate, total number of flashing times, interruption test success rate, and stress test success rate through the preset interactive interface.
[0087] In some specific embodiments, the first result processing module 13 may specifically include:
[0088] The random number determination unit is used to convert the target coordinates into absolute coordinates, and obtain a target random number within a preset range according to the absolute coordinates, so as to trigger a corresponding flash interrupt operation at every preset time unit of the target random number during the flash process, and start the next round of Bootloader flashing.
[0089] In some specific embodiments, the second result processing module 14 may specifically include:
[0090] The second result processing unit is used to automatically identify and process error reminders or error pop-up windows based on the preset image recognition interface by periodically creating a new thread.
[0091] Furthermore, the present application also discloses an electronic device. Fig.10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0092] Fig.10 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the Bootloader flashing method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0093] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0094] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0095] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the Bootloader flashing method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0096] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the Bootloader flashing method disclosed above is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0097] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0098] Professionals may further appreciate that the units and algorithm 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 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 hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians 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 application.
[0099] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0100] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0101] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for flashing a vehicle ECU Bootloader, characterized in that: Used in pre-set stability testing and error injection tools, including: Configure the software and hardware environment for Bootloader flashing; During the current round of Bootloader flashing, the preset stability test and error injection tool are started to record the mouse and keyboard actions, and it is determined whether the current test is an interruption test; If yes, dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing; If not, after the recording is completed, the local automatic flashing program is started, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, the software abnormal situation is automatically processed or the hardware abnormal situation is automatically processed through the digital IO and the program power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein the hardware abnormal situation includes voltage mutation and / or excessive bus load; The step of obtaining a corresponding target random number according to the target coordinates, triggering a corresponding flash interrupt operation based on the target random number and starting the next round of Bootloader flash, includes: By converting the target coordinates into absolute coordinates, a target random number within a preset range is obtained according to the absolute coordinates, so as to trigger a corresponding flash interrupt operation at every preset time unit of the target random number during the flash process, and start the next round of Bootloader flashing; The automatic identification and processing of abnormal situations based on the preset image recognition interface includes: In the process of running the recorded script, a new thread is created periodically to monitor various error messages appearing on the screen in real time based on the preset image recognition interface, so as to automatically identify and process error reminders or error pop-up windows; The recording of mouse and keyboard actions by starting the preset stability test and error injection tool includes: The preset stability test and error injection tool is started by running a preset command line or a preset script in a preset interactive interface, and mouse and keyboard action recording is performed based on the preset stability test and error injection tool; Also includes: Select to perform normal flashing or interrupt testing through the preset interactive interface; The corresponding number of flashing times, number of flashing failures, flashing failure rate, total number of flashing times, interruption test success rate and / or stress test success rate are recorded and displayed in real time through the preset interactive interface.
2. The flashing method of the vehicle ECU Bootloader according to claim 1, characterized in that: After obtaining the corresponding flashing result and the stress test result of the current round, the following steps are also included: Jump back to the step of starting the local automatic flashing program, start the next round of stress testing, and complete the preset round of stress testing.
3. The flashing method of the vehicle ECU Bootloader according to claim 1, characterized in that: After obtaining the corresponding flashing result and the stress test result of the current round, the following steps are also included: Jump back to the step of configuring the software and hardware environment for Bootloader flashing to start the next round of stress testing until the preset round of stress testing is completed.
4. A flashing device for a vehicle ECU Bootloader, characterized in that: Used in pre-set stability testing and error injection tools, including: Environment configuration module, used to configure the software and hardware environment for Bootloader flashing; A judgment result acquisition module is used to record the mouse and keyboard actions by starting the preset stability test and error injection tool during the current round of Bootloader flashing, and to judge whether the current test is an interruption test; The first result processing module is used to dynamically obtain the target coordinates in the current flashing page based on the preset image recognition interface, and obtain the corresponding target random number according to the target coordinates, so as to trigger the corresponding flashing interruption operation based on the target random number and start the next round of Bootloader flashing; The second result processing module is used to start the local automatic flashing program after the recording is completed, and when it is determined based on the preset image recognition interface that a preset abnormal situation currently exists, automatically process the software abnormal situation or automatically process the hardware abnormal situation through the digital IO and the program power supply connected to the preset stability test and error injection tool to obtain the corresponding flashing result and the current round of stress test results; wherein the hardware abnormal situation includes voltage mutation and / or excessive bus load; The first result processing module includes: A random number determination unit, configured to convert the target coordinates into absolute coordinates, and obtain a target random number within a preset range according to the absolute coordinates, so as to trigger a corresponding flash interrupt operation at every preset time unit of the target random number during the flash process, and start the next round of Bootloader flash; The second result processing module includes: A second result processing unit is used to monitor various error messages appearing on the screen in real time based on the preset image recognition interface by periodically creating a new thread during the running of the recorded script, so as to automatically identify and process error reminders or error pop-up windows; The judgment result acquisition module includes: An action recording unit, used to start the preset stability test and error injection tool by running a preset command line or a preset script in a preset interactive interface, and to record mouse and keyboard actions based on the preset stability test and error injection tool; Also includes: An interface selection unit, used for selecting normal flashing or interrupting the test through the preset interactive interface; The interface display unit is used to record and display in real time the corresponding number of flashing times, number of flashing failures, flashing failure rate, total number of flashing times, interruption test success rate and / or stress test success rate through the preset interactive interface.
5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, used for executing the computer program to implement the vehicle ECU Bootloader flashing method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the vehicle ECU Bootloader flashing method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Vehicle-mounted ECU bus refreshing test system and method
CN112748713A
Vehicle ECU (Electronic Control Unit) data flashing pressure measurement system and pressure measurement method
CN113219945A