Software upgrade method, device, electronic device and readable storage medium
By decoupling the control surface and forwarding surface in the switch device, keeping the forwarding surface state unchanged and synchronizing the control surface and forwarding surface state, the packet loss problem of existing software upgrade methods for online services is solved, and business reliability and upgrade are improved efficiency.
Patent Information
- Application Number
- CN202011163768.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-27
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-10-27
AI Technical Summary
Existing software upgrade methods often have packet loss effects on online services and reduce business reliability.
By introducing a thermal upgrade mechanism into the switch device, decoupling the control surface and forwarding surface, the state of the forwarding surface remains unchanged during the software upgrade process, restart the new process of the control surface, and perform state synchronization after the new process restarts, ensuring that Online business has no interruptions and no packet loss.
It effectively reduces traffic interruption time during software upgrade process, improves business reliability, and realizes a senseless software upgrade process.
Smart Images

Figure CN112181469B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a software upgrading method, device, electronic device and readable storage medium. Background Art
[0002] The diversity and rapid iteration of data center services require continuous upgrades of system software to meet business needs. Currently, common software upgrade methods include online patches, nightly upgrades, and direct cold starts. However, these software upgrade methods often cause certain packet loss effects on online services, reducing business reliability. Summary of the invention
[0003] The present disclosure provides a software upgrading method, device, electronic device and readable storage medium.
[0004] According to one aspect of the present disclosure, there is provided a software upgrade method, comprising:
[0005] Obtain software upgrade instructions for switch devices;
[0006] In response to the software upgrade instruction, maintaining the state of the forwarding plane of the switch device unchanged, and restarting a new process of the control plane of the switch device;
[0007] After the new process of the control plane is restarted, the states of the control plane and the forwarding plane are synchronized.
[0008] According to another aspect of the present disclosure, there is provided a software upgrade device, comprising:
[0009] An acquisition module is used to obtain software upgrade instructions for switch devices;
[0010] A control module, configured to keep the state of the forwarding plane of the switch device unchanged and restart a new process of the control plane of the switch device in response to the software upgrade instruction;
[0011] The processing module is used to synchronize the states of the control plane and the forwarding plane after the new process of the control plane is restarted.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.
[0017] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.
[0018] The technology according to the present application solves the problem that current software upgrade methods often cause packet loss to online services, thereby improving service reliability.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0021] Figure 1 It is a flowchart of the software upgrade method provided in the embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a thermal upgrade process of an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a software upgrade process of an embodiment of the present application;
[0024] Figure 4 It is a structural diagram of a software upgrade device provided in an embodiment of the present application;
[0025] Figure 5 It is a block diagram of an electronic device used to implement the software upgrade method of an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. "And / or" in the specification and claims represents at least one of the connected objects.
[0028] In order to facilitate understanding of the embodiments of the present application, the following contents are first described.
[0029] In the embodiment of the present application, the switch software can be divided into a control plane and a forwarding plane according to the scope of the switch function. The control plane mainly involves user configuration commands, switch software protocols, etc. The forwarding plane mainly involves the kernel, the chip software development kit (SDK), chip hardware, etc. The kernel is the first layer of software expansion based on hardware, providing the most basic functions of the operating system and is the basis for the operation of the operating system. It is responsible for managing system processes, memory, device drivers, etc.
[0030] In view of the fact that software upgrade methods in the prior art often cause a certain amount of packet loss to online services, the embodiments of the present application provide a hot upgrade mechanism, which decouples the control plane and the forwarding plane during the hot upgrade process, thereby ensuring that online services are not interrupted or lost during software upgrades, effectively reducing the traffic interruption time during the software upgrade process, and improving service reliability.
[0031] See also Figure 1 , Figure 1 is a flowchart of a software upgrade method provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0032] Step 11: Obtain software upgrade instructions for the switch device.
[0033] In this embodiment, the switch device may be an access switch device. The number of central processing units (CPUs) of the switch device may be one or more. Preferably, the switch device is a single CPU device.
[0034] Optionally, the software upgrade instruction may be input by a user for a switch device. The software upgrade instruction is used to trigger a hot upgrade process for the switch device.
[0035] As an example, by configuring the software upgrade instruction of the switch device by the user, the switch device can select the hot software upgrade mode, so as to perform the software upgrade in a hot restart mode.
[0036] Step 12: In response to the software upgrade instruction, the state of the forwarding plane of the switch device is kept unchanged, and a new process of the control plane of the switch device is restarted.
[0037] In this embodiment, when implementing a hot software upgrade, the new process of the control plane of the switch device can be restarted without restarting the process of the forwarding plane, thereby keeping the state of the forwarding plane unchanged, thereby decoupling the control plane and the forwarding plane of the switch device, that is, decoupling the process of the control plane and the process of the forwarding plane, ensuring that online services are not interrupted or lost during the software upgrade.
[0038] As an example, in order to keep the state of the forwarding plane unchanged, the operation of the chip software development kit (SDK) application programming interface (API) can be locked during a hot upgrade so that operations such as routing changes during software upgrades can no longer call the SDK to operate the forwarding plane.
[0039] Step 13: After the new process of the control plane is restarted, the states of the control plane and the forwarding plane are synchronized.
[0040] Optionally, the synchronization of the states of the control plane and the forwarding plane may include synchronization of data states of the control plane and the forwarding plane, such as routing data states, to ensure normal operation of online services before and after the software upgrade.
[0041] The software upgrade method of the embodiment of the present application can, after obtaining the software upgrade instruction for the switch device, respond to the software upgrade instruction, keep the state of the forwarding plane of the switch device unchanged, restart the new process of the control plane of the switch device, and synchronize the states of the control plane and the forwarding plane after the new process of the control plane is restarted. Thus, the control plane and the forwarding plane can be decoupled during the software upgrade, ensuring that the online service is not interrupted and there is no packet loss during the software upgrade, and ensuring the normal forwarding of the online service, thereby improving service reliability.
[0042] Furthermore, the software upgrade method of the embodiment of the present application can also improve the software upgrade efficiency, reduce the software upgrade time, and realize a seamless software upgrade process.
[0043] In an embodiment of the present application, during the software upgrade process that introduces a hot upgrade method, in order to ensure the progress of the hot upgrade process, after the new process of the control plane is restarted, it is possible to further identify whether the new process of the control plane is a hot restart, and when it is identified as a hot restart, the state synchronization of the control plane and the forwarding plane is achieved.
[0044] Optionally, after the new process of the control plane is restarted, the software upgrade method may further include:
[0045] Determine whether the new process of the control plane is a hot restart.
[0046] Furthermore, the process of synchronizing the states of the control plane and the forwarding plane includes: synchronizing the states of the control plane and the forwarding plane when it is determined that the new process of the control plane is a hot restart. In this way, by further determining whether the new process of the control plane is a hot restart during the hot upgrade process, the hot upgrade process can be identified, thereby ensuring the hot upgrade process.
[0047] It should be noted that the software hot upgrade in this embodiment is to perform a software upgrade while the switch device is already running. The current process can be called an old process or an OLD process, and the process that is about to replace the current process is called a new process or a NEW process. When the process of the control plane is hot restarted, the user configures a hot upgrade command to perform a software hot upgrade, and the switch device can save a hot restart flag to indicate that the new process of the control plane is a hot restart.
[0048] Optionally, the above method for determining whether the new process of the control plane is a hot restart can be: determining whether the current restart identifier in the switch device is a hot restart identifier. When the current restart identifier is a hot restart identifier, it can be determined that the new process of the control plane is a hot restart; or, when the current restart identifier is not a hot restart identifier, it can be determined that the new process of the control plane is not a hot restart.
[0049] For example, see Figure 2 As shown, during the hot upgrade process of the embodiment of the present application, the control plane and the forwarding plane can be decoupled, and the process of the forwarding plane is not restarted, so as to ensure that the online service does not lose packets. When restarting the current process (OLD process) of the control plane, a hot restart flag can be set to indicate that the current process of the control plane is a hot restart, not a cold start. When restarting a new process (NEW process) of the control plane, the process of the forwarding plane can be not directly controlled according to the current hot restart flag. After the new process of the control plane is restarted, the upgrade process is implemented by synchronizing the states of the control plane and the forwarding plane. After the states of the control plane and the forwarding plane are synchronized, the new process of the control plane can directly control the process of the forwarding plane again.
[0050] Understandably, during the software upgrade process, after the new process of the control plane is restarted, it is necessary to restore the protocols of the switch device, such as the Link Aggregation Control Protocol (LACP) and the routing protocols of the control plane, such as the Border Gateway Protocol (BGP), etc., in order to re-establish connections and communications with other devices, such as servers and terminals. When restoring the protocols of the switch device, the control plane of the switch device can obtain routing forwarding rules, etc. from the newly connected device, and then send the new exchange information to the forwarding plane to achieve state synchronization between the control plane and the forwarding plane.
[0051] For the protocol processing during the software upgrade, since the protocol is interrupted and restarted, the upstream device or downstream server of the switch device will think that the switch device is in an error state, thereby interrupting the data channel with the switch device, thereby causing a one-way communication problem of data. In order to ensure that the communication of the control plane is not interrupted during the hot upgrade, the BGP Graceful Restart (GR) function can be introduced in the embodiment of the present application. The BGP GR function is mainly used to achieve uninterrupted data forwarding during the restart of the protocol.
[0052] Optionally, the process of synchronizing the states of the control plane and the forwarding plane may include: reading the first forwarding rule in the forwarding plane; obtaining the second forwarding rule when the protocol of the switch device is restored; and synchronizing the forwarding rules of the control plane and the forwarding plane according to the first forwarding rule and the second forwarding rule. In this way, state synchronization can be achieved based on the underlying forwarding rules and the forwarding rules obtained by the software upgrade, thereby keeping the forwarding rules of the control plane consistent with the forwarding rules of the forwarding plane and avoiding online service packet loss.
[0053] For example, the above forwarding rules such as the first forwarding rule and the second forwarding rule may include but are not limited to the following contents: routing data status, data port information, MAC address, access control list (Access Control Lists, ACL), etc.
[0054] Optionally, the process of synchronizing the forwarding rules of the control plane and the forwarding plane according to the first forwarding rule and the second forwarding rule may include:
[0055] Compare the first forwarding rule and the second forwarding rule;
[0056] Obtain a third forwarding rule in the second forwarding rule that is newly added compared to the first forwarding rule, and / or obtain a fourth forwarding rule in the first forwarding rule that is redundant compared to the second forwarding rule;
[0057] The third forwarding rule is sent to the forwarding plane, and / or the fourth forwarding rule in the forwarding plane is deleted.
[0058] In this way, with the help of difference comparison, the forwarding rules of the control plane and the forwarding plane can be synchronized simply and efficiently to ensure that the forwarding rules of the control plane are consistent with the forwarding rules of the underlying hardware.
[0059] Combine the following Figure 3 The embodiments of the present application are described in detail.
[0060] like Figure 3 As shown, the software upgrade process in the embodiment of the present application may include:
[0061] S1: Before hot restart, save the forwarding rules and status of the forwarding plane, and set the hot restart flag such as WARMBOOT. At this time, according to the current hot restart flag, the SDK API operation of the forwarding plane chip can be locked. Operations such as routing changes during hot restart can no longer call the SDK to operate the forwarding plane, keeping the state of the forwarding plane unchanged;
[0062] S2: Status reading and recovery after hot restart: After the new process of the control plane is started and upgraded, it can be determined whether the current restart identifier is a hot restart identifier. If it is determined that the current restart identifier is a hot restart identifier, the forwarding rules of the current forwarding plane are read, and the forwarding rules when the protocol of the receiving switch device, such as the routing protocol of the control plane, are restored are waited for. Afterwards, based on the hot restart identifier, the received forwarding rules can be temporarily stored. After receiving the last forwarding rule, the forwarding rules of the read forwarding plane and the received forwarding rules can be compared for differences, and the newly added ones can be re-issued and the redundant ones can be deleted, so that the forwarding rules of the control plane are consistent with the forwarding rules of the forwarding plane.
[0063] If it is determined that the current restart flag is not a hot restart flag, the forwarding plane needs to be initialized, and the forwarding rules obtained when the protocol is restored are written into the forwarding plane.
[0064] S3: When the forwarding rule of the control plane is consistent with the forwarding rule of the forwarding plane, it can be determined that the hot restart is completed, and the current hot restart flag is cleared.
[0065] See also Figure 4 , Figure 4 is a structural diagram of a software upgrade device provided in an embodiment of the present application, such as Figure 4 As shown, the software upgrade device 40 includes:
[0066] An acquisition module 41 is used to acquire a software upgrade instruction for a switch device;
[0067] A control module 42, configured to keep the state of the forwarding plane of the switch device unchanged and restart a new process of the control plane of the switch device in response to the software upgrade instruction;
[0068] The processing module 43 is used to synchronize the states of the control plane and the forwarding plane after the new process of the control plane is restarted.
[0069] Optionally, the software upgrading device 40 further includes:
[0070] A judging module, configured to judge whether the new process of the control plane is a hot restart after the new process of the control plane is restarted;
[0071] The processing module 43 is specifically configured to: synchronize the states of the control plane and the forwarding plane when it is determined that the new process of the control plane is a hot restart.
[0072] Optionally, the judgment module is specifically used for:
[0073] Determine whether the current restart flag in the switch device is a hot restart flag;
[0074] When the current restart identifier is a hot restart identifier, it is determined that the new process of the control plane is a hot restart; or when the current restart identifier is not a hot restart identifier, it is determined that the new process of the control plane is not a hot restart.
[0075] Optionally, the processing module 43 includes:
[0076] A reading unit, configured to read a first forwarding rule in the forwarding plane;
[0077] An acquiring unit, used for acquiring a second forwarding rule when the protocol of the switch device is restored;
[0078] A synchronization unit is used to synchronize the forwarding rules of the control plane and the forwarding plane according to the first forwarding rule and the second forwarding rule.
[0079] Optionally, the synchronization unit includes:
[0080] a comparing subunit, configured to compare the first forwarding rule with the second forwarding rule;
[0081] an acquisition subunit, configured to acquire a third forwarding rule in the second forwarding rule that is newly added compared to the first forwarding rule, and / or to acquire a fourth forwarding rule in the first forwarding rule that is redundant compared to the second forwarding rule;
[0082] The processing subunit is configured to send the third forwarding rule to the forwarding plane, and / or delete the fourth forwarding rule in the forwarding plane.
[0083] It is understandable that the software upgrade device 40 of the embodiment of the present application can achieve the above Figure 1 The various processes implemented in the illustrated method embodiment and the same beneficial effects achieved are not described again here to avoid repetition.
[0084] According to an embodiment of the present application, the present application also provides a computer program product, including a computer program, which implements the above-mentioned Figure 1 The various processes implemented in the illustrated method embodiment and the same beneficial effects achieved are not described again here to avoid repetition.
[0085] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0086] like Figure 5 , is a block diagram of an electronic device according to a software upgrade method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0087] like Figure 5 As shown, the electronic device includes: one or more processors 501, a memory 502, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 501 is taken as an example.
[0088] The memory 502 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the software upgrade method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the software upgrade method provided in the present application.
[0089] The memory 502 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the software upgrade method in the embodiment of the present application (for example, the attached Figure 4 The processor 501 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 502, that is, the software upgrade method in the above method embodiment is implemented.
[0090] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device for software upgrade, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the electronic device for software upgrade via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0091] The electronic device of the software upgrade method may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0092] The input device 503 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device for software upgrade, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 504 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0093] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0094] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0095] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0096] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0097] The computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0098] According to the technical solution of the embodiment of the present application, after obtaining the software upgrade instruction for the switch device, the state of the forwarding plane of the switch device can be kept unchanged in response to the software upgrade instruction, and the new process of the control plane of the switch device can be restarted, and after the new process of the control plane is restarted, the states of the control plane and the forwarding plane are synchronized. In this way, the control plane and the forwarding plane can be decoupled during the software upgrade, ensuring that the online business is not interrupted and there is no packet loss during the software upgrade, and ensuring the normal forwarding of the online business, thereby improving the business reliability.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0100] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A software upgrade method, comprising: Obtaining a software upgrade instruction for a switch device, wherein the switch device is a single CPU device; In response to the software upgrade instruction, maintaining the state of the forwarding plane of the switch device unchanged, and restarting a new process of the control plane of the switch device; After the new process of the control plane is restarted, synchronizing the states of the control plane and the forwarding plane; The state of the forwarding plane of the switch device remains unchanged, specifically including: The chip software development kit SDK application program interface API is locked so that the route change operation in the software upgrade cannot call the SDK operation forwarding plane.
2. The method according to claim 1, wherein: After the new process of the control plane is restarted, the method further includes: Determining whether the new process of the control plane is a hot restart; The synchronizing the states of the control plane and the forwarding plane includes: When it is determined that the new process of the control plane is a hot restart, the states of the control plane and the forwarding plane are synchronized.
3. The method according to claim 2, wherein: The determining whether the new process of the control plane is a hot restart includes: Determine whether the current restart flag in the switch device is a hot restart flag; When the current restart identifier is a hot restart identifier, it is determined that the new process of the control plane is a hot restart; or when the current restart identifier is not a hot restart identifier, it is determined that the new process of the control plane is not a hot restart.
4. The method according to claim 1, wherein: The synchronizing the states of the control plane and the forwarding plane includes: Reading a first forwarding rule in the forwarding plane; Acquire a second forwarding rule when the protocol of the switch device is restored; According to the first forwarding rule and the second forwarding rule, the forwarding rules of the control plane and the forwarding plane are synchronized.
5. The method according to claim 4, wherein: The synchronizing the forwarding rules of the control plane and the forwarding plane according to the first forwarding rule and the second forwarding rule includes: comparing the first forwarding rule and the second forwarding rule; Obtain a third forwarding rule in the second forwarding rule that is newly added compared to the first forwarding rule, and / or obtain a fourth forwarding rule in the first forwarding rule that is redundant compared to the second forwarding rule; The third forwarding rule is sent to the forwarding plane, and / or the fourth forwarding rule in the forwarding plane is deleted.
6. A software upgrade device, comprising: An acquisition module, used to acquire a software upgrade instruction for a switch device, wherein the switch device is a single CPU device; A control module, configured to keep the state of the forwarding plane of the switch device unchanged and restart a new process of the control plane of the switch device in response to the software upgrade instruction; A processing module, configured to synchronize the states of the control plane and the forwarding plane after the new process of the control plane is restarted; The state of the forwarding plane of the switch device remains unchanged, specifically including: The chip software development kit SDK application program interface API is locked so that the route change operation in the software upgrade cannot call the SDK operation forwarding plane.
7. The apparatus according to claim 6, further comprising: A judging module, configured to judge whether the new process of the control plane is a hot restart after the new process of the control plane is restarted; The processing module is specifically configured to: synchronize the states of the control plane and the forwarding plane when it is determined that the new process of the control plane is a hot restart.
8. The device according to claim 7, wherein: The judgment module is specifically used for: Determine whether the current restart flag in the switch device is a hot restart flag; When the current restart identifier is a hot restart identifier, it is determined that the new process of the control plane is a hot restart; or when the current restart identifier is not a hot restart identifier, it is determined that the new process of the control plane is not a hot restart.
9. The device according to claim 6, wherein: The processing module comprises: A reading unit, configured to read a first forwarding rule in the forwarding plane; An acquiring unit, used for acquiring a second forwarding rule when the protocol of the switch device is restored; A synchronization unit is used to synchronize the forwarding rules of the control plane and the forwarding plane according to the first forwarding rule and the second forwarding rule.
10. The device according to claim 9, wherein: The synchronization unit comprises: a comparing subunit, configured to compare the first forwarding rule with the second forwarding rule; an acquisition subunit, configured to acquire a third forwarding rule in the second forwarding rule that is newly added compared to the first forwarding rule, and / or to acquire a fourth forwarding rule in the first forwarding rule that is redundant compared to the second forwarding rule; The processing subunit is configured to send the third forwarding rule to the forwarding plane, and / or delete the fourth forwarding rule in the forwarding plane.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and system for updating patch software
CN102937906A
Router and software upgrading method thereof
CN103581008A
Authority management method and device, mobile terminal and storage medium
CN108712561A
Switchboard upgrading method and device, electronic equipment and computer readable medium
CN109450676A
Method and device for updating virtual switch, storage medium and equipment
CN110149231A
