Node upgrade state determination method, node upgrade method, device and electronic equipment
Patent Information
- Application Number
- CN202410071083.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-01-17
AI Technical Summary
[0005]本申请提供一种节点升级状态确定方法、节点升级方法、装置及电子设备,用以解决服务器升级效率低的技术问题
[0044]本申请提供的节点升级状态确定方法、节点升级方法、装置及电子设备,通过检测目标节点的进程状态确定目标节点升级进程是否启动成功,若启动成功则可以对目标节点进行远程访问测试,并在远程访问正常的情况下获取目标节点的传输控制协议访问状态,根据传输控制协议访问状态确定目标节点是否升级成功。通过本实施例的节点状态确定方法,不仅可以检测节点升级进程,还可以检测节点的远程访问状态和传输控制协议状态,从而可以确认节点是否完全可用,无需人工排查,可以提高服务器节点升级效率,减少升级时间。
Smart Images

Figure CN117914741B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method for determining node upgrade status, a node upgrade method, an apparatus, and an electronic device. Background Technology
[0002] With the development of computer technology, enterprises, schools, and other institutions are increasingly using servers on a larger scale. To enhance efficient server management, adopting a unified operation and maintenance system is essential.
[0003] Currently, some operations and maintenance (O&M) systems can achieve unified upgrades of multiple servers. For example, to achieve unified management, an organization's headquarters can use an O&M system to synchronously upgrade the headquarters server and the servers of each branch office. The O&M system needs to confirm the upgrade status of each server node during the server upgrade process and take appropriate measures promptly based on whether the upgrade is complete.
[0004] However, confirming the upgrade status of server nodes through the operations and maintenance system is quite complex. Some nodes may fail to complete the upgrade due to various factors, while others may have completed the upgrade but exhibit abnormalities such as node unavailability, requiring manual troubleshooting using tools such as the console. As the number of server nodes increases, determining their upgrade status becomes even more difficult, leading to low server upgrade efficiency and long processing times. Summary of the Invention
[0005] This application provides a method for determining node upgrade status, a node upgrade method, an apparatus, and an electronic device to solve the technical problem of low server upgrade efficiency.
[0006] Firstly, this application provides a method for determining the node upgrade status, including:
[0007] Detect the process status of the target node; the target node is a node that has started the upgrade process;
[0008] If the process status of the target node is "started successfully", then a remote access test is performed on the target node to obtain the remote access result.
[0009] If the remote access result is normal, obtain the transmission control protocol access status of the target node;
[0010] The upgrade status of the target node is determined based on the access status of the transmission control protocol, and the upgrade status includes upgrade success and upgrade failure.
[0011] In one possible implementation, detecting the process state of the target node includes:
[0012] Obtain the startup log of the target node;
[0013] Detect the target information in the startup log;
[0014] The target information includes a first error message and / or a first running message; the first error message indicates that the process status of the target node is startup failure; the first running message indicates that the process status of the target node is startup success.
[0015] In one possible implementation, the node upgrade state determination method also includes:
[0016] If the process status is "startup failed", the process status of the target node is checked again.
[0017] If the number of repeated checks reaches a first preset number and the process status is "startup failed", the upgrade status of the target node is determined to be "upgrade failed".
[0018] Based on the first error message, an upgrade error log is generated.
[0019] In one possible implementation, performing a remote access test on the target node includes:
[0020] Remote login access to the target node is performed via a remote terminal protocol;
[0021] Obtain the return information from the remote login access;
[0022] The returned information includes a second error message and / or a second operational message; the second error message indicates that the remote access result of the target node is an access failure; the second operational message indicates that the remote access result of the target node is a normal access.
[0023] In one possible implementation, the node upgrade state determination method also includes:
[0024] If the remote access result is an access failure, repeat the remote access test on the target node;
[0025] If the number of repeated tests reaches the second preset number and all remote access results are access failures, the upgrade status of the target node is determined to be upgrade failure.
[0026] Based on the second error message, an upgrade error log is generated.
[0027] In one possible implementation, determining the upgrade status of the target node based on the Transmission Control Protocol access status includes:
[0028] If the access status of the transmission control protocol is "connection established", the upgrade status of the target node is determined to be "upgrade successful".
[0029] And / or,
[0030] If the access status of the transmission control protocol is pending connection, the access status of the transmission control protocol of the target node is repeatedly obtained; if the number of repeated acquisitions reaches a third preset number and the access status of the transmission control protocol is pending connection, the upgrade status of the target node is determined to be upgrade failure, and an upgrade error log is generated according to the access status of the transmission control protocol.
[0031] Secondly, this application provides a node upgrade method applied to an operation and maintenance system, the operation and maintenance system including a first atomic component and a second atomic component, the node upgrade method including:
[0032] Invoke the first atomic component to start the upgrade process of the target node;
[0033] The second atomic component is invoked to determine the upgrade status of the target node; the second atomic component contains a preloaded script, which is used to perform the steps of the node upgrade status determination method as described in the first aspect.
[0034] Thirdly, this application provides a node upgrade status determination device, comprising:
[0035] The process detection module is used to detect the process status of the target node; the target node is a node that has started the upgrade process.
[0036] The remote testing module is used to perform remote access tests on the target node when the process status of the target node is successful, and obtain the remote access results.
[0037] The transmission access module is used to obtain the transmission control protocol access status of the target node when the remote access result is normal.
[0038] The status determination module is used to determine the upgrade status of the target node based on the access status of the transmission control protocol, wherein the upgrade status includes upgrade success and upgrade failure.
[0039] Fourthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0040] The memory stores computer-executed instructions;
[0041] The processor executes computer execution instructions stored in the memory to implement the node upgrade status determination method as described in any one of the first aspects or the node upgrade method as described in the second aspect.
[0042] Fifthly, this application provides a computer-readable storage medium, comprising: computer-executable instructions stored in the computer-readable storage medium, wherein the computer-executable instructions, when executed by a processor, are used to implement the node upgrade state determination method as described in any one of the first aspects or the node upgrade method as described in the second aspect.
[0043] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the node upgrade state determination method as described in any one of the first aspects or the node upgrade method as described in the second aspect.
[0044] The node upgrade status determination method, node upgrade method, apparatus, and electronic device provided in this application determine whether the target node upgrade process has started successfully by detecting the process status of the target node. If it has started successfully, a remote access test can be performed on the target node, and if the remote access is normal, the transmission control protocol access status of the target node can be obtained. Based on the transmission control protocol access status, it is determined whether the target node has been upgraded successfully. The node status determination method of this embodiment can not only detect the node upgrade process, but also detect the node's remote access status and transmission control protocol status, thereby confirming whether the node is fully available without manual troubleshooting, improving server node upgrade efficiency and reducing upgrade time. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0046] Figure 1 This is a schematic diagram of an automated upgrade process for a server node provided in an embodiment of this application;
[0047] Figure 2 This is a flowchart illustrating a method for determining a node upgrade status provided in an embodiment of this application;
[0048] Figure 3 This is a flowchart illustrating a method for detecting the process status of a target node provided in an embodiment of this application;
[0049] Figure 4 This is a flowchart illustrating a method for determining a node upgrade status according to another embodiment of this application;
[0050] Figure 5This is a flowchart illustrating a method for remotely accessing a target node according to an embodiment of this application.
[0051] Figure 6 This is a flowchart illustrating a method for determining a node upgrade status according to another embodiment of this application;
[0052] Figure 7 This is a flowchart illustrating a node upgrade method provided in an embodiment of this application;
[0053] Figure 8 This is a schematic diagram of a process for automatically upgrading nodes provided in an embodiment of this application;
[0054] Figure 9 This is a schematic diagram of the structure of a node upgrade status determination device provided in an embodiment of this application;
[0055] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0056] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0057] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0058] With the development of computer technology, intelligent operation and maintenance systems can automate batch upgrades of systems across multiple server nodes. This is especially useful in scenarios where headquarters manage branch offices, where headquarters need to coordinate and manage system upgrades and changes for their own and branch office server nodes. If a node upgrade fails, it could disrupt normal business operations.
[0059] Figure 1 This is a schematic diagram illustrating a process for automated server node upgrades provided in this application. For example... Figure 1As shown, the typical upgrade process for server nodes in an operations and maintenance system includes: first, stopping all service processes on all nodes and clearing all service caches; then, starting the master control node for the upgrade; next, logging into the console tool to check the master control node's startup status; after confirming successful master control node startup and upgrade, starting managed nodes in batches; finally, checking the status of all nodes in the console tool to see if they are RUNNING, and verifying that individual nodes can be accessed normally. If access is normal, the upgrade is complete; if access is abnormal, the cause of failure needs to be investigated node by node.
[0060] In the aforementioned node upgrade process, the operations and maintenance system can initiate the upgrade process by launching upgrade scripts for the master node and managed nodes. These scripts allow nodes to automatically load the upgrade data package after stopping service processes and clearing caches, thus completing the node system upgrade. However, node upgrades may encounter anomalies such as upgrade failures. Some node upgrades may fail due to incomplete upgrades, while others may be unusable even after completion. Manual intervention is required to log into the console tool to determine the upgrade status of each node, and to address any upgrade failures promptly. This approach is time-consuming and labor-intensive, prolonging the upgrade process and resulting in low efficiency for server node upgrades.
[0061] To address the aforementioned technical problems, this application provides a method for determining node upgrade status, a node upgrade method, an apparatus, and an electronic device.
[0062] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0063] Figure 2 This is a flowchart illustrating a method for determining the node upgrade status provided in an embodiment of this application. This method can be applied to the upgrade process of server nodes in an operation and maintenance system. Figure 2 As shown, the method includes:
[0064] Step S210: Detect the process status of the target node.
[0065] The target node is the node whose upgrade process has been initiated. This node can be a server node that needs to be upgraded.
[0066] Specifically, the process status of the target node can be monitored in real time using process monitoring tools to confirm whether the target node's processes have started successfully. Process monitoring tools can be monitoring and analysis tools in the Linux system, such as nmon (Nigel's Monitor, a performance monitoring tool). In some other implementations, Linux commands or Linux scheduled tasks can also be used to detect whether the target node's processes have started successfully.
[0067] Step S220: If the process status of the target node is "started successfully", then perform a remote access test on the target node and obtain the remote access result.
[0068] Specifically, if the target node's process status is detected as successfully started, a remote access test can be performed on the target node based on a pre-determined remote protocol. The remote access test result can include normal access and access failure. The remote protocol can be a network protocol such as Telnet (Remote Terminal Protocol, a protocol that can remotely control a web server) or SSH (Secure Shell, a protocol that can be used for network services such as remote login).
[0069] In some other implementations, remote access tests of the target node can also be performed using pre-installed remote control software such as VNC (Virtual Network Console).
[0070] It should be noted that the entity performing the remote access test on the target node can be a server running the operation and maintenance system, or other terminal devices with communication capabilities.
[0071] Step S230: If the remote access result is normal, obtain the transmission control protocol access status of the target node.
[0072] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol, often simply referred to as TCP.
[0073] Specifically, if the remote access test shows normal access, the TCP connection access status of the target node can be monitored using computer commands such as netstat (network statistics). For example, by entering the netstat command, you can view the TCP connection access status. If it returns a "LISTEN" status, it means that it is listening for connection requests from other TCP ports and needs to wait for a connection; if it returns an "ESTABLISHED" status, it means that the TCP port connection of the target node has been established.
[0074] Step S240: Determine the upgrade status of the target node based on the Transmission Control Protocol access status. The upgrade status includes upgrade success and upgrade failure.
[0075] Specifically, if the target node's TCP access status is "connection established," it means that the target node's upgrade process has been completed and the node is available, thus determining that the target node's upgrade status is "upgrade successful." Otherwise, the target node's upgrade status is "upgrade failed."
[0076] In the above embodiments, by detecting the process status of the target node, it can be determined whether the target node upgrade process has started successfully. If it has started successfully, a remote access test can be performed on the target node, and if the remote access is normal, the transmission control protocol access status of the target node can be obtained. Based on the transmission control protocol access status, it can be determined whether the target node has been upgraded successfully. The node status determination method of this embodiment can not only detect the node upgrade process, but also detect the node's remote access status and transmission control protocol status, thereby confirming whether the node is fully available without manual troubleshooting, improving server node upgrade efficiency and reducing upgrade time.
[0077] Figure 3 This is a flowchart illustrating a method for detecting the process status of a target node provided in an embodiment of this application. Figure 3 As shown, the method may include:
[0078] Step S310: Obtain the startup log of the target node.
[0079] Step S320: Detect the target information in the startup log.
[0080] The target information includes first error information and / or first running information; the first error information indicates that the process status of the target node is startup failure; the first running information indicates that the process status of the target node is startup success. The first error information may include Exception error information. The first running information may include RUNNING prompt information.
[0081] Specifically, the startup log information of the target node can be obtained, and the process startup status of the target node can be monitored by checking whether this information contains target information. For example, if an Exception error message is detected in the startup log, it means that resource loading failed or files are missing during process startup, causing the node to fail to restart; if a RUNNING message is detected in the startup log, it means that the process started successfully.
[0082] Figure 4 This is a flowchart illustrating a method for determining a node upgrade status according to another embodiment of this application. Figure 4 As shown, the method for determining the node upgrade status may include:
[0083] Step S410: If the process status is "startup failed", repeat the process status check of the target node.
[0084] In this context, process state startup failure can be considered as a situation other than successful process state startup, such as the failure to detect the first running information. In some other implementations, process state startup failure can also be a pre-defined process state situation, such as the detection of the first error message.
[0085] Specifically, if no RUNNING message is detected in the startup log of the target node, the startup log information of the target node can be checked again after a certain time interval. If a RUNNING message is detected during the second check, the process status can be considered as successful startup. In some other implementations, the startup log of the target node can be checked periodically through scheduled tasks or other means, and the number of checks can be set to achieve repeated checks.
[0086] Step S420: If the number of repeated checks reaches the first preset number and the process status is "startup failed", determine that the upgrade status of the target node is "upgrade failed".
[0087] The first preset number of times can be any positive integer that is pre-defined. For example, the first preset number of times can be 3 times.
[0088] Specifically, if the number of repeated checks reaches the first preset number, and the result of each repeated check is that the process fails to start, it can be regarded as the target node starting abnormal and unable to complete the upgrade process, thus confirming that the upgrade status of the target node is upgrade failed.
[0089] Step S430: Generate an upgrade error log based on the first error message.
[0090] The first error message may include an Exception error message. In some implementations, the first error message may also include a first preset number of attempts. In other implementations, if neither an Exception error message nor a RUNNING message appears during the process of detecting the target node process status, the first error message can be automatically generated to indicate that the target node process has failed to start.
[0091] In the above embodiments, if the process status of the target node is detected as "startup failed," the detection can be repeated according to a preset first count, thereby reducing the possibility of misjudgment due to the inability to detect the correct process status immediately. If the process status still does not fail to start after repeated detection, it can be determined that the target node upgrade has failed, and an upgrade error log is generated so that the upgrade failure status and error log of the target node can be viewed in a timely manner, and the cause of the node upgrade failure can be quickly located.
[0092] Figure 5 This is a flowchart illustrating a method for remotely accessing a target node, as provided in an embodiment of this application. Figure 5 As shown, the method may include:
[0093] Step S510: Remotely log in and access the target node via a remote terminal protocol.
[0094] The remote terminal protocol is the Telnet protocol.
[0095] Step S520: Obtain the return information for remote login access.
[0096] The returned information includes a second error message and / or a second operational message; the second error message indicates that the remote access result of the target node is an access failure; the second operational message indicates that the remote access result of the target node is a successful access. The second error message can be "No route to host". The second operational message can be "Escape character is '^]'."
[0097] Specifically, you can use the Telnet command to remotely log in to the target node server and obtain the returned information. If it returns "No route to host", it means that the server is still restarting or the restart failed, and the remote access failed. If it returns "Escape character is '^]'.", it means that the remote access to the target node is normal.
[0098] Figure 6 This is a flowchart illustrating a method for determining a node upgrade status according to another embodiment of this application. Figure 6 As shown, the method for determining the node upgrade status also includes:
[0099] Step S610: If the remote access result is an access failure, repeat the remote access test on the target node.
[0100] In this context, access failure can be considered as a situation where the remote access result is other than normal access, such as not returning the second running information. In some other implementations, access failure can also be another situation that meets predefined criteria, such as returning the second error message.
[0101] Specifically, if the second running information is not returned when obtaining the return information for remote login access via the Telnet protocol, the target node can be remotely accessed again via the Telnet protocol after a certain time interval. If the second running information is returned upon the second access, the remote access to the target node can be considered normal. In some other implementations, the target node can be remotely accessed periodically via scheduled tasks or other methods, and the number of access tests can be set to achieve repeated testing.
[0102] Step S620: If the number of repeated tests reaches the second preset number and the remote access results are all access failures, determine that the upgrade status of the target node is upgrade failure.
[0103] The second preset number of times can be any positive integer that is pre-defined. For example, the second preset number of times can be 3 times.
[0104] Specifically, if the number of times the remote access test is repeated reaches the second preset number, and the result of each repeated test is an access failure, it can be considered that the target node cannot perform normal remote login access, thus confirming that the target node's upgrade status has failed due to remote access factors.
[0105] Step S630: Generate an upgrade error log based on the second error message.
[0106] In some implementations, the second error message may also include a second preset number of attempts. In other implementations, if neither the second error message nor the second prompt message appears during the remote access test of the target node, a second error message can be automatically generated to indicate that the remote access of the target node is abnormal.
[0107] In the above embodiments, if remote access to the target node fails, the test can be repeated according to a preset number of times. This reduces the possibility of misjudgment due to temporary inability to remotely access the target node. If remote access still fails after repeated testing, it can be determined that the upgrade failed due to an abnormal remote access, and an upgrade error log is generated. This allows the upgrade failure status and error log of the target node to be viewed promptly, quickly pinpointing the cause of the node upgrade failure.
[0108] In one embodiment, determining the upgrade status of the target node based on the Transmission Control Protocol access status may include:
[0109] Step S2401: If the access status of the transmission control protocol is "connection established", determine that the upgrade status of the target node is "upgrade successful".
[0110] Specifically, when checking the TCP connection access status using the netstat command, if the "ESTABLISHED" status is returned, it means that the TCP connection to the target node has been established and the target node upgrade has been successful.
[0111] In one embodiment, determining the upgrade status of the target node based on the Transmission Control Protocol access status may include:
[0112] Step S2402: If the access status of the transmission control protocol is pending connection, repeatedly obtain the access status of the transmission control protocol of the target node.
[0113] Specifically, when checking the TCP connection access status using the netstat command, if it returns a "LISTEN" status, it indicates that the target node's TCP access status is pending connection. In this case, the TCP connection access status can be checked again after a certain time interval. If the status returns "ESTABLISHED" on the second check, it can be considered that the TCP connection to the target node has been established, and the target node upgrade has been successful. In some other implementations, the TCP connection access status can be checked periodically through scheduled tasks, and the number of checks can be set to achieve repeated checks.
[0114] Step S2403: If the number of repeated acquisitions reaches the third preset number and the access status of the transmission control protocol is "waiting to connect", determine that the upgrade status of the target node is "upgrade failed" and generate an upgrade error log according to the access status of the transmission control protocol.
[0115] The third preset number of times can be any positive integer that is pre-defined. For example, the third preset number of times can be 3 times.
[0116] If the number of times the TCP connection access status is checked repeatedly reaches the third preset number, and the result of each repeated check is "pending connection", it can be regarded as an abnormal TCP connection access of the target node. This confirms that the upgrade status of the target node is "upgrade failed" due to the TCP access status, and generates the corresponding upgrade error log.
[0117] In one embodiment, determining the upgrade status of the target node based on the Transmission Control Protocol access status may also include steps for performing the methods described in steps S2401, S2402, and S2403 above.
[0118] In the above embodiments, if the TCP access status remains pending connection after the process starts successfully and remote login access is normal, it indicates that the target node is unavailable due to TCP connection abnormality, thereby quickly locating the cause of node upgrade failure.
[0119] Figure 7 This is a flowchart illustrating a node upgrade method provided in an embodiment of this application. This node upgrade method can be applied to an operations and maintenance (O&M) system, which can be a system developed in-house or based on a third-party O&M platform. The O&M system can initiate an automated node upgrade process through function calls to atomic components to upgrade or update server nodes. Figure 7 In the illustrated embodiment, the operation and maintenance system includes a first atomic component and a second atomic component, and the node upgrade method includes:
[0120] Step S710: Invoke the first atomic component to start the upgrade process of the target node.
[0121] Step S720: Call the second atomic component to determine the upgrade status of the target node.
[0122] The second atomic component includes a preloaded script, which is used to execute the steps of the node upgrade status determination method as described in any of the above embodiments.
[0123] Specifically, firstly, the current service process of the target node can be stopped and the target node cached by calling the first atomic component to start the upgrade process of the target node; secondly, the second atomic component can be called to execute the pre-loading script in the second atomic component, and the steps of the node upgrade status determination method in any of the above method embodiments can be executed through the pre-loading script. If the upgrade status is upgrade successful, the automated upgrade process of the current target node can be terminated. If the upgrade status is upgrade failed, an upgrade error report can be generated based on the error information and displayed through the atomic component. In some other embodiments, if the upgrade status is upgrade failed, the error information can also be directly captured and displayed in the atomic component. It should be noted that the error information may include the first error information and the second error information in the above method embodiments.
[0124] Figure 8 This is a schematic diagram illustrating a process for automatically upgrading nodes, provided in an embodiment of this application. Figure 8 In this embodiment, the operation and maintenance system needs to perform automated upgrades on the master control node and the controlled nodes, such as... Figure 8As shown, the operation and maintenance system includes six atomic components: "Stop Master Control", "Clear Cache", "Start Master Control", "Master Control Diagnostic Test", "Start Managed Node", and "Managed Node Diagnostic Test". After the automated upgrade process begins, the "Stop Master Control" atomic component can be used to stop the machine where the master control node is located, and then the "Clear Cache" atomic component can be used to clear the cache of the master control node. The "Start Master Control" atomic component can be used to start the master control node. After the master control node starts, it will automatically enter the upgrade process according to the upgrade data. Then, the "Master Control Diagnostic Test" atomic component can execute the steps of the node upgrade status determination method in any of the above method embodiments, thereby determining the upgrade status of the master control node. After the master control node upgrade is completed, the "Start Managed Node" atomic component can be used to start the managed node, and the "Managed Node Diagnostic Test" can execute the steps of the node upgrade status determination method in any of the above method embodiments to determine the upgrade status of the managed node.
[0125] In this system, the master node and managed nodes can be server nodes within the enterprise that have a master-slave management relationship, and there can be multiple managed nodes. After startup, managed nodes can automatically load the necessary upgrade data packages and perform automatic upgrades.
[0126] In the above embodiments, by adding atoms to the original automated operation and maintenance process to determine the node upgrade status, there is no need to manually check the node status or manually check whether a single node is accessible normally. This can reduce errors caused by manual operation and improve the efficiency of server node upgrades.
[0127] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0128] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0129] Figure 9This is a schematic diagram of a node upgrade status determination device provided in an embodiment of this application, as shown below. Figure 9 As shown, the node upgrade status determination device 900 may include:
[0130] The process detection module 910 can be used to detect the process status of a target node; the target node is a node that has started the upgrade process.
[0131] The remote testing module 920 can be used to perform remote access tests on the target node when the process status of the target node is successful, and obtain the remote access results.
[0132] The transmission access module 930 can be used to obtain the transmission control protocol access status of the target node when the remote access result is normal.
[0133] The status determination module 940 can be used to determine the upgrade status of the target node based on the access status of the transmission control protocol, wherein the upgrade status includes upgrade success and upgrade failure.
[0134] In one embodiment, the process detection module 910 may include:
[0135] The log acquisition unit can be used to acquire the startup log of the target node.
[0136] The information detection unit can be used to detect target information in the startup log.
[0137] The target information includes a first error message and / or a first running message; the first error message indicates that the process status of the target node is startup failure; the first running message indicates that the process status of the target node is startup success.
[0138] In one embodiment, the node upgrade status determination device 900 may further include:
[0139] The duplicate detection module can be used to repeatedly detect the process status of the target node when the process status is "startup failed".
[0140] The first determining module can be used to determine that the upgrade status of the target node is an upgrade failure when the number of repeated detections reaches a first preset number and the process status is a startup failure.
[0141] The first generation module can be used to generate an upgrade error log based on the first error information.
[0142] In one embodiment, the remote testing module 920 may include:
[0143] The remote login access unit can be used to remotely log in and access the target node via a remote terminal protocol.
[0144] The return information acquisition unit can be used to acquire the return information of the remote login access.
[0145] The returned information includes a second error message and / or a second operational message; the second error message indicates that the remote access result of the target node is an access failure; the second operational message indicates that the remote access result of the target node is a normal access.
[0146] In one embodiment, the node upgrade status determination device 900 may further include:
[0147] The repeat test module can be used to repeatedly perform remote access tests on the target node when the remote access result is an access failure.
[0148] The second determining module can be used to determine the upgrade status of the target node as upgrade failure when the number of repeated tests reaches a second preset number and the remote access results are all access failures.
[0149] The second generation module can be used to generate an upgrade error log based on the second error information.
[0150] In one embodiment, the state determination module 940 may include:
[0151] The TCP first connection unit can be used to determine that the upgrade status of the target node is successful when the access status of the transmission control protocol is that the connection has been established.
[0152] In one embodiment, the state determination module 940 may further include:
[0153] The TCP repeat connection unit can be used to repeatedly acquire the transmission control protocol access status of the target node when the access status of the transmission control protocol is pending connection; and can be used to determine that the upgrade status of the target node is upgrade failure when the number of repeated acquisitions reaches a third preset number and the access status of the transmission control protocol is pending connection, and generate an upgrade error log based on the access status of the transmission control protocol.
[0154] The node upgrade status determination device provided in this embodiment can be used to execute the technical solutions in any of the aforementioned method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0155] In one embodiment, a node upgrade device is also provided, which can be applied to an operation and maintenance system, the operation and maintenance system including a first atomic component and a second atomic component, and the node upgrade device may include:
[0156] The first calling module can be used to call the first atomic component to start the upgrade process of the target node.
[0157] The second invocation module can be used to invoke the second atomic component to determine the upgrade status of the target node. The second atomic component contains a preloaded script, which is used to execute the steps of the node upgrade status determination method as described in any of the above method embodiments.
[0158] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0159] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0160] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device 40 includes:
[0161] Processor 41, memory 42, and communication interface 43;
[0162] The memory 42 is used to store the executable instructions of the processor 41;
[0163] Wherein, the processor 41 is determined to execute the technical solution in any of the foregoing method embodiments by executing the executable instructions.
[0164] Optionally, the memory 42 can be either standalone or integrated with the processor 41.
[0165] Optionally, when the memory 42 is a device independent of the processor 41, the electronic device 40 may further include:
[0166] Bus 44, memory 42 and communication interface 43 are connected to processor 41 through bus 44 and complete communication with each other. Communication interface 43 is used to communicate with other devices.
[0167] Optionally, the communication interface 43 can be implemented using a transceiver. The communication interface is used to enable communication between the database access device and other devices (e.g., clients, read-write databases, and read-only databases). The memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk drive.
[0168] Bus 44 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0169] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0170] The electronic device is used to execute the technical solutions in any of the foregoing method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0171] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the technical solutions provided in any of the foregoing method embodiments.
[0172] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solutions provided in any of the foregoing method embodiments.
[0173] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0174] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0175] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0176] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for determining the upgrade status of a node, characterized in that, include: Detect the process status of the target node; The target node is a node whose upgrade process has been initiated; If the process status of the target node is "started successfully", then a remote access test is performed on the target node to obtain the remote access result. If the remote access result is normal, obtain the transmission control protocol access status of the target node; The upgrade status of the target node is determined based on the access status of the transmission control protocol, and the upgrade status includes upgrade success and upgrade failure.
2. The determination method according to claim 1, characterized in that, Detecting the process status of the target node includes: Obtain the startup log of the target node; Detect the target information in the startup log; The target information includes a first error message or a first running message; the first error message indicates that the process status of the target node is startup failure; the first running message indicates that the process status of the target node is startup success.
3. The determination method according to claim 2, characterized in that, Also includes: If the process status is "startup failed", the process status of the target node is checked again. If the number of repeated checks reaches a first preset number and the process status is "startup failed", the upgrade status of the target node is determined to be "upgrade failed". Based on the first error message, an upgrade error log is generated.
4. The determination method according to claim 1, characterized in that, The remote access test of the target node includes: Remote login access to the target node is performed via a remote terminal protocol; Obtain the return information from the remote login access; The returned information includes a second error message or a second running message; the second error message indicates that the remote access result of the target node is an access failure; the second running message indicates that the remote access result of the target node is a normal access.
5. The determination method according to claim 4, characterized in that, Also includes: If the remote access result is an access failure, repeat the remote access test on the target node; If the number of repeated tests reaches the second preset number and all remote access results are access failures, the upgrade status of the target node is determined to be upgrade failure. Based on the second error message, an upgrade error log is generated.
6. The determining method according to any one of claims 1 to 5, characterized in that, Determining the upgrade status of the target node based on the access status of the Transmission Control Protocol includes: If the access status of the transmission control protocol is "connection established", the upgrade status of the target node is determined to be "upgrade successful". And / or, If the access status of the transmission control protocol is pending connection, the access status of the transmission control protocol of the target node is repeatedly obtained; if the number of repeated acquisitions reaches a third preset number and the access status of the transmission control protocol is pending connection, the upgrade status of the target node is determined to be upgrade failure, and an upgrade error log is generated according to the access status of the transmission control protocol.
7. A node upgrade method, characterized in that, Applied to an operations and maintenance system, the operations and maintenance system includes a first atomic component and a second atomic component, and the node upgrade method includes: Invoke the first atomic component to start the upgrade process of the target node; The second atomic component is invoked to determine the upgrade status of the target node; the second atomic component contains a preloaded script, which is used to perform the steps of the node upgrade status determination method as described in any one of claims 1 to 6.
8. A node upgrade status determination device, comprising: The process detection module is used to detect the process status of the target node; The target node is a node whose upgrade process has been initiated; The remote testing module is used to perform remote access tests on the target node when the process status of the target node is successful, and obtain the remote access results. The transmission access module is used to obtain the transmission control protocol access status of the target node when the remote access result is normal. The status determination module is used to determine the upgrade status of the target node based on the access status of the transmission control protocol, wherein the upgrade status includes upgrade success and upgrade failure.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the node upgrade status determination method as described in any one of claims 1 to 6 or the node upgrade method as described in claim 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the node upgrade status determination method as described in any one of claims 1 to 6 or the node upgrade method as described in claim 7.
Citation Information
Patent Citations
Remote software upgrading technique
CN102075564A
Upgrading strategy determination method and device, storage medium and electronic device
CN116527503A