Software online upgrading method and device, electronic equipment and storage medium
By establishing a dual-partition table in DSP Flash, online software upgrades without downtime or restart in high-availability systems such as server power supply are achieved, solving the problem of interruption during the upgrade process, and improving the system availability and maintenance convenience.
Patent Information
- Application Number
- CN202310822449.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, high-availability systems such as server power supply require the lowest downtime when software upgrades, but lack an online upgrade method that does not restart or downtime, resulting in interruptions during the upgrade process.
By establishing a dual-partition table in DSP Flash, built-in boot program and user program, allowing online upgrades when the program is running, and automatically switch to a new program to run after the upgrade is completed. Users can freely choose to reset or not reset the system.
It realizes online upgrade of the software without shutting down or restarting, simplifies the update and maintenance of the software version, and eliminates interruptions caused by shutdown or restarting during the upgrade process.
Smart Images

Figure CN119271249A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software upgrade, and in particular to a method, device, electronic device and storage medium for online software upgrade. Background Art
[0002] Most system devices need to support timely updates and upgrades of software versions. Software upgrades are essential for adding additional features, improving performance and fixing software errors / vulnerabilities. Traditional upgrade methods often require a restart or downtime after the upgrade to enable the new application to run.
[0003] However, in many similar scenarios such as server power supply (PSU) and metering, the system needs to run continuously to reduce downtime. Terminal equipment such as server power supply is a high-availability system that needs to have the lowest downtime. The existing technology lacks a corresponding online upgrade method without restarting or shutting down. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a software online upgrade method, device, electronic device and storage medium, which can upgrade the software online and eliminate the interruption caused by shutdown or restart during the upgrade process.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for online software upgrade, comprising the following steps:
[0007] In response to an upgrade command for first target software, upgrading second target software located in a second partition, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type;
[0008] When the second target software is upgraded, the current application is switched from the first target software to the second target software.
[0009] In a possible implementation manner, the software is DSP software, and before the second target software located in the second partition is upgraded in response to the upgrade command for the first target software, the method further includes:
[0010] Establishing a first Flash partition and a second Flash partition in the cache;
[0011] A first boot program and the first target software are built into the first Flash partition, and a second boot program and the second target software are built into the second Flash partition.
[0012] In a possible implementation manner, the step of upgrading the second target software located in the second partition includes:
[0013] Identify the upgrade command, switch control from the first boot program to the second boot program, and download an update program;
[0014] The update program is programmed based on the second boot program to obtain upgraded upgrade software.
[0015] In a possible implementation manner, the first partition and the second partition are in a single-active working mode.
[0016] In a possible implementation manner, switching the current application from the first target software to the second target software includes:
[0017] Compiling the second target software to obtain a second executable application program, wherein the current application program is a first executable application program obtained after compiling the first target software;
[0018] A first execution address of the first executable application is remapped to a second execution address of the second executable application.
[0019] In a possible implementation manner, remapping the first execution address of the first executable application to the second execution address of the second executable application includes:
[0020] Obtaining a first PIE vector and a first RAM memory block corresponding to the first executable application and a second PIE vector and a second RAM memory block corresponding to the second executable application;
[0021] The addresses of the first PIE vector and the second PIE vector and the addresses of the first RAM memory block and the second RAM memory block are exchanged based on a DSP compiler.
[0022] In a second aspect, an embodiment of the present application further provides a method for online software upgrade, comprising the following steps:
[0023] Detecting and processing the version of the current application, and when the version is updated, updating the current application by the software online upgrade method as described in any one of the first aspects of the present application;
[0024] The updated current application is displayed in the human-computer interaction interface, wherein the system does not shut down or restart during the process of updating and displaying the updated current application.
[0025] In a third aspect, an embodiment of the present application further provides a software online upgrade device, the device comprising:
[0026] an upgrade module, configured to upgrade second target software located in the second partition in response to an upgrade command for first target software, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type;
[0027] The conversion module is used to switch the current application from the first target software to the second target software after the upgrade of the second target software is completed.
[0028] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the software online upgrade method described in any one of the first aspect, or executes the software online upgrade method described in the second aspect.
[0029] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the software online upgrade method described in any one of the first aspect or the software online upgrade method described in the second aspect is executed.
[0030] The embodiments of the present application have the following beneficial effects:
[0031] By establishing a dual partition table of DSP Flash, bootloader and user program are built in different spaces at the same time. It allows users to complete online upgrade of user software while the program is running. After the upgrade is completed, users can freely choose to reset or not reset the system and switch to the new upgrade program to run. At the same time, dual partitions can customize the code running space and upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for software version updates and maintenance. The software can be upgraded online to eliminate interruptions caused by downtime or restart during the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1It is a flowchart of steps S101-S102 provided in an embodiment of the present application;
[0034] Figure 2 It is a flowchart of steps S201-S202 provided in an embodiment of the present application;
[0035] Figure 3 It is a flowchart of steps S301-S302 provided in an embodiment of the present application;
[0036] Figure 4 It is a flowchart of steps S401-S402 provided in an embodiment of the present application;
[0037] Figure 5 It is a flowchart of steps S501-S502 provided in an embodiment of the present application;
[0038] Figure 6 It is a schematic diagram of software online upgrade provided in an embodiment of the present application;
[0039] Figure 7 It is a structural diagram of a software online upgrade device provided in an embodiment of the present application;
[0040] Figure 8 It is a schematic diagram of the composition structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0042] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0043] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0044] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0045] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0047] See also Figure 1 , Figure 1 is a flowchart of steps S101-S102 of the software online upgrade method provided in the embodiment of the present application, which will be combined with Figure 1 Steps S101-S102 are shown for explanation.
[0048] Step S101, in response to an upgrade command for first target software, upgrading second target software located in a second partition, wherein the first target software runs in the first partition, and the first target software and the second target software are of the same type;
[0049] Step S102: when the second target software is upgraded, the current application is switched from the first target software to the second target software.
[0050] The above software online upgrade method, by establishing a dual partition table of DSP Flash, simultaneously embeds the bootloader and the user program in different spaces. It allows the user to complete the online upgrade of the user software while the program is running. After the upgrade is completed, the user can freely choose to reset or not reset the system and switch to the new upgrade program to run. At the same time, the dual partition can customize the code running space and the upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for the update and maintenance of the software version. The software can be upgraded online to eliminate the interruption caused by shutdown or restart during the upgrade process.
[0051] The above exemplary steps of the embodiments of the present application are described below respectively.
[0052] In step S101, in response to an upgrade command for first target software, second target software located in a second partition is upgraded, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type.
[0053] In some embodiments, see Figure 2 , Figure 2 It is a flow chart of steps S201-S202 provided in an embodiment of the present application. The software is DSP software. In response to the upgrade command for the first target software, steps S201-S202 can also be executed before upgrading the second target software located in the second partition. The steps will be explained in combination.
[0054] In step S201, a first Flash partition and a second Flash partition are established in a cache.
[0055] In step S202, a first boot program and the first target software are built into the first Flash partition, and a second boot program and the second target software are built into the second Flash partition.
[0056] For example, see Figure 6 , Figure 6This is a schematic diagram of software online upgrade provided by an embodiment of the present application. A first Flash partition (partition 1) and a second Flash partition (partition 2) are established in the DSP Flash partition. The first Flash partition has a first boot program and a first target software built in it, and the second Flash partition has a second boot program and a second target software built in it. The first boot program can be a customized bootloader1, and the first boot program can be a customized bootloader2. BootLoader runs before the operating system kernel runs. Hardware devices can be initialized and memory space mapping can be established, so as to bring the system's hardware and software environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel.
[0057] After the system is reset and flash is started, the flash jump logic is selected first. Based on the firmware version field, it can determine which flash partition to execute from and pass control to the corresponding application. For example, application A includes two versions, A_0.1 and A_0.2, where the version of A_0.2 is higher than the version of A_0.1. In the initial state (A_0.2 is not released), both partition 1 and partition 2 have built-in application A of version A_0.1. Users can execute application A_0.1 in the first partition or in the second partition.
[0058] It should be noted that in the embodiment of the present application, the default application A_0.1 is executed in the first partition.
[0059] In some embodiments, see Figure 3 , Figure 3 It is a flowchart of steps S301-S302 provided in an embodiment of the present application. The upgrading of the second target software located in the second partition can be achieved through steps S301-S302, which will be explained in combination with each step.
[0060] In step S301, the upgrade command is identified, control is switched from the first boot program to the second boot program, and an update program is downloaded.
[0061] In step S302, the update program is programmed based on the second boot program to obtain upgraded upgrade software.
[0062] For example, after the necessary system initialization and interrupt enablement, the real-time control loop is executed in the corresponding specific interrupt service routine (ISR). During idle time, a background loop consisting of lower priority functions is executed between the interrupt service routines. If the host issues an online upgrade command, it triggers the receive interrupt in the DSP and the corresponding ISR (with a lower priority than the control loop ISR) executes and recognizes the host command request. In the background loop, the command is parsed, the online upgrade request is recognized, and the control is passed to the customized bootloader2, which downloads the new application image from the host and programs it.
[0063] For example, when executing the partition 1 user program, if A_0.2 is released and update information is detected, bootloader2 downloads the update program and programs it.
[0064] In some embodiments, the first partition and the second partition are in single-active working mode.
[0065] Here, the first partition and the second partition do not execute application A_0.1 at the same time. Different from the dual-active working mode, only one partition executes application A_0.1. The single-active working mode can save memory and reduce load.
[0066] In step S102, when the second target software is upgraded, the current application is switched from the first target software to the second target software.
[0067] Here, continue to see Figure 6 , after upgrading the partition 2 user program, execute program switching, start executing the partition 2 user program and reset. Similarly, if the initial state is to execute the partition 2 user program, upgrade the partition 1 user program and then switch to partition 1.
[0068] In some embodiments, see Figure 4 , Figure 4 It is a flowchart of steps S401-S402 provided in an embodiment of the present application. The switching of the current application from the first target software to the second target software can be achieved through steps S401-S402, which will be explained in combination with each step.
[0069] In step S401, the second target software is compiled to obtain a second executable application program, wherein the current application program is a first executable application program obtained after compiling the first target software.
[0070] In step S402, a first execution address of the first executable application is remapped to a second execution address of the second executable application.
[0071] In some embodiments, see Figure 5 , Figure 5 It is a flowchart of steps S501-S502 provided in an embodiment of the present application. The remapping of the first execution address of the first executable application to the second execution address of the second executable application can be achieved through steps S501-S502, which will be explained in combination with each step.
[0072] In step S501, a first PIE vector and a first RAM memory block corresponding to the first executable application and a second PIE vector and a second RAM memory block corresponding to the second executable application are obtained.
[0073] In step S502, addresses of the first PIE vector and the second PIE vector as well as addresses of the first RAM memory block and the second RAM memory block are exchanged based on a DSP compiler.
[0074] Here, since the DSP compiler can move existing PIE (interrupt vector table) vectors and function pointers to new locations between firmware versions, or add or delete PIE vectors and function pointers between firmware versions, the user's application code needs to correctly and efficiently manage during LFU. Remapping the addresses of PIE vectors and RAM memory blocks, remapping, is "swapping". If swapping is not performed, the user application code will need to update each PIE vector and function pointer individually, adding time cycles to the DSP real-time online upgrade switching time. Before the DSP real-time online upgrade switch, the user application code can fill in different PIE vector tables and different LS RAM areas.
[0075] Once completed, at the appropriate time (DSP Live Online Upgrade Switchover - Wait for the appropriate time), the user application code initiates the transition to the new firmware. Once the DSP compiler Live Online Upgrade initialization routine is complete and transfers execution to the new application.
[0076] Before a new application can start running, necessary initialization needs to be performed. Since the PIE vectors and function pointers are already populated in the "swap" locations, all that is required is a PIE vector swap (first PIE vector and second PIE vector) and a LS0 RAM (first RAM memory block) swap with a LS1 RAM (second RAM memory block).
[0077] For CLA (coprocessor) applicability, DSP devices do not support swap tables for CLA task vectors (MVECTs). Live online upgrades of the CLA for DSPs usually update the MVECTs sequentially at the appropriate time. The method for updating MVECTs is described in the System Reference Design Guide, and it should be noted that this method is different from the case of the CPU PIE vector table. In this case, a simple single-cycle swap can be achieved to switch to the new PIE vector table. In order for the LS0 / LS1 RAM memory swap function to be useful for CLA LFU switching, the following two conditions need to be met:
[0078] (1) The CLA code must fit into a single LSx block. The MVECT table contains CLA task vectors whose addresses correspond to locations in the LSx block. For example, if the current firmware CLA code exists in LS0, the MVECTs will point to different locations in LS0. If the new firmware CLA code exists in LS1, the MVECTs will point to various locations in LS1.
[0079] (2) When switching from the current firmware to the new firmware, the MVECTs will need to be updated unless they exist in the same relative position in LS0 and LS1. If this is the case, then simply swapping the LS0 / LS1 RAM and memory blocks will effectively update the MVECT table without the need to update the MVECTs sequentially.
[0080] As for the switch time of the firmware, after programming the new firmware into Flash, the user application code will need to determine when it is appropriate to switch to the new firmware. The technique for determining this is critical in the real-time firmware content running on the CPU and CLA itself. The device supports two register bits that can be set or reset to indicate that the DSP real-time online upgrade switch is in progress for the CPU (LFUConfig.LFU_CPU) and CLA (LFUCConfig.LFU_CLA1). These bits do not affect any hardware logic on the device. For example, LFUConfig.LFU_CPU can be set by the user application code at the beginning of the switch and then tested in the initialization code in the main function. This only enables the DSP real-time online upgrade switch-specific initialization to be performed (for example, PIE vector table swap, LS0 / LS1 RAM memory swap), while bypassing all other initialization that usually occurs after a device reset.
[0081] In summary, the embodiments of the present application have the following beneficial effects:
[0082] By establishing a dual partition table of DSP Flash, bootloader and user program are built in different spaces at the same time. It allows users to complete online upgrade of user software while the program is running. After the upgrade is completed, users can freely choose to reset or not reset the system and switch to the new upgrade program to run. At the same time, dual partitions can customize the code running space and upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for software version updates and maintenance. The software can be upgraded online to eliminate interruptions caused by downtime or restart during the upgrade process.
[0083] The embodiment of the present application also provides another software online upgrade method step, including steps ab.
[0084] a: Detect and process the version of the current application. When the version is updated, update the current application using the software online upgrade method as described in the above embodiment of the present application.
[0085] b: Displaying the updated current application in the human-computer interaction interface, wherein the system does not shut down or restart during the process of updating and displaying the updated current application.
[0086] For example,
[0087] Based on the same inventive concept, the embodiment of the present application also provides a software online upgrade device corresponding to the software online upgrade method in the first embodiment. Since the principle of solving the problem by the device in the embodiment of the present application is similar to that of the above-mentioned software online upgrade method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0088] like Figure 7 As shown, Figure 7 : is a structural diagram of a software online upgrade device 700 provided in an embodiment of the present application. The software online upgrade device 700 includes:
[0089] An upgrade module 701, configured to upgrade second target software located in a second partition in response to an upgrade command for first target software, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type;
[0090] The conversion module 702 is used to switch the current application from the first target software to the second target software after the upgrade of the second target software is completed.
[0091] Those skilled in the art should understand that Figure 7 The implementation functions of each unit in the software online upgrade device 700 shown can be understood by referring to the relevant description of the aforementioned software online upgrade method. Figure 7The functions of the various units in the software online upgrade device 700 shown may be implemented by a program running on a processor, or may be implemented by a specific logic circuit.
[0092] In a possible implementation manner, the software is DSP software, and before the upgrade module 701 upgrades the second target software located in the second partition in response to the upgrade command for the first target software, the upgrade module 701 further includes:
[0093] Establishing a first Flash partition and a second Flash partition in the cache;
[0094] A first boot program and the first target software are built into the first Flash partition, and a second boot program and the second target software are built into the second Flash partition.
[0095] In a possible implementation manner, the upgrading module 701 upgrades the second target software located in the second partition, including:
[0096] Identify the upgrade command, switch control from the first boot program to the second boot program, and download an update program;
[0097] The update program is programmed based on the second boot program to obtain upgraded upgrade software.
[0098] In a possible implementation, the second partition where the second target software upgraded by the upgrade module 701 is located and the first partition where the first target software is running are in a single-active working mode.
[0099] In a possible implementation manner, the conversion module 702 switches the current application from the first target software to the second target software, including:
[0100] Compiling the second target software to obtain a second executable application program, wherein the current application program is a first executable application program obtained after compiling the first target software;
[0101] A first execution address of the first executable application is remapped to a second execution address of the second executable application.
[0102] In a possible implementation manner, the conversion module 702 remaps the first execution address of the first executable application to the second execution address of the second executable application, including:
[0103] Obtaining a first PIE vector and a first RAM memory block corresponding to the first executable application and a second PIE vector and a second RAM memory block corresponding to the second executable application;
[0104] The addresses of the first PIE vector and the second PIE vector and the addresses of the first RAM memory block and the second RAM memory block are exchanged based on a DSP compiler.
[0105] The above-mentioned software online upgrade device builds a dual partition table of DSP Flash, and simultaneously embeds the bootloader and user program in different spaces. It allows the user to complete the online upgrade of the user software while the program is running. After the upgrade is completed, the user can freely choose to reset or not reset the system and switch to the new upgrade program to run. At the same time, the dual partitions can customize the code running space and upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for software version updates and maintenance. The software can be upgraded online to eliminate the interruption caused by shutdown or restart during the upgrade process.
[0106] like Figure 8 As shown, Figure 8 The present invention provides a schematic diagram of the structure of an electronic device 800 according to an embodiment of the present invention. The electronic device 800 includes:
[0107] A processor 801, a storage medium 802 and a bus 803, wherein the storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device 800 is running, the processor 801 communicates with the storage medium 802 via the bus 803, and the processor 801 executes the machine-readable instructions to perform the steps of the software online upgrade method described in the embodiment of the present application.
[0108] In actual application, the components in the electronic device 800 are coupled together via bus 803. It is understood that bus 803 is used to realize the connection and communication between these components. Bus 803 includes not only a data bus, but also a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as bus 803.
[0109] The electronic device above simultaneously builds a dual partition table of DSP Flash and embeds bootloader and user program in different spaces. It allows users to complete online upgrade of user software while the program is running. After the upgrade is completed, users can freely choose to reset or not reset the system and switch to the new upgraded program to run. At the same time, the dual partition can customize the code running space and upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for software version update and maintenance. The software can be upgraded online to eliminate the interruption caused by shutdown or restart during the upgrade process.
[0110] The embodiment of the present application further provides a computer-readable storage medium, which stores executable instructions. When the executable instructions are executed by at least one processor 801, the software online upgrade method described in the embodiment of the present application is implemented.
[0111] In some embodiments, the storage medium can be a magnetic random access memory (FRAM), 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), a flash memory, a magnetic surface storage, an optical disk, or a compact disc read-only memory (CD ROM); it can also be various devices including one or any combination of the above memories.
[0112] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0113] As an example, executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (for example, files storing one or more modules, subroutines, or code portions).
[0114] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0115] The computer-readable storage medium establishes a dual partition table of DSP Flash, and simultaneously embeds the bootloader and the user program in different spaces. This allows the user to complete the online upgrade of the user software while the program is running. After the upgrade is completed, the user can freely choose to reset or not reset the system and switch to the new upgraded program to run. At the same time, the dual partitions can customize the code running space and the upgrade space. After the program upgrade is completed, the code is automatically switched to the running space, which is very convenient for updating and maintaining the software version. The software can be upgraded online, eliminating the interruption caused by downtime or restart during the upgrade process.
[0116] In the several embodiments provided in the present application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. 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 can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0117] The modules described as separate components may or may not be physically separated, and the components shown as modules 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.
[0118] In addition, each functional unit in each 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.
[0119] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) 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 USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0120] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A software online upgrade method, characterized in that: The following steps are involved: In response to an upgrade command for first target software, upgrading second target software located in a second partition, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type; When the second target software is upgraded, the current application is switched from the first target software to the second target software.
2. The method according to claim 1, characterized in that The software is DSP software. Before the second target software located in the second partition is upgraded in response to the upgrade command for the first target software, the method further includes: Establishing a first Flash partition and a second Flash partition in the cache; A first boot program and the first target software are built into the first Flash partition, and a second boot program and the second target software are built into the second Flash partition.
3. The method according to claim 2, characterized in that The step of upgrading the second target software in the second partition includes: Identify the upgrade command, switch control from the first boot program to the second boot program, and download an update program; The update program is programmed based on the second boot program to obtain upgraded upgrade software.
4. The method according to claim 1, characterized in that: The first partition and the second partition are in single-active working mode.
5. The method according to claim 1, characterized in that The switching of the current application from the first target software to the second target software includes: Compiling the second target software to obtain a second executable application program, wherein the current application program is a first executable application program obtained after compiling the first target software; A first execution address of the first executable application is remapped to a second execution address of the second executable application.
6. The method according to claim 5, characterized in that The remapping of the first execution address of the first executable application to the second execution address of the second executable application includes: Obtaining a first PIE vector and a first RAM memory block corresponding to the first executable application and a second PIE vector and a second RAM memory block corresponding to the second executable application; The addresses of the first PIE vector and the second PIE vector and the addresses of the first RAM memory block and the second RAM memory block are exchanged based on a DSP compiler.
7. A software online upgrade method, characterized in that: The following steps are involved: Detecting and processing the version of the current application, and when the version is updated, updating the current application by the software online upgrade method as described in any one of claims 1 to 6 of the present application; The updated current application is displayed in the human-computer interaction interface, wherein the system does not shut down or restart during the process of updating and displaying the updated current application.
8. A software online upgrade device, characterized in that: The device comprises: an upgrade module, configured to upgrade second target software located in the second partition in response to an upgrade command for first target software, wherein the first target software runs in the first partition and the first target software and the second target software are of the same type; The conversion module is used to switch the current application from the first target software to the second target software after the upgrade of the second target software is completed.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to execute the software online upgrade method according to any one of claims 1 to 6, or executes the software online upgrade method according to claim 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program executes the software online upgrade method according to any one of claims 1 to 6, or executes the software online upgrade method according to claim 7.