Process hot upgrade method and device, storage medium and electronic equipment
By using dynamic library replacement and loading to perform hot upgrades of processes, the problem of inconsistency between primary and backup environments in hot migration scenarios is solved, achieving seamless process upgrades and continuity of the hot migration process.
Patent Information
- Application Number
- CN202111568062.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2041-12-21
AI Technical Summary
Traditional hot upgrade methods for processes can lead to inconsistencies between primary and backup environments in hot migration scenarios, causing the hot migration process to be interrupted.
The process to be upgraded is hot-upgraded by replacing and loading dynamic libraries. By receiving hot-upgrade commands, the process status is detected, and when the process is in backup data state, the switch is turned off, dynamic libraries are replaced and loaded to achieve hot-upgrade of the process, and the command is sent to the backup board for upgrade.
Maintain consistency between primary and backup environments in hot migration scenarios to avoid interruption of the hot migration process and achieve seamless process upgrades.
Smart Images

Figure CN116302143B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of computers, and in particular, to a process hot upgrade method and device, a storage medium and an electronic device. BACKGROUND
[0002] The process hot upgrade can make the process upgrade without restarting, and is suitable for modularized processes in the form of dynamic libraries. The traditional process hot upgrade method is applied to single machine or single board environment, and does not consider the hot migration scenario. In the hot migration scenario, the main board continuously backs up the memory data of the process and synchronizes it to the backup board. When the main board fails, the backup board recovers the process using the backup memory data and goes online. If the main board process has been hot upgraded, the backup board cannot recover the process, causing the hot migration to be interrupted.
[0003] The traditional process hot upgrade method is suitable for single machine or single board environment, and does not consider the process hot upgrade in the hot migration scenario, which can cause inconsistency between the main and backup environments and result in interruption of the hot migration process.
[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0005] The present disclosure provides a process hot upgrade method and device, a storage medium and an electronic device, which at least partially overcome the problem of inconsistency between the main and backup environments caused by the process hot upgrade in the hot migration scenario in the related art, resulting in interruption of the hot migration process.
[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a process hot upgrade method is provided, applied to a main board, comprising: receiving a hot upgrade command, wherein the hot upgrade command is used to hot upgrade a process to be upgraded in a dynamic library replacement and loading manner; detecting a process state of the process to be upgraded according to the hot upgrade command; when the process to be upgraded is in a backup data state, controlling the process to be upgraded to close a switching switch, and hot upgrading the process to be upgraded in a dynamic library replacement and loading manner; and after the main board hot upgrades the process to be upgraded, sending the hot upgrade command to a backup board, so that the backup board upgrades the process to be upgraded according to the hot upgrade command.
[0008] In one embodiment of the present disclosure, the control of the standby process in the backup data state to close the switch and the hot upgrade of the standby process in the backup data state by the dynamic library replacement and loading method include: controlling the standby process in the backup data state to close the switch by a disable signal; and hot upgrading the standby process in the backup data state by the dynamic library replacement and loading method.
[0009] In one embodiment of the present disclosure, the hot upgrade command includes: the process identification and the dynamic library information of the standby process; and the hot upgrade of the standby process in the backup data state by the dynamic library replacement and loading method includes: obtaining the process identification and the dynamic library information of the standby process; and replacing the first dynamic library of the standby process with a second dynamic library according to the process identification and the dynamic library information of the standby process, wherein the first dynamic library is the dynamic library before the process upgrade, and the second dynamic library is the dynamic library after the process upgrade.
[0010] In one embodiment of the present disclosure, after the hot upgrade command is sent to the backup board to make the backup board hot upgrade the standby process according to the hot upgrade command, the method further includes: performing the data backup of the main board and the backup board by the process after the hot upgrade.
[0011] In one embodiment of the present disclosure, the method further includes: loading the dynamic library of the standby process to the main board and the backup board.
[0012] According to one aspect of the present disclosure, a process hot upgrade method is provided, which is applied to a backup board and includes: receiving a hot upgrade command from a main board, wherein the hot upgrade command is used to hot upgrade a standby process by a dynamic library replacement and loading method; the hot upgrade command is sent after the main board hot upgrades the standby process in a backup data state, and the main board is used to control the standby process in the backup data state to close a switch and hot upgrade the standby process by the dynamic library replacement and loading method after receiving the hot upgrade command for hot upgrading the standby process in the backup data state; and the standby process is upgraded by the dynamic library replacement method according to the hot upgrade command.
[0013] According to another aspect of the present disclosure, there is provided a process hot upgrade device applied to a master board, comprising: a command receiving module configured to receive a hot upgrade command, wherein the hot upgrade command is configured to hot upgrade a process to be upgraded in a dynamic library replacement and loading manner; a state detecting module configured to detect a process state of the process to be upgraded according to the hot upgrade command; a hot upgrade module configured to control the process to be upgraded to close a switch when the process to be upgraded is in a backup data state, and hot upgrade the process to be upgraded in the dynamic library replacement and loading manner; and a command sending module configured to send the hot upgrade command to a backup board after the master board hot upgrades the process to be upgraded, so that the backup board upgrades the process to be upgraded according to the hot upgrade command.
[0014] According to another aspect of the present disclosure, there is provided a process hot upgrade device applied to a backup board, comprising: a receiving module configured to receive a hot upgrade command from a master board, wherein the hot upgrade command is configured to hot upgrade a process to be upgraded by the master board in a dynamic library replacement and loading manner; the hot upgrade command is sent by the master board after hot upgrading the process to be upgraded in a backup data state, and the master board is configured to control the process to be upgraded in the backup data state to close a switch and hot upgrade the process to be upgraded in the dynamic library replacement and loading manner after receiving the hot upgrade command for hot upgrading the process to be upgraded in the backup data state; and a replacement module configured to upgrade the process to be upgraded in the dynamic library replacement manner according to the hot upgrade command.
[0015] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the process hot upgrade method described above via executing the executable instructions.
[0016] According to another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the process hot upgrade method described above.
[0017] The process hot upgrading method and device, storage medium and electronic equipment provided by the embodiments of the present disclosure receive a hot upgrading command, wherein the hot upgrading command is used to hot upgrade a process to be upgraded in a dynamic library replacement and loading manner; the process state of the process to be upgraded is detected according to the hot upgrading command; when the process to be upgraded is in a backup data state, the process to be upgraded is controlled to close a switching switch, and the process to be upgraded is hot upgraded in a dynamic library replacement and loading manner; after the mainboard hot upgrades the process to be upgraded, the hot upgrading command is sent to a backup board, so that the backup board upgrades the process to be upgraded according to the hot upgrading command. Based on the process in the backup data state, the switching switch is closed, the dynamic library is replaced, and the process hot upgrading in the hot migration scenario can be realized.
[0018] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0019] The drawings incorporated into the specification and forming a part of the specification, show embodiments consistent with the present disclosure, and together with the specification, serve to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1 A schematic diagram of a process hot upgrading system structure in an embodiment of the present disclosure is shown;
[0021] Figure 2 A process hot upgrading method flowchart applied to a mainboard in an embodiment of the present disclosure is shown;
[0022] Figure 3 A process hot upgrading method flowchart applied to a backup board in an embodiment of the present disclosure is shown;
[0023] Figure 4 A process hot upgrading device schematic diagram applied to a mainboard in an embodiment of the present disclosure is shown;
[0024] Figure 5 A process hot upgrading device schematic diagram applied to a backup board in an embodiment of the present disclosure is shown;
[0025] Figure 6 A schematic diagram of a process hot upgrading system structure in an embodiment of the present disclosure is shown;
[0026] Figure 7 A process hot upgrading method flowchart in an embodiment of the present disclosure is shown;
[0027] Figure 8 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0028] Example implementations are now described with reference to the drawings. Example implementations can, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the gist of the example implementations to those skilled in the art. The features, structures, or characteristics described can be combined in one or more implementations in any suitable manner.
[0029] In addition, the drawings are to be considered in all respects as illustrative and not restrictive; identical reference numerals have been used, where possible, to denote identical or similar features, and thus repetition of the description thereof will be omitted. Some of the blocks in the drawings are functional blocks, and thus can not necessarily correspond to physical or logical entities. These functional blocks can be implemented in software, hardware, or a combination thereof, in one or more hardware or integrated circuit devices, or in different network and / or processor devices and / or microcontroller devices.
[0030] For ease of understanding, the following first explains several terms related to the present disclosure as follows:
[0031] Process: Process is a running activity of a program on a certain data collection in a computer, is a basic unit of system resource allocation and scheduling, and is the basis of operating system structure. In the early process-oriented computer structure, process is the basic execution entity of program; in the contemporary thread-oriented computer structure, process is the container of thread. Program refers to the description of instructions, data and their organization form, and process is the entity of program.
[0032] Hot upgrade: on the premise that the program / service does not stop, the purpose of function upgrade is achieved by increasing, modifying and deleting related function modules.
[0033] Hot migration: process hot migration.
[0034] Dynamic library: Dynamic Link Library, abbreviated as DLL, refers to dynamic link library. Using dynamic link library can more easily apply updates to each module without affecting other parts of the program. Dynamic link library file is a non-executable binary program file that allows programs to share code and other resources necessary to perform special tasks.
[0035] Modular: Module, is a way to deal with complex system decomposition into better manageable modules. Modularization is used to divide, organize and package software. Each module completes a specific sub-function, all modules are assembled in a certain way, become a whole, complete the function required by the whole system.
[0036] Enable: Enable is responsible for the input and output of control signals. It is a "permission" signal, the feed enable is the signal that allows the feed, that is, the motor can only rotate when the feed enable signal is valid. Some commands in network equipment are in the state of closing, so it is necessary to modify the enable (that is, open) to make it normal use. For example, the computer motherboard needs to open some functions, so it needs to enable it.
[0037] Full backup: full backup, refers to the full backup of all data at a certain point in time, including system and all data. This backup method needs to perform a full backup of the system and all data every time. As above, if there is no change in data between two backups, the data of the two backups is the same. That is, 100GB of data will consume 100GB of storage space to do backup even if there is no data change. But the biggest advantage of this backup method is that when restoring lost data, only one complete backup needs to be operated to restore the lost data, greatly speeding up the system or data recovery time.
[0038] The present example embodiment will be described in detail below in conjunction with the accompanying drawings and examples.
[0039] Figure 1 A schematic diagram of an exemplary system architecture of a process hot upgrade method or process hot upgrade device that can be applied to the embodiments of the present disclosure is shown.
[0040] As Figure 1 shown, the system architecture 100 can include a mainboard 101, a backup board 102, and a network 103.
[0041] The network 103 is a medium for providing a communication link between the mainboard 101 and the backup board 102, which can be a wired network or a wireless network.
[0042] Optionally, the wireless network or wired network described above uses standard communication techniques and / or protocols. The network is typically the Internet, but can also be any network, including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wired or wireless network, a private network, or any combination of the above networks. In some embodiments, techniques and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), and the like are used to represent data exchanged over the network. In addition, all or some links can be encrypted using conventional encryption technologies such as the Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), Internet Protocol Security (IPsec), and the like. In other embodiments, custom and / or proprietary data communications technologies can be employed in place of, or in addition to, the above techniques and technologies.
[0043] Those skilled in the art can know that, Figure 1 The number of master boards and backup boards in the master board and backup board is only illustrative, and can have any number of master boards and backup boards according to actual needs. The embodiments of the disclosure do not limit this.
[0044] In Figure 1 Under the system architecture shown in FIG. 1, the embodiments of the disclosure provide a process hot upgrade method applied to a master board, which can be executed by any electronic device with computing processing capability.
[0045] Figure 2 A flow chart of a process hot upgrade method applied to a master board in the embodiments of the disclosure is shown in FIG. 2, which includes the following steps: Figure 2 The process hot upgrade method provided in the embodiments of the disclosure is applied to a master board and includes the following steps:
[0046] Step S202, receiving a hot upgrade command, wherein the hot upgrade command is used to replace and load the to-be-upgraded process by using a dynamic library.
[0047] Step S204, detecting the process state of the to-be-upgraded process according to the hot upgrade command.
[0048] Step S206, when the to-be-upgraded process is in the backup data state, the control to-be-upgraded process closes the switching switch, and uses the dynamic library replacement and loading method to perform hot upgrading on the to-be-upgraded process.
[0049] Step S208, after the mainboard performs hot upgrading on the to-be-upgraded process, sends a hot upgrading command to the backup board, so that the backup board upgrades the to-be-upgraded process according to the hot upgrading command.
[0050] For S202, in an embodiment, the mainboard can receive a hot upgrading command of a process, and the hot upgrading command can be to use the dynamic library replacement and loading method to perform hot upgrading on the to-be-upgraded process without stopping running.
[0051] For example, the mainboard and the backup board can include: a to-be-upgraded process A (for the sake of distinction, the to-be-upgraded process A running on the backup board is denoted as A'), a new dynamic library B, and an old dynamic library C. When the mainboard receives a hot upgrading command of the A process, the A process uses the B dynamic library to replace the C dynamic library, and loads the C dynamic library to perform hot upgrading without stopping running.
[0052] To further specifically describe the method of closing the switching switch, in a specific embodiment, the control to-be-upgraded process in the backup data state to close the switching switch, and using the dynamic library replacement and loading method to perform hot upgrading on the to-be-upgraded process can include: controlling the to-be-upgraded process in the backup data state to close the switching switch through a disable signal; and using the dynamic library replacement and loading method to perform hot upgrading on the to-be-upgraded process in the backup data state.
[0053] For example, the running A process is in the backup data state, and after receiving the disable signal, the A process closes the switching switch, and then uses the dynamic library replacement method to perform hot upgrading on the to-be-upgraded process in the backup data state.
[0054] To further specifically describe the method of hot upgrading, in a specific embodiment, the hot upgrading command can include: a process identifier of the to-be-upgraded process and dynamic library information; and using the dynamic library replacement and loading method to perform hot upgrading on the to-be-upgraded process in the backup data state can include: obtaining the process identifier of the to-be-upgraded process and the dynamic library information; and replacing a first dynamic library of the to-be-upgraded process with a second dynamic library according to the process identifier of the to-be-upgraded process and the dynamic library information, wherein the first dynamic library is a dynamic library before process upgrading, and the second dynamic library is a dynamic library after process upgrading.
[0055] For example, the hot upgrade command can include: a process identifier A of the A process, and information C of the C dynamic library; and the hot upgrade of the process in the backup data state by using the dynamic library replacement and loading can include: obtaining the process identifier A of the A process and the dynamic library information C; and replacing the first dynamic library (B dynamic library) of the A process with the second dynamic library (C dynamic library) and loading the second dynamic library (C dynamic library) according to the process identifier A of the A process and the dynamic library information C.
[0056] For S204, in an embodiment, the mainboard can detect the current process state of the A process according to the hot upgrade command.
[0057] For S206, in an embodiment, when the A process is in the backup data state, the A process can be controlled to close the switch and the hot upgrade of the process to be upgraded can be performed by using the dynamic library replacement and loading.
[0058] For S208, in an embodiment, after the mainboard performs the hot upgrade on the A process, the hot upgrade command can be sent to the backup board, and the backup board can perform the upgrade on the process to be upgraded according to the hot upgrade command.
[0059] For example, the backup board includes the A' process to be upgraded, and after the mainboard performs the hot upgrade on the A process, the mainboard sends the hot upgrade command to the backup board, and the backup board performs the upgrade on the A' process according to the hot upgrade command. The backup board is upgraded to the ordinary upgrade of replacing the dynamic library, and the mainboard is the hot upgrade of replacing and loading the dynamic library.
[0060] In order to keep the mainboard and the backup board consistent after the hot upgrade, in an embodiment, after the hot upgrade command is sent to the backup board to make the backup board perform the hot upgrade on the process to be upgraded according to the hot upgrade command, the data backup of the mainboard and the backup board can be performed by using the process after the hot upgrade.
[0061] For example, after the hot upgrade command is sent to the backup board and the backup board performs the hot upgrade on the A' process according to the hot upgrade command, the mainboard and the backup board perform the full backup.
[0062] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not for limiting purposes. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of the processes. In addition, it is also easy to understand that the processes can be executed synchronously or asynchronously, for example, in multiple modules.
[0063] Figure 3 A flow chart of a process hot upgrade method applied to a backup board in an embodiment of the present disclosure is shown in FIG. 6. Figure 3 As shown in FIG. 6, the process hot upgrade method provided in the embodiment of the present disclosure is applied to the backup board and includes the following steps:
[0064] In step S302, the hot upgrade command from the mainboard is received, wherein the hot upgrade command is used for the mainboard to perform hot upgrade on the process to be upgraded by using the dynamic library replacement and loading method; the hot upgrade command is sent after the mainboard performs hot upgrade on the process to be upgraded in the backup data state; and the mainboard is used to control the process to be upgraded in the backup data state to close the switch and perform hot upgrade on the process to be upgraded by using the dynamic library replacement and loading method after receiving the hot upgrade command for performing hot upgrade on the process to be upgraded in the backup data state.
[0065] In step S304, the process to be upgraded is upgraded by using the dynamic library replacement method according to the hot upgrade command.
[0066] For S302, in an embodiment, the mainboard controls the process to be upgraded in the backup data state to close the switch and performs hot upgrade on the process to be upgraded by using the dynamic library replacement and loading method after receiving the hot upgrade command for performing hot upgrade on the process to be upgraded in the backup data state; the mainboard sends the hot upgrade command to the backup board after performing hot upgrade on the process to be upgraded in the backup data state; and the backup board receives the hot upgrade command from the mainboard.
[0067] For example, the mainboard and the backup board can include: a running process A to be upgraded, a new dynamic library B, and an old dynamic library C. The mainboard receives the hot upgrade command for the process A to be upgraded in the backup data state, controls the process A to close the switch, and performs hot upgrade by using the B dynamic library to replace the C dynamic library; and the mainboard sends the hot upgrade command to the backup board after completing the hot upgrade.
[0068] For S304, in an embodiment, the backup board upgrades the process to be upgraded by using the dynamic library replacement method according to the received hot upgrade command.
[0069] For example, the backup board performs hot upgrade on the process A' by using the B dynamic library to replace the C dynamic library according to the hot upgrade command, and completes the upgrade.
[0070] It should be noted that the above-described figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not for the purpose of limitation. It is easy to understand that the processes shown in the above-described figures do not indicate or limit the time sequence of the processes. In addition, it is also easy to understand that the processes can be executed synchronously or asynchronously, for example, in multiple modules.
[0071] Based on the same inventive concept, the present disclosure also provides a process hot upgrade device, as described in the following embodiments. Since the principle of solving problems of the device embodiments is similar to that of the above-mentioned method embodiments, the implementation of the device embodiments can be referred to the implementation of the above-mentioned method embodiments, and the repeated parts will not be described herein.
[0072] Figure 4 A schematic diagram of a process hot upgrade device applied to a mainboard in an embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the device includes: Figure 4
[0073] A receiving command module 401 is configured to receive a hot upgrade command, wherein the hot upgrade command is used to hot upgrade a process to be upgraded in a dynamic library replacement and loading manner.
[0074] A detecting state module 402 is configured to detect a process state of the process to be upgraded according to the hot upgrade command.
[0075] A hot upgrade module 403 is configured to control the process to be upgraded to close a switch when the process to be upgraded is in a backup data state, and hot upgrade the process to be upgraded in a dynamic library replacement and loading manner.
[0076] A sending command module 404 is configured to send the hot upgrade command to a backup board after the mainboard hot upgrades the process to be upgraded, so that the backup board upgrades the process to be upgraded according to the hot upgrade command.
[0077] To further illustrate the method of closing the switch, in one embodiment, the hot upgrade module 403 can include: controlling the process to be upgraded in the backup data state to close the switch through a de-activation signal; and hot upgrading the process to be upgraded in the backup data state in a dynamic library replacement and loading manner.
[0078] To further illustrate the method of hot upgrading, in one embodiment, the hot upgrade command includes: a process identifier of the process to be upgraded and dynamic library information; and the hot upgrading the process to be upgraded in the backup data state in a dynamic library replacement and loading manner includes: obtaining the process identifier of the process to be upgraded and the dynamic library information; and replacing a first dynamic library of the process to be upgraded with a second dynamic library according to the process identifier of the process to be upgraded and the dynamic library information, wherein the first dynamic library is a dynamic library before process upgrading, and the second dynamic library is a dynamic library after process upgrading.
[0079] To keep the mainboard and the backup board consistent after hot upgrading, in one embodiment, the device can further include:
[0080] A data backup module is configured to perform data backup of the mainboard and the backup board by using the process after hot upgrading.
[0081] In one embodiment, the device can further include:
[0082] A loading module is configured to load the dynamic library of the process to be upgraded to the mainboard and the backup board.
[0083] Figure 5 A schematic diagram of a process hot upgrade device applied to a backup board in an embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the device comprises: Figure 5
[0084] A receiving module 501 is configured to receive a hot upgrade command from the main board, wherein the hot upgrade command is used for the main board to perform hot upgrade on the process to be upgraded in a dynamic library replacement and loading manner; the hot upgrade command is sent after the main board performs hot upgrade on the process to be upgraded in a backup data state; and the main board is configured to control the process to be upgraded in the backup data state to close a switching switch and perform hot upgrade on the process to be upgraded in the dynamic library replacement and loading manner after receiving the hot upgrade command for hot upgrade on the process to be upgraded in the backup data state.
[0085] A replacement module 502 is configured to perform upgrade on the process to be upgraded in a dynamic library replacement manner according to the hot upgrade command.
[0086] Figure 6 A schematic diagram of a process hot upgrade system structure in an embodiment of the present disclosure is shown in FIG. 2. As shown in FIG. 2, the process hot upgrade system structure comprises: Figure 6
[0087] A main board 101 and a backup board 102.
[0088] The main board 101 comprises: a receiving command module 401 responsible for receiving hot upgrade, dynamic library replacement and other commands; a state detection module 402 responsible for detecting the state of the process to be hot upgraded, including but not limited to whether the process exists, whether the process runs normally and whether the process is normally backed up; a hot upgrade module 403 responsible for process upgrade, specifically responsible for replacement and loading of dynamic libraries during process running and replacement of dynamic libraries in process execution files; and a sending command module 404 responsible for sending hot upgrade, dynamic library replacement and other commands.
[0089] The backup board 102 can comprise:
[0090] A receiving module 501 is configured to receive a hot upgrade command from the main board; and a replacement module 502 is configured to be responsible for process upgrade, specifically responsible for replacement of dynamic libraries in process execution files.
[0091] Figure 7 A flowchart of a process hot upgrade method in an embodiment of the present disclosure is shown in FIG. 3. As shown in FIG. 3, the flowchart of a specific example of the process hot upgrade method comprises: Figure 7
[0092] 1. Before hot upgrade starts, the main board and the backup board already contain new dynamic libraries for upgrade.
[0093] 2. The receiving command module of the main board receives a process hot upgrade command, wherein the hot upgrade command contains corresponding process number and dynamic library information.
[0094] 3. The detection state module of the mainboard detects the corresponding process state, detects whether all processes requiring hot upgrade are normally running and normally backed up.
[0095] 4. If the upgrade condition is met, continue to execute; otherwise, end the hot upgrade process.
[0096] 5. The mainboard executes a de- enabled switching service to prevent switching during the hot upgrade process.
[0097] 6. The hot upgrade module of the mainboard performs hot upgrade on the specified process, and replaces and loads the dynamic library during the process running.
[0098] 7. The mainboard sends a dynamic library replacement command to the backup board, and the backup board replacement module replaces the dynamic library of the specified process.
[0099] 8. The mainboard performs full backup of the process after hot upgrade.
[0100] 9. End the hot upgrade process.
[0101] In the above embodiment, the upgrade condition refers to: 1. The process is normally running; 2. The process is normally backed up. The process normally running can be that the process is in a running state. The process normally backed up can be that the backup data exists and the backup process is normally running.
[0102] In the main-backup scenario, switching means that the mainboard is offline and the backup board is online. Generally, the system with main-backup function has a switching enable setting (i.e. a switch whether to allow switching), and when switching is not enabled, even if there is a condition triggering switching, there will be no switching behavior.
[0103] De- enabling the switching service refers to: 1. The process responsible for hot migration stops backup and closes the switching switch transmission; 2. Locking the management interface IP (Internet Protocol), preventing being controlled by the process responsible for hot migration.
[0104] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method, or a program product. Therefore, each aspect of the present disclosure can be embodied as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here.
[0105] The electronic device 800 according to this embodiment of the present disclosure will be described below with reference to Figure 8 Figure 8 The electronic device 800 shown is merely one example and should not be taken as limiting the scope of the present disclosure.
[0106] As shown in Figure 8 The electronic device 800 is in the form of a general computing device. Components of the electronic device 800 can include, but are not limited to, the at least one processing unit 810 described above, the at least one storage unit 820 described above, and a bus 830 that connects different system components, including the storage unit 820 and the processing unit 810.
[0107] The storage unit stores program code that can be executed by the processing unit 810, so that the processing unit 810 performs the steps described in the above "Exemplary Methods" section according to various exemplary embodiments of the present disclosure.
[0108] For example, the processing unit 810 can perform the following steps of the above method embodiments:
[0109] Receiving a hot upgrade command, wherein the hot upgrade command is used to hot upgrade the process to be upgraded in a dynamic library replacement and loading manner;
[0110] According to the hot upgrade command, detecting the process state of the process to be upgraded;
[0111] When the process to be upgraded is in the backup data state, controlling the upgrade process to close the switch and hot upgrading the process to be upgraded in a dynamic library replacement and loading manner;
[0112] After the mainboard hot upgrades the process to be upgraded, the hot upgrade command is sent to the backup board to make the backup board upgrade the process to be upgraded according to the hot upgrade command.
[0113] For example, the processing unit 810 controls the process to be upgraded in the backup data state to close the switch and hot upgrades the process to be upgraded in a dynamic library replacement and loading manner, which can include:
[0114] Controlling the process to be upgraded in the backup data state to close the switch through a disable signal;
[0115] Hot upgrading the process to be upgraded in the backup data state in a dynamic library replacement and loading manner.
[0116] For example, in the processing unit 810, the hot upgrade command can include the process identifier of the process to be upgraded and dynamic library information;
[0117] Hot upgrading the process to be upgraded in the backup data state in a dynamic library replacement and loading manner includes:
[0118] Obtain the process identifier and dynamic library information of the process to be upgraded;
[0119] According to the process identifier and dynamic library information of the process to be upgraded, replace the first dynamic library of the process to be upgraded with the second dynamic library, wherein the first dynamic library is the dynamic library before process upgrading, and the second dynamic library is the dynamic library after process upgrading.
[0120] For example, after the processing unit 810 sends the hot upgrade command to the backup board to make the backup board upgrade the process to be upgraded according to the hot upgrade command, the processing unit 810 further includes:
[0121] Perform data backup of the main board and the backup board by using the process after hot upgrading.
[0122] For example, the processing unit 810 can further include:
[0123] Load the dynamic library of the process to be upgraded to the main board and the backup board.
[0124] For example, the processing unit 810 can perform the following steps of the above method embodiments:
[0125] Receive the hot upgrade command from the main board, wherein the hot upgrade command is used for the main board to perform hot upgrading on the process to be upgraded in a dynamic library replacement and loading manner; the hot upgrade command is sent after the main board performs hot upgrading on the process to be upgraded in the backup data state, and the main board is used to control the process to be upgraded in the backup data state to close the switching switch and perform hot upgrading on the process to be upgraded in the dynamic library replacement and loading manner after receiving the hot upgrade command for hot upgrading on the process to be upgraded in the backup data state;
[0126] According to the hot upgrade command, upgrade the process to be upgraded in a dynamic library replacement manner.
[0127] The storage unit 820 can include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 8201 and / or a cache storage unit 8202, and can further include a read-only storage unit (ROM) 8203.
[0128] The storage unit 820 can further include programs / utilities 8204 having a set of (at least one) program modules 8205, such as an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which can include implementation of a network environment.
[0129] Bus 830 can be one or more of several types of bus structure including a storage bus or a memory bus, a peripheral bus, a graphics bus, a processor or local bus using any of a variety of bus architectures including a memory, using a variety of bus architectures including Industry Standard Architecture (ISA), Micro Channel Architecture (MCA), Enhanced ISA (EISA), Video Electronics Standards Association (VESA) local bus, and PCI (peripheral component interconnect) bus.
[0130] Electronic device 800 can also communicate with one or more external devices 840 such as a keyboard or pointing device, a Bluetooth device, etc.; one or more devices 850 that enable a user to interact with electronic device 800; and / or one or more devices 860 that enable electronic device 800 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface(s) 850. Still yet, electronic device 800 can communicate with one or more networks, such as one or more local area networks (LANs), one or more wide area networks (WANs), and / or one or more public networks, such as the Internet, via network adapter 860. As depicted, network adapter 860 communicates with the other components of electronic device 800 via bus 830. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with electronic device 800. Examples, include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0131] Those skilled in the art will readily understand that the example embodiments described herein can be implemented by software and / or by hardware coupled with software, as described above. Thus, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash disk, a mobile hard disk, etc.) or a network, and includes a number of instructions that cause a computing device (such as a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0132] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, which can be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored on the computer readable storage medium. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing a terminal device to perform the steps according to various example embodiments of the present disclosure described in the above “example method” section of the specification when the program product is run on the terminal device.
[0133] More specific examples of the computer-readable storage medium in the present disclosure can include but are not limited to an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] In the present disclosure, a computer readable storage medium can include a data signal carrying the readable program code in a baseband or in a carrier wave. Such a propagated data signal can take a wide variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. A computer readable medium can also be any medium that can be read by a computer or a device that can be used to store or transport the program in a functional manner, rather than the medium that the program is presented on.
[0135] Optionally, program code embodied on a computer readable storage medium can be transmitted by any data transmission techniques, including but not limited to radio frequency, wireless, cable, wire, optical fiber cable, or any suitable combination thereof.
[0136] In an implementation, the program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider (ISP).
[0137] It should be noted that, although several modules or units for a device to perform actions are mentioned in the above detailed description, such a division into modules or units is not mandatory. In fact, features and functions of two or more modules or units described above can be embodied in one module or unit according to embodiments of the present disclosure. Conversely, a feature or function of one module or unit described above can be further divided into multiple modules or units.
[0138] Moreover, although individual steps of the methods in the present disclosure are described in a particular order in the drawings, this is not required or implied, nor is it necessary to perform all of the steps shown to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined into a single step, performed in a different order, broken down into multiple steps, and / or the like.
[0139] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0140] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art to which the present disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for process hot upgrade, the method comprising: Applied to a mainboard, comprising: receiving a hot upgrade command, wherein the hot upgrade command is used to hot upgrade a process to be upgraded in a dynamic library replacement and loading mode, the dynamic library replacement comprising: replacing an old dynamic library with a new dynamic library without stopping the running of the process, and loading the old dynamic library for hot upgrade; detecting a process state of the process to be upgraded according to the hot upgrade command; when the process to be upgraded is in a backup data state, controlling the process to be upgraded to close a switching switch, and hot upgrading the process to be upgraded in a dynamic library replacement and loading mode; after the mainboard hot upgrades the process to be upgraded, sending the hot upgrade command to a backup board, so that the backup board upgrades the process to be upgraded according to the hot upgrade command.
2. The process heat upgrading method according to claim 1, characterized in that, The control of the process to be upgraded in the backup data state to close the switching switch and the hot upgrade of the process to be upgraded in the dynamic library replacement and loading mode comprise: controlling the process to be upgraded in the backup data state to close the switching switch through a de-activation signal; hot upgrading the process to be upgraded in the backup data state in the dynamic library replacement and loading mode.
3. The process heat upgrading method according to claim 2, characterized in that, The hot upgrade command comprises: a process identifier and dynamic library information of the process to be upgraded; wherein the hot upgrade of the process to be upgraded in the backup data state in the dynamic library replacement and loading mode comprises: obtaining the process identifier and the dynamic library information of the process to be upgraded; replacing a first dynamic library of the process to be upgraded with a second dynamic library according to the process identifier and the dynamic library information of the process to be upgraded, wherein the first dynamic library is a dynamic library before process upgrade, and the second dynamic library is a dynamic library after process upgrade.
4. The process heat upgrading method according to claim 1, characterized in that, After the hot upgrade command is sent to the backup board so that the backup board upgrades the process to be upgraded according to the hot upgrade command, the method further comprises: using the process after hot upgrade to perform data backup of the mainboard and the backup board.
5. The process heat upgrading method according to claim 4, characterized in that, The method further comprises: loading the dynamic library of the process to be upgraded to the mainboard and the backup board.
6. A method for process hot upgrade, the method comprising: Applied to a backup board, comprising: receiving a hot upgrade command from a mainboard, wherein the hot upgrade command is used to hot upgrade a process to be upgraded of the mainboard in a dynamic library replacement and loading mode, the dynamic library replacement comprising: replacing an old dynamic library with a new dynamic library without stopping the running of the process, and loading the old dynamic library for hot upgrade; the hot upgrade command is sent after the mainboard hot upgrades the process to be upgraded in a backup data state, and the mainboard is used to control the process to be upgraded in the backup data state to close a switching switch, and hot upgrade the process to be upgraded in a dynamic library replacement and loading mode after receiving the hot upgrade command for hot upgrading the process to be upgraded in the backup data state; upgrading the process to be upgraded in a dynamic library replacement mode according to the hot upgrade command.
7. A process heat upgrading apparatus, characterized by Applied to a mainboard, comprising: The receiving command module is configured to receive a hot upgrade command, wherein the hot upgrade command is used to perform hot upgrade on a process to be upgraded in a dynamic library replacement and loading mode, and the dynamic library replacement comprises: replacing an old dynamic library with a new dynamic library without stopping running of the process, and loading the old dynamic library to perform hot upgrade. The detecting state module is configured to detect a process state of the process to be upgraded according to the hot upgrade command. The hot upgrade module is configured to control the process to be upgraded to close a switch when the process to be upgraded is in a backup data state, and perform hot upgrade on the process to be upgraded in a dynamic library replacement and loading mode. The sending command module is configured to send the hot upgrade command to a backup board after the main board performs hot upgrade on the process to be upgraded, so that the backup board performs upgrade on the process to be upgraded according to the hot upgrade command.
8. A process heat upgrading apparatus, characterized by The application is applied to a backup board and comprises: The receiving module is configured to receive a hot upgrade command from a main board, wherein the hot upgrade command is used to perform hot upgrade on a process to be upgraded in a dynamic library replacement and loading mode by the main board, the dynamic library replacement comprises: replacing an old dynamic library with a new dynamic library without stopping running of the process, and loading the old dynamic library to perform hot upgrade; and the hot upgrade command is sent by the main board after performing hot upgrade on the process to be upgraded in a backup data state, and the main board is configured to control the process to be upgraded in the backup data state to close a switch and perform hot upgrade on the process to be upgraded in a dynamic library replacement and loading mode after receiving the hot upgrade command for performing hot upgrade on the process to be upgraded in the backup data state. The replacing module is configured to perform upgrade on the process to be upgraded in a dynamic library replacement mode according to the hot upgrade command.
9. An electronic device, comprising: The application comprises: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to perform the process hot upgrade method in any one of claims 1-6 by executing the executable instructions.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the process hot upgrade method in any one of claims 1-6.
Citation Information
Patent Citations
Single board upgrade method and device
CN106571939A
Hot update method for application program
CN108845813A