Updating method and device of switching system, storage medium and electronic equipment
By obtaining the version information of the first version of the bootloader associated with the switching system, the Swap system was updated, which solved the problem of the Swap system being unable to be updated and reduced the probability and cost of hardware replacement.
Patent Information
- Application Number
- CN202411085730.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-19
AI Technical Summary
In existing technologies, the update technology of the Swap system is not applicable to vehicle updates, which means that when there are vulnerabilities in the Swap system, they cannot be overcome by updates, requiring hardware replacement and increasing costs.
By obtaining the version information of the first version of the bootloader associated with the switching system, updating to the first version of the bootloader, and entering boot mode, the switching system is updated using the burning file, thus realizing the update of the Swap system.
By updating the Swap system, operating system vulnerabilities can be overcome, reducing or avoiding the probability of hardware replacement and thus reducing costs.
Smart Images

Figure CN118981328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to vehicle software update technology, and in particular to an update method, device, storage medium and electronic device for a switching system. Background Art
[0002] The swap system is also called the Swap system, which is used to verify the integrity of the Boot and ensure that the program jumps to the Boot. The Boot is used to verify the integrity of the application (Application, referred to as App) and App upgrades, and the Boot has a self-upgrade function.
[0003] In the related technologies, as the Internet of Vehicles technology gradually matures, Boot and APP are usually updated through Over-The-Air (OTA) technology. Specifically, manufacturers can use OTA technology to transfer updated program files from the cloud to the vehicle's central gateway, and then upgrade, repair and optimize the vehicle's Boot or APP through the vehicle's internal network. However, the update technology in the related technologies is usually set for Boot and APP, and is not suitable for updating the Swap system. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one purpose of the present application is to propose a method, device, storage medium and electronic device for updating a switching system, which can overcome the vulnerability of the operating system by updating the switching system, thereby reducing the probability of replacing the corresponding hardware, or even avoiding the replacement of the corresponding hardware.
[0005] In a first aspect, this embodiment provides a method for updating a switching system, including:
[0006] Obtaining version information of a first version of a boot program associated with a switching system; wherein the first version of the boot program can be flashed into a memory address of the switching system;
[0007] When the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program, updating the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program;
[0008] Run the updated second version of the bootloader and enter boot mode;
[0009] In the boot mode, the switching system is updated based on a burning file.
[0010] In some embodiments, in the boot mode, updating the switching system based on the burning file includes:
[0011] In the boot mode, in response to confirming the instruction to update the switching system, the switching system is updated based on the acquired burning file.
[0012] In some embodiments, updating the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program includes:
[0013] Based on the version information of the first version of the boot program, obtaining the code of the first version of the boot program;
[0014] Based on the code of the first version of the boot program, the current second version of the boot program is updated to the first version of the boot program in a self-update mode.
[0015] In some embodiments, updating the current second version of the boot program to the first version of the boot program includes:
[0016] The second version of the boot program in the first storage area and the second storage area are both updated to the first version of the boot program; wherein the boot program in the first storage area and the boot program in the second storage area are backed up for each other.
[0017] In some embodiments, the updating method further includes:
[0018] Get the burning file;
[0019] Obtain the memory address corresponding to the burning file;
[0020] When the memory address corresponding to the burning file is the memory address corresponding to the switching system, it is determined to update the switching system.
[0021] In some embodiments, the updating method further includes:
[0022] When the memory address corresponding to the burning file is the memory address corresponding to the boot program, the boot program is updated based on the burning file.
[0023] In some embodiments, after updating the switching system based on the burning file, the method further includes:
[0024] Based on the version information of the second version of the boot program, the first version of the boot program is updated back to the second version of the boot program.
[0025] In a second aspect, this embodiment provides an updating device for a switching system, including:
[0026] An acquisition unit, used for acquiring version information of a first version of a boot program associated with a switching system; wherein the first version of the boot program can be flashed into a memory address of the switching system;
[0027] A first processing unit, configured to update the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program when the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program;
[0028] A second processing unit, configured to run the updated second version of the boot program and enter a boot mode;
[0029] The third processing unit is configured to update the switching system based on a burning file in the boot mode.
[0030] In a third aspect, this embodiment provides an electronic device, the electronic device comprising:
[0031] one or more processors;
[0032] A memory for storing one or more programs;
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above.
[0034] In a fourth aspect, this embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods described above.
[0035] The updating method, device, storage medium and electronic device of the switching system provided by the embodiments of the present application obtain the version information of the first version boot program associated with the switching system; wherein the first version boot program can be flashed into the memory address of the switching system; when the version information of the first version boot program is inconsistent with the version information of the current second version boot program, based on the version information of the first version boot program, the current second version boot program is updated to the first version boot program; the updated second version boot program is run and enters the boot mode; in the boot mode, the switching system is updated based on the burned file, so that the first version boot program associated with the switching system can be used to implement the update of the switching system, so that the vulnerability of the operating system can be overcome by updating the switching system, thereby reducing the probability of replacing the corresponding hardware, or even avoiding the replacement of the corresponding hardware.
[0036] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of a method for updating a switching system provided by an exemplary embodiment;
[0038] Figure 2 is a schematic diagram of updating a first storage area and a second storage area provided by an exemplary embodiment;
[0039] Figure 3 is a schematic diagram of updating a first storage area and a second storage area provided by another exemplary embodiment;
[0040] Figure 4 is a schematic structural diagram of an updating device of a switching system provided by an exemplary embodiment;
[0041] Figure 5 The present invention is a schematic structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0042] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0043] In the related technologies, as the Internet of Vehicles technology gradually develops and matures, Boot and APP are usually updated through Over-The-Air (OTA) technology. Specifically, manufacturers can use OTA technology to transfer updated program files from the cloud to the vehicle's central gateway, and then upgrade, repair and optimize the vehicle's Boot or APP through the vehicle's internal network. However, the update technology in the related technologies is usually set for Boot and APP, and is not suitable for updating the Swap system. This leads to some scenarios where the Swap needs to be updated. For example, when the current Swap causes some vulnerabilities in the operating system, it is impossible to overcome the system vulnerabilities by updating the Swap system, but to overcome them by replacing the corresponding hardware, resulting in higher costs.
[0044] In order to overcome the above problems, this embodiment provides a method for updating a switching system, which can implement an operating system update by using a boot program associated with the switching system, thereby overcoming operating system vulnerabilities by updating the switching system.
[0045] The following describes an implementation process of the updating method of the switching system according to an embodiment of the present application with reference to the accompanying drawings for illustration.
[0046] Figure 1FIG. 1 is a flow chart of a method for updating a switching system provided by an exemplary embodiment. Figure 1 The updating method of the switching system provided in this embodiment includes the following steps:
[0047] Step S110, obtaining version information of a first version of the boot program associated with the exchange system; wherein the first version of the boot program can be flashed into a memory address of the exchange system;
[0048] Step S120: when the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program, the current second version of the boot program is updated to the first version of the boot program based on the version information of the first version of the boot program;
[0049] Step S130, running the updated first version of the boot program and entering the boot mode;
[0050] Step S140: In the boot mode, update the exchange system based on the burned file.
[0051] The execution subject of this embodiment may be a terminal, which may be used to display a graphical user interface. The terminal is used to interact with the user through the graphical user interface, for example, by downloading and installing a corresponding client and running it, for example, by calling and running a corresponding applet, for example, by logging into a website and presenting a corresponding graphical user interface, etc.
[0052] In step S110, for ease of description, the updated switching system is referred to as a new version of the switching system. When it is determined that the switching system needs to be updated, the version information of the first version of the boot program associated with the new version of the switching system is searched according to the version information of the new version of the switching system. The first version of the boot program can be flashed into the memory address of the corresponding switching system to support the update of the switching system. Exemplarily, the first version of the boot program includes a module that can launch the installation program of the new version of the switching system.
[0053] In addition, in some examples, before obtaining the version information of the first version boot program associated with the new version of the exchange system, the version information of the exchange system and the version information of the associated first version boot program can be obtained in advance. The version information of the exchange system and the version information of the associated first version boot program can be stored in the cloud or locally or on the server. The version information of the exchange system and the version information of the associated first version boot program can be stored in the form of a list.
[0054] In other examples, a request for obtaining version information of the first version of the boot program associated with the new version of the switching system may also be sent to the cloud or server. The cloud or server searches for version information of the first version of the boot program associated with the new version of the switching system according to the request and returns the version information to the terminal.
[0055] In step S120, the version information of the second version of the boot program currently on the terminal is obtained, and the version information of the first version of the boot program associated with the new version of the exchange system is compared with the version information of the second version of the boot program. If the two are inconsistent, the current second version of the boot program is updated to the first version of the boot program based on the version information of the first version of the boot program to support the update of the exchange system. The version information includes a version number. If the version number of the first version of the boot program associated with the new version of the exchange system is the same as the version number of the current second version of the boot information, it is confirmed that the version information of the two is consistent.
[0056] It can be understood that: if the obtained version information of the first version boot program associated with the new version of the exchange system is consistent with the version information of the second version boot information, the current second version boot program is directly run and the boot mode is entered.
[0057] In step S130, the first version of the boot program associated with the new version of the exchange system is run and the boot mode is entered. The first version of the boot program and the second version of the boot program in this embodiment are both primary bootloaders (PBL) in the boot program.
[0058] PBL is mainly used to perform the initialization of the vehicle's electronic control unit and the detection of the underlying hardware. The boot program also includes a secondary bootloader (SBL), which is used to read data from the storage medium and load it into the memory for execution. Generally speaking, SBL needs to run and be activated in PBL mode.
[0059] In step S140, after entering the PBL mode, the installation program of the new version of the exchange system can be pulled up, and the installation program of the new version of the exchange system can be run to update the exchange system. Among them, the burning file includes the installation program of the new version of the exchange system. When the current vehicle supports OTA technology, the burning file can be obtained from the device connected to the terminal communication, and can also be obtained through OTA technology. When the current vehicle does not support OTA technology, the burning file can be obtained from the device connected to the terminal communication.
[0060] The updating method of the switching system provided in the present embodiment obtains the version information of the first version boot program associated with the switching system; wherein the first version boot program can be flashed into the memory address of the switching system; when the version information of the first version boot program is inconsistent with the version information of the current second version boot program, based on the version information of the first version boot program, the current second version boot program is updated to the first version boot program; the updated second version boot program is run, and the boot mode is entered; in the boot mode, the switching system is updated based on the burned file, so that the first version boot program associated with the switching system can be used to implement the update of the switching system, so that the vulnerability of the operating system can be overcome by updating the switching system, thereby reducing the probability of replacing the corresponding hardware, or even avoiding the replacement of the corresponding hardware.
[0061] In some embodiments, step S103, in the boot mode, updating the exchange system based on the burned file, includes:
[0062] In the boot mode, in response to confirming the instruction to update the switching system, the switching system is updated based on the acquired burning file.
[0063] In some examples, after entering the boot mode, a prompt message can be generated and displayed in the form of a pop-up window. At the same time, two options can be provided to the customer, one of which is "Update" or "Confirm" for the user to click to confirm updating the exchange system, and the other is "Cancel" or "Exit" for the user to click to cancel updating the exchange system.
[0064] In specific implementation, within a preset time period, in response to the user's instruction to confirm updating the switching system, the switching system is updated based on the acquired burning file; if no user response is received within the preset time period, the updating of the switching system is canceled; within the preset time period, in response to the user's instruction to cancel updating the switching system, the updating of the switching system is canceled.
[0065] In other instances, after entering the boot mode, the terminal can display a corresponding graphical user interface, in which options such as "Update" or "Confirm" can be displayed for the user to click to update the exchange system; the graphical user interface can also display options such as "Cancel" or "Exit" to cancel the update of the exchange system.
[0066] In other embodiments, after the terminal displays options such as "Update" or "Confirm" for the user to click to update the switching system, and options such as "Cancel" or "Exit" for the user to click to cancel updating the switching system, if no user response is received within a preset time period, the switching system is updated based on the acquired burning file.
[0067] In this embodiment, the user clicks to further confirm the update of the switching system, so as to avoid the terminal entering the boot mode and performing unnecessary operations on the switching system due to factors such as accidental touch, which is conducive to ensuring the reliable operation of the system on the terminal.
[0068] In some embodiments, step S102, based on the version information of the first version of the boot program, updating the current second version of the boot program to the first version of the boot program, includes the following steps a1 to a2:
[0069] Step a1: based on the version information of the first version of the boot program, obtain the code of the first version of the boot program;
[0070] Step a2: Based on the code of the first version of the boot program, the current second version of the boot program is updated to the first version of the boot program in a self-update mode.
[0071] In step a1, the code of the first version of the boot program can be downloaded from the cloud or the server, wherein the download time of the first version of the boot program is later than the installation time of the second version of the boot program.
[0072] In step a2, before performing self-update, the main program module of the second version boot program is started and checks whether there is a newly downloaded boot program, that is, the first version boot program; if it is determined that there is a first version boot program, the second version boot program can be replaced by the first version boot program; if it is determined that there is no first version boot program, the second version boot program continues to run.
[0073] In this embodiment, the convenience can be improved and the user experience can be enhanced by the self-update method. Of course, the implementation process of the boot program self-update is not limited to this, and this embodiment is only used as an example.
[0074] In some embodiments, step S102, updating the current second version boot program to the first version boot program, includes: updating the second version boot program in the first storage area and the second storage area to the first version boot program; wherein the boot program in the first storage area and the boot program in the second storage area back up each other.
[0075] In specific implementation, the first storage area and the second storage area are pre-set, and the first storage area and the second storage area are backed up for each other. When updating the boot program, one of the first storage area and the second storage area can be updated first, and then the other can be updated after completion.
[0076] Figure 2 is a schematic diagram of updating the first storage area and the second storage area provided by an exemplary embodiment. Figure 2, take the first storage area as Bank A, the second storage area as Bank B, the first version of the boot program includes Pbl0* and Pbl1*, and the second version of the boot program includes Pbl0 and Pbl2 as an example. In some examples, first update Pbl0 of Bank A to Pbl0*, and update Pbl1 of Bank A to Pbl1*; then update Pbl0 of Bank B to Pbl0*, and update Pbl1 of Bank A to Pbl1*. In other examples, first update Pbl1 of Bank A to Pbl1*, update Pbl1 of Bank B to Pbl1*, then update Pbl0 of Bank A to Pbl0*, and update Pbl0 of Bank B to Pbl0*.
[0077] In some embodiments, the updating method of the switching system further includes the following steps b1 to b3:
[0078] Step b1, obtaining the burning file;
[0079] Step b2, obtaining the memory address corresponding to the burning file;
[0080] Step b3, when the memory address corresponding to the burning file is the memory address corresponding to the switching system, determining to update the switching system;
[0081] Step b4: when the memory address corresponding to the burning file is the memory address corresponding to the boot program, the boot program is updated based on the burning file.
[0082] In step b1, the burning file may be obtained from a host computer connected to the terminal, or the burning file may be obtained through OTA technology.
[0083] In step b2, generally speaking, the switching system and the boot program correspond to different memory addresses. When the burning file is used to update the switching system, the memory address corresponding to the burning file is the memory address corresponding to the switching system. When the burning file is used to update the boot program, the memory address corresponding to the burning file is the memory address corresponding to the boot program.
[0084] Therefore, whether to update the switching system can be determined by whether the memory address corresponding to the burning file is the memory address of the switching system. When it is determined based on the memory address corresponding to the burning file that the switching system is to be updated, step b3 is executed. Of course, when it is determined based on the memory address corresponding to the burning file that the boot program is to be updated, step b4 is executed.
[0085] In some embodiments, after step S140, the updating method of the switching system of this embodiment further includes: updating the first version of the boot program back to the second version of the boot program based on the version information of the second version of the boot program.
[0086] After the exchange system is updated, the first version of the boot program is updated back to the second version of the boot program, that is, the first version of the boot program is replaced with the second version of the boot program to ensure that all programs on the terminal can run normally. Before the current second version of the boot program is updated to the first version of the boot program, the version information of the second version of the boot program and / or the code of the second version of the boot program are saved.
[0087] Figure 3 FIG. 1 is a schematic diagram of updating the first storage area and the second storage area provided by another exemplary embodiment. Figure 3 , take the first storage area as Bank A, the second storage area as Bank B, the first version of the boot program includes Pbl0* and Pbl1*, and the second version of the boot program includes Pbl0 and Pbl2 as an example. In some examples, first update Pbl0* of Bank A to Pbl0, and update Pbl1* of Bank A to Pbl1; then update Pbl0* of Bank B to Pbl0, and update Pbl1* of Bank A to Pbl1. In other examples, first update Pbl1* of Bank A to Pbl1, update Pbl1* of Bank B to Pbl1, then update Pbl0* of Bank A to Pbl0, and update Pbl0* of Bank B to Pbl0.
[0088] The updating method provided in this embodiment can implement the updating of the switching system, can solve the vulnerability caused by the inability to update the switching system, and prevent the loss caused by replacing hardware.
[0089] In order to better implement the updating method of the switching system of the embodiment of the present application, the embodiment of the present application also provides an updating device of the switching system. Figure 4 For a structural diagram of an updating device of a display switching system provided in an embodiment of the present application, please refer to Figure 4 , the device includes the following units:
[0090] The acquisition unit 410 is used to acquire version information of a first version of the boot program associated with the exchange system; wherein the first version of the boot program can be flashed into a memory address of the exchange system;
[0091] The first processing unit 420 is configured to update the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program when the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program;
[0092] The second processing unit 430 is used to run the updated second version of the boot program and enter the boot mode;
[0093] The third processing unit 440 is used to update the exchange system based on the burning file in the boot mode.
[0094] In some embodiments, the third processing unit is specifically configured to:
[0095] In the boot mode, in response to confirming the instruction to update the switching system, the switching system is updated based on the acquired burning file.
[0096] In some embodiments, the first processing unit is specifically configured to:
[0097] Based on the version information of the first version of the boot program, the code of the first version of the boot program is obtained;
[0098] Based on the code of the first version of the boot program, the current second version of the boot program is updated to the first version of the boot program in a self-updating mode.
[0099] In some embodiments, the first processing unit is specifically configured to:
[0100] The second version of the boot program in the first storage area and the second storage area are both updated to the first version of the boot program; wherein the boot program in the first storage area and the boot program in the second storage area are backed up for each other.
[0101] In some embodiments, the updating device of the switching system further includes a fourth processing unit configured to:
[0102] Get the burning file;
[0103] Get the memory address corresponding to the burning file;
[0104] When the memory address corresponding to the burning file is the memory address corresponding to the switching system, it is determined to update the switching system.
[0105] In some embodiments, the updating device of the switching system further includes a fifth processing unit, which is configured to:
[0106] When the memory address corresponding to the burning file is the memory address corresponding to the boot program, the boot program is updated based on the burning file.
[0107] In some embodiments, the updating device of the switching system further includes a sixth processing unit, configured to:
[0108] After the exchange system is updated based on the burned file, the first version of the boot program is updated back to the second version of the boot program based on the version information of the second version of the boot program.
[0109] In the embodiment of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of the module or unit. The above-mentioned each "module" or "unit" can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned each unit.
[0110] The updating device of the switching system may be integrated in a terminal or a server having a storage device and a processor installed therein and having computing capability, or the updating device of the switching system is the terminal or the server.
[0111] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 As shown, in some embodiments, the present application further provides an electronic device, including a memory 502 and a processor 501, the memory 502 is used to store executable instructions of the processor 501, and the processor 501 is configured to execute the steps in the above-mentioned method embodiments by executing the executable instructions. In addition, the electronic device also includes an input device 503 and an output device 504 for realizing interaction, and the memory 502, the processor 501, the input device 503 and the output device 504 are connected via a communication bus.
[0112] The processor may include one or more processing cores. The memory may include one or more computer-readable storage media. The memory stores a computer program, which can be run on the processor. The processor is electrically connected to the memory. Those skilled in the art will appreciate that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0113] The processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and performed. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0114] The memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0115] The above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiment of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM), etc. That is to say, the memory in the embodiment of the present application is intended to include but not limited to these and any other suitable types of memory.
[0116] although Figure 5Not shown, the electronic device may also include a power module, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0117] In some embodiments, the present application further provides a computer-readable storage medium, which stores a computer program. The computer-readable storage medium can be applied to an electronic device, and the computer program enables the electronic device to execute the corresponding process in the method in the embodiment of the present application, which will not be described here for the sake of brevity.
[0118] In some embodiments, the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the corresponding process in the method in the embodiment of the present application, which will not be described here for the sake of brevity.
[0119] In some embodiments, the present application further provides a computer program, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the corresponding process in the method in the embodiment of the present application, which will not be repeated here for the sake of brevity.
[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can 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.
[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0122] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0123] 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional unit in the embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0125] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for an electronic device (which can be a personal computer, a server) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk.
[0126] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.
[0127] For the purposes of this specification, a "computer readable medium" may be any device that can contain, store, communicate, propagate or transport a program for use with or in conjunction with an instruction execution system, apparatus or device. More specific examples (a non-exhaustive list) of computer readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM).
[0128] In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0129] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for updating a switching system, characterized in that: include: Obtaining version information of a first version of a boot program associated with a switching system; wherein the first version of the boot program can be flashed into a memory address of the switching system; When the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program, updating the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program; Run the updated second version of the bootloader and enter boot mode; In the boot mode, the switching system is updated based on a burning file.
2. The updating method according to claim 1, characterized in that: In the boot mode, updating the switching system based on the burning file includes: In the boot mode, in response to confirming the instruction to update the switching system, the switching system is updated based on the acquired burning file.
3. The updating method according to claim 1, characterized in that: The updating of the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program includes: Based on the version information of the first version of the boot program, obtaining the code of the first version of the boot program; Based on the code of the first version of the boot program, the current second version of the boot program is updated to the first version of the boot program in a self-update mode.
4. The updating method according to claim 1 or 3, characterized in that: The step of updating the current second version of the boot program to the first version of the boot program includes: The second version of the boot program in the first storage area and the second storage area are both updated to the first version of the boot program; wherein the boot program in the first storage area and the boot program in the second storage area are backed up for each other.
5. The updating method according to claim 1, characterized in that: Also includes: Get the burning file; Obtain the memory address corresponding to the burning file; When the memory address corresponding to the burning file is the memory address corresponding to the switching system, it is determined to update the switching system.
6. The updating method according to claim 5, characterized in that: Also includes: When the memory address corresponding to the burning file is the memory address corresponding to the boot program, the boot program is updated based on the burning file.
7. The updating method according to claim 1, characterized in that: After updating the switching system based on the burning file, the method further includes: Based on the version information of the second version of the boot program, the first version of the boot program is updated back to the second version of the boot program.
8. An updating device for a switching system, characterized in that: include: An acquisition unit, used for acquiring version information of a first version of a boot program associated with a switching system; wherein the first version of the boot program can be flashed into a memory address of the switching system; A first processing unit, configured to update the current second version of the boot program to the first version of the boot program based on the version information of the first version of the boot program when the version information of the first version of the boot program is inconsistent with the version information of the current second version of the boot program; A second processing unit, configured to run the updated second version of the boot program and enter a boot mode; The third processing unit is configured to update the switching system based on a burning file in the boot mode.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
