Operation and maintenance method and device, computer device, readable storage medium and program product
By acquiring the operation and maintenance tasks of the target distributed system, using preset naming rules and role recognition models to automatically identify the role information of host devices, and combining operation and maintenance tools and script files to automatically execute operation and maintenance tasks, the problem of low operation and maintenance efficiency in existing technologies is solved, and unmanned and efficient operation and maintenance is achieved.
Patent Information
- Application Number
- CN202411727851.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In existing technologies, the use of operation and maintenance tools to assist technicians in performing operation and maintenance tasks of distributed systems suffers from low operation and maintenance efficiency.
By acquiring the operation and maintenance tasks of the target distributed system, determining the role identification information and IoT protocol IP address of the target host device, using preset naming rules and role recognition models to automatically identify the role information of the host device, and executing operation and maintenance tasks according to the role information, combined with operation and maintenance tools and script files to automatically execute operation and maintenance tasks.
It enables automated execution of operation and maintenance tasks without the need for technical personnel assistance, reducing costs while significantly improving operation and maintenance efficiency and task success rate.
Smart Images

Figure CN119520216B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated operation and maintenance technology, and in particular to an operation and maintenance method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] Large-scale distributed systems typically consist of a large number of interconnected hosts, each playing a different role to collaboratively achieve efficient operation. In distributed systems where maintenance tasks are involved, technical personnel often manually configure each host to complete these tasks.
[0003] In existing technologies, in order to improve the operation and maintenance efficiency of distributed systems, most methods utilize operation and maintenance tools to assist technical personnel in performing operation and maintenance tasks of distributed systems.
[0004] However, this method of using operation and maintenance tools to assist technicians in performing operation and maintenance tasks of distributed systems still suffers from low operation and maintenance efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide an operation and maintenance method, device, computer equipment, computer-readable storage medium, and computer program product that can improve operation and maintenance efficiency in response to the above-mentioned technical problems.
[0006] Firstly, this application provides an operation and maintenance method, including:
[0007] Obtain the operation and maintenance tasks of the target distributed system, and determine the target host devices in the target distributed system involved in the operation and maintenance tasks;
[0008] Based on the target host device, a list of host devices for the target operation and maintenance tool is determined. This list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0009] Using the target operation and maintenance tool, determine the role information of the target host device based on the host device list, and execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0010] In one embodiment, the method further includes: when the target host device joins the target distributed system, obtaining the functional information of the target host device, the functional information being used to characterize the services that the target host device can provide; and generating role identification information of the target host device based on the functional information using a preset naming rule.
[0011] In one embodiment, the process of using the target operation and maintenance tool to determine the role information of the target host device based on the host device list includes: using the target operation and maintenance tool to call a preset acquisition variable, and obtaining the role identification information from the host device list based on the preset acquisition variable; and using the target operation and maintenance tool to determine the role information based on the role identification information.
[0012] In one embodiment, the method of using the target maintenance tool to determine the role information based on the role identification information includes: using the target maintenance tool to call the role recognition model, which is determined according to the preset naming rules; and inputting the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0013] In one embodiment, executing the maintenance task based on the role information, the script file of the maintenance task, and the target host device includes: determining the maintenance sub-task to be executed by the target host device in the maintenance task from the script file based on the role information, and executing the maintenance sub-task based on the target host device.
[0014] In one embodiment, the execution of the operation and maintenance sub-task based on the target host device includes: obtaining the IP address of the target host device and establishing a connection with the target host device using the IP address, so that the target host device can execute the operation and maintenance sub-task.
[0015] Secondly, this application also provides an operation and maintenance device, including:
[0016] The acquisition module is used to acquire the operation and maintenance tasks of the target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks.
[0017] The determination module is used to determine a list of host devices for the target operation and maintenance tool based on the target host device. The list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0018] The execution module is used to utilize the target operation and maintenance tool to determine the role information of the target host device based on the host device list, and to execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0019] Thirdly, this application also provides a computer device, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described in any of the embodiments of the first aspect above.
[0020] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.
[0021] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the embodiments of the first aspect above.
[0022] The aforementioned operation and maintenance method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire the operation and maintenance tasks of a target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks. Based on the target host devices, a host device list for the target operation and maintenance tool is determined. This host device list includes the role identification information and IoT protocol IP address of the target host devices, whereby the role identification information is determined based on the functional information of the target host devices. Using the target operation and maintenance tool, the role information of the target host devices is determined based on the host device list, and the operation and maintenance task is executed based on the role information, the script file of the operation and maintenance task, and the target host devices. The operation and maintenance method provided in this application can automate the execution of operation and maintenance tasks of a distributed system using operation and maintenance tools, without the assistance of technical personnel, thereby reducing costs and effectively improving the efficiency of operation and maintenance tasks. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating the operation and maintenance method in one embodiment;
[0025] Figure 2 This is a flowchart illustrating a method for joining a target distributed system to a target host device in one embodiment.
[0026] Figure 3 This is a flowchart illustrating a method for determining the role information of a target host device based on a host device list in one embodiment.
[0027] Figure 4 This is a flowchart illustrating a method for determining role information based on role identifier information in one embodiment;
[0028] Figure 5 This is a flowchart illustrating the operation and maintenance method in another embodiment;
[0029] Figure 6 This is a structural block diagram of the operation and maintenance device in one embodiment;
[0030] Figure 7 This is an internal structural diagram of a computer device in one embodiment;
[0031] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] Large-scale distributed systems typically consist of a large number of interconnected hosts, each playing a different role to collaboratively achieve efficient operation. In distributed systems where maintenance tasks are involved, technical personnel often manually configure each host to complete these tasks.
[0034] In existing technologies, to improve the operational efficiency of distributed systems, most methods utilize operational tools to assist technicians in performing distributed system maintenance tasks. However, this approach still suffers from relatively low operational efficiency.
[0035] In view of this, this application provides an operation and maintenance method. The operation and maintenance method provided by this application can use operation and maintenance tools to realize the automated execution of operation and maintenance tasks of distributed systems without the assistance of technical personnel. While reducing costs, it can also effectively improve operation and maintenance efficiency.
[0036] The operation and maintenance method provided in this application can be executed by a computer device, which can be a terminal or a server. The target operation and maintenance tool is installed on the computer device.
[0037] In one exemplary embodiment, such as Figure 1 As shown, an operation and maintenance method is provided, which should include the following steps:
[0038] Step 101: Obtain the operation and maintenance tasks of the target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks.
[0039] Optionally, a distributed system refers to a system composed of multiple computer nodes that communicate and collaborate through a network. These computer nodes can be servers or terminal devices, and they are physically or logically distributed in different geographical locations, collaborating to complete specific tasks or provide a range of services. The target distributed node refers to the distributed system for which operational tasks are to be performed.
[0040] In some alternative embodiments, the target distributed system can be a large distributed system, that is, a system containing a greater number of computer nodes than a conventional distributed system.
[0041] This operation and maintenance task refers to a series of management and maintenance tasks to ensure that the target distributed system can operate stably, efficiently, and securely to meet business needs. Specifically, this operation and maintenance task can include deployment tasks, configuration tasks, and other types of operation and maintenance tasks.
[0042] In some exemplary embodiments, upon receiving an operation and maintenance task for a target distributed system, the target host device that needs to perform the operation and maintenance task can be determined from multiple host devices in the target distributed system based on the operation and maintenance task. This host device can be understood as a computer node in the distributed system described above.
[0043] Step 102: Determine the list of host devices for the target operation and maintenance tools based on the target host device.
[0044] The host device list includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0045] Optionally, the target maintenance tool can be Ansible. The host device inventory is the AnsibleInventory file in Ansible.
[0046] This role identification information can be used to indicate the role of the target host device.
[0047] For example, when a target operation and maintenance tool automates the execution of operation and maintenance tasks, there exists a "script" corresponding to each task. Therefore, it's necessary to determine the role of each target host device to ascertain its corresponding content within the script—that is, the actions or tasks the target host device needs to perform. The actions or tasks that a target host device can perform are also determined by its functionality. Therefore, it can be understood that the functional information of a target host device determines its role identification information, which in turn characterizes the role of the target host device.
[0048] In some exemplary embodiments, after obtaining the operation and maintenance tasks of the target distributed system and determining the target host devices in the target distributed system involved in the operation and maintenance tasks, the role identification information and IP address of the target host devices can be determined to generate a list of host devices for the target operation and maintenance tools.
[0049] Step 103: Using the target operation and maintenance tool, determine the role information of the target host device based on the host device list, and execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0050] Optionally, the script file can be an Ansible Playbook. An Ansible Playbook is a script file used to describe a series of automated operations for maintenance tasks. It can be viewed as a task list or operation manual, specifying in detail the series of tasks that Ansible will perform on the target host, as well as the execution order and dependencies of these tasks. This script file is the playbook mentioned above.
[0051] In some exemplary embodiments, after determining the list of host devices for the target operation and maintenance tool, the role identification information in the list of host devices can be identified using the target operation and maintenance tool to obtain the role information of the target host devices. Specifically, the identification can be based on a pre-trained model or on a keyword recognition algorithm.
[0052] Furthermore, after determining the role information of the target host device, the actions or tasks that the target host device needs to perform can be determined based on the role information and script files, so that the target host device can perform the corresponding actions or tasks.
[0053] The aforementioned operation and maintenance method involves obtaining the operation and maintenance tasks of the target distributed system and identifying the target host devices in the target distributed system involved in the operation and maintenance tasks. Based on the target host devices, a list of host devices for the target operation and maintenance tool is determined. This list includes the role identification information and IoT protocol IP address of the target host devices, with the role identification information determined based on the functional information of the target host devices. Using the target operation and maintenance tool, the role information of the target host devices is determined based on the host device list, and the operation and maintenance task is executed based on the role information, the script file of the operation and maintenance task, and the target host devices. The operation and maintenance method provided in this application can automate the execution of operation and maintenance tasks of a distributed system using operation and maintenance tools, eliminating the need for technical personnel assistance. This reduces costs while effectively improving the efficiency of operation and maintenance tasks.
[0054] In one exemplary embodiment, such as Figure 2 As shown, when the target host device joins the target distributed system, the method further includes the following steps:
[0055] Step 201: Obtain the functional information of the target host device.
[0056] This functional information is used to characterize the services that the target host device can provide.
[0057] Optionally, this feature information may include applications, databases, and networks.
[0058] In some exemplary embodiments, the functional information of the target host device can be determined by obtaining basic information about the target host device, such as operating system version, hardware configuration, and network settings.
[0059] The functional information of the target host device can also be determined by obtaining its performance and status data.
[0060] The functional information of the target host device can also be determined by the hardware device manual of the target host device, which includes the functional characteristics of the target host device, the types of services it supports, and the purpose of its ports.
[0061] Step 202: Using preset naming rules, generate the role identification information of the target host device based on the function information.
[0062] Optionally, the preset naming rule can be pre-set by technicians according to actual needs. This preset naming rule allows the generated target host device's role identification information to include the target host device's role.
[0063] In some exemplary embodiments, after obtaining the functional information of the target host device, a role identification information for the target host device can be generated based on the functional information using a preset naming rule. For example, if the functional information of the target host device indicates that the target host device is a compute server, and the node information of the target host device in the target distributed system is node cm7, then the role identification information generated based on the functional information of the target host device using the preset rule can be "compute-cm7-XX". If the functional information of the target host device indicates that the target host device is a database server, then the role identification information generated based on the functional information of the target host device using the preset rule can be "db-server-XX". Here, "XX" is a serial number or other identifier.
[0064] In one exemplary embodiment, such as Figure 3 As shown, the method of using the target operation and maintenance tool to determine the role information of the target host device based on the host device list includes the following steps:
[0065] Step 301: Use the target operation and maintenance tool to call the preset acquisition variables, and obtain the role identification information from the host device list based on the preset acquisition variables.
[0066] Optionally, the default variable to retrieve can be an Ansible built-in variable, such as inventory_hostname.
[0067] In some exemplary embodiments, after obtaining the host device list, Ansible can be used to call inventory_hostname to obtain the role identification information from the host device list based on the inventory_hostname.
[0068] Step 302: Using the target operation and maintenance tool, determine the role information based on the role identification information.
[0069] In some exemplary embodiments, the target operation and maintenance tool may store a preset role recognition script, which may be a role recognition model, so as to use the target operation and maintenance tool to determine the role information based on the role identification information.
[0070] The script can also be a keyword recognition algorithm to use the target operation and maintenance tool to determine the role information based on the role identification information.
[0071] In one exemplary embodiment, such as Figure 4 As shown, the method of using the target operation and maintenance tool to determine the role information based on the role identifier information includes the following steps:
[0072] Step 401: Use the target operation and maintenance tool to call the role recognition model.
[0073] The role recognition model is determined according to the preset naming rules.
[0074] In some exemplary embodiments, since the role recognition model is determined according to the preset naming rules, that is, it can identify role identification information to determine its corresponding role information. Therefore, after obtaining the role identification information, the target operation and maintenance tool can first use the role recognition model to call the role recognition model.
[0075] Step 402: Input the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0076] In some exemplary embodiments, after the target operation and maintenance tool calls the role recognition model, the role identification information can be input into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0077] For example, in existing operation and maintenance methods, role groups are usually set in the host device list, and then technicians identify the roles of the target host devices to determine the role group of the target host devices. When there are a large number of target host devices, the role grouping operation is time-consuming, and because it is a manual operation, it is easy to make mistakes, which not only leads to low efficiency of operation and maintenance tasks, but may also cause operation and maintenance tasks to fail. This application realizes the automation of role recognition by combining preset naming rules and role recognition models, which reduces time consumption and improves accuracy, thereby improving not only the efficiency of operation and maintenance tasks, but also the success rate of operation and maintenance tasks.
[0078] In an exemplary embodiment, executing the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device includes: determining the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file based on the role information, and executing the operation and maintenance sub-task based on the target host device.
[0079] In some exemplary embodiments, an operation and maintenance task is usually executed by multiple target host devices. Therefore, the conditional statements of the target operation and maintenance tool can be called first, and then the operation and maintenance sub-tasks to be executed by each target host device in the operation and maintenance task can be determined from the script file according to the role information and the conditional statements.
[0080] Furthermore, after determining the maintenance sub-tasks that each target host device needs to perform, each maintenance sub-task can be executed based on each target host device to complete the maintenance task.
[0081] In an exemplary embodiment, the execution of the operation and maintenance sub-task based on the target host device includes: obtaining the IP address of the target host device and establishing a connection with the target host device using the IP address, so that the target host device can execute the operation and maintenance sub-task.
[0082] In some exemplary embodiments, after determining the maintenance sub-tasks that each target host device needs to execute, the IP address of each target host device can be obtained first. This IP address is then used to establish a connection with each target host device, enabling the target host device to execute the maintenance sub-task. Specifically, the IP address can also be obtained by calling a preset acquisition variable in the target maintenance tool. This preset acquisition variable is different from the preset acquisition variable used to obtain role identification information described above.
[0083] In one exemplary embodiment, such as Figure 5 As shown, another operation and maintenance method is provided, which includes the following steps:
[0084] Step 501: Obtain the operation and maintenance tasks of the target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks;
[0085] Step 502: Determine the host device list of the target operation and maintenance tool based on the target host device. The host device list includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device. The identification information is generated based on the functional information of the target host device when the target host device joins the target distributed system, using a preset naming rule. The functional information is used to characterize the services that the target host device can provide.
[0086] Step 503: Use the target operation and maintenance tool to call the preset acquisition variables, and obtain the role identification information from the host device list based on the preset acquisition variables; use the target operation and maintenance tool to call the role recognition model, which is determined according to the preset naming rules; input the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model;
[0087] Step 504: Based on the role information, determine the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file, obtain the IP address of the target host device, and establish a connection with the target host device using the IP address so that the target host device can execute the operation and maintenance sub-task.
[0088] It should be understood that although the steps in the flowcharts of the above embodiments 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 flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0089] Based on the same inventive concept, this application also provides an operation and maintenance device for implementing the operation and maintenance method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more operation and maintenance device embodiments provided below can be found in the limitations of the operation and maintenance method above, and will not be repeated here.
[0090] In one exemplary embodiment, such as Figure 6 As shown, an operation and maintenance device 600 is provided, including: an acquisition module 601, a determination module 602, and an execution module 603, wherein:
[0091] The acquisition module 601 is used to acquire the operation and maintenance tasks of the target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks.
[0092] The determination module 602 is used to determine a list of host devices for the target operation and maintenance tool based on the target host device. The list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0093] The execution module 603 is used to utilize the target operation and maintenance tool to determine the role information of the target host device based on the host device list, and to execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0094] In one embodiment, the determining module 602 is further configured to, when the target host device joins the target distributed system, obtain the functional information of the target host device, the functional information being used to characterize the services that the target host device can provide; and generate the role identification information of the target host device based on the functional information using a preset naming rule.
[0095] In one embodiment, the execution module 603 is specifically used to call a preset acquisition variable using the target operation and maintenance tool, and obtain the role identification information from the host device list based on the preset acquisition variable; and use the target operation and maintenance tool to determine the role information based on the role identification information.
[0096] In one embodiment, the execution module 603 is specifically used to call the role recognition model using the target operation and maintenance tool, the role recognition model being determined according to the preset naming rules; and input the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0097] In one embodiment, the execution module 603 is specifically used to determine the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file based on the role information, and to execute the operation and maintenance sub-task based on the target host device.
[0098] In one embodiment, the execution module 603 is specifically used to obtain the IP address of the target host device and establish a connection with the target host device using the IP address so that the target host device can execute the operation and maintenance sub-task.
[0099] Each module in the aforementioned maintenance device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0100] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an operation and maintenance method.
[0101] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an operation and maintenance method.
[0102] Those skilled in the art will understand that Figure 7 and Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0103] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0104] Obtain the operation and maintenance tasks of the target distributed system, and determine the target host devices in the target distributed system involved in the operation and maintenance tasks;
[0105] Based on the target host device, a list of host devices for the target operation and maintenance tool is determined. This list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0106] Using the target operation and maintenance tool, determine the role information of the target host device based on the host device list, and execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0107] In one embodiment, when the processor executes the computer program, it further performs the following steps: when the target host device joins the target distributed system, it obtains the functional information of the target host device, which is used to characterize the services that the target host device can provide; and generates the role identification information of the target host device based on the functional information using a preset naming rule.
[0108] In one embodiment, when the processor executes the computer program, it further performs the following steps: using the target maintenance tool to call a preset acquisition variable, and based on the preset acquisition variable, obtains the role identification information from the host device list; using the target maintenance tool, determines the role information based on the role identification information.
[0109] In one embodiment, when the processor executes the computer program, it further performs the following steps: using the target maintenance tool to call the role recognition model, which is determined according to the preset naming rules; inputting the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0110] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining, based on the role information, the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file, and executing the operation and maintenance sub-task based on the target host device.
[0111] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the IP address of the target host device and establishing a connection with the target host device using the IP address, so that the target host device can execute the operation and maintenance subtask.
[0112] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0113] Obtain the operation and maintenance tasks of the target distributed system, and determine the target host devices in the target distributed system involved in the operation and maintenance tasks;
[0114] Based on the target host device, a list of host devices for the target operation and maintenance tool is determined. This list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0115] Using the target operation and maintenance tool, determine the role information of the target host device based on the host device list, and execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0116] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the target host device joins the target distributed system, it obtains the functional information of the target host device, which is used to characterize the services that the target host device can provide; and generates the role identification information of the target host device based on the functional information using a preset naming rule.
[0117] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: using the target operation and maintenance tool to call a preset acquisition variable, and based on the preset acquisition variable, obtain the role identification information from the host device list; using the target operation and maintenance tool, determine the role information based on the role identification information.
[0118] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: using the target maintenance tool to call the role recognition model, which is determined according to the preset naming rules; inputting the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0119] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file based on the role information, and executing the operation and maintenance sub-task based on the target host device.
[0120] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the IP address of the target host device and establishing a connection with the target host device using the IP address, so that the target host device can perform the operation and maintenance subtask.
[0121] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0122] Obtain the operation and maintenance tasks of the target distributed system, and determine the target host devices in the target distributed system involved in the operation and maintenance tasks;
[0123] Based on the target host device, a list of host devices for the target operation and maintenance tool is determined. This list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device.
[0124] Using the target operation and maintenance tool, determine the role information of the target host device based on the host device list, and execute the operation and maintenance task based on the role information, the script file of the operation and maintenance task, and the target host device.
[0125] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the target host device joins the target distributed system, it obtains the functional information of the target host device, which is used to characterize the services that the target host device can provide; and generates the role identification information of the target host device based on the functional information using a preset naming rule.
[0126] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: using the target operation and maintenance tool to call a preset acquisition variable, and based on the preset acquisition variable, obtain the role identification information from the host device list; using the target operation and maintenance tool, determine the role information based on the role identification information.
[0127] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: using the target maintenance tool to call the role recognition model, which is determined according to the preset naming rules; inputting the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model.
[0128] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file based on the role information, and executing the operation and maintenance sub-task based on the target host device.
[0129] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the IP address of the target host device and establishing a connection with the target host device using the IP address, so that the target host device can perform the operation and maintenance subtask.
[0130] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0132] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An operation and maintenance method, characterized in that, The method includes: Obtain the operation and maintenance tasks of the target distributed system, and determine the target host devices in the target distributed system involved in the operation and maintenance tasks; A list of host devices for the target operation and maintenance tool is determined based on the target host device. The list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device. The target operation and maintenance tool is used to call preset acquisition variables, and the role identification information is obtained from the host device list based on the preset acquisition variables; the target operation and maintenance tool is used to call a role recognition model, which is determined according to the preset naming rules; the role identification information is input into the role recognition model to obtain the role information of the host device output by the role recognition model, and the operation and maintenance task is executed according to the role information, the script file of the operation and maintenance task, and the target host device; The method further includes: when the target host device joins the target distributed system, obtaining the functional information of the target host device, the functional information being used to characterize the services that the target host device can provide; and generating role identification information of the target host device based on the functional information using a preset naming rule.
2. The method according to claim 1, characterized in that, The step of executing the maintenance task based on the role information, the script file of the maintenance task, and the target host device includes: Based on the role information, determine the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file, and execute the operation and maintenance sub-task based on the target host device.
3. The method according to claim 2, characterized in that, The execution of the maintenance sub-task based on the target host device includes: Obtain the IP address of the target host device and establish a connection with the target host device using the IP address so that the target host device can execute the operation and maintenance sub-task.
4. The method according to claim 2, characterized in that, The step of determining the operation and maintenance sub-task to be executed by the target host device in the operation and maintenance task from the script file based on the role information includes: Conditional statements that invoke the target operation and maintenance tool; Based on the role information and the conditional statements, the target host device is determined from the script file to perform the operation and maintenance sub-task in the operation and maintenance task.
5. The method according to claim 1, characterized in that, The target maintenance tool is Ansible, and the host device list is the Ansible Inventory file in Ansible.
6. The method according to claim 5, characterized in that, The script file is Ansible Playbook.
7. A maintenance device, characterized in that, The device includes: The acquisition module is used to acquire the operation and maintenance tasks of the target distributed system and determine the target host devices in the target distributed system involved in the operation and maintenance tasks. The determination module is used to determine a list of host devices for the target operation and maintenance tool based on the target host device. The list of host devices includes the role identification information and IoT protocol IP address of the target host device. The role identification information is determined based on the functional information of the target host device. The execution module is used to invoke preset acquisition variables using the target operation and maintenance tool, and obtain the role identification information from the host device list based on the preset acquisition variables; invoke a role recognition model using the target operation and maintenance tool, the role recognition model being determined according to the preset naming rules; input the role identification information into the role recognition model to obtain the role information of the host device output by the role recognition model, and execute the operation and maintenance task according to the role information, the script file of the operation and maintenance task, and the target host device; The determining module is further configured to, when the target host device joins the target distributed system, obtain the functional information of the target host device, the functional information being used to characterize the services that the target host device can provide; and generate the role identification information of the target host device based on the functional information using a preset naming rule.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and equipment for automatically building container platform based on ansible
CN114416290A
Operation and maintenance management method and device, equipment, computer storage medium and program product
CN118071275A