Switch management method and device, equipment, storage medium and product
By switching to the factory version during the switch startup process, the startup failure problem caused by the device incompatible with the original configuration file is solved, ensuring the stability and reliability of the switch during the firmware upgrade process.
Patent Information
- Application Number
- CN202411049327.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-26
AI Technical Summary
When the switch is upgraded to a new version of the system, the startup failed due to the device being incompatible with the original configuration file, causing the device to fail to enter the switch system normally.
During the startup process of the switch, determine the startup partition address, store the upgraded version, and judge the startup situation. If the startup fails, switch to the factory version in the target address to restart the switch to ensure that the switch maintains stability and reliability during the firmware upgrade process. .
By automatically switching to the factory version to restart the switch, the problem of equipment not being able to enter the switch system normally due to failure to start the system is avoided, and the stability and reliability of the switch during the firmware upgrade process is ensured.
Smart Images

Figure CN119030939A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of switch technology, and in particular to switch management methods, devices, equipment, storage media and products. Background Art
[0002] When the switch is upgraded to a new version of the system, if the device is not compatible with the original configuration file, the switch will face the risk of startup failure, which will make the device unable to enter the switch system normally.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a switch management method, device, equipment, storage medium and product, aiming to solve the technical problem that when the switch is upgraded to a new version system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file.
[0005] To achieve the above objectives, the present application proposes a switch management method, the switch management method comprising:
[0006] During the switch startup process, determine the boot partition address;
[0007] Determine the upgrade version stored in the boot partition address;
[0008] Determining a startup condition of restarting the switch based on the upgraded version;
[0009] When the startup condition is a startup failure, the startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
[0010] In one embodiment, when the startup condition is a startup failure, the step of switching the startup partition address to a target address and restarting the switch based on the factory version stored in the target address includes:
[0011] When the startup condition is a startup failure, switching the startup partition address to a new startup partition address, and determining a new upgraded version of the new startup partition;
[0012] When restarting the switch based on the new upgraded version fails, the new startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
[0013] In one embodiment, during the startup process of the switch, the step of determining the startup partition address includes:
[0014] During the startup of the switch, determining whether the switch supports switching zones;
[0015] When it is determined that the switch does not support switching partitions, enabling switching partitions, and determining a startup partition address after enabling switching partitions;
[0016] When it is determined that the switch supports switching partitions, a startup partition address is determined.
[0017] In one embodiment, when determining that the switch supports switching partitions, the step of determining the boot partition address includes:
[0018] When it is determined that the switch supports switching zones, receiving input information from the user;
[0019] The boot partition address is determined according to the input information.
[0020] In one embodiment, when it is determined that the switch supports switching partitions, the step of determining the boot partition address includes:
[0021] When determining that the switch supports switching zones, determining default information;
[0022] The boot partition address is determined according to the default information.
[0023] In one embodiment, the step of determining a startup condition of restarting the switch based on the upgraded version includes:
[0024] After restarting the switch based on the upgraded version, determining whether the user can normally use the switch;
[0025] When it is determined that the user can use the switch normally, determining that the startup condition is successful;
[0026] When it is determined that the user cannot normally use the switch, the startup condition is determined to be a startup failure.
[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a switch management device, the switch management device comprising:
[0028] A determination module, used to determine the boot partition address during the boot process of the switch;
[0029] The determination module is further used to determine the upgrade version stored in the boot partition address;
[0030] The determination module is further used to determine a startup condition of restarting the switch based on the upgraded version;
[0031] A restart module is used to switch the startup partition address to a target address when the startup condition is a startup failure, and restart the switch based on the factory version stored in the target address.
[0032] In addition, to achieve the above objectives, the present application also proposes a switch management device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the switch management method described above.
[0033] In addition, to achieve the above purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and stores a computer program on the storage medium. When the computer program is executed by a processor, the steps of the switch management method described above are implemented.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the switch management method described above are implemented.
[0035] One or more technical solutions proposed in this application have at least the following technical effects:
[0036] The switch management method, device, equipment, storage medium and product proposed in the present application determine the boot partition address during the startup process of the switch; determine the upgrade version stored in the boot partition address; determine the startup situation of restarting the switch based on the upgrade version; when the startup situation is a startup failure, switch the boot partition address to the target address, and restart the switch based on the factory version stored in the target address, thereby solving the technical problem that the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file when the switch upgrades to a new version system. Compared with the prior art, the present application can automatically switch to the factory version and restart the switch when the switch fails to start based on the upgrade version, which can not only ensure that the switch can maintain stability and reliability during the firmware upgrade process, but also avoid the device from being unable to enter the switch system normally due to the failure of the switch to start the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A flowchart of the first embodiment of the switch management method of the present application is provided;
[0040] Figure 2 A schematic diagram of a specific process of the switch management method provided in Embodiment 1 of the present application;
[0041] Figure 3 A flow chart of the second embodiment of the switch management method of the present application;
[0042] Figure 4 This is a schematic diagram of the module structure of the switch management device according to an embodiment of the present application;
[0043] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the switch management method in the embodiment of the present application.
[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0047] The main solutions of the embodiments of this application are:
[0048] In this embodiment, for the convenience of description, the following description is made by taking the identification of the switch management device as the execution subject.
[0049] When a switch in the prior art upgrades a new version system, if there is a problem with the new version, the switch will face the risk of startup failure, which will make the device unable to normally enter the switch system.
[0050] This application provides a solution that can automatically switch to the factory version and restart the switch when the switch fails to be started based on the upgraded version. This can not only ensure that the switch can maintain stability and reliability during the firmware upgrade process, but also avoid the device from being unable to enter the switch system normally due to the failure of the switch to start the system.
[0051] It can be seen from the above embodiments that the present application solves the technical problem that when the switch is upgraded to a new version of the system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file. Compared with the prior art, the present application can automatically switch to the factory version and restart the switch when the switch fails to start based on the upgraded version. This can not only ensure that the switch can maintain stability and reliability during the firmware upgrade process, but also avoid the device being unable to enter the switch system normally due to the failure of the switch to start the system.
[0052] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a switch management device, etc. The following takes the switch management device as an example to illustrate this embodiment and the following embodiments.
[0053] Based on this, the present application embodiment provides a switch management method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the switch management method of the present application.
[0054] In this embodiment, the switch management method includes steps S10 to S40:
[0055] Step S10, during the startup process of the switch, determining the startup partition address;
[0056] It should be noted that the flash of the switch is divided into boot partition, firmware partition and configuration partition; the boot partition (such as uboot) is used to store the boot loader, which is mainly used to start the switch system; the firmware partition (such as image0, image1, image2) is used to store different versions of operating system images, which can be used for firmware upgrades and version rollbacks (that is, switching back to the previous old version after the switch is upgraded); the configuration partition (such as config) is used to store the device's configuration files / configuration information, such as network configuration, security settings, etc. (the configuration files stored in the configuration partition can ensure that the device can still maintain the settings after restarting).
[0057] It is understandable that the boot partition address refers to the address used to store the operating system image (ie, the upgraded version), and the boot partition address is located in the firmware partition in the flash.
[0058] In a feasible implementation manner, during the startup process of the switch, the step of determining the startup partition address includes:
[0059] During the startup of the switch, determining whether the switch supports switching zones;
[0060] When it is determined that the switch does not support switching partitions, enabling switching partitions, and determining a startup partition address after enabling switching partitions;
[0061] When it is determined that the switch supports switching partitions, a startup partition address is determined.
[0062] It should be noted that during the startup process of the switch, it can be determined whether the switch supports switching partitions. If the switch can support switching partitions, the startup partition address can be determined directly based on the default information or the user's input information. If the switch cannot support switching partitions, it is necessary to enable the switching partitions on the switch before determining the startup partition address.
[0063] In a feasible implementation manner, when determining that the switch supports switching partitions, the step of determining the boot partition address includes:
[0064] When it is determined that the switch supports switching zones, receiving input information from the user;
[0065] The boot partition address is determined according to the input information.
[0066] It should be noted that during the startup process of the switch, it can be determined whether the switch supports switching partitions. If the switch can support switching partitions, the user can be prompted to enter a number during the startup process to confirm the input information. For example, when the user enters 0, the boot partition address is determined to be the memory address of image0. When the user enters 1, the boot partition address is determined to be the memory address of image1. When the user enters 2, the boot partition address is determined to be the memory address of image2.
[0067] In a feasible implementation manner, when it is determined that the switch supports switching partitions, the step of determining the boot partition address includes:
[0068] When determining that the switch supports switching zones, determining default information;
[0069] The boot partition address is determined according to the default information.
[0070] It should be noted that during the startup process of the switch, it can be determined whether the switch supports switching partitions. If the switch can support switching partitions, the boot partition address can be determined according to the default information. For example, when the default information is 0, the boot partition address is determined to be the memory address of image0. When the default information is 1, the boot partition address is determined to be the memory address of image1. When the default information is 2, the boot partition address is determined to be the memory address of image2.
[0071] Step S20, determining the upgrade version stored in the boot partition address;
[0072] Step S30, determining a startup condition of restarting the switch based on the upgraded version;
[0073] It should be noted that the startup status includes successful startup and failed startup. Successful startup can be understood as the customer being able to use the switch normally after restarting the switch based on the upgraded version. Failed startup can be understood as the customer not being able to use the switch normally after restarting the switch based on the upgraded version. Failed startup may be caused by the device being incompatible with the previous configuration file, or it may be caused by problems with the upgraded version.
[0074] Step S40: When the startup condition is a startup failure, the startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
[0075] It should be noted that the target address refers to the address used to store the operating system image (ie, the factory version), and the target address is located in the firmware partition in the flash.
[0076] It should be noted that since the factory version is a firmware version that has been verified and tested many times before leaving the factory, it has high stability and reliability, and the switch will hardly fail when using the factory version.
[0077] It is understandable that when the switch fails to start, the boot partition address can be quickly switched to the target address, and the switch can be restarted based on the factory version stored in the target address.
[0078] In the specific implementation, when the switch needs to be upgraded to a new version, uboot will load the new operating system image (i.e., the upgraded version) from the specified Flash partition (such as image1) according to the boot partition address, and write the upgraded version to the device's memory and restart the switch. If the switch fails to start, uboot will load the factory version from the specified Flash partition (such as image0) according to the target address, which can quickly switch back to the previous stable version (i.e., the factory version) to reduce device downtime and service interruption.
[0079] In the specific implementation, the flash of the switch can be divided into five partitions, namely: uboot (boot partition), config (configuration partition), image0 (firmware partition), image1 (firmware partition), image2 (firmware partition), among which image0 saves system version 0, that is, the factory version (to ensure that the switch can be used normally), and image1 and image2 both save system version 1, that is, system version 1.
[0080] In the specific implementation, Figure 2 As shown, uboot initializes and identifies the SPI Flash device, reads data from the SPI Flash, writes the read data to the memory address (and the length of the read starting offset address), and starts reading the image system file (i.e., the upgraded version or the factory version) in the memory address with a specific value from the SPI Flash. When the switch starts normally (or starts for the first time), uboot saves the boot address as the image1 memory address to start the system, and image1 version 1 is enabled after power-off restart / software restart; upgrade version 2, change the image2 content to version 2, and uboot saves the boot address as the image2 memory address to start the system. The configuration remains unchanged (such as the IP address, etc.) to ensure that the customer uses the switch normally (the switch also checks the rollback version information, and the page sets the switch version boot address to the image1 memory address); upgrade version 3, change the image1 content to version 3, and uboot saves the boot address as the image2 memory address to start the system. If there is a problem with starting version 3 at this time, uboot automatically identifies it, switches the partition to save the boot address as the image2 memory address to start the system, ensures the normal operation of the device and promptly prompts the user that the system needs to be re-upgraded. If both image1 and image2 have problems starting up, you can switch to image0 to start up and configure it by default, using the default configuration and IP address to prompt the user to upgrade the system.
[0081] In the specific implementation, when manually switching, the device is connected to the serial port line, and during the startup process, the user enters the number 0 (0 starts image0, 1 starts image1, and 2 starts image2), saves the startup address according to the number, and starts the system for operation.
[0082] In a feasible implementation manner, the step of determining a startup condition of restarting the switch based on the upgraded version includes:
[0083] After restarting the switch based on the upgraded version, determining whether the user can normally use the switch;
[0084] When it is determined that the user can use the switch normally, determining that the startup condition is successful;
[0085] When it is determined that the user cannot normally use the switch, the startup condition is determined to be a startup failure.
[0086] It should be noted that when the device is not compatible with the previous configuration file, the user cannot use the switch normally, or when there is a problem with the upgraded version, the user cannot use the switch normally.
[0087] This embodiment determines the boot partition address during the startup process of the switch; determines the upgrade version stored in the boot partition address; determines the startup situation of restarting the switch based on the upgrade version; when the startup situation is a startup failure, switches the boot partition address to the target address, and restarts the switch based on the factory version stored in the target address, thereby solving the technical problem that the switch faces the risk of startup failure due to device incompatibility with the original configuration file when upgrading the switch to a new version system. Compared with the prior art, the present application can automatically switch to the factory version and restart the switch when the switch fails to start based on the upgrade version, which can not only ensure that the switch can maintain stability and reliability during the firmware upgrade process, but also avoid the device being unable to enter the switch system normally due to the failure of the switch to start the system.
[0088] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S40 also includes steps S401 to S402:
[0089] Step S401, when the startup condition is a startup failure, switching the startup partition address to a new startup partition address, and determining a new upgraded version of the new startup partition;
[0090] It should be noted that when the startup situation is a startup failure, it may also be caused by a problem with the upgrade version stored in the startup partition address. At this time, you can switch to a new upgrade version of the new startup partition address, and then restart the switch according to the new upgrade version.
[0091] Step S402: When restarting the switch based on the new upgraded version fails, the new startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
[0092] It is understandable that if restarting the switch based on the new upgraded version still fails, it is necessary to switch the new boot partition address to the target address and then restart the switch based on the factory version stored in the target address to ensure that the switch can operate normally.
[0093] In this embodiment, when the startup situation is a startup failure, the boot partition address is switched to a new boot partition address, and a new upgrade version of the new boot partition is determined; when the switch fails to be restarted based on the new upgrade version, the new boot partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address. This embodiment can not only restart the switch based on the new upgrade version when the switch fails to be restarted based on the upgrade version, but also switch to the factory version when the switch fails to be restarted based on the new upgrade version, ensuring that the switch can be used normally after switching to the factory version when the version upgrade cannot be performed.
[0094] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the switch management method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0095] This application also provides a switch management device, please refer to Figure 4 , the switch management device comprises:
[0096] The determination module 10 is used to determine the boot partition address during the boot process of the switch;
[0097] The determination module 10 is further used to determine the upgrade version stored in the boot partition address;
[0098] The determination module 10 is further configured to determine a startup condition of restarting the switch based on the upgraded version;
[0099] The restart module 20 is used to switch the startup partition address to a target address when the startup condition is a startup failure, and restart the switch based on the factory version stored in the target address.
[0100] The switch management device provided by the present application adopts the switch management method in the above embodiment, which can solve the technical problem that when the switch upgrades to a new version of the system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file. Compared with the prior art, the beneficial effects of the switch management device provided by the present application are the same as the beneficial effects of the switch management method provided by the above embodiment, and the other technical features in the switch management device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0101] The present application provides a switch management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the switch management method in the above-mentioned embodiment 1.
[0102] Reference below Figure 5 , which shows a schematic diagram of the structure of a switch management device suitable for implementing the embodiment of the present application. The switch management device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The switch management device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0103] like Figure 5 As shown, the switch management device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the switch management device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the switch management device to communicate with other devices wirelessly or by wire to exchange data. Although the switch management device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0104] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0105] The switch management device provided by the present application adopts the switch management method in the above embodiment, which can solve the technical problem that when the switch upgrades to a new version of the system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file. Compared with the prior art, the beneficial effects of the switch management device provided by the present application are the same as the beneficial effects of the switch management method provided by the above embodiment, and the other technical features in the switch management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0106] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0107] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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.
[0108] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the switch management method in the above-mentioned embodiment.
[0109] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0110] The computer-readable storage medium may be included in the switch management device; or may exist independently without being assembled into the switch management device.
[0111] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the switch management device, the switch management device: during the startup process of the switch, determines the boot partition address; determines the upgrade version stored in the boot partition address; determines the startup situation of restarting the switch based on the upgrade version; when the startup situation is a startup failure, switches the boot partition address to a target address, and restarts the switch based on the factory version stored in the target address.
[0112] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0115] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned switch management method, and can solve the technical problem that when the switch upgrades to a new version of the system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the switch management method provided by the above-mentioned embodiment, and will not be repeated here.
[0116] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the switch management method as described above are implemented.
[0117] The computer program product provided by the present application can solve the technical problem that when the switch upgrades to a new version of the system, the switch faces the risk of startup failure due to the incompatibility of the device with the original configuration file. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the switch management method provided by the above embodiment, and will not be repeated here.
[0118] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A switch management method, characterized in that: The method comprises: During the switch startup process, determine the boot partition address; Determine the upgrade version stored in the boot partition address; Determining a startup condition of restarting the switch based on the upgraded version; When the startup condition is a startup failure, the startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
2. The method according to claim 1, characterized in that When the startup condition is a startup failure, the step of switching the startup partition address to a target address and restarting the switch based on the factory version stored in the target address includes: When the startup condition is a startup failure, switching the startup partition address to a new startup partition address, and determining a new upgraded version of the new startup partition; When restarting the switch based on the new upgraded version fails, the new startup partition address is switched to a target address, and the switch is restarted based on the factory version stored in the target address.
3. The method according to claim 1, characterized in that During the startup process of the switch, the step of determining the startup partition address includes: During the startup of the switch, determining whether the switch supports switching zones; When it is determined that the switch does not support switching partitions, enabling switching partitions, and determining a startup partition address after enabling switching partitions; When it is determined that the switch supports switching partitions, a startup partition address is determined.
4. The method according to claim 3, characterized in that When determining that the switch supports switching partitions, the step of determining the boot partition address includes: When it is determined that the switch supports switching zones, receiving input information from the user; The boot partition address is determined according to the input information.
5. The method according to claim 3, characterized in that When it is determined that the switch supports switching partitions, the step of determining the boot partition address includes: When determining that the switch supports switching zones, determining default information; The boot partition address is determined according to the default information.
6. The method according to claim 1, characterized in that The step of determining a startup condition of restarting the switch based on the upgraded version comprises: After restarting the switch based on the upgraded version, determining whether the user can normally use the switch; When it is determined that the user can use the switch normally, determining that the startup condition is successful; When it is determined that the user cannot normally use the switch, the startup condition is determined to be a startup failure.
7. A switch management device, characterized in that: The device comprises: A determination module, used to determine the boot partition address during the boot process of the switch; The determination module is further used to determine the upgrade version stored in the boot partition address; The determination module is further used to determine a startup condition of restarting the switch based on the upgraded version; A restart module is used to switch the startup partition address to a target address when the startup condition is a startup failure, and restart the switch based on the factory version stored in the target address.
8. A switch management device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the switch management method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the switch management method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the switch management method according to any one of claims 1 to 6 are implemented.
