Node expansion method and device of operation and maintenance platform and electronic equipment

By obtaining instructions from the image file and determining the result, the expansion method can be selected: virtualization or containerization can be used to expand the operation and maintenance platform nodes. This solves the problem of not being able to automatically expand nodes and improves the execution efficiency of script tasks.

CN115113983BActive Publication Date: 2026-08-04INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2022-07-14
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing technologies cannot automatically expand the nodes of the operation and maintenance platform, resulting in the inability to efficiently execute large-scale script tasks.

Method used

The system determines whether the image file was successfully acquired by using the image file acquisition command. Based on the result, it selects either virtualization or containerization as the expansion method, and expands the nodes of the operation and maintenance platform to control the target device to execute tasks.

Benefits of technology

It enables automatic expansion of operation and maintenance platform nodes, improving the flexibility of node expansion and the execution efficiency of script tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115113983B_ABST
    Figure CN115113983B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and electronic device for extending nodes in an operations and maintenance platform, relating to the field of cloud computing technology. The method includes: executing an image file acquisition instruction to obtain an image file of the operations and maintenance platform, and obtaining an execution result, wherein the execution result indicates whether the image file was successfully acquired; based on the execution result, determining a node extension method, wherein the node extension method is one of the following: virtualization extension method or containerization extension method, wherein the virtualization extension method extends the nodes of the operations and maintenance platform based on virtual machines, and the containerization extension method extends the nodes of the operations and maintenance platform based on container technology; based on the node extension method, extending the nodes of the operations and maintenance platform to obtain extended nodes, wherein the extended nodes are used to control target devices to execute target tasks. This invention solves the technical problem in the prior art that nodes of an operations and maintenance platform cannot be automatically extended.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and more specifically, to a method, apparatus, and electronic device for expanding nodes in an operations and maintenance platform. Background Technology

[0002] With the continuous development of cloud computing technology, many automated operation and maintenance tools have emerged for operation and maintenance personnel. Among them, Ansible is a free and open-source configuration and automation tool developed based on Python. After installing Ansible on a server, other servers can be managed and controlled via the SSH protocol, enabling functions such as batch system configuration, batch program deployment, and batch command execution. Currently, when using Ansible to execute large-scale script tasks, it is usually necessary to manually split the script tasks, and there are problems with automatically scaling Ansible nodes and automatically distributing script tasks.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a method, apparatus, and electronic device for expanding nodes of an operation and maintenance platform, so as to at least solve the technical problem that the nodes of an operation and maintenance platform cannot be automatically expanded in the prior art.

[0005] According to one aspect of the present invention, a method for extending nodes of an operation and maintenance platform is provided, comprising: executing an image file acquisition instruction to acquire an image file of the operation and maintenance platform, and obtaining an execution result, wherein the execution result indicates whether the image file was successfully acquired; determining a node extension method based on the execution result, wherein the node extension method is one of the following: a virtualization extension method or a containerization extension method, wherein the virtualization extension method extends the nodes of the operation and maintenance platform based on virtual machines, and the containerization extension method extends the nodes of the operation and maintenance platform based on container technology; extending the nodes of the operation and maintenance platform based on the node extension method to obtain extended nodes, wherein the extended nodes are used to control a target device to execute a target task.

[0006] Furthermore, the node expansion method of the operation and maintenance platform also includes: if the execution result indicates that the image file was not successfully obtained, then the node expansion method is determined to be the virtualization expansion method; if the execution result indicates that the image file was successfully obtained, then the node expansion method is determined to be the containerization expansion method.

[0007] Furthermore, the node expansion method of the operation and maintenance platform also includes: when the node expansion method is virtualization expansion, determining the number of nodes required to control the target device to execute the target task; comparing the number of nodes with the second threshold to obtain the comparison result; and based on the comparison result, determining whether to expand the nodes of the operation and maintenance platform.

[0008] Furthermore, the node expansion method of the operation and maintenance platform also includes: acquiring resource data of at least one device executing the target task, wherein the resource data is used to characterize the idle / busy state of at least one device; sorting the at least one device based on the resource data to obtain a sorting result; determining a first device from the at least one device based on the sorting result, and marking the node status of the node corresponding to the first device as idle in the node list table, wherein the resource data of the first device is greater than or equal to a first threshold; determining a second device from the at least one device based on the sorting result, and marking the node status of the node corresponding to the second device as busy in the node list table, wherein the resource data of the second device is less than the first threshold.

[0009] Furthermore, the node expansion method of the operation and maintenance platform also includes: if the number of nodes is less than the second threshold, then obtain the nodes in the node list that are in an idle state, distribute the target task to the idle nodes, and update the status of the idle nodes to a busy state.

[0010] Furthermore, the node expansion method of the operation and maintenance platform also includes: if the number of nodes is greater than or equal to the second threshold, then the nodes required to control the target device to perform the target task are expanded to obtain expanded nodes, and the node status of the expanded nodes is marked as idle in the node list table, so that the expanded nodes can control the target device to perform the target task.

[0011] Furthermore, the node expansion method of the operation and maintenance platform also includes: starting the target device, controlling the target device to execute the target task, and obtaining the execution status of the target task fed back by the target device, wherein the execution status indicates whether the target task has been executed successfully.

[0012] Furthermore, the node expansion method of the operation and maintenance platform also includes: obtaining the target task and storing the target task in the task team list; storing the task status of the target task in the task status table.

[0013] Furthermore, the node expansion method of the operation and maintenance platform also includes: when the node expansion method is containerized expansion, generating a configuration file for the first node of the preset cluster, wherein the configuration file represents the program script of the first node; and distributing the first node to an idle second node in the preset cluster based on preset scheduling rules, wherein the second node is used to generate a target container corresponding to the first node based on the configuration file, and the target container is used to execute the configuration file.

[0014] According to another aspect of the present invention, a node expansion device for an operation and maintenance platform is also provided, comprising: an execution module, configured to execute an image file acquisition instruction to acquire an image file of the operation and maintenance platform and obtain an execution result, wherein the execution result indicates whether the image file was successfully acquired; a determination module, configured to determine a node expansion method based on the execution result, wherein the node expansion method is one of the following: a virtualization expansion method and a containerization expansion method, wherein the virtualization expansion method is based on virtual machines to expand the nodes of the operation and maintenance platform, and the containerization expansion method is based on container technology to expand the nodes of the operation and maintenance platform; and an expansion module, configured to expand the nodes of the operation and maintenance platform based on the node expansion method to obtain expanded nodes, wherein the expanded nodes are used to control a target device to execute a target task.

[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the above-described node expansion method of the operation and maintenance platform at runtime.

[0016] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to run the programs, wherein the programs are configured to execute the node expansion method of the operation and maintenance platform described above during runtime.

[0017] According to another aspect of the present invention, a computer program product is also provided, including a computer program / instruction that, when executed by a processor, implements the node expansion method of the operation and maintenance platform described above.

[0018] In this embodiment of the invention, the node expansion method is determined based on whether the image file of the operation and maintenance platform is successfully obtained. First, an image file acquisition command is executed to obtain the image file of the operation and maintenance platform, and the execution result is obtained. Then, based on the execution result, the node expansion method is determined, and then the nodes of the operation and maintenance platform are expanded based on the node expansion method to obtain expanded nodes. The execution result indicates whether the image file was successfully obtained. The node expansion method is one of the following: virtualization expansion method or containerization expansion method. The virtualization expansion method expands the nodes of the operation and maintenance platform based on virtual machines, while the containerization expansion method expands the nodes of the operation and maintenance platform based on container technology. The expanded nodes are used to control the target device to execute the target task.

[0019] In the above process, the image file of the operation and maintenance platform is obtained by executing the image file acquisition command, and the execution result is obtained, which provides a data foundation for determining the node expansion method. Based on the execution result, the node expansion method is determined, and the nodes of the operation and maintenance platform can be expanded according to the determined node expansion method, which improves the flexibility of node expansion. By expanding the nodes of the operation and maintenance platform according to the determined node expansion method, the expanded nodes can be obtained, realizing the automatic expansion of the operation and maintenance platform nodes, thereby improving the efficiency of node expansion and thus improving the execution efficiency of script tasks.

[0020] Therefore, the technical solution of this invention achieves the goal of improving the execution efficiency of script tasks, thereby realizing the technical effect of automatically expanding the nodes of the operation and maintenance platform, and thus solving the technical problem that the existing technology cannot automatically expand the nodes of the operation and maintenance platform. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0022] Figure 1 This is a flowchart of an optional node expansion method for an operation and maintenance platform according to an embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of a node expansion system of an optional operation and maintenance platform according to an embodiment of the present invention;

[0024] Figure 3 This is a schematic diagram of a node expansion system of an optional operation and maintenance platform according to an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of an optional node expansion device for an operation and maintenance platform according to an embodiment of the present invention;

[0026] Figure 5 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] It should be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this invention are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it needs to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.

[0030] Example 1

[0031] According to an embodiment of the present invention, a method embodiment of a node expansion method for an operation and maintenance platform is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] Figure 1 This is a flowchart of an optional node expansion method for an operation and maintenance platform according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0033] Step S101: Execute the image file acquisition command to obtain the image file of the operation and maintenance platform and obtain the execution result, wherein the execution result indicates whether the image file was successfully obtained.

[0034] In the above steps, the image file retrieval command can be executed through devices such as application systems, processors, and electronic devices. Optionally, the operations and maintenance platform can be the automated operations and maintenance tool Ansible, and the image file of the operations and maintenance platform can be the image file generated during the Docker containerization process of Ansible. The execution result of the image file retrieval command can be either successful, meaning the image file of the operations and maintenance platform can be successfully retrieved, or it can fail, meaning the image file of the operations and maintenance platform cannot be successfully retrieved.

[0035] It should be noted that, in the above process, by executing the image file acquisition command, it is possible to determine whether an image file of the operation and maintenance platform exists, thus providing a data foundation for subsequently determining the node expansion method.

[0036] Step S102: Based on the execution result, determine the node expansion method, wherein the node expansion method is one of the following: virtualization expansion method or containerization expansion method. The virtualization expansion method is based on virtual machines to expand the nodes of the operation and maintenance platform, and the containerization expansion method is based on container technology to expand the nodes of the operation and maintenance platform.

[0037] In the steps described above, the nodes on the operations and maintenance platform can be Ansible nodes. Whether the image file is successfully obtained determines which node expansion method to use for Ansible nodes. Optionally, virtualization expansion can be achieved by building an Ansible-based operations and maintenance cluster system using virtual machines, while containerization expansion can be achieved by building a containerized automated operations and maintenance system based on Ansible using container technology. Both methods can manage Ansible nodes and Ansible tasks, such as automatically expanding Ansible nodes and automatically distributing Ansible tasks.

[0038] It should be noted that, in the above process, the node expansion method can be determined by whether the image file is successfully obtained. This allows the nodes of the operation and maintenance platform to be expanded according to the determined node expansion method, thereby improving the flexibility of node expansion.

[0039] Step S103: Based on the node expansion method, the nodes of the operation and maintenance platform are expanded to obtain expanded nodes, wherein the expanded nodes are used to control the target device to execute the target task.

[0040] In the above steps, the target task can be a task to be executed, such as installing a program on multiple machines in batches. The target devices can be machines controlled by Ansible nodes to execute the target task, and the extended nodes can be newly added Ansible nodes. Optionally, after extending the Ansible nodes according to the determined node extension method, new Ansible nodes are obtained, and the target devices are controlled to execute the target task through these new Ansible nodes. For example, if the target task is to install a program on 100 machines in batches, assuming that one Ansible node can only control 50 machines, then two Ansible nodes are needed to control all 100 machines. When there is only one Ansible node, it can be extended using the aforementioned determined node extension method to obtain new Ansible nodes. At this point, the two Ansible nodes can work together to complete the task of installing a program on 100 machines in batches.

[0041] It should be noted that by using the node expansion method determined above, the nodes of the operation and maintenance platform are expanded, thereby automatically expanding the nodes of the operation and maintenance platform, thus improving the node expansion efficiency and consequently improving the execution efficiency of script tasks.

[0042] Based on the scheme defined in steps S101 to S103 above, it can be understood that in this embodiment of the invention, the node expansion method is determined by whether the image file of the operation and maintenance platform is successfully obtained. First, an image file acquisition instruction is executed to obtain the image file of the operation and maintenance platform, and an execution result is obtained. Then, based on the execution result, the node expansion method is determined, and then based on the node expansion method, the nodes of the operation and maintenance platform are expanded to obtain the expanded nodes. The execution result indicates whether the image file was successfully obtained. The node expansion method is one of the following: virtualization expansion method or containerization expansion method. The virtualization expansion method expands the nodes of the operation and maintenance platform based on virtual machines, and the containerization expansion method expands the nodes of the operation and maintenance platform based on container technology. The expanded nodes are used to control the target device to execute the target task.

[0043] It is noteworthy that in the above process, by executing the image file acquisition command, the image file of the operation and maintenance platform is obtained, and the execution result is obtained, which provides a data foundation for subsequently determining the node expansion method. By determining the node expansion method based on the execution result, the nodes of the operation and maintenance platform can be expanded according to the determined node expansion method, thereby improving the flexibility of node expansion. By expanding the nodes of the operation and maintenance platform according to the determined node expansion method, the expanded nodes can be obtained, realizing the automatic expansion of the nodes of the operation and maintenance platform, thereby improving the efficiency of node expansion and thus improving the execution efficiency of script tasks.

[0044] Therefore, the technical solution of this invention achieves the goal of improving the execution efficiency of script tasks, thereby realizing the technical effect of automatically expanding the nodes of the operation and maintenance platform, and thus solving the technical problem that the existing technology cannot automatically expand the nodes of the operation and maintenance platform.

[0045] In one optional embodiment, during the process of determining the node expansion method based on the execution result, if the execution result indicates that the image file was not successfully obtained, the node expansion method is determined to be the virtualization expansion method; if the execution result indicates that the image file was successfully obtained, the node expansion method is determined to be the containerization expansion method.

[0046] Optionally, if the image file is not successfully obtained, the node will be expanded using virtualization. Figure 2 This is a schematic diagram of a node expansion system for an optional operation and maintenance platform according to an embodiment of the present invention, such as... Figure 2 As shown, an Ansible-based operations and maintenance cluster system includes: an API Server module, a Scheduler module, a Daemon process, an Oracle database, Ansible nodes, and an FSS disk.

[0047] Optionally, if the image file is successfully obtained, the nodes will be expanded using a containerized expansion approach. Figure 3 This is a schematic diagram of a node expansion system for an optional operation and maintenance platform according to an embodiment of the present invention, such as... Figure 3 As shown, an Ansible-based containerized automated operation and maintenance system includes: a management and control platform, a Kubernetes cluster (K8S cluster), node nodes, job resources, and FSS disks.

[0048] It should be noted that the node expansion method can be determined by whether the image file is successfully obtained. Both of the above methods can expand the nodes of the operation and maintenance platform, providing operation and maintenance personnel with a choice and improving the flexibility of node expansion.

[0049] In one optional embodiment, during the process of expanding the nodes of the operation and maintenance platform based on the node expansion method, if the node expansion method is a virtualization expansion method, the number of nodes required to control the target device to execute the target task is first determined, then the number of nodes is compared with the second threshold to obtain the comparison result, and then based on the comparison result, it is determined whether to expand the nodes of the operation and maintenance platform.

[0050] Optionally, after obtaining the target task, it is necessary to determine the number of nodes required to control the target device to execute the target task. For example, if the target task is to install a certain program on 1000 machines in batches, and assuming that one Ansible node can only control 500 machines, then it can be determined that two Ansible nodes are needed to control the 1000 machines. Optionally, the second threshold can be the number of nodes in the existing operations and maintenance platform; for example, there is currently one Ansible node.

[0051] Furthermore, comparing the number of nodes with the second threshold can determine whether the number of nodes in the operations and maintenance platform needs to be expanded. For example, if two Ansible nodes are needed to control the target device, and there is currently only one Ansible node, then one more Ansible node needs to be added. Conversely, if two Ansible nodes are needed to control the target device, and there are currently two Ansible nodes, then no expansion is needed.

[0052] It should be noted that by determining the number of nodes required to control the target device to execute the target task, it is possible to determine whether to expand the nodes of the operation and maintenance platform, thus ensuring the stable execution of the operation and maintenance platform's script tasks under large-scale equipment.

[0053] In one optional embodiment, before determining the number of nodes required for the target device to execute the target task, resource data of at least one device executing the target task is first obtained. Then, the at least one device is sorted based on the resource data to obtain a sorting result. Based on the sorting result, a first device is determined from the at least one device, and the node status of the node corresponding to the first device is marked as idle in the node list table. Then, based on the sorting result, a second device is determined from the at least one device, and the node status of the node corresponding to the second device is marked as busy in the node list table. The resource data is used to characterize the idle / busy status of the at least one device. The resource data of the first device is greater than or equal to a first threshold, and the resource data of the second device is less than the first threshold.

[0054] Optionally, the device can be a machine controlled by an Ansible node to execute the target task, and the resources can be information such as the machine's CPU, memory, and disk. For example, resource data could be the remaining CPU capacity. Optionally, the node status can be idle or busy. The node status can be determined by the resource data of the device controlled by the node, that is, whether the node is idle can be determined by the resource data.

[0055] Specifically, to obtain the remaining CPU capacity of multiple machines, the machines can be sorted according to their remaining CPU capacity, and the available machine can be selected based on the sorting result. For example, if machine A has a CPU with a remaining capacity of 8GHz, machine B has a CPU with a remaining capacity of 6GHz, and machine C has a CPU with a remaining capacity of 4GHz, the sorting result would be: Machine A > Machine B > Machine C.

[0056] Furthermore, available machines are selected based on the sorting results. For example, assuming the first threshold is 6GHz, and the remaining CPU capacity of machines A, B, and C is 8GHz, 6GHz, and 4GHz respectively, then the remaining CPU capacity (i.e., resource data) of machines A and B is greater than or equal to the first threshold, so the first available devices are machines A and B; the remaining CPU capacity (i.e., resource data) of machine C is less than the first threshold, so machine C is the second available device.

[0057] Furthermore, in such Figure 2 In the Oracle node list table shown, the node status of the node corresponding to the first device is marked as idle, and the node status of the node corresponding to the second device is marked as busy. For example, the node status of the nodes controlling machine A and machine B is marked as idle, and the node status of the node controlling machine C is marked as busy. Optionally, through, as... Figure 2 The Daemon process shown periodically monitors the node status of all Ansible nodes in the cluster system and records it in the node list table of the Oracle database. When the Scheduler module schedules, it selects the Ansible node marked as idle.

[0058] It should be noted that by sorting at least one device based on resource data, resource utilization is improved, thereby reducing the waste of idle resources.

[0059] In one optional embodiment, during the process of determining whether to expand the nodes of the operation and maintenance platform based on the comparison results, if the number of nodes is less than the second threshold, the nodes in the node list table that are in an idle state are obtained, the target task is distributed to the idle nodes, and the status of the idle nodes is updated to a busy state.

[0060] Optionally, the second threshold can be the number of nodes in the existing operations and maintenance platform. For example, if there are currently 3 Ansible nodes, and 1 Ansible node is needed to control the target device, the number of nodes is less than the second threshold. In this case, the number of nodes in the existing operations and maintenance platform can fully meet the needs of the target task, and there is no need to expand the nodes. By obtaining the nodes in the node list that are in an idle state and distributing the target task to the idle nodes, the target task can be completed, and the status of the idle nodes can be updated to a busy state.

[0061] It should be noted that by comparing the number of nodes and the second threshold, it is determined whether to expand the nodes of the operation and maintenance platform. This ensures the stable execution of script tasks on the operation and maintenance platform under large-scale equipment and improves resource utilization.

[0062] In one optional embodiment, if the number of nodes is greater than or equal to a second threshold, the nodes required to control the target device to perform the target task are expanded to obtain expanded nodes. In the node list table, the node status of the expanded nodes is marked as idle, so that the expanded nodes can control the target device to perform the target task.

[0063] Optionally, for example, if there are currently 3 Ansible nodes, and 5 Ansible nodes are needed to control the target device, then the number of nodes exceeds the second threshold. In this case, the existing operation and maintenance platform's node count cannot meet the requirements of the target task, and node expansion is necessary. Optionally, the nodes can be expanded using the Scheduler module, and the expanded nodes' node status can be marked as idle in the node list table. This allows the Scheduler module to select the expanded nodes to control the target device and execute the target task during scheduling.

[0064] It should be noted that by comparing the number of nodes and the second threshold, it is determined whether to expand the nodes of the operation and maintenance platform. This ensures the stable execution of script tasks on the operation and maintenance platform under large-scale equipment and improves resource utilization.

[0065] In one optional embodiment, after the target task is distributed to an idle node, the target device is started, the target device is controlled to execute the target task, and the execution status of the target task fed back by the target device is obtained, wherein the execution status indicates whether the target task has been executed successfully.

[0066] Optional, such as Figure 2 As shown, in steps 6 and 7, the Ansible node control machine starts and executes the target task. Optionally, after the target task is completed, it can be executed via... Figure 2The FSS disk shown stores the execution process of the target task in the form of a log. Optionally, after the target task is completed, the machine reports the execution status and records it in the task status table in the Oracle database. Optionally, the execution status can be execution success or execution failure.

[0067] It should be noted that obtaining the execution status of the target task reported by the target device allows maintenance personnel to understand the task's execution status, facilitating subsequent maintenance of the target task.

[0068] In one optional embodiment, before acquiring resource data of at least one device performing the target task, the target task is first acquired and stored in a task queue list, and then the task status of the target task is stored in a task status table.

[0069] Optional, such as Figure 2 As shown, the Oracle database stores a node list table, a task team list, and a task status table. The task status can be waiting, running, successful, failed, or interrupted.

[0070] Optionally, steps 1 to 3 are performed. First, the operations and maintenance cluster system obtains the target task through the API Server module and stores it in the task queue list. Then, the task status of the target task is stored in the task status table. Further, steps 4 and 5 are performed. The Scheduler module reads the tasks with a waiting status from the task queue list and the currently idle Ansible nodes from the node list table. The target task is then distributed to the target device through the idle Ansible node, and the waiting status of the task is changed to the running status.

[0071] Optionally, the API Server module serves as the central entry point for all external interfaces. It receives requests from external tasks and provides operation interfaces for the target tasks, such as interfaces for adding, starting, stopping, querying task logs, and querying task status. It also provides interfaces for managing Ansible nodes, such as interfaces for adding and deleting Ansible nodes.

[0072] It should be noted that by obtaining the target task, a data foundation is provided for the subsequent distribution of the target task through Ansible nodes.

[0073] In one optional embodiment, during the process of expanding the nodes of the operation and maintenance platform based on the node expansion method, if the node expansion method is a containerized expansion method, a configuration file for the first node of the preset cluster is generated. Then, based on preset scheduling rules, the first node is distributed to idle second nodes in the preset cluster. The configuration file represents the program script of the first node, and the second node is used to generate a target container corresponding to the first node based on the configuration file. The target container is used to execute the configuration file.

[0074] Optionally, the default cluster can be a Kubernetes cluster, the first node can be a job resource, and the configuration file can be a YAML file used to generate the job resource, which includes commands to start the target task, image file processing commands, and commands to mount the FSS disk, etc. The second node can be a node, and the target container can be a pod container.

[0075] Optionally, before generating the configuration file for the first node of the preset cluster, the target task is first obtained and stored on the target disk. The target disk can be an FSS disk.

[0076] Next, environmental preparation work is carried out, and a management and control platform is built, including modules for starting and stopping tasks, querying task status, collecting logs, adding and deleting tasks. Then, step 1 is performed to generate the YAML file of the job resource and create the job resource in the Kubernetes cluster. Then, steps 2 and 3 are performed. The Kubernetes cluster will distribute the job to idle node nodes according to its own scheduling rules. At the same time, the corresponding pod container will be generated on the node to execute the commands in the configuration file.

[0077] Optionally, after distributing the first node to an idle second node in the preset cluster based on preset scheduling rules, the target disk can be mounted to a preset directory in the target container, so that the target container executes the configuration file and executes the target task in the preset directory. Specifically, in step 4, the pod container executes the command to mount the FSS disk in the configuration file, mounting the FSS disk to the / approot1 / paas / admin / task directory in the pod container; the pod container executes the image file processing command to process the obtained image file of the operation and maintenance platform; the pod container executes the command to start the target task, executing the target task in that directory. For example, to execute task A, it can be triggered by the sh command, which can be cd / approot1 / paas / admin / task / A&&sh / approot1 / paas / admin / task / A / run.sh.

[0078] Optionally, after executing the target task in the preset directory, the execution process of the target container corresponding to the first node is recorded, a log file is generated, and the log file is stored in the preset directory.

[0079] Specifically, after performing steps 5 and 6, the pod container returns the job status to the management platform after completing the target task. This status can be either successful or failed. Simultaneously, each job's corresponding pod container generates a log file during execution, which is stored in a preset directory: / approot1 / paas / admin / task / $JobName / $JobName.log, where $JobName is the name of the target task.

[0080] It should be noted that by using the above containerization expansion method to expand the nodes of the operation and maintenance platform, combining Ansible containerization with the use of Kubernetes clusters, and leveraging Kubernetes' preferred scheduling features, dynamic scheduling of nodes is achieved, which improves the scalability of Ansible nodes and increases execution efficiency.

[0081] Therefore, the technical solution of this invention achieves the goal of improving the execution efficiency of script tasks, thereby realizing the technical effect of automatically expanding the nodes of the operation and maintenance platform, and thus solving the technical problem that the existing technology cannot automatically expand the nodes of the operation and maintenance platform.

[0082] Example 2

[0083] According to an embodiment of the present invention, an embodiment of a node expansion device for an operation and maintenance platform is provided, wherein, Figure 4 This is a schematic diagram of an optional node expansion device for an operation and maintenance platform according to an embodiment of the present invention, such as... Figure 4 As shown, the device includes: an execution module 401, used to execute an image file acquisition instruction to obtain an image file of the operation and maintenance platform and obtain an execution result, wherein the execution result indicates whether the image file was successfully acquired; a determination module 402, used to determine the node expansion method based on the execution result, wherein the node expansion method is one of the following: virtualization expansion method or containerization expansion method. The virtualization expansion method is based on virtual machines to expand the nodes of the operation and maintenance platform, and the containerization expansion method is based on container technology to expand the nodes of the operation and maintenance platform; and an expansion module 403, used to expand the nodes of the operation and maintenance platform based on the node expansion method to obtain expanded nodes, wherein the expanded nodes are used to control the target device to execute the target task.

[0084] It should be noted that the execution module 401, the determination module 402 and the extension module 403 mentioned above correspond to steps S101 to S103 in the above embodiments. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment 1.

[0085] Optionally, the determining module includes: a first determining module, used to determine that the node extension method is virtualization extension method if the execution result indicates that the image file has not been successfully obtained; and a second determining module, used to determine that the node extension method is containerization extension method if the execution result indicates that the image file has been successfully obtained.

[0086] Optionally, the expansion module includes: a first determining module, used to determine the number of nodes required to control the target device to perform the target task when the node expansion method is virtualization expansion method; a comparison module, used to compare the number of nodes and a second threshold to obtain a comparison result; and a second determining module, used to determine whether to expand the nodes of the operation and maintenance platform based on the comparison result.

[0087] Optionally, the node expansion device of the operation and maintenance platform further includes: an acquisition module, used to acquire resource data of at least one device executing the target task, wherein the resource data is used to characterize the idle / busy state of at least one device; a processing module, used to sort the at least one device based on the resource data to obtain a sorting result; a first marking module, used to determine a first device from the at least one device based on the sorting result, and mark the node status of the node corresponding to the first device as idle in the node list table, wherein the resource data of the first device is greater than or equal to a first threshold; and a second marking module, used to determine a second device from the at least one device based on the sorting result, and mark the node status of the node corresponding to the second device as busy in the node list table, wherein the resource data of the second device is less than the first threshold.

[0088] Optionally, the second determining module includes: an updating module, used to obtain the nodes in the node list that are in an idle state if the number of nodes is less than a second threshold, distribute the target task to the idle nodes, and update the state of the idle nodes to a busy state.

[0089] Optionally, the second determining module includes: a marking module, used to expand the nodes required to control the target device to perform the target task if the number of nodes is greater than or equal to a second threshold, to obtain expanded nodes, and to mark the node status of the expanded nodes as idle in the node list table, so that the expanded nodes can control the target device to perform the target task.

[0090] Optionally, the node expansion device of the operation and maintenance platform also includes: a startup module, used to start the target device, control the target device to execute the target task, and obtain the execution status of the target task fed back by the target device, wherein the execution status indicates whether the target task has been executed successfully.

[0091] Optionally, the node expansion device of the operation and maintenance platform further includes: a first storage module for acquiring the target task and storing the target task in the task queue list; and a second storage module for storing the task status of the target task in the task status table.

[0092] Optionally, the extension module includes: a generation module, used to generate a configuration file for the first node of the preset cluster when the node extension method is containerized extension, wherein the configuration file represents the program script of the first node; and a distribution module, used to distribute the first node to an idle second node in the preset cluster based on preset scheduling rules, wherein the second node is used to generate a target container corresponding to the first node based on the configuration file, and the target container is used to execute the configuration file.

[0093] Example 3

[0094] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described node expansion method of the operation and maintenance platform at runtime.

[0095] Example 4

[0096] According to another aspect of the present invention, an electronic device is also provided, wherein, Figure 5 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as... Figure 5 As shown, the electronic device includes one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to run the programs, wherein the programs are configured to execute the node extension method of the aforementioned operation and maintenance platform at runtime.

[0097] Example 5

[0098] According to another aspect of the present invention, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the node expansion method of the operation and maintenance platform described above.

[0099] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0100] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0101] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0102] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0103] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0104] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0105] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for extending a node of an operation and maintenance platform, characterized in that, include: Execute the image file acquisition command to obtain the image file of the operation and maintenance platform, and obtain the execution result, wherein the execution result indicates whether the image file was successfully acquired; Based on the execution results, a node expansion method is determined, wherein the node expansion method is one of the following: virtualization expansion method or containerization expansion method. The virtualization expansion method is based on virtual machines to expand the nodes of the operation and maintenance platform, and the containerization expansion method is based on container technology to expand the nodes of the operation and maintenance platform. Based on the node expansion method, the nodes of the operation and maintenance platform are expanded to obtain expanded nodes, wherein the expanded nodes are used to control the target device to execute the target task; Based on the execution results, the node expansion method is determined, including: If the execution result indicates that the image file was not successfully obtained, then the node extension method is determined to be the virtualization extension method; If the execution result indicates that the image file was successfully obtained, then the node extension method is determined to be the containerization extension method.

2. The method of claim 1, wherein, Based on the aforementioned node expansion method, the nodes of the operation and maintenance platform are expanded, including: When the node expansion method is the virtualization expansion method, determine the number of nodes required to control the target device to execute the target task; The comparison result is obtained by comparing the number of nodes with the second threshold; Based on the comparison results, it is determined whether to expand the nodes of the operation and maintenance platform.

3. The method of claim 2, wherein, Before determining the number of nodes required to control the target device to perform the target task, the method further includes: Obtain resource data of at least one device performing the target task, wherein the resource data is used to characterize the idle / busy state of the at least one device; Based on the resource data, the at least one device is sorted to obtain a sorting result; Based on the sorting result, a first device is determined from the at least one device, and the node status of the node corresponding to the first device is marked as idle in the node list table, wherein the resource data of the first device is greater than or equal to a first threshold. Based on the sorting result, a second device is determined from the at least one device, and the node status of the node corresponding to the second device is marked as busy in the node list table, wherein the resource data of the second device is less than the first threshold.

4. The method of claim 3, wherein, Based on the comparison results, determine whether to expand the nodes of the operation and maintenance platform, including: If the number of nodes is less than the second threshold, then the nodes in the node list that are in the idle state are obtained, the target task is distributed to the idle nodes, and the state of the idle nodes is updated to the busy state.

5. The method of claim 4, wherein, The method further includes: If the number of nodes is greater than or equal to the second threshold, the nodes required to control the target device to execute the target task are expanded to obtain the expanded nodes. The node status of the expanded nodes is marked as the idle state in the node list table so that the expanded nodes can control the target device to execute the target task.

6. The method of claim 4, wherein, After distributing the target task to idle nodes, the method further includes: The target device is started, the target device is controlled to execute the target task, and the execution status of the target task fed back by the target device is obtained, wherein the execution status indicates whether the target task is executed successfully.

7. The method of claim 3, wherein, Before acquiring resource data of at least one device performing the target task, the method further includes: Obtain the target task and store it in the task team list; The task status of the target task is stored in the task status table.

8. The method according to claim 1, characterized in that, Based on the aforementioned node expansion method, the nodes of the operation and maintenance platform are expanded, including: When the node expansion method is the containerized expansion method, a configuration file for the first node of the preset cluster is generated, wherein the configuration file represents the program script of the first node; Based on preset scheduling rules, the first node is distributed to an idle second node in the preset cluster. The second node is used to generate a target container corresponding to the first node based on the configuration file. The target container is used to execute the configuration file.

9. A node expansion device for an operation and maintenance platform, characterized in that, include: The execution module is used to execute the image file acquisition instruction to obtain the image file of the operation and maintenance platform and obtain the execution result, wherein the execution result indicates whether the image file was successfully acquired; The determination module is used to determine the node expansion method based on the execution result, wherein the node expansion method is one of the following: virtualization expansion method and containerization expansion method. The virtualization expansion method is based on virtual machines to expand the nodes of the operation and maintenance platform, and the containerization expansion method is based on container technology to expand the nodes of the operation and maintenance platform. An extension module is used to extend the nodes of the operation and maintenance platform based on the node extension method to obtain extended nodes, wherein the extended nodes are used to control the target device to execute the target task; The determining module includes: a first determining module, used to determine that the node extension method is virtualization extension method if the execution result indicates that the image file was not successfully obtained; and a second determining module, used to determine that the node extension method is containerization extension method if the execution result indicates that the image file was successfully obtained.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the node expansion method of the operation and maintenance platform according to any one of claims 1 to 8 when it is run.

11. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to run the programs, wherein the programs are configured to execute the node expansion method of the operation and maintenance platform as described in any one of claims 1 to 8.

12. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the node expansion method of the operation and maintenance platform as described in any one of claims 1 to 8.