Software flashing method and device, equipment and storage medium

By automatically determining and updating the flashing mode in the lower computer, the automation of software flashing is realized, the problem of low automation in the existing technology is solved, and the efficiency and efficiency of software updating are improved.

CN118626104APending Publication Date: 2024-09-10CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410762901.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The existing software flashing method has a low degree of automation, resulting in a heavy workload for technicians when updating software.

Method used

By reading the currently set brushing mode after the lower computer is started, automatically determining and updating the brushing mode according to the brushing tasks to be received, and restarting the lower computer to execute the corresponding brushing tasks, the automatic selection of the brushing program is realized. and automatic startup and shutdown.

Benefits of technology

It reduces the operating steps for technicians when updating software, improves the efficiency of software flashing, avoids the need to manually start and shut down the lower computer, and reduces the workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626104A
    Figure CN118626104A
Patent Text Reader

Abstract

The invention relates to a software flashing method and device, equipment and a storage medium. The method comprises the following steps: after a lower computer is started, reading a current set flashing mode and determining a flashing mode corresponding to a flashing task to be received; starting the lower computer and keeping the lower computer alive after the target equipment is electrified; if the current set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, calling a flashing program corresponding to the flashing mode to execute the flashing task after the flashing task is received; and otherwise, updating the current set flashing mode to the flashing mode corresponding to the flashing task to be received, and restarting the lower computer. According to the method, the lower computer is started after the target equipment is powered on, and the lower computer is kept alive, so that a technician is prevented from manually starting the lower computer and calling the flashing program when executing the flashing task, the technician is prevented from manually operating the flashing program, automatic software flashing is realized on the lower computer side, and the workload of the technician is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and in particular to a software flashing method, device, equipment and storage medium. Background Art

[0002] As people's demands for vehicles increase, the iteration speed of software used in vehicles is very fast. In order to meet the iteration requirements of software, vehicle factories have proposed line-side flashing technology to adapt to the iteration and update of software.

[0003] Specifically, during the vehicle generation phase, the software used in the vehicle will have update requirements from time to time, and there are often scenarios where the vehicle has not been assembled yet, but the vehicle's assembly parts need to be updated. In this scenario, since the assembly parts may not have networking capabilities, the assembly parts can only be operated by technicians alone to update the software of the assembly parts through line-side flashing. Among them, the line-side flashing steps include: installing an embedded program in the assembly part, and when the software of the assembly part needs to be updated, the technician is responsible for manually starting the embedded program; using the host computer to send the pre-prepared software package to the assembly part, the embedded program in the assembly part is responsible for installing the software package to complete the software update; after the update is completed, the technician closes the embedded program, because: after the vehicle leaves the factory, the embedded program installed during the vehicle production stage will no longer be used.

[0004] At present, during the vehicle production stage, a large number of vehicles and vehicle assemblies are produced at the same time. If technicians are required to manually start and close the embedded program at irregular intervals for each vehicle and each assembly, then this software flashing method with a low degree of automation will result in a large workload for technicians when updating the software. Summary of the invention

[0005] The present application provides a software flashing method, apparatus, device and storage medium to solve the problem that the existing software flashing method has a low degree of automation, resulting in a large workload for technicians when updating software.

[0006] An embodiment of the present application provides a software flashing method, comprising: after a lower computer is started, reading a currently set flashing mode and determining a flashing mode corresponding to a flashing task to be received; wherein the lower computer is installed in a target device; the target device starts the lower computer and keeps the lower computer alive after power-on; if the currently set flashing mode and the flashing mode corresponding to the flashing task to be received are the same, then after receiving the flashing task, calling a flashing program corresponding to the flashing mode to execute the flashing task; if the currently set flashing mode and the flashing mode corresponding to the flashing task to be received are different, then updating the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarting the lower computer.

[0007] Wherein, the target device starts the lower computer and keeps the lower computer alive after power-on, including: the target device starts the lower computer after power-on; after starting the lower computer, detects the working status of the lower computer; wherein the types of the working status include: normal working status and abnormal working status; when it is detected that the working status of the lower computer is an abnormal working status and has lasted for a preset time length, restarts the lower computer.

[0008] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; the determination of the flashing mode corresponding to the flashing task to be received includes: monitoring whether the preset port is externally connected to a preset host computer; if it is monitored that the port is externally connected to the host computer, connecting to the host computer and performing security authentication on the host computer; after determining that the host computer has passed the security authentication, determining that the flashing task to be received corresponds to the line-side flashing mode; if it is monitored that the port is not externally connected to the host computer or it is determined that the host computer has not passed the security authentication, determining that the flashing task to be received corresponds to the remote flashing mode.

[0009] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; after receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task, including: if the flashing mode is the remote flashing mode, then after receiving the remote flashing task from the preset server, calling the preset remote flashing program to execute the remote flashing task; if the flashing mode is the line-side flashing mode, then after receiving the line-side flashing task from the preset host computer, calling the preset line-side flashing program to execute the line-side flashing task.

[0010] Among them, after receiving the remote flash task from the preset server, calling the preset remote flash program to execute the remote flash task, including: after receiving the remote flash task from the server, running the remote flash program; sending the remote flash task to the remote flash program so that the remote flash program executes the remote flash task; after the remote flash task is completed, stopping the remote flash program.

[0011] Among them, after receiving the line-side flashing task from the preset host computer, calling the preset line-side flashing program to execute the line-side flashing task, including: after receiving the line-side flashing task from the host computer, running the line-side flashing program; sending the line-side flashing program to the line-side flashing program so that the line-side flashing program executes the line-side flashing task; after the line-side flashing task is completed, stopping the running of the line-side flashing program.

[0012] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; wherein, the flashing mode of the lower computer by default is the remote flashing mode; before calling the preset line-side flashing program to execute the line-side flashing task, it also includes: updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode; and, after calling the preset line-side flashing program to execute the line-side flashing task, shutting down the lower computer or restarting the lower computer; or, after calling the preset line-side flashing program to execute the line-side flashing task, it also includes: updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode; and shutting down the lower computer or restarting the lower computer.

[0013] Among them, after calling the preset line-side flashing program to execute the line-side flashing task, the currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode, including: after detecting that the upper computer is disconnected from the lower computer, the currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode.

[0014] Among them, updating the currently set flash mode to the flash mode corresponding to the flash task to be received and restarting the lower computer includes: updating the currently set flag information; wherein the remote flash mode corresponds to the first flag information and the line-side flash mode corresponds to the second flag information; upon detecting that the flag information is updated from the first flag information to the second flag information, or, from the second flag information to the first flag information, restarting the lower computer.

[0015] An embodiment of the present application provides a software flashing device, including: a reading and determining module, which is used to read the currently set flashing mode and determine the flashing mode corresponding to the flashing task to be received after the lower computer is started; wherein the lower computer is installed in a target device; the target device starts the lower computer and keeps the lower computer alive after power-on; a calling and executing module, which is used to call the flashing program corresponding to the flashing mode to execute the flashing task after receiving the flashing task if the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received; an updating and starting module, which updates the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarts the lower computer if the currently set flashing mode is different from the flashing mode corresponding to the flashing task to be received.

[0016] An embodiment of the present application provides a software flashing device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: execute a software flashing program stored in the memory to implement any of the software flashing methods described above.

[0017] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement any of the software flashing methods described above.

[0018] The beneficial effects of this application are as follows:

[0019] In the embodiment of the present application, after the lower computer is started, the currently set flash mode is read and the flash mode corresponding to the flash task to be received is determined; wherein, the lower computer is installed in the target device; the target device starts the lower computer and keeps the lower computer alive after power-on; if the currently set flash mode and the flash mode corresponding to the flash task to be received are the same, then after receiving the flash task, the flash program corresponding to the flash mode is called to execute the flash task; if the currently set flash mode and the flash mode corresponding to the flash task to be received are different, then the currently set flash mode is updated to the flash mode corresponding to the flash task to be received and the lower computer is restarted. In the embodiment of the present application, the lower computer is started and kept alive after the target device is powered on, avoiding the need for technical personnel to manually start the lower computer from time to time according to the software iteration requirements that may arise at any time. In addition, the embodiment of the present application automatically selects the appropriate flashing mode according to the flashing task to be received and calls the corresponding flashing program only when the flashing task is executed, thereby realizing automatic selection, automatic startup and shutdown of the flashing program, avoiding manual operation of the flashing program by technical personnel. Furthermore, the embodiment of the present application realizes automated software flashing on the lower computer side, effectively reducing the workload of technical personnel and improving software flashing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of a software flashing method according to an embodiment of the present application;

[0021] Figure 2 is an architectural diagram of a software flashing method according to an embodiment of the present application;

[0022] Figure 3 A flowchart of the selection steps of a flashing procedure according to an embodiment of the present application;

[0023] Figure 4 is a timing diagram of security authentication according to an embodiment of the present application;

[0024] Figure 5 is a structural diagram of a software flashing device according to an embodiment of the present application;

[0025] Figure 6 It is a structural diagram of a software flashing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0027] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0028] For ease of description, spatial relative terms may be used in the text to describe the relative position or movement of an element or feature as shown in the figure relative to another element or feature, such as "inside", "outside", "inner side", "outer side", "below", "below", "above", "above", "front", "back", etc. Such spatial relative terms are intended to include different orientations of the device in use or operation in addition to the orientation depicted in the figure. For example, if the device in the figure undergoes a position flip or a change in posture or a change in motion state, then these directional indications will also change accordingly, for example: an element described as "below other elements or features" or "below other elements or features" will subsequently be oriented as "above other elements or features" or "above other elements or features". Therefore, the example term "below..." can include both upper and lower orientations. The device can be oriented otherwise (rotated 90 degrees or in other directions) and the spatial relative descriptors used in the text are interpreted accordingly.

[0029] In order to solve the problem that the existing software flashing method has a low degree of automation, resulting in a large amount of work for technicians when updating software. The embodiment of the present application provides a software flashing method. The execution subject of this embodiment is a lower computer. The lower computer is pre-installed in the target device. The target device can be a whole vehicle or an assembly of a whole vehicle. After the target device is powered on, the lower computer is automatically started and the lower computer is kept alive. That is to say, when an abnormality occurs in the lower computer, the lower computer is restored to keep the lower computer running normally.

[0030] The following describes the software flashing method of the embodiment of the present application. Figure 1 , which is a flow chart of a software flashing method according to an embodiment of the present application.

[0031] Step S110, after the lower computer is started, read the currently set flashing mode and determine the flashing mode corresponding to the flashing task to be received; wherein the lower computer is installed in the target device; the target device starts the lower computer after power-on and keeps the lower computer alive.

[0032] Types of flashing modes include: line-side flashing mode and remote flashing mode. Among them, line-side flashing mode refers to a mode in which a flashing task is obtained through a preset host computer. Remote flashing mode refers to a mode in which a flashing task is obtained through a preset server. Remote flashing mode can also be called OTA (Over-the-Air Technology) mode.

[0033] The flashing task to be received refers to the flashing task that the lower computer is about to receive. The types of flashing tasks include remote flashing tasks and line-side flashing tasks. The contents of the flashing tasks include flashing instructions and software packages for updating the target software.

[0034] In an embodiment of the present application, the flashing mode corresponding to the flashing task to be received can be determined by monitoring a preset port. The preset port is used to connect to a preset host computer. The host computer is used to connect to a slave computer and cooperate with the slave computer to complete line-side flashing. If it is monitored that the preset port is connected to the host computer, it can be determined that the flashing task to be received corresponds to the line-side flashing mode. If it is monitored that the preset port is not connected to the host computer, it can be determined that the flashing task to be received corresponds to the remote flashing mode.

[0035] Step S120, determining whether the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received; if yes, executing step S130; if not, executing step S140.

[0036] Step S130: If the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, after receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task.

[0037] The flashing program is used to update the target software using the software package in the flashing task under the instruction of the flashing instruction in the flashing task.

[0038] The types of flashing programs include: remote flashing programs and line-side flashing programs. Among them, the remote flashing program is used to execute remote flashing tasks; the line-side flashing program is used to execute line-side flashing tasks.

[0039] In the embodiment of the present application, the flashing mode and the flashing program have a corresponding relationship. In the remote flashing mode, the remote flashing program is allowed to be called; in the online flashing mode, the online flashing program is allowed to be called. In this way, only when the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, can it be guaranteed that the flashing task can be correctly executed after being received.

[0040] Furthermore, after reading the currently set flashing mode, the flashing program corresponding to the flashing mode can be started; or when calling the flashing program corresponding to the currently set flashing mode, the flashing program can be started, and after the call is ended, the flashing program can be stopped. Calling the flashing program means sending the flashing task to the flashing program so that the flashing program executes the flashing task.

[0041] Step S140: If the currently set flashing mode is different from the flashing mode corresponding to the flashing task to be received, the currently set flashing mode is updated to the flashing mode corresponding to the flashing task to be received and the lower computer is restarted.

[0042] In an embodiment of the present application, the method of restarting the lower computer includes: the lower computer restarts itself; the lower computer shuts down itself, and restarts the lower computer by keeping the lower computer alive through the target device. Among them, restarting the lower computer after the flash mode is updated makes the process corresponding to the lower computer exit and then be pulled up, so as to ensure the stability of the lower computer program. After the lower computer is shut down, the cache data corresponding to the lower computer can be cleared to prevent the data corresponding to different flash modes from having adverse effects and causing flash failure.

[0043] In the embodiment of the present application, since the flash mode and the flash program have a corresponding relationship, when the flash task to be received does not match the currently set flash mode, the currently set flash mode is adjusted so that the adjusted flash mode can call the flash program for executing the flash task. Moreover, after adjusting the currently set flash mode, it is necessary to restart the lower computer so that the adjusted flash mode takes effect, thereby realizing the switching of the flash mode. Afterwards, after restarting the lower computer, it is possible to jump to step S110, read the currently set flash mode again and determine the flash mode corresponding to the flash task to be received. There will be a situation where the currently set flash mode and the flash mode corresponding to the flash task to be received are the same. At this time, after receiving the flash task, the flash program corresponding to the flash mode can be called to execute the flash task.

[0044] In the embodiment of the present application, after the lower computer is started, the currently set flash mode is read and the flash mode corresponding to the flash task to be received is determined; wherein, the lower computer is installed in the target device; the target device starts the lower computer and keeps the lower computer alive after power-on; if the currently set flash mode and the flash mode corresponding to the flash task to be received are the same, then after receiving the flash task, the flash program corresponding to the flash mode is called to execute the flash task; if the currently set flash mode and the flash mode corresponding to the flash task to be received are different, then the currently set flash mode is updated to the flash mode corresponding to the flash task to be received and the lower computer is restarted. In the embodiment of the present application, the lower computer is started and kept alive after the target device is powered on, avoiding the need for technical personnel to manually start the lower computer from time to time according to the software iteration requirements that may arise at any time. In addition, the embodiment of the present application integrates different flashing modes, automatically selects the appropriate flashing mode according to the flashing task to be received, and calls the corresponding flashing program only when the flashing task is executed, thereby realizing automatic selection, automatic startup and shutdown of the flashing program, avoiding manual operation of the flashing program by technical personnel, and avoiding the problem of continuous occupation of system resources due to the flashing program running all the time. Furthermore, the embodiment of the present application realizes automated software flashing on the lower computer side, effectively reducing the workload of technical personnel and improving the efficiency of software flashing.

[0045] In the embodiment of the present application, the line-side flashing program and the remote flashing program are integrated in the lower computer to form a software flashing application (lower computer). Users can automatically meet different flashing needs by installing and using a software flashing application, and technicians only need to maintain a software flashing application, thereby avoiding the need to set up both the line-side flashing application and the remote flashing application in the target device, causing the technicians to install both the line-side flashing application and the remote flashing application, and to maintain both the line-side flashing application and the remote flashing application, which brings many work items to the technicians.

[0046] In order to make the embodiments of the present application easier to understand, the embodiments of the present application will be further described below.

[0047] In an embodiment of the present application, the lower computer is installed in the target device. In order to avoid manually starting the lower computer, the target device starts the lower computer after powering on; after starting the lower computer, the working state of the lower computer is detected; wherein the types of the working state include: normal working state and abnormal working state; when it is detected that the working state of the lower computer is an abnormal working state and has lasted for a preset length of time, the lower computer is restarted. Further, the abnormal working state includes but is not limited to: the lower computer is shut down; the flashing task is abnormal; during the execution of the line-side flashing task, the upper computer and the lower computer are disconnected; during the execution of the remote flashing task, the lower computer and the server port are connected. Restarting the lower computer is used to try to restore the normal operation of the lower computer.

[0048] In the embodiment of the present application, since the time of vehicle production is shorter than the time of vehicle use, and in the vehicle production stage, line-side flashing and remote flashing can be used, after the vehicle leaves the factory, remote flashing is generally used. Therefore, the use time of line-side flashing is shorter than the time of remote flashing. In order to reduce the number of times the flashing mode is switched, the default flashing mode can be set to the remote flashing mode. When there is a need for line-side flashing, the flashing mode is updated from the remote flashing mode to the line-side flashing mode. After the line-side flashing task is completed, the flashing mode is adjusted from the line-side flashing mode back to the default remote flashing mode. Furthermore, in the vehicle production stage, if the whole vehicle or assembly has the ability to connect to the Internet, remote flashing or line-side flashing can be used. If it does not have the ability to connect to the Internet, line-side flashing is used. After the vehicle leaves the factory, if the whole vehicle has the ability to connect to the Internet, remote flashing can be used.

[0049] In the embodiment of the present application, since the flash mode can be adjusted, after the lower computer is started, it is necessary to read the currently set flash mode and determine the flash mode corresponding to the flash task to be received.

[0050] Furthermore, when determining the flashing mode corresponding to the flashing task to be received, it is possible to monitor whether the preset port is externally connected to the preset host computer; if it is monitored that the port is externally connected to the host computer, then the host computer is connected and security authentication is performed on the host computer; after determining that the host computer has passed the security authentication, it is determined that the flashing task to be received corresponds to the line-side flashing mode; if it is monitored that the port is not externally connected to the host computer or it is determined that the host computer has not passed the security authentication, then it is determined that the flashing task to be received corresponds to the remote flashing mode.

[0051] In the embodiment of the present application, when it is determined that the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, the flashing task is received, and after receiving the flashing task, the flashing program corresponding to the flashing mode is called to execute the flashing task. Since the types of flashing modes include remote flashing mode and line-side flashing mode, the remote flashing mode and the line-side flashing mode are described separately below.

[0052] In one case, after reading the currently set flash mode, if the flash mode is the remote flash mode, then after receiving the remote flash task from the preset server, the preset remote flash program is called to execute the remote flash task. The remote flash program may start running when reading that the currently set flash mode is the remote flash mode, or start running the remote flash program when calling the remote flash program and stop running the remote flash program after the call ends. Further, before receiving the remote flash task from the preset server, a connection request sent by the server is received, based on the connection request, a communication connection is established with the server, and based on the communication connection, a remote flash task from the preset server is received.

[0053] Furthermore, in order to avoid the problem of long-term operation of the remote flashing program occupying system resources, the remote flashing program can be run after receiving the remote flashing task from the server; the remote flashing task is sent to the remote flashing program so that the remote flashing program executes the remote flashing task; after the remote flashing task is completed, the remote flashing program is stopped. In other words, when the remote flashing program is called, the remote flashing program is started, and when the call is ended, the remote flashing program is stopped.

[0054] In another case, after reading the currently set flash mode, if the flash mode is the line-side flash mode, then after receiving the line-side flash task from the preset host computer, the preset line-side flash program is called to execute the line-side flash task. Among them, the line-side flash program can start running when it reads that the currently set flash mode is the line-side flash mode, or start running the line-side flash program when calling the line-side flash program and stop running the line-side flash program after the call ends. Further, after monitoring the external preset port of the host computer, before receiving the line-side flash task from the host computer, a communication connection is established with the host computer and security authentication is performed on the host computer. Only after the security authentication of the host computer is passed, the line-side flash task from the host computer is received through the communication connection.

[0055] Furthermore, in order to avoid the problem that the long-term running of the line-side flashing program will occupy system resources, the line-side flashing program can be run after receiving the line-side flashing task from the host computer; the line-side flashing program is sent to the line-side flashing program so that the line-side flashing program executes the line-side flashing task; after the line-side flashing task is completed, the line-side flashing program is stopped. In other words, when the line-side flashing program is called, the line-side flashing program is run, and when the call is completed, the line-side flashing program is stopped.

[0056] Further, if the flash mode of the lower computer is the remote flash mode by default, before calling the preset line-side flash program to execute the line-side flash task, it also includes: updating the currently set flash mode from the line-side flash mode to the remote flash mode; and, after calling the preset line-side flash program to execute the line-side flash task, shutting down the lower computer or restarting the lower computer; or, after calling the preset line-side flash program to execute the line-side flash task, it also includes: updating the currently set flash mode from the line-side flash mode to the remote flash mode; and, shutting down the lower computer or restarting the lower computer. Wherein, after calling the preset line-side flash program to execute the line-side flash task, updating the currently set flash mode from the line-side flash mode to the remote flash mode includes: after detecting that the upper computer is disconnected from the lower computer, updating the currently set flash mode from the line-side flash mode to the remote flash mode. If the lower computer is turned off, the target device will keep the lower computer alive, that is, when it detects that the lower computer has been turned off for a preset time, it will restart the lower computer.

[0057] In the embodiment of the present application, since the flash program is allowed to be called only when it is in its corresponding flash mode, if it is determined that the currently set flash mode is different from the flash mode corresponding to the flash task to be received, the flash task to be received is directly discarded after it is received. For example: if the currently set flash mode is the line-side flash mode, the received remote flash task is discarded; if the currently set flash mode is the remote flash mode, the received line-side flash task is discarded.

[0058] In an embodiment of the present application, if it is determined that the currently set flashing mode is different from the flashing mode corresponding to the flashing task to be received, the currently set flashing mode is updated to the flashing mode corresponding to the flashing task to be received and the lower computer is restarted. Among them, the flag bit can be used to identify the currently set flashing mode. Further, when it is necessary to adjust the currently set flashing mode, the currently set flag information is updated; wherein, the remote flashing mode corresponds to the first flag information and the line-side flashing mode corresponds to the second flag information; when it is detected that the flag information is updated from the first flag information to the second flag information, or, from the second flag information to the first flag information, the lower computer is restarted. Flag information refers to the value of the flag bit. The first flag information can be a first preset value. The second flag information can be a second preset value. The first preset value and the second preset value are different. Of course, one of the first flag information and the second flag information can be set to a null value, and the other can be set to a numerical value.

[0059] After adjusting the currently set flash mode by updating the flag information, restart the lower computer; after restarting the lower computer, the currently set flash mode can be re-read and the flash mode corresponding to the flash task to be received can be determined. At this time, the currently set flash mode is the same as the flash mode corresponding to the flash task to be received. After receiving the flash task, the flash program corresponding to the flash mode can be called to execute the flash task. In an embodiment of the present application, an automated software flash operation can be implemented on the lower computer side, without the need for a technician to manually start the lower computer, and even more without the need for a technician to manually open and close the flash program, which effectively reduces the technician's operating steps, reduces the technician's workload, and improves the software flash efficiency. If the upper computer is set in a software flash platform and multiple target devices are connected to the software flash platform, the lower computers set in multiple target devices can be used separately to complete the software update.

[0060] In the embodiment of the present application, the software flashing method of the embodiment of the present application can be used both in the vehicle production stage and after the vehicle leaves the factory. Since the flashing program can be started when called, whether in the vehicle production stage or after the vehicle leaves the factory, the line-side flashing program or the remote flashing program will not occupy system resources for a long time. When the line-side flashing program is used, the remote flashing program is closed, and when the remote flashing program is used, the line-side flashing program is closed. Moreover, the embodiment of the present application integrates the remote flashing program and the line-side flashing program in the lower computer, and the technicians only need to maintain the corresponding program of the lower computer, without the need to separately maintain the two sets of programs, the remote flashing program and the line-side flashing program, thereby saving maintenance costs. Furthermore, in the embodiment of the present application, since the flashing task can be run after receiving the flashing task, and the flashing program can be stopped after the flashing task is completed, when the target device keeps the lower computer alive, if there is no flashing task, the lower computer only needs to maintain a small amount of program code running, such as: maintaining the code running of the port monitoring function, and the lower computer does not need to run all the program code, avoiding the problem of running the flashing program that is not used and occupying system resources. Especially after the vehicle leaves the factory, if the line-side flashing program is no longer used, then keeping the line-side flashing program running will inevitably cause the problem of useless programs occupying system resources.

[0061] A more specific example is provided below to describe the software flashing method of an embodiment of the present application.

[0062] like Figure 2 , which is an architectural diagram of a software flashing method according to an embodiment of the present application.

[0063] In the embodiment of the present application, the remote flashing is an OTA program. The line-side flashing includes: a host computer program (lite_master) and an embedded program. The host computer program is set in the user terminal, and the embedded program (line-side flashing program) is merged with the OTA program (remote flashing program) to form a flashing program (submaster) and set in the lower computer.

[0064] In the embodiment of the present application, the host computer refers to the host computer program set in the user terminal. The lower computer refers to the lower computer program set in the target device. The user terminal can be a PC (Personal Computer). The target device can be a whole vehicle or an assembly of a whole vehicle. The host computer can interact with the lower computer via Ethernet. The cloud server can interact with the lower computer via the Internet. In this way, line-side flashing can be completed through the host computer, and OTA upgrade can be completed through the cloud server.

[0065] The following describes the specific process of selecting the flash program.

[0066] In this example, the remote flash mode is used as the default flash mode, and the line-side flash task is used as the flash task to be executed in this example. Thus, referring to the above embodiment, it can be known that in this example, the lower computer needs to be started twice to complete the line-side flash task.

[0067] Based on the above settings, the following describes the steps for selecting the flash program. Figure 3 , is a flow chart of the selection steps of the flashing procedure according to an embodiment of the present application.

[0068] Step S310, the lower computer starts.

[0069] In this example, after the target device is powered on, it starts the lower computer and keeps the lower computer alive.

[0070] Step S320, monitoring the port in the target device for connecting to an external host computer.

[0071] The lower computer can be started multiple times and does not require manual triggering.

[0072] In this example, after each startup, the lower computer starts to listen to the port used to connect to the upper computer. Further, it can be preset to allow only the upper computer to connect to the port.

[0073] In this example, in order to describe the process of line-side flashing, the host computer is already connected to the port.

[0074] Step S330, determine whether the port monitoring is successful; if yes, execute step S340; if not, jump to step S320.

[0075] Successful port monitoring indicates that the port is connected to a host computer and may require line-side flashing.

[0076] Port monitoring failure means that the port is not connected to an external host computer.

[0077] In this example, after the lower computer is started, it continues to determine whether the port monitoring is successful until the lower computer is shut down.

[0078] Furthermore, when the port is monitored to be connected to an external host computer, that is, when the monitoring is successful, a connection can be established between the host computer and the host computer so that the host computer and the host computer can communicate; based on the connection between the host computer and the host computer, a security authentication is performed on the host computer; if the security authentication fails, an authentication failure message is returned to the host computer, and the connection between the host computer and the host computer is disconnected; if the security authentication passes, an authentication success message is returned to the host computer and the currently set flag is read to determine whether the currently set flag corresponds to the line-side flushing mode.

[0079] like Figure 4As shown, it is a timing diagram of security authentication according to an embodiment of the present application. The upper computer requests a seed from the lower computer; the lower computer returns the seed to the upper computer; wherein the seed can be a random number used for security authentication; the upper computer encrypts the seed with a pre-stored encryption key to obtain authentication information, and sends the authentication information to the lower computer so that the lower computer can perform key authentication, that is: the lower computer uses a pre-stored decryption key to decrypt the authentication information. If the decrypted data is the same as the random number, it is determined that the security authentication is passed, otherwise, it is determined that the security authentication is not passed; finally, the lower computer returns the authentication result (authentication passed message or authentication failed message) to the upper computer. wherein, the encryption key and the decryption key can be the same key.

[0080] Further, after it is determined that the host computer has passed the security authentication, it can be determined that the flashing task to be received is a line-side flashing task. At this time, it is necessary to wait for receiving the line-side flashing task.

[0081] Step S340, read the currently set flag bit.

[0082] Step S350, determine whether the flag is a preset value; if yes, execute step S360; if not, execute step S380.

[0083] In this example, the flag bit can be preset to a null value corresponding to the remote writing mode, and the flag bit can be preset to a preset value corresponding to the line-side writing mode.

[0084] The flushing task to be received is a line-side flushing task, which corresponds to a line-side flushing mode, that is, a preset value. This step is equivalent to determining whether the currently set flushing mode is the same as the flushing mode corresponding to the flushing task to be received.

[0085] Step S360, clearing the preset value in the flag.

[0086] After clearing the flag, the flag is empty. In this way, after the online flash program is executed, the lower computer is restarted and the lower computer returns to the remote flash mode, that is, after executing the required online flash, it returns to the default flash mode.

[0087] Step S370 , selecting and starting a line-by-line flashing program corresponding to the line-by-line flashing mode, so as to use the line-by-line flashing program to execute the received line-by-line flashing task.

[0088] In this example, after the port monitoring is successful, it starts to wait for the line-side flashing task sent by the upper computer; if the flag is a preset value, it means that the currently set flashing mode is the line-side flashing mode, and the line-side flashing program can be used to execute the line-side flashing task; if the flag is a null value, it means that the currently set flashing mode is still the remote flashing mode, and the received line-side flashing task can be discarded first. Furthermore, when the upper computer passes the security authentication and the flag is a preset value, the lower computer can receive the line-side flashing task generated by the upper computer through the connection between the upper computer and the lower computer, and can normally process the line-side flashing task sent by the upper computer.

[0089] In this example, after the connection is established between the upper computer and the lower computer, the upper computer sends a heartbeat packet to the lower computer every preset heartbeat time period. The lower computer monitors the heartbeat packet sent by the upper computer; if the time from the last time a heartbeat packet was received has exceeded the preset heartbeat time threshold, it means that the connection between the upper computer and the lower computer has been disconnected, and there is no need to execute the line-side flushing task, the lower computer is shut down, and this process ends. Furthermore, the target device can detect the working status of the lower computer in real time, for example: the target device detects that the port can receive the heartbeat packet normally, but the lower computer does not return a response packet, and the lower computer is shut down, so that the target device can determine that the lower computer is in an abnormal working state. If the time for which the lower computer is in an abnormal working state exceeds the preset time length, the target device restarts the lower computer.

[0090] In this example, after executing the line-side flashing task using the line-side flashing program, the lower computer sends an execution completion message to the upper computer through the port and receives a line-side flashing task completion message sent by the upper computer; after receiving the line-side flashing task completion message from the upper computer, the lower computer can be shut down. Afterwards, the lower computer can be started again based on the keep-alive mechanism of the target device.

[0091] Step S380, set the flag to a preset value and restart the lower computer.

[0092] After the upper computer passes the security authentication, if the flag is not the preset value, it means that even if the upper computer passes the security authentication, the upper computer cannot perform line-side flashing because the currently set flashing mode is not the line-side flashing mode. At this time, the lower computer not only needs to send an authentication pass message to the upper computer through the port, but also needs to send a reconnection instruction to the upper computer and disconnect the connection between the upper computer and the lower computer. The reconnection instruction is used to instruct the upper computer to connect to the lower computer again after the lower computer is restarted. After receiving the authentication pass message and the reconnection message, the upper computer waits for the connection between the upper computer and the lower computer to be disconnected, and then reconnects to the lower computer at an interval of the preset lower computer restart time. If the reconnection is successful, the security authentication needs to be re-performed; if the reconnection fails for a preset number of consecutive times, the reconnection is stopped and the line-side flashing task is terminated.

[0093] The present application also provides a software flashing device. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 5 , which is a structural diagram of a software flashing device according to an embodiment of the present application.

[0094] The software flashes the device, including:

[0095] The reading and determining module 510 is used to read the currently set flashing mode and determine the flashing mode corresponding to the flashing task to be received after the lower computer is started; wherein the lower computer is installed in the target device; the target device starts the lower computer and keeps the lower computer alive after power-on.

[0096] The calling and executing module 520 is used to call the flashing program corresponding to the flashing mode to execute the flashing task after receiving the flashing task if the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received.

[0097] The updating and starting module 530 updates the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarts the lower computer if the currently set flashing mode is different from the flashing mode corresponding to the flashing task to be received.

[0098] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.

[0099] The present application also provides a software flashing device, such as Figure 6 , which is a structural diagram of a software flashing device according to an embodiment of the present application.

[0100] The software flashing device includes: a processor 610, a communication interface 620, a memory 630 and a communication bus 640. The processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640.

[0101] The memory 630 is used to store computer programs.

[0102] In one embodiment of the present application, the processor 610, when executing the program stored in the memory 630, implements the software flashing method provided by any of the aforementioned method embodiments, including: after the lower computer is started, reading the currently set flashing mode and determining the flashing mode corresponding to the flashing task to be received; wherein the lower computer is installed in the target device; the target device starts the lower computer after power-on and keeps the lower computer alive; if the currently set flashing mode and the flashing mode corresponding to the flashing task to be received are the same, then after receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task; if the currently set flashing mode and the flashing mode corresponding to the flashing task to be received are different, then updating the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarting the lower computer.

[0103] Wherein, the target device starts the lower computer and keeps the lower computer alive after power-on, including: the target device starts the lower computer after power-on; after starting the lower computer, detects the working status of the lower computer; wherein the types of the working status include: normal working status and abnormal working status; when it is detected that the working status of the lower computer is an abnormal working status and has lasted for a preset time length, restarts the lower computer.

[0104] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; the determination of the flashing mode corresponding to the flashing task to be received includes: monitoring whether the preset port is externally connected to a preset host computer; if it is monitored that the port is externally connected to the host computer, connecting to the host computer and performing security authentication on the host computer; after determining that the host computer has passed the security authentication, determining that the flashing task to be received corresponds to the line-side flashing mode; if it is monitored that the port is not externally connected to the host computer or it is determined that the host computer has not passed the security authentication, determining that the flashing task to be received corresponds to the remote flashing mode.

[0105] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; after receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task, including: if the flashing mode is the remote flashing mode, then after receiving the remote flashing task from the preset server, calling the preset remote flashing program to execute the remote flashing task; if the flashing mode is the line-side flashing mode, then after receiving the line-side flashing task from the preset host computer, calling the preset line-side flashing program to execute the line-side flashing task.

[0106] Among them, after receiving the remote flash task from the preset server, calling the preset remote flash program to execute the remote flash task, including: after receiving the remote flash task from the server, running the remote flash program; sending the remote flash task to the remote flash program so that the remote flash program executes the remote flash task; after the remote flash task is completed, stopping the remote flash program.

[0107] Among them, after receiving the line-side flashing task from the preset host computer, calling the preset line-side flashing program to execute the line-side flashing task, including: after receiving the line-side flashing task from the host computer, running the line-side flashing program; sending the line-side flashing program to the line-side flashing program so that the line-side flashing program executes the line-side flashing task; after the line-side flashing task is completed, stopping the running of the line-side flashing program.

[0108] Among them, the types of flashing modes include: line-side flashing mode and remote flashing mode; wherein, the flashing mode of the lower computer by default is the remote flashing mode; before calling the preset line-side flashing program to execute the line-side flashing task, it also includes: updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode; and, after calling the preset line-side flashing program to execute the line-side flashing task, shutting down the lower computer or restarting the lower computer; or, after calling the preset line-side flashing program to execute the line-side flashing task, it also includes: updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode; and shutting down the lower computer or restarting the lower computer.

[0109] Wherein, after calling the preset line-side flashing program to execute the line-side flashing task, updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode includes:

[0110] After detecting that the upper computer is disconnected from the lower computer, the currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode.

[0111] Among them, updating the currently set flash mode to the flash mode corresponding to the flash task to be received and restarting the lower computer includes: updating the currently set flag information; wherein the remote flash mode corresponds to the first flag information and the line-side flash mode corresponds to the second flag information; upon detecting that the flag information is updated from the first flag information to the second flag information, or, from the second flag information to the first flag information, restarting the lower computer.

[0112] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the software flashing method provided in any of the above method embodiments are implemented. Since the software flashing method has been described in detail above, for the details not fully described in the description of this embodiment, please refer to the relevant description in the above embodiments, and no further description will be given here.

[0113] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0115] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0116] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A software flashing method, characterized in that: include: After the lower computer is started, the currently set flashing mode is read and the flashing mode corresponding to the flashing task to be received is determined; wherein the lower computer is installed in the target device; the target device starts the lower computer after power-on and keeps the lower computer alive; If the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, after receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task; If the currently set flashing mode is different from the flashing mode corresponding to the to-be-received flashing task, the currently set flashing mode is updated to the flashing mode corresponding to the to-be-received flashing task and the lower computer is restarted.

2. The method according to claim 1, characterized in that The target device starts the lower computer after powering on and keeps the lower computer alive, including: After the target device is powered on, the lower computer is started; After starting the lower computer, detecting the working state of the lower computer; wherein the types of the working state include: normal working state and abnormal working state; When it is detected that the working state of the lower computer is an abnormal working state and has lasted for a preset time length, the lower computer is restarted.

3. The method according to claim 1, characterized in that The types of the flashing modes include: line-side flashing mode and remote flashing mode; The step of determining the flashing mode corresponding to the flashing task to be received includes: Monitor the preset port to see if it is connected to the preset host computer; If it is monitored that the port is connected to the host computer, connect to the host computer and perform security authentication on the host computer; After determining that the host computer passes the security authentication, determining that the flashing task to be received corresponds to a line-side flashing mode; If it is monitored that the port is not externally connected to the host computer or it is determined that the host computer has not passed the security authentication, it is determined that the flashing task to be received corresponds to the remote flashing mode.

4. The method according to claim 1, characterized in that Claims The types of the flashing modes include: line-side flashing mode and remote flashing mode; After receiving the flashing task, calling the flashing program corresponding to the flashing mode to execute the flashing task includes: If the flashing mode is the remote flashing mode, after receiving the remote flashing task from the preset server, calling the preset remote flashing program to execute the remote flashing task; If the flashing mode is the line-by-line flashing mode, after receiving the line-by-line flashing task from the preset host computer, a preset line-by-line flashing program is called to execute the line-by-line flashing task.

5. The method according to claim 4, characterized in that After receiving the remote flash task from the preset server, calling a preset remote flash program to execute the remote flash task includes: After receiving the remote flashing task from the server, running the remote flashing program; Sending the remote flashing task to the remote flashing program so that the remote flashing program executes the remote flashing task; After the remote flashing task is completed, the remote flashing program is stopped.

6. The method according to claim 4, characterized in that After receiving the line-side flashing task from the preset host computer, calling the preset line-side flashing program to execute the line-side flashing task includes: After receiving the line-side flashing task from the host computer, running the line-side flashing program; Sending the line-side flashing program to the line-side flashing program so that the line-side flashing program executes the line-side flashing task; After the line-side flashing task is completed, the line-side flashing program is stopped.

7. The method according to claim 4, characterized in that The types of the flashing modes include: line-side flashing mode and remote flashing mode; wherein the flashing mode of the lower computer by default is the remote flashing mode; Before calling the preset line-side flashing program to execute the line-side flashing task, the method further includes: The currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode; and after calling the preset line-side flashing program to execute the line-side flashing task, the lower computer is shut down or restarted; Alternatively, after calling a preset line-side flashing program to execute the line-side flashing task, the method further includes: Claims The currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode; and the lower computer is shut down or restarted.

8. The method according to claim 7, characterized in that After calling the preset line-side flashing program to execute the line-side flashing task, updating the currently set flashing mode from the line-side flashing mode to the remote flashing mode, including: After detecting that the upper computer is disconnected from the lower computer, the currently set flashing mode is updated from the line-side flashing mode to the remote flashing mode.

9. The method according to claim 1, characterized in that: The updating of the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarting the lower computer includes: Update the currently set flag information; wherein the remote flash mode corresponds to the first flag information and the line-side flash mode corresponds to the second flag information; When it is detected that the flag information is updated from the first flag information to the second flag information, or from the second flag information to the first flag information, the lower computer is restarted.

10. A software flashing device, characterized in that: include: A reading and determining module, used for reading the currently set flashing mode and determining the flashing mode corresponding to the flashing task to be received after the lower computer is started; wherein the lower computer is installed in the target device; the target device starts the lower computer and keeps the lower computer alive after power-on; a calling and executing module, configured to, if the currently set flashing mode is the same as the flashing mode corresponding to the flashing task to be received, call the flashing program corresponding to the flashing mode to execute the flashing task after receiving the flashing task; The update and start module updates the currently set flashing mode to the flashing mode corresponding to the flashing task to be received and restarts the lower computer if the currently set flashing mode is different from the flashing mode corresponding to the flashing task to be received.

11. A software flashing device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: execute a software flashing program stored in the memory to implement the software flashing method according to any one of claims 1-9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement the software flashing method according to any one of claims 1 to 9.