Cluster management system, task scheduling method, medium and equipment
Through the design of the cluster management system, the scheduling algorithm of priority queue and resource prediction model is used to dynamically allocate tasks, which solves the problem of traditional task scheduling relying on external agents, improves the stability and efficiency of the system, and simplifies the management process.
Patent Information
- Application Number
- CN202410701746.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-13
AI Technical Summary
Traditional task scheduling methods rely on external message agents, which increases the workload of technical personnel and risks information loss and task scheduling failure. At the same time, the workflow management system is complex to set up and use, and consumes intensive resources, resulting in low system stability and efficiency.
A cluster management system is designed, including a console, head node and slave node. It manages tasks through a graphical user interface and API interface. It uses a scheduling algorithm based on priority queues and resource prediction models to dynamically allocate tasks and reduce dependence on external agents. , and automatically elect a new head node when the head node fails.
It improves task processing efficiency and system stability, reduces the possibility of message loss, optimizes resource utilization, simplifies management and maintenance processes, and improves system response speed and processing capabilities.
Smart Images

Figure CN118642845A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a cluster management system, a task scheduling method, a medium and a device. Background Art
[0002] In the current technical context, regarding the methods of scheduling different projects to create and execute work tasks, the traditional implementation methods can be roughly divided into two types according to the differences in implementation methods: distributed task queues and workflow management. Taking Python language as an example, the specific implementation methods are as follows: First, Celery asynchronous task queue, as an asynchronous task queue / job queue, is based on a distributed messaging mechanism. Therefore, Celery needs to use a message broker for message transmission during operation. Common message brokers include RabbitMQ and Redis. Secondly, Apache Airflow, as a form of workflow management, can define a series of tasks and dependencies between tasks. In addition, Luigi also belongs to the category of workflow management and has some task status monitoring capabilities. Unlike Airflow, Luigi does not provide a web interface.
[0003] However, in the traditional task scheduling implementation mechanism, the reliance of asynchronous task queues on message brokers increases the workload of technicians. At the same time, due to this dependency, there is also the risk of information loss or task scheduling failure due to abnormal working of the message broker. Workflow management like Airflow is relatively complex to set up and use, and resource-intensive. In order to fully utilize all its functions, the deployment settings of Airflow are also quite complicated. Therefore, it is urgent to provide a new method for creating parallel work tasks to improve the above problems. Summary of the invention
[0004] The object of the present invention is to provide a cluster management system, a task scheduling method, a medium and a device, which can reduce the dependence on external agents and improve the efficiency of task processing and the stability of the system.
[0005] In a first aspect, an embodiment of the present invention provides a cluster management system, comprising: a console, a head node and at least one slave node, wherein the head node and the at least one slave node constitute a cluster, wherein: the console is used to interact with the head node and the slave nodes in the cluster to manage and monitor the status of the cluster, and provide a graphical user interface and / or an application program interface to a user so that the user can define and adjust task settings according to needs; the head node is used to monitor the resource usage status of the at least one slave node, and allocate the task queue in the console to the at least one slave node according to the load and resource availability of the cluster; the slave node is used to execute the task assigned by the head node and report real-time data to the head node, wherein the real-time data includes the task execution status and the resource usage status of the slave node.
[0006] In a possible embodiment, when the head node allocates the task queue in the console to the at least one slave node, it is specifically used to: adopt a scheduling algorithm based on a priority queue and a resource prediction model to dynamically allocate the task queue in the console to the at least one slave node, and adjust the scheduling algorithm according to the real-time data reported by the slave node.
[0007] In another possible embodiment, the head node is further used to encrypt and authenticate the slave node when the slave node joins the cluster.
[0008] In other possible embodiments, the console is further used to: elect a new head node from the slave nodes of the cluster when a current head node fails.
[0009] In a second aspect, an embodiment of the present invention further provides a cluster task scheduling method, which is applied to the cluster management system as described in any one of claims 1 to 4, comprising: receiving a configuration operation performed by a user on a console; in response to the configuration operation, creating a cluster on the console, setting a head node of the cluster, and starting a container of at least one slave node so that the at least one slave node joins the cluster, controlling the head node to execute a task script, wherein the task script is used to monitor the resource usage status of the at least one slave node, and allocating the task queue in the console to the at least one slave node according to the load and resource availability of the cluster.
[0010] In a possible embodiment, the method further includes: setting concurrent execution in the head node, allocating tasks to a specified slave node list according to load and resource usage status, and controlling each slave node in the slave node list to execute tasks in parallel.
[0011] In another possible embodiment, allocating the task queue in the console to the at least one slave node includes: using a scheduling algorithm based on a priority queue and a resource prediction model to dynamically allocate the task queue in the console to the at least one slave node, and adjusting the scheduling algorithm according to real-time data reported by the slave node.
[0012] In other possible embodiments, the method further includes: when a current head node fails, triggering the console to elect a new head node from the slave nodes of the cluster.
[0013] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a program, and when the program runs on an electronic device, the electronic device executes a method of any possible implementation of the second aspect above.
[0014] In a fourth aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a program that can be run on the processor, and when the program is executed by the processor, the electronic device implements the method described in any embodiment of the second aspect above.
[0015] In a fifth aspect, an embodiment of the present invention further provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute a method of any possible implementation of the second aspect.
[0016] The cluster management system, task scheduling method, medium and equipment provided by the embodiments of the present invention have the following significant advantages: first, efficiency is significantly improved. By integrating task scheduling and resource management functions, the dependence on external message agents is reduced, thereby improving the response speed and processing capacity of the system; second, stability is greatly enhanced. Thanks to the direct node management and task allocation mechanism, the possibility of message loss is effectively reduced, and the reliability of task execution is significantly improved; third, resource utilization is more optimized. With the help of intelligent resource scheduling algorithms, cluster resources are ensured to be maximized, thereby improving overall operating efficiency; fourth, management is more convenient. The rapid access of new nodes and automated management strategies simplify the system expansion and maintenance process. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of the structure of a cluster management system provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a cluster task scheduling method provided by an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In the description of the embodiments of the present invention, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations of the present invention. As used in the specification of the present invention and the appended claims, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present invention, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0022] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0023] In the embodiments of the present invention, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or implementation scheme described as "exemplarily" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or implementation schemes. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0024] like Figure 1 As shown, a cluster management system provided in an embodiment of the present invention includes a console, a head node and n slave nodes, where n is a positive integer, wherein:
[0025] 1. As an independent control platform, the console is independent of the cluster nodes. Its core responsibility is to interact with the current head node and the slave nodes in the cluster to achieve comprehensive management and monitoring of the entire cluster status. By providing a user-friendly graphical interface or API interface as an operation interface, the console enables users to easily define and adjust task settings. Its core functions include the following aspects:
[0026] First, the console provides task definition and management functions. Users can easily define tasks through the platform, including setting the task execution command, resource requirements (such as CPU, memory, etc.) and key parameters such as priority, so as to achieve precise control of tasks.
[0027] Secondly, the console has system monitoring and logging functions. The platform can collect and display detailed logs of each node and task execution in real time, provide comprehensive system status monitoring, and help users gain an in-depth understanding of the operation status of the cluster.
[0028] Finally, the console focuses on the user interaction experience. Through an intuitive graphical interface and API interface, the console can interact with users efficiently and conveniently, provide clear operation instructions and system feedback, and further enhance the user experience.
[0029] 2. The head node plays a key role as a temporary leader in the cluster. Its main responsibility is to perform task scheduling and resource management tasks. In the event of a head node failure, the system will automatically start the node election mechanism and select a new head node from other nodes to ensure the continuous operation and management functions of the cluster are not affected. Its core functions are summarized as follows:
[0030] First, a dynamic task scheduling mechanism is implemented. The head node implements dynamic task scheduling based on the resource requirements of the task, the task priority, and the real-time data of the current resource status of the cluster, so as to optimize resource utilization and improve the efficiency of task execution. Optionally, when the head node allocates the task queue in the console to the at least one slave node, it can adopt a scheduling algorithm based on a priority queue and a resource prediction model to dynamically allocate the task queue in the console to the at least one slave node, and adjust the scheduling algorithm according to the real-time data reported by the slave node. Exemplarily, the scheduling algorithm can be a scheduling algorithm similar to the Volcano Engine, which can optimize the allocation of tasks and reduce resource waste and waiting time.
[0031] Secondly, it is responsible for resource management and optimization. The head node is responsible for the allocation and optimization of resources within the cluster, including but not limited to the reasonable allocation of core resources such as memory, CPU and network bandwidth, in order to meet the actual needs of various tasks.
[0032] Finally, the failover and node election process is executed. When the head node fails, the failover mechanism will be automatically triggered and a new head node will be elected to ensure that the stability and reliability of the cluster are maintained.
[0033] 3. Slave nodes are responsible for executing tasks assigned by the head node. At startup, the slave node will automatically join the cluster and communicate through secure network protocols (such as TLS), while using authentication mechanisms such as OAuth to ensure secure access. Its core functions are as follows: 1. Task execution; the slave node executes specific tasks according to the allocation of the head node, including remote code execution, script running, plug-in installation and other operations to support the smooth development of various businesses in the cluster. 2. Status reporting; the slave node reports the status of task execution and the resource status of the node to the head node in real time, so that the head node can monitor and adjust the cluster status in real time.
[0034] As a component of the cluster, the slave node bears the important responsibility of executing the tasks assigned by the head node. During the startup process, the slave node will automatically integrate into the cluster system and communicate with other nodes through secure network protocols (such as TLS). At the same time, it uses authentication mechanisms such as OAuth to ensure secure access and communication of the node. Its core functions mainly include the following two aspects:
[0035] First, the slave node is responsible for executing specific tasks assigned by the head node. These tasks include but are not limited to remote code execution, script running, plug-in installation, etc., aiming to support the smooth development and efficient operation of various businesses in the cluster.
[0036] Secondly, the slave node has the function of status reporting. During the execution of a task, the slave node will report the status of the task execution and the resource usage of the node to the head node in real time, so that the head node can fully understand the operation status of the cluster, monitor the cluster status in real time and make necessary adjustments.
[0037] In summary, as an important part of the cluster, the slave node provides a strong guarantee for the stable operation and efficient collaboration of the cluster by executing tasks and reporting status.
[0038] The above system not only reduces dependence on external agents and improves the availability and reliability of the system, but also enables the system to respond more flexibly to various operating conditions, providing a strong guarantee for the continuous and stable operation of the business.
[0039] Based on the above system, an embodiment of the present invention provides a cluster task scheduling method, such as Figure 2 As shown, the process of the method can be executed by an electronic device, and the method includes the following steps:
[0040] S201, receiving a configuration operation performed by a user on a console.
[0041] S202, in response to the configuration operation, creating a cluster on the console, setting a head node of the cluster, and starting a container of at least one slave node, so that the at least one slave node joins the cluster.
[0042] S203, controlling the head node to execute a task script, wherein the task script is used to monitor the resource usage status of the at least one slave node, and to distribute the task queue in the console to the at least one slave node according to the load and resource availability of the cluster.
[0043] In step S202, creating a cluster on the console mainly includes: creating a management middle platform project and specifying a head node for the project. Writing relevant scripts for executing cluster tasks in the management middle platform project.
[0044] In addition, when the slave nodes join the cluster, each slave node's container automatically joins the cluster according to the pre-set settings when it starts. After that, when the head node starts the task, it will run the script that has been written to execute the task. These tasks can be automatically submitted to each slave node in the cluster, or executed on a specific slave node according to the needs.
[0045] In this method, the head node can automatically assign tasks to the corresponding slave nodes for execution according to the real-time load and resource availability of the cluster, thereby achieving load balancing of the above cluster. In addition, the head node also has the ability to set concurrent execution, can assign tasks to a specified list of slave nodes according to the load and resource usage status, and control each slave node in the slave node list to execute tasks in parallel. For example, in a model training task, the head node can specify a list of slave nodes to execute tasks, and submit multiple training tasks in parallel, thereby achieving full utilization of cluster resources and efficient execution of tasks.
[0046] In step S203, when the task script is executed, the task queue in the console is allocated to the at least one slave node, including: using a scheduling algorithm based on a priority queue and a resource prediction model to dynamically allocate the task queue in the console to the at least one slave node, and adjusting the scheduling algorithm according to the real-time data reported by the slave node. In addition, when the current head node encounters a failure, the node election mechanism will be automatically started to select a new head node from other nodes to ensure that the continuous operation and management functions of the cluster are not affected.
[0047] The following is an illustrative example of the above method in combination with examples in different application scenarios.
[0048] Scenario 1: Application in model training
[0049] In today's era of big data, the training of machine learning models has become increasingly important. Especially when dealing with large-scale data sets, traditional single-machine training methods often seem inadequate. In order to overcome this problem, a cluster method based on ten nodes is used to train machine learning models. This method not only significantly improves the training speed, but also helps to improve the accuracy and stability of the model. The specific implementation steps are as follows:
[0050] First, set up the management center according to the requirements and create a head node for the cluster. This head node is the command center of the entire cluster, responsible for coordinating and managing the various nodes in the cluster. When creating the head node, you need to consider factors such as its hardware configuration, network bandwidth, and security to ensure that it can run stably and take on the responsibility of cluster management. Next, add the other 9 nodes to the cluster as slave nodes. These worker nodes will take on the actual model training tasks. When configuring the worker nodes, you need to ensure that their hardware configuration matches the head node so that high computing efficiency and data transmission speed can be maintained during parallel training. Once the cluster configuration is complete, you need to define and start the model training task on the head node. This task will include the selection of data sets, preprocessing, definition of model structure, and setting of training parameters. When defining tasks, you need to fully consider the distribution and characteristics of the data, as well as the complexity and performance requirements of the model. After the task is started, the head node will automatically distribute the task to the various worker nodes in the cluster. These nodes will execute the training tasks in parallel, accelerating the training process by sharing data and computing resources. During the training process, the head node will monitor the running status and training progress of each node in real time to ensure the smooth progress of the entire process. When the task is completed, the head node will collect the training results of each node and conduct comprehensive analysis and optimization. By evaluating the training results, you can understand the performance of the model and make adjustments and optimizations for the deficiencies. This process helps to improve the accuracy and generalization ability of the model, so that it can play a better role in practical applications. In short, when training machine learning models on large-scale data sets, this scenario uses a cluster based on 10 nodes to effectively improve the training speed and model performance. By reasonably configuring the cluster, optimizing the task definition, and monitoring the training process, the advantages of the cluster can be fully utilized to provide strong support for machine learning applications.
[0051] Scenario 2: Big Data Processing - In-depth analysis of enterprise-level big data analysis and processing
[0052] In modern society, big data has become one of the key factors for enterprises to gain competitive advantages. How to efficiently process and analyze this data to mine valuable information is a challenge faced by every enterprise. This scenario will describe in detail the process of enterprise-level big data analysis and processing, as well as each link in the implementation steps.
[0053] First, the data processing task needs to be clearly defined. This includes determining the required data source, data type, processing target, and required computing resources. Only when the task requirements are clear can the subsequent configuration and scheduling work be carried out in a targeted manner.
[0054] Next, you need to configure a cluster with multiple nodes for distributed processing. In this scenario, 20 nodes are configured to automatically join the cluster. These nodes can be physical machines or virtual machines, which are connected to each other through the network to form a powerful computing cluster.
[0055] Once the cluster is configured, you can start automatic task scheduling. The head node, as the manager of the cluster, is responsible for receiving data processing tasks and automatically assigning tasks according to the load of each node. This automatic scheduling mechanism ensures that tasks can be processed in the shortest time and fully utilize the computing resources of the cluster. After the task allocation is completed, each node starts to process data in parallel. According to the assigned tasks, they read data from the data source and perform operations such as cleaning, conversion and analysis. Since multiple nodes work at the same time, the processing speed can be greatly accelerated and the processing efficiency can be improved.
[0056] When all nodes have completed their respective tasks, they will aggregate the processing results to the head node. The head node is responsible for collecting data from all nodes and performing final aggregation and analysis. In this way, enterprises can get a comprehensive and accurate data analysis report to better understand the business situation and make appropriate decisions. By deeply analyzing this big data processing scenario, we can see that enterprise-level big data analysis and processing is a complex and delicate process. It involves multiple links such as task definition, cluster configuration, automatic task scheduling, parallel processing, and result aggregation. Each link needs to be carefully designed and optimized to ensure the efficiency and accuracy of data processing. In addition, with the continuous development of technology, the field of big data processing is also constantly innovating and advancing. For example, more and more companies are beginning to adopt machine learning and artificial intelligence technologies to optimize the data processing process and improve processing efficiency and accuracy. At the same time, some emerging technologies such as cloud computing and edge computing also provide new solutions and ideas for big data processing.
[0057] In short, big data processing is one of the important means for enterprises to gain competitive advantages. By deeply understanding the process and technology of big data processing, enterprises can better cope with data challenges, mine valuable information, and provide strong support for business development.
[0058] Scenario 3: Web Service Deployment
[0059] In today's information society, the deployment and expansion of Web services has become an important part of enterprise development. Dynamic deployment and expansion of Web services is a key step in this process, aiming to achieve rapid deployment, efficient expansion, and flexible adjustment of services. The following will introduce the implementation steps of this scenario and the technical principles behind it in detail.
[0060] First, service containerization is required. Service containerization is to encapsulate the Web service and its operating environment in an independent container to facilitate deployment and management in different environments. By containerizing Web services, rapid deployment and migration of services can be achieved while reducing problems caused by environmental differences. This step can be completed with the help of container technologies such as Docker. By writing a Dockerfile to define the environment and configuration of the service, and then building and publishing the container image.
[0061] Next, dynamic cluster access needs to be implemented. Dynamic cluster access refers to dynamically adding servers as nodes to an existing cluster to expand the processing capacity of the service. In order to implement dynamic cluster access, container orchestration tools such as Kubernetes can be used. These tools can automatically manage containers in the cluster, including operations such as container creation, scheduling, expansion, and reduction. When you need to expand a service, you only need to define the deployment strategy of the service in Kubernetes, and then the tool will automatically select the appropriate node for service deployment and expansion. On the basis of dynamic cluster access, load balancing scheduling also needs to be implemented. Load balancing scheduling refers to dynamically adjusting the number of service nodes according to changes in access volume to ensure the stability and performance of the service. Through load balancing technology, requests can be distributed to different service nodes to avoid overloading of a single node and causing service unavailability. Common load balancing algorithms include polling, random, least connection, etc., and you can choose the appropriate algorithm for scheduling according to actual conditions.
[0062] Finally, elastic scaling is also required. Elastic scaling refers to increasing or decreasing service instances in real time according to the actual needs of the service in order to optimize service response and reduce costs. By monitoring the performance indicators of the service (such as response time, throughput, etc.), you can determine whether the service needs to be scaled. When the service load is too high, you can automatically increase the service instance to improve the processing capacity; when the service load is low, you can automatically reduce the service instance to save resources.
[0063] In short, dynamic deployment and expansion of Web services is a complex and important process that requires the use of a variety of technical means such as container technology, container orchestration tools, and load balancing technology. Through reasonable deployment and expansion strategies, the stability, efficiency, and flexibility of Web services can be ensured, providing strong support for the business development of enterprises.
[0064] Scenario 4: Real-time video processing
[0065] In the digital age, video has become an important channel for people to obtain information and entertainment. However, with the continuous growth and high definition of video content, the requirements for video processing are also increasing. Especially in the field of real-time video processing, how to efficiently process video streams to meet user needs has become an urgent problem to be solved. Real-time video processing is a complex and critical process that requires a series of operations such as decoding, analyzing, processing, and encoding of video streams. In order to achieve efficient processing of real-time video streams, a complete set of implementation steps needs to be formulated.
[0066] First, we need to define the video processing task. This includes clarifying the processing goals, such as video format conversion, video content recognition and analysis, etc. At the same time, it is also necessary to set the resource requirements required for the task, including computing resources, storage resources, and network resources. The reasonable allocation of these resources will directly affect the efficiency and quality of video processing.
[0067] Next, we need to optimize the node configuration. In the process of real-time video processing, high-performance GPU nodes will play a vital role. Therefore, we need to select nodes with high-performance GPUs and add them to the processing cluster. Through reasonable node configuration, we can make full use of the parallel computing power of GPUs and improve the efficiency of video processing.
[0068] The head node plays a key role in task priority management. The head node needs to schedule tasks according to their priorities to ensure that important tasks are processed first. This helps to achieve optimal processing of tasks under limited resource conditions.
[0069] In terms of parallel video processing, multiple video streams are processed simultaneously. By assigning different video streams to different nodes for processing, the parallel computing capabilities of the cluster can be fully utilized to improve the processing speed. At the same time, it is also necessary to ensure the coordination between the nodes to achieve overall efficient processing.
[0070] Finally, synchronous feedback and optimization need to be achieved. Real-time video processing is a dynamic process that requires real-time feedback of processing results and adjustment and optimization based on the feedback results. This includes adjusting resource allocation, optimizing algorithms, etc. Through continuous feedback and optimization, the efficiency and quality of video processing can be gradually improved.
[0071] In summary, real-time video processing is a complex and critical process. By defining video processing tasks, optimizing node configuration, managing task priorities, implementing parallel video processing, and synchronous feedback and optimization, we can achieve efficient processing of real-time video streams. This will help meet users' demand for high-quality video processing and promote the continuous development of video processing technology.
[0072] In summary, the cluster management system, task scheduling method, medium and device provided by the embodiments of the present invention have shown significant advantages in many aspects. First, from the perspective of efficiency, this system significantly reduces the dependence on external message agents by integrating task scheduling and resource management functions. In previous system designs, task scheduling and resource management are often separate, and they need to communicate through message agents, which not only increases the complexity of the system, but also may lead to slower response speed and limited processing power. The cluster management system in the embodiments of the present invention integrates these two functions together, realizes the seamless connection between task scheduling and resource management, and thus greatly improves the response speed and processing power of the system.
[0073] Secondly, from the perspective of stability, the cluster management system of the embodiment of the present invention effectively reduces the possibility of message loss through direct node management and task allocation mechanism. In traditional systems, message transmission often relies on external message agents, which may cause message loss or delay during transmission. The system of the embodiment of the present invention ensures the accuracy and timeliness of messages by directly managing nodes and allocating tasks, thereby significantly improving the reliability of task execution.
[0074] In addition, the cluster management system of the embodiment of the present invention also has significant advantages in resource utilization. With the help of intelligent resource scheduling algorithms, the system can analyze the load of each node in the cluster in real time and make reasonable resource allocation according to the priority and resource requirements of the task. This intelligent resource scheduling method ensures that cluster resources are maximized, avoids waste and idleness of resources, and thus improves overall operating efficiency.
[0075] Finally, from the perspective of management convenience, the cluster management system of the embodiment of the present invention also shows obvious advantages. The system supports the rapid access and automated management strategy of new nodes, which makes the expansion and maintenance of the system simpler and more convenient. When a new node needs to be added, the system can automatically identify and configure it without manual tedious operations. At the same time, the system's automated management strategy can automatically monitor the operating status of the node and make corresponding adjustments, thereby reducing maintenance costs and improving system stability.
[0076] In summary, the cluster management system, task scheduling method, medium and device provided by the embodiments of the present invention have shown significant advantages in efficiency, stability, resource utilization and management convenience. These advantages enable the system to have higher performance and better reliability when processing large-scale task scheduling and resource management, providing strong support for the business development of enterprises.
[0077] Next, an electronic device provided by an embodiment of the present application is introduced. Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 300 can be specifically a mobile phone, a tablet, a laptop computer, a smart wearable device, etc., which is not limited here. Figure 2 Functions of the corresponding method embodiments. Specifically, the electronic device 300 includes: a receiver 301, a transmitter 302, a processor 303 and a memory 304 (wherein the number of processors 303 in the electronic device 300 can be one or more), wherein the processor 303 may include an application processor 3031 and a communication processor 3032. In some embodiments of the present application, the receiver 301, the transmitter 302, the processor 303 and the memory 304 may be connected via a bus or other means.
[0078] The memory 304 may include a read-only memory and a random access memory, and provides instructions and data to the processor 303. A portion of the memory 304 may also include a non-volatile random access memory (NVRAM). The memory 304 stores processor and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0079] The processor 303 controls the operation of the electronic device. In a specific application, the various components of the electronic device are coupled together through a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are referred to as bus systems in the figure.
[0080] The method disclosed in the above embodiment of the present application can be applied to the processor 303, or implemented by the processor 303. The processor 303 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the processor 303. The above processor 303 can be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and a vision processor (vision processing unit, VPU), a tensor processor (tensorprocessing unit, TPU) and other processors suitable for AI operations, and can further include an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 303 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 304, and the processor 303 reads the information in the memory 304, and completes the steps in the above method embodiment in combination with its hardware.
[0081] The receiver 301 can be used to receive input digital or character information, and generate signal input related to the relevant settings and function control of the electronic device. The transmitter 302 can be used to output digital or character information through the first interface; the transmitter 302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 302 can also include a display device such as a display screen.
[0082] The present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in the above method embodiment is implemented. Specific beneficial effects can be found in the above method embodiment.
[0083] The present invention also provides a computer program product, which implements the method described in the above method embodiment when executed by a computer. Specific beneficial effects can be found in the above method embodiment.
[0084] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0085] The above is only a specific implementation of the embodiment of the present invention, but the protection scope of the embodiment of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiment of the present invention should be included in the protection scope of the embodiment of the present invention. Therefore, the protection scope of the embodiment of the present invention should be based on the protection scope of the claims.
Claims
1. A cluster management system, characterized in that: include: A control console, a head node and at least one slave node, wherein the head node and the at least one slave node form a cluster, wherein: The console is used to interact with the head node and slave nodes in the cluster to manage and monitor the status of the cluster, and provide a graphical user interface and / or an application program interface to the user so that the user can define and adjust task settings according to needs; The head node is used to monitor the resource usage status of the at least one slave node, and allocate the task queue in the console to the at least one slave node according to the load and resource availability of the cluster; The slave node is used to execute the task assigned by the head node and report real-time data to the head node, wherein the real-time data includes the task execution status and the resource usage status of the slave node.
2. The system according to claim 1, characterized in that When the head node distributes the task queue in the console to the at least one slave node, the head node is specifically used to: A scheduling algorithm based on a priority queue and a resource prediction model is used to dynamically allocate the task queue in the console to the at least one slave node, and the scheduling algorithm is adjusted according to the real-time data reported by the slave node.
3. The system according to claim 1 or 2, characterized in that: The head node is also used to encrypt and authenticate the slave node when the slave node joins the cluster.
4. The system according to claim 1 or 2, characterized in that: The console is also used to elect a new head node from the slave nodes of the cluster when a current head node fails.
5. A cluster task scheduling method, characterized in that: Applied to the cluster management system according to any one of claims 1 to 4, characterized in that it includes: Receive configuration operations performed by users on the console; In response to the configuration operation, a cluster is created on the console, a head node of the cluster is set, and a container of at least one slave node is started so that the at least one slave node joins the cluster; The head node is controlled to execute a task script, wherein the task script is used to monitor the resource usage status of the at least one slave node, and to distribute the task queue in the console to the at least one slave node according to the load and resource availability of the cluster.
6. The method according to claim 5, characterized in that Also includes: Concurrent execution is set in the head node, tasks are assigned to a specified list of slave nodes according to load and resource usage status, and each slave node in the list of slave nodes is controlled to execute tasks in parallel.
7. The method according to claim 5 or 6, characterized in that: Allocating the task queue in the console to the at least one slave node includes: A scheduling algorithm based on a priority queue and a resource prediction model is used to dynamically allocate the task queue in the console to the at least one slave node, and the scheduling algorithm is adjusted according to the real-time data reported by the slave node.
8. The method according to claim 5 or 6, characterized in that: Also includes: When the current head node fails, the console is triggered to elect a new head node from the slave nodes of the cluster.
9. A computer-readable storage medium, wherein a program is stored in the computer-readable storage medium, characterized in that: When the program is executed by a processor, the method according to any one of claims 5 to 8 is implemented.
10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores a program executable on the processor, and when the program is executed by the processor, the electronic device implements the method as claimed in any one of claims 5 to 8.
