WO2020259081A1 - Task scheduling method, apparatus, and device, and computer-readable storage medium - Google Patents

Task scheduling method, apparatus, and device, and computer-readable storage medium Download PDF

Info

Publication number
WO2020259081A1
WO2020259081A1 PCT/CN2020/088126 CN2020088126W WO2020259081A1 WO 2020259081 A1 WO2020259081 A1 WO 2020259081A1 CN 2020088126 W CN2020088126 W CN 2020088126W WO 2020259081 A1 WO2020259081 A1 WO 2020259081A1
Authority
WO
WIPO (PCT)
Prior art keywords
kubenetes
target
interface
task
cluster
Prior art date
Application number
PCT/CN2020/088126
Other languages
French (fr)
Chinese (zh)
Inventor
卢道和
杨军
李焕
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2020259081A1 publication Critical patent/WO2020259081A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • This application relates to the field of financial technology (Fintech) technology, and in particular to task scheduling methods, devices, equipment and computer-readable storage media.
  • Kubernetes as a container cluster management system can dynamically allocate corresponding processing resources for operation tasks, that is, the Kubernetes cluster includes the Kubernetes control plane (master node) and Kubernetes slave nodes, and the Kubernetes control plane is responsible for the Kubernetes cluster All resources in Kubernetes are controlled and scheduled. Kubernetes slave nodes are used for the execution of operational tasks.
  • Kubernetes must be used to first deploy the Kubernetes control plane.
  • the Kubernetes control plane deployment requires application developers (also called callers) to provide for the Kubernetes control plane.
  • the Kubernetes interface writes code, the operation of the application developer is more troublesome, and the Kubernetes control plane requires high hardware, which makes the hardware cost high.
  • the main purpose of this application is to propose a task scheduling method, device, device, and computer-readable storage medium, which aims to solve the problem of troublesome operation by application developers and high hardware cost when Kubernetes cluster calls are currently made through the Kubernetes control plane. problem.
  • this application provides a task scheduling method, which includes the following steps:
  • the operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operating parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is based on the yaml file Perform the operation task.
  • the step of sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and converting the operating parameters into a yaml file through the target Kubenetes interface includes:
  • the interface template passes the verification, the interface template is associated with the corresponding Kubernetes interface.
  • the operation parameter corresponding to the operation task is sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operation parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes
  • the steps for the cluster to execute the operation task according to the yaml file include:
  • the target Kubernetes interface has an associated interface template, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters so that the target Kubenetes cluster can be The yaml file performs the operation task.
  • the method includes:
  • a template configuration prompt is generated based on the target Kubenetes interface, and the template configuration prompt is sent to the client corresponding to the operation task, so that the client corresponds The user configures the interface template of the target Kubenetes interface.
  • the step of querying the preset mapping relationship table and determining the target Kubenetes cluster according to the container parameters of the container includes:
  • Container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
  • the method includes:
  • the step of creating a container corresponding to the operation task is executed.
  • the method includes:
  • the operating parameters are converted into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
  • the present application also provides a task scheduling device, the task scheduling device is set in the Kubenetes Gateway, the task scheduling device includes:
  • the container creation module is used to create a container corresponding to the operation task when the operation task is received;
  • the query determination module is used to query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
  • the sending execution module is configured to send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target Kubenetes The cluster executes the operation task according to the yaml file.
  • the task scheduling device further includes:
  • the obtaining configuration module is used to obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter passing format of the Kubenetes interface;
  • the verification association module is configured to associate the interface template with the corresponding Kubernetes interface when the interface template is verified.
  • the sending execution module includes:
  • the interface selection unit is configured to obtain the operating parameter corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameter from the Kubernetes interfaces of the target Kubenetes cluster;
  • the association judgment unit is used to judge whether the target Kubernetes interface has an associated interface template
  • the sending execution unit is configured to, if there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that all The target Kubenetes cluster executes the operation task according to the yaml file.
  • the sending execution module includes:
  • the template configuration unit is configured to generate a template configuration prompt based on the target Kubenetes interface if there is no associated interface template for the target Kubernetes interface, and send the template configuration prompt to the client corresponding to the operation task to Enable the user corresponding to the client to configure the interface template of the target Kubenetes interface.
  • the query determination module includes:
  • a parameter acquisition unit for acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
  • the cluster query unit is configured to query a preset mapping relationship table, and determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
  • the task scheduling device includes:
  • the authority judgment module is used to obtain the task ID corresponding to the operation task, and judge whether it has the operation authority of the operation task according to the task ID;
  • the determination execution module is configured to create a container corresponding to the operation task when the operation authority has the operation task.
  • the task scheduling device further includes:
  • a statistics module used to count the amount of tasks currently to be processed in the target Kubenetes cluster
  • a sending prompt module configured to generate prompt information to the client corresponding to the operation task if the amount of tasks currently to be processed is greater than or equal to a preset threshold
  • the sending execution module is configured to, if the task amount currently to be processed is less than a preset threshold, execute the: sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and pass the The target Kubenetes interface converts the operating parameters into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
  • this application also provides a task scheduling device, the task scheduling device includes: a memory, a processor, and a task scheduling program stored in the memory and running on the processor, so When the task scheduling program is executed by the processor, the steps of the task scheduling method described above are implemented.
  • the present application also provides a computer-readable storage medium having a task scheduler stored on the computer-readable storage medium, and when the task scheduler is executed by a processor, the task scheduling as described above is realized. Method steps.
  • This application provides a task scheduling method, device, equipment, and computer-readable storage medium.
  • the Kubenetes Gateway is used to replace the Kubenetes control plane, and the Kubenetes interface is encapsulated by the Kubenetes Gateway, and the caller developer does not need to know
  • the processing logic of the Kubenetes back-end cluster is customized and developed according to the processing logic, which reduces the workload of the caller developer; in this embodiment, when the Kubenetes Gateway receives an operation task, the Kubenetes Gateway creates a container corresponding to the operation task, and The operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster to route the operation task to the target Kubenetes cluster, call the target Kubenetes cluster to execute the operation task, and realize the management of the Kubenetes cluster; at the same time, the Kubenetes Gateway device
  • the hardware requirements are low, and Kubernetes hardware costs are low.
  • FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application
  • FIG. 2 is a schematic diagram of a specific scenario of the first embodiment of the task scheduling method of the application
  • FIG. 4 is a schematic diagram of functional modules of an embodiment of a task scheduling device of this application.
  • FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
  • the task scheduling device in the embodiment of the present application may be a PC or a server device.
  • the task scheduling device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory.
  • the memory 1005 may also be a storage device independent of the foregoing processor 1001.
  • FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
  • a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a computer program corresponding to task scheduling.
  • the network interface 1004 is mainly used to connect to a back-end server and communicate with the back-end server;
  • the user interface 1003 is mainly used to connect to a client (user side) and communicate with the client;
  • the processor 1001 can be used to call a computer program corresponding to task scheduling stored in the memory 1005, and perform operations in the following task scheduling method.
  • the operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operating parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is based on the yaml file Perform the operation task.
  • the preset Kubenetes Gateway device in this embodiment is set at the front end of each Kubenetes cluster, and the Kubenetes Gateway device is used to convert the operation task to the Kubenetes Gateway device when it receives an operation request triggered by an application. It is a container, and routes the container corresponding to the operation task to the target Kubenetes cluster that processes the operation task, that is, the Kubenetes Gateway encapsulates the underlying Kubenetes interface of each Kubenetes cluster.
  • the back-end Kubenetes cluster and the yaml file corresponding to the Kubenetes cluster use the preset Kubenetes Gateway to route operation tasks to achieve centralized management of the Kubernetes multi-cluster architecture, specifically:
  • Fig. 3 is a schematic flowchart of a first embodiment of a task scheduling method according to this application. The method includes:
  • Step S10 when an operation task is received, a container corresponding to the operation task is created;
  • the task scheduling method is applied to a task scheduling device, and the task scheduling device is provided with a Kubenetes Gateway.
  • the task scheduling device can process and schedule operation tasks sent by a JVM (Java Virtual Machine, Java virtual machine) or a physical machine.
  • JVM Java Virtual Machine
  • a physical machine For example, in financial institutions in the financial industry (financial institutions include but not limited to banking institutions, insurance institutions and securities institutions), it is necessary to access financial database tables, such as accounting information tables, account opening information tables, financial transaction information tables, etc.
  • This process Trigger operation tasks are used in the process.
  • the task scheduling device calls the target Kubenetes cluster to process the operation task to allocate processing resources for the operation task to meet the concurrency and access speed requirements of financial services.
  • the Kubenetes Gateway in the task scheduling device receives the operation task.
  • the triggering method of the operation task is not specifically limited, that is, the operation task can be triggered by the user. For example, the user clicks a button in the client application to trigger the operation task.
  • the operation task is sent to the task scheduling device; in addition, the operation task can also be automatically triggered by the client, for example, when the client detects that the preset operation task execution condition is met, the operation task is automatically triggered, and the client sends the operation task to the task Dispatch equipment.
  • the Kubenetes Gateway in the task scheduling device packages the operation task into a container image, and configures the read-write layer of the container image, that is, the Kubenetes Gateway executes the docker create command as the container image ( image) adds a read-write layer to form a container.
  • the Kubenetes Gateway device in the task scheduling device creates a container based on the operation task
  • the Kubenetes Gateway device will set the container's running parameters and container parameters according to the operation task.
  • the running parameters are the necessary parameters for the operation of the container. You can determine how the container runs.
  • the operating parameters include but are limited to: input parameters of the operation task, and output parameters of the operation task. For example, if the operation task is to query the contact information of Wang xx in the mysql database, the operation parameter of the operation task is: mysql Database, king xx and contact information; container parameters refer to the operating environment parameters of the container. According to the container parameters, you can determine where to run the container.
  • the container parameters include but are not limited to: container name parameters, container forwarding parameters, container IP parameters, geographic location parameters , Program structure parameters and deployment environment parameters. For example, if the operation task is to query the contact information of Wang xx in the mysql database, the geographic location parameter in the container parameter of the operation task is: Futian District, Shenzhen, Guangdong province, where the geographic location parameter can be Determine according to the network IP carried by the operation task.
  • Step S20 Query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container.
  • the Kubenetes Gateway has a preset mapping relationship table.
  • the preset mapping relationship table saves the container parameter and cluster mapping relationship.
  • the container parameter in the preset mapping relationship table is: the container IP parameter is 001, the container name is xxx, corresponding to cluster A
  • the Kubenetes Gateway obtains the container parameters of the container, and the Kubenetes Gateway queries the preset mapping relationship table to obtain the target Kubenetes cluster corresponding to the container parameters. Specifically, it includes:
  • Step a1 Obtain container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
  • Step a2 query a preset mapping relationship table, and obtain a target Kubenetes cluster matching the program structure information, the geographic location information, and the deployment environment information.
  • the Kubenetes Gateway determines the target Kubenetes cluster according to the container parameters of the container, has routed the container corresponding to the operation task to the target Kubenetes cluster, and executes the operation task by calling the target Kubenetes cluster, specifically:
  • Step S30 Send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is The yaml file performs the operation task.
  • the Kubenetes Gateway implements statistics on the Kubenetes interface corresponding to each Kubenetes cluster in advance.
  • the Kubenetes interface is associated with pre-customized parameter processing code, that is, the Kubenetes cluster only processes operating parameters in the yaml file format, and the Kubenetes interface is pre-associated with data processing code.
  • the operating parameters of the operation task can be converted into the yaml file format, specifically, including:
  • Step b1 Obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter transfer format of the Kubenetes interface;
  • Step b2 When the interface template passes the verification, the interface template is associated with the corresponding Kubernetes interface.
  • the task scheduling device obtains the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and the task scheduling device configures the interface template according to the parameter passing format of the Kubenetes interface.
  • the parameter passing format of the Kubenetes interface is the yaml file format, and the task scheduling device configures the yaml template;
  • the task scheduling device verifies the configured interface template. If the interface template verification fails, the task scheduling device reconfigures; if the interface template verification passes, the task scheduling device compares the interface template with the corresponding Kubernetes interface for association.
  • the Kubenetes Gateway device in the task scheduling device sends the operating parameters corresponding to the operating task (operating parameters include but not limited to the input and output parameters of the operating task) to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the target Kubenetes interface processes the operating parameters so that The target Kubenetes cluster executes the operation task according to the processed operating parameters, specifically, including:
  • Step c1 Obtain the operating parameters corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster;
  • Step c2 judging whether the target Kubernetes interface has an associated interface template
  • Step c3 If there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that the target Kubenetes The cluster executes the operation task according to the yaml file.
  • the Kubenetes Gateway device obtains the operating parameters corresponding to the operation task, and the Kubenetes Gateway device selects the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster; the Kubenetes Gateway device determines whether the target Kubernetes interface has an associated interface template. If there is an interface template associated with the Kubernetes interface, the operating parameters are entered into the interface template associated with the target Kubernetes interface, and a yaml file containing the operating parameters is obtained, so that the target Kubenetes cluster can perform operation tasks according to the yaml file.
  • the existing Federation integrates Kubernetes clusters distributed in multiple regions into a large cluster and unified management and scheduling.
  • This management and scheduling method depends on the deployed Kubernetes control plane.
  • the Kubernetes control plane schedules Kubernetes.
  • developers need to customize the data processing programs related to the development operation tasks.
  • the data processing programs customized by different users are different, and the data processing programs are not standardized.
  • the interface template of the Kubernetes interface is pre-configured, and the operation parameters corresponding to the operation task are processed through the interface template of the Kubenetes interface, and the operation task is routed to the Kubenetes cluster.
  • the implementation of this application improves the scheduling efficiency of the Kubernetes cluster by simplifying the processing process of the operating parameters, so as to improve the processing efficiency of the operation task.
  • the technical solution of the embodiment of the application Compared with the existing method, the operation is simpler, and the bottleneck caused by the untimely routing of the operation task is not prone to occur.
  • the Kubenetes Gateway is used to replace the Kubenetes control plane, and the Kubenetes interface is encapsulated by the Kubenetes Gateway.
  • the caller developer does not need to understand the processing logic of the Kubenetes back-end cluster and develop customized development based on the processing logic, reducing caller development The workload of personnel; in this embodiment, when the Kubenetes Gateway device receives an operation task, the Kubenetes Gateway device creates a container corresponding to the operation task, and sends the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster to transfer the operation Task routing is in the target Kubenetes cluster, calling the target Kubenetes cluster to perform operation tasks, realizing the management of the Kubenetes cluster; at the same time, the Kubenetes Gateway has low hardware requirements and low Kubernetes hardware costs.
  • the Kubenetes Gateway device is applied to a financial institution, which reduces the workload of developers.
  • the target Kubenetes cluster can be called through the Kubenetes Gateway device to process operation tasks, which improves the processing efficiency of financial business corresponding operation tasks.
  • step c2 of the first embodiment the steps after judging whether the target Kubernetes interface has an associated interface template also include:
  • Step c4 If the target Kubernetes interface does not have an associated interface template, generate a template configuration prompt based on the target Kubenetes interface, and send the template configuration prompt to the client corresponding to the operation task, so that the The user corresponding to the client configures the interface template of the target Kubenetes interface.
  • the Kubenetes Gateway device determines the target Kubernetes When the interface does not have an associated interface template, the Kubenetes Gateway obtains the parameter transfer mode of the target Kubernetes interface. The Kubenetes Gateway generates a template configuration prompt containing the parameter transfer mode, and sends the template configuration prompt to the client that triggers the operation task.
  • the interface template of the target Kubenetes interface is developed and configured by the client corresponding to the user customization.
  • the Kubenetes Gateway device associates the interface template with the target Kubenetes interface, and executes step c3. If there is an associated interface template for the target Kubernetes interface, the operating parameters are input to all In the interface template associated with the target Kubernetes interface, a yaml file containing the operating parameters is obtained, so that the target Kubenetes cluster executes the operation task according to the yaml file.
  • the Kubenetes Gateway can customize the interface template in real time during the execution of the operation task, making the Kubenetes Gateway more flexible in cluster management.
  • This embodiment is the step before step S10 in the first embodiment: creating the container corresponding to the operation task.
  • the difference between this embodiment and the first embodiment is:
  • the step of creating a container corresponding to the operation task is executed.
  • the Kubenetes Gateway device After the Kubenetes Gateway device receives the operation task, the Kubenetes Gateway device obtains the task ID corresponding to the operation task.
  • the task ID can be a task code, task name, etc., and the Kubenetes Gateway device determines whether there is an operation task operation based on the task ID
  • the permissions specifically, include:
  • Implementation method 1 Kubenetes Gateway implements a preset logo set, which contains standard logos with operating permissions. Kubenettes Gateway compares the task logo with the standard logo in the preset logo set. If the default logo set If there is a target standard identifier that is the same as the task identifier, the Kubenetes Gateway device determines that it has the operation authority to operate the task; otherwise, it does not have it.
  • the Kubenetes Gateway device pre-marks the task identifier with operation authority. If the task identifier contains marking information, the Kubenetes Gateway device determines that it has the operation authority for the operation task; otherwise, it does not have it.
  • the Kubenetes Gateway When the Kubenetes Gateway determines that it has the operation authority for the operation task, the Kubenetes Gateway creates a container corresponding to the operation task; when the Kubenetes Gateway determines that it does not have the operation authority for the operation task, the Kubenetes Gateway outputs a prompt message.
  • the Kubenetes Gateway device authenticates the operation task according to the task identifier of the operation task, so that the Kubenetes Gateway device corresponds to part of the operation task routing to ensure the security of the Kubenetes Gateway device calling the target Kubenetes cluster to perform the operation task.
  • This embodiment is a step after step S20 in the first embodiment.
  • the difference between this embodiment and the first embodiment lies in:
  • the operating parameters are converted into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
  • the Kubenetes Gateway device determines the target Kubenetes cluster to be called, the Kubenetes Gateway device does not directly call the container, but counts the number of tasks currently to be processed in the target Kubenetes cluster.
  • the Kubenetes Gateway device compares the current number of tasks to be processed with the expected number of tasks.
  • Set the threshold (the preset threshold can be flexibly set according to the specific scenario, for example, the Kubenetes Gateway device is set according to the processing efficiency of the target Kubenetes cluster, and the processing efficiency of the target Kubenetes cluster is 1000 per second, then the preset threshold is set to 1000) for comparison ;
  • a prompt message is generated to send the client that triggers the operation task, so that the client user can understand the task execution status.
  • step S30 in the first embodiment is executed: the operating parameters corresponding to the operation tasks are sent to the target Kubenetes cluster, so that the target Kubenetes cluster executes the Operation to perform operational tasks.
  • the Kubenetes Gateway centrally manages all the Kubenetes clusters. After the Kubenetes Gateway determines the target Kubenetes cluster, the Kubenetes Gateway counts the number of tasks currently to be processed in the target Kubenetes cluster, and based on the current number of tasks to be processed in the target Kubenetes cluster , Determine whether to schedule the container to the target Kubenetes cluster. When the amount of tasks to be processed before is greater than the preset threshold, suspend the scheduling of the container to the target Kubenetes cluster to reduce the target Kubenetes cluster through current limiting and ensure the normal operation of the operation tasks.
  • the Kubenetes Gateway device can also adjust the weight of each container parameter to determine a new target Kubenetes cluster.
  • the container parameter has a program structure.
  • the Kubenetes Gateway will change the program structure
  • the weights of the geographic location and the geographic location are adjusted to 40% and 60% to obtain the second target Kubenetes cluster to execute step S30 in the first embodiment: the operating parameters corresponding to the operation task are sent to the second target Kubenetes interface corresponding to the second target Kubenetes cluster , Convert the second operating parameters into a yaml file through the second target Kubenetes interface, so that the second target Kubenetes cluster executes the operation task according to the yaml file.
  • the Kubenetes Gateway unit manages the Kubenetes cluster in a unified manner, and can count and schedule the amount of operation tasks processed by the Kubenetes cluster, making the Kubenetes cluster management implemented based on the Kubenetes Gateway more reasonable.
  • the present application also provides a task scheduling device, the task scheduling device includes:
  • the container creation module 10 is configured to create a container corresponding to the operation task when the operation task is received;
  • the query determination module 20 is configured to query a preset mapping relationship table, and determine a target Kubenetes cluster according to the container parameters of the container;
  • the sending execution module 30 is configured to send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target The Kubenetes cluster executes the operation task according to the yaml file.
  • the task scheduling device further includes:
  • the obtaining configuration module is used to obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter passing format of the Kubenetes interface;
  • the verification association module is configured to associate the interface template with the corresponding Kubernetes interface when the interface template is verified.
  • the sending execution module includes:
  • the interface selection unit is configured to obtain the operating parameter corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameter from the Kubernetes interfaces of the target Kubenetes cluster;
  • the association judgment unit is used to judge whether the target Kubernetes interface has an associated interface template
  • the sending execution unit is configured to, if there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that all The target Kubenetes cluster executes the operation task according to the yaml file.
  • the sending execution module includes:
  • the template configuration unit is configured to generate a template configuration prompt based on the target Kubenetes interface if there is no associated interface template for the target Kubernetes interface, and send the template configuration prompt to the client corresponding to the operation task to Enable the user corresponding to the client to configure the interface template of the target Kubenetes interface.
  • the query determination module includes:
  • a parameter acquisition unit for acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
  • the cluster query unit is configured to query a preset mapping relationship table, and determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
  • the task scheduling device includes:
  • the authority judgment module is used to obtain the task identifier corresponding to the operation task, and determine whether it has the operation authority of the operation task according to the task identifier;
  • the determination execution module is configured to create a container corresponding to the operation task when the operation authority has the operation task.
  • the task scheduling device further includes:
  • a statistics module used to count the amount of tasks currently to be processed in the target Kubenetes cluster
  • a sending prompt module configured to generate prompt information to the client corresponding to the operation task if the amount of tasks currently to be processed is greater than or equal to a preset threshold
  • the sending execution module is configured to, if the task amount currently to be processed is less than a preset threshold, execute the: sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and pass the The target Kubenetes interface converts the operating parameters into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
  • the application also provides a computer-readable storage medium.
  • a task scheduling program is stored on the computer-readable storage medium of the present application, and when the task scheduling program is executed by a processor, the steps of the task scheduling method described above are implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

A task scheduling method, apparatus, and device, and a computer-readable storage medium. The method comprises: when an operation task is received, creating a container corresponding to the operation task (S10); querying a preset mapping table, and determining a target Kubenetes cluster according to container parameters of the container (S20); and sending running parameters corresponding to the operation task to a target Kubenetes interface corresponding to the target Kubenetes cluster, and converting the running parameters into a yaml file by means of the target Kubenetes interface such that the target Kubenetes cluster executes the operation task according to the yaml file (S30).

Description

任务调度方法、装置、设备及计算机可读存储介质Task scheduling method, device, equipment and computer readable storage medium
本申请要求于2019年6月25日申请的、申请号为201910564385.7、名称为“任务调度方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on June 25, 2019, with application number 201910564385.7 and titled "task scheduling method, device, equipment, and computer-readable storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及金融科技(Fintech)技术领域,尤其涉及任务调度方法、装置、设备及计算机可读存储介质。This application relates to the field of financial technology (Fintech) technology, and in particular to task scheduling methods, devices, equipment and computer-readable storage media.
背景技术Background technique
随着互联网技术,尤其是互联网金融科技(Fintech)的飞速发展,越来越多的技术(大数据、分布式、区块链Blockchain、人工智能等)应用在金融领域。With the rapid development of Internet technology, especially Internet financial technology (Fintech), more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field.
以金融领域中银行为例,通常它们拥有成百上千个业务应用程序,若每个应用程序设置对应的服务器处理应用程序对应的操作任务,可能会出现操作任务较多服务器超负荷,或者操作任务较少服务器资源闲置;Kubernetes作为一个容器集群管理***可以为操作任务动态地分配相应的处理资源,即,Kubernetes集群包括Kubernetes控制平面(主节点)和Kubernetes从节点,Kubernetes控制平面负责对Kubernetes集群中所有资源进行管控和调度,Kubernetes从节点用于操作任务的执行;故要使用Kubernetes首先部署Kubernetes控制平面,Kubernetes控制平面部署需要应用程序的开发者(又叫调用方)针对Kubernetes控制平面提供的Kubernetes接口编写代码,应用程序的开发者的操作较为麻烦,且Kubernetes控制平面对硬件要求较高,使得硬件成本高。Take banks in the financial sector as an example. Usually they have hundreds of business applications. If each application is set up with a corresponding server to handle the operation tasks corresponding to the application, there may be more operation tasks, server overload, or operation There are few tasks and server resources are idle; Kubernetes as a container cluster management system can dynamically allocate corresponding processing resources for operation tasks, that is, the Kubernetes cluster includes the Kubernetes control plane (master node) and Kubernetes slave nodes, and the Kubernetes control plane is responsible for the Kubernetes cluster All resources in Kubernetes are controlled and scheduled. Kubernetes slave nodes are used for the execution of operational tasks. Therefore, Kubernetes must be used to first deploy the Kubernetes control plane. The Kubernetes control plane deployment requires application developers (also called callers) to provide for the Kubernetes control plane. The Kubernetes interface writes code, the operation of the application developer is more troublesome, and the Kubernetes control plane requires high hardware, which makes the hardware cost high.
发明概述Summary of the invention
技术问题technical problem
问题的解决方案The solution to the problem
技术解决方案Technical solutions
本申请的主要目的在于提出一种任务调度方法、装置、设备及计算机可读存储介质,旨在解决当前通过Kubernetes控制平面进行Kubernetes集群调用时,应用 程序的开发者操作麻烦、硬件成本高的技术问题。The main purpose of this application is to propose a task scheduling method, device, device, and computer-readable storage medium, which aims to solve the problem of troublesome operation by application developers and high hardware cost when Kubernetes cluster calls are currently made through the Kubernetes control plane. problem.
为实现上述目的,本申请提供一种任务调度方法,所述任务调度方法包括以下步骤:In order to achieve the above objective, this application provides a task scheduling method, which includes the following steps:
在接收到操作任务时,创建所述操作任务对应的容器;When an operation task is received, a container corresponding to the operation task is created;
查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;Query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operating parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is based on the yaml file Perform the operation task.
可选地,所述将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件的步骤之前,包括:Optionally, before the step of sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and converting the operating parameters into a yaml file through the target Kubenetes interface, includes:
获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,根据所述Kubenetes接口的传参格式配置接口模板;Obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter transfer format of the Kubenetes interface;
在所述接口模板校验通过时,将所述接口模板与对应的所述Kubernetes接口进行关联。When the interface template passes the verification, the interface template is associated with the corresponding Kubernetes interface.
可选地,所述将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤,包括:Optionally, the operation parameter corresponding to the operation task is sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operation parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes The steps for the cluster to execute the operation task according to the yaml file include:
获取所述操作任务对应的运行参数,从目标Kubenetes集群的Kubernetes接口中选择所述运行参数对应的目标Kubernetes接口;Obtain the operating parameters corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster;
判断所述目标Kubernetes接口是否存在关联的接口模板;Determine whether the target Kubernetes interface has an associated interface template;
若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。If the target Kubernetes interface has an associated interface template, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters so that the target Kubenetes cluster can be The yaml file performs the operation task.
可选地,所述判断所述目标Kubernetes接口是否存在关联的接口模板的步骤之后,包括:Optionally, after the step of judging whether the target Kubernetes interface has an associated interface template, the method includes:
若所述目标Kubernetes接口不存在关联的接口模板,则基于所述目标Kubenetes 接口生成模板配置提示,并将所述模板配置提示发送至所述操作任务对应的客户端,以使所述客户端对应的用户配置所述目标Kubenetes接口的接口模板。If the target Kubernetes interface does not have an associated interface template, a template configuration prompt is generated based on the target Kubenetes interface, and the template configuration prompt is sent to the client corresponding to the operation task, so that the client corresponds The user configures the interface template of the target Kubenetes interface.
可选地,所述查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群的步骤,包括:Optionally, the step of querying the preset mapping relationship table and determining the target Kubenetes cluster according to the container parameters of the container includes:
获取所述容器的容器参数,其中,所述容器参数包括地理位置参数、程序结构参数和部署环境参数;Acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
查询预设映射关系表,确定所述地理位置参数、所述程序结构参数和所述部署环境参数对应的目标Kubenetes集群。Query a preset mapping relationship table to determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
可选地,所述创建所述操作任务对应的容器的步骤之前,包括:Optionally, before the step of creating a container corresponding to the operation task, the method includes:
获取所述操作任务对应的任务标识,根据所述任务标识判断是否具有所述操作任务的操作权限;Acquiring a task identifier corresponding to the operation task, and judging whether it has operation authority of the operation task according to the task identifier;
在所述具有所述操作任务的操作权限时,执行所述创建所述操作任务对应的容器的步骤。When the operation authority of the operation task is obtained, the step of creating a container corresponding to the operation task is executed.
可选地,所述查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群的步骤之后,包括:Optionally, after the step of querying the preset mapping relationship table and determining the target Kubenetes cluster according to the container parameters of the container, the method includes:
统计所述目标Kubenetes集群当前待处理的任务量;Count the amount of tasks currently to be processed in the target Kubenetes cluster;
若当前待处理的所述任务量大于或等于预设阈值,则生成提示信息至发送所述操作任务对应的客户端;If the amount of tasks currently to be processed is greater than or equal to a preset threshold, generating prompt information to send the client corresponding to the operation task;
若当前待处理的所述任务量小于预设阈值时,则执行所述:将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤。If the amount of tasks currently to be processed is less than a preset threshold, then execute: send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and transfer all the tasks through the target Kubenetes interface The operating parameters are converted into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
此外,为实现上述目的,本申请还提供一种任务调度装置,所述任务调度装置设置于Kubenetes Gateway器中,所述任务调度装置包括:In addition, in order to achieve the above object, the present application also provides a task scheduling device, the task scheduling device is set in the Kubenetes Gateway, the task scheduling device includes:
容器创建模块,用于在接收到操作任务时,创建所述操作任务对应的容器;The container creation module is used to create a container corresponding to the operation task when the operation task is received;
查询确定模块,用于查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;The query determination module is used to query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
发送执行模块,用于将所述操作任务对应的运行参数发送至所述目标Kubenetes 集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The sending execution module is configured to send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target Kubenetes The cluster executes the operation task according to the yaml file.
可选地,所述任务调度装置还包括:Optionally, the task scheduling device further includes:
获取配置模块,用于获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,根据所述Kubenetes接口的传参格式配置接口模板;The obtaining configuration module is used to obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter passing format of the Kubenetes interface;
校验关联模块,用于在所述接口模板校验通过时,将所述接口模板与对应的所述Kubernetes接口进行关联。The verification association module is configured to associate the interface template with the corresponding Kubernetes interface when the interface template is verified.
可选地,所述发送执行模块,包括:Optionally, the sending execution module includes:
接口选择单元,用于获取所述操作任务对应的运行参数,从目标Kubenetes集群的Kubernetes接口中选择所述运行参数对应的目标Kubernetes接口;The interface selection unit is configured to obtain the operating parameter corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameter from the Kubernetes interfaces of the target Kubenetes cluster;
关联判断单元,用于判断所述目标Kubernetes接口是否存在关联的接口模板;The association judgment unit is used to judge whether the target Kubernetes interface has an associated interface template;
发送执行单元,用于若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The sending execution unit is configured to, if there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that all The target Kubenetes cluster executes the operation task according to the yaml file.
可选地,所述发送执行模块,包括:Optionally, the sending execution module includes:
模板配置单元,用于若所述目标Kubernetes接口不存在关联的接口模板,则基于所述目标Kubenetes接口生成模板配置提示,并将所述模板配置提示发送至所述操作任务对应的客户端,以使所述客户端对应的用户配置所述目标Kubenetes接口的接口模板。The template configuration unit is configured to generate a template configuration prompt based on the target Kubenetes interface if there is no associated interface template for the target Kubernetes interface, and send the template configuration prompt to the client corresponding to the operation task to Enable the user corresponding to the client to configure the interface template of the target Kubenetes interface.
可选地,所述查询确定模块,包括:Optionally, the query determination module includes:
参数获取单元,用于获取所述容器的容器参数,其中,所述容器参数包括地理位置参数、程序结构参数和部署环境参数;A parameter acquisition unit for acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
集群查询单元,用于查询预设映射关系表,确定所述地理位置参数、所述程序结构参数和所述部署环境参数对应的目标Kubenetes集群。The cluster query unit is configured to query a preset mapping relationship table, and determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
可选地,所述任务调度装置,包括:Optionally, the task scheduling device includes:
权限判断模块,用于获取所述操作任务对应的任务标识,根据所述任务标识判 断是否具有所述操作任务的操作权限;The authority judgment module is used to obtain the task ID corresponding to the operation task, and judge whether it has the operation authority of the operation task according to the task ID;
判定执行模块,用于在所述具有所述操作任务的操作权限时,创建所述操作任务对应的容器。The determination execution module is configured to create a container corresponding to the operation task when the operation authority has the operation task.
可选地,所述任务调度装置,还包括:Optionally, the task scheduling device further includes:
统计模块,用于统计所述目标Kubenetes集群当前待处理的任务量;A statistics module, used to count the amount of tasks currently to be processed in the target Kubenetes cluster;
发送提示模块,用于若当前待处理的所述任务量大于或等于预设阈值,则生成提示信息至发送所述操作任务对应的客户端;A sending prompt module, configured to generate prompt information to the client corresponding to the operation task if the amount of tasks currently to be processed is greater than or equal to a preset threshold;
发送执行模块,用于若当前待处理的所述任务量小于预设阈值时,则执行所述:将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤。The sending execution module is configured to, if the task amount currently to be processed is less than a preset threshold, execute the: sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and pass the The target Kubenetes interface converts the operating parameters into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
此外,为实现上述目的,本申请还提供一种任务调度设备,所述任务调度设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的任务调度程序,所述任务调度程序被所述处理器执行时实现如上所述的任务调度方法的步骤。In addition, in order to achieve the above object, this application also provides a task scheduling device, the task scheduling device includes: a memory, a processor, and a task scheduling program stored in the memory and running on the processor, so When the task scheduling program is executed by the processor, the steps of the task scheduling method described above are implemented.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有任务调度程序,所述任务调度程序被处理器执行时实现如上所述的任务调度方法的步骤。In addition, in order to achieve the above-mentioned object, the present application also provides a computer-readable storage medium having a task scheduler stored on the computer-readable storage medium, and when the task scheduler is executed by a processor, the task scheduling as described above is realized. Method steps.
本申请提供了一种任务调度方法、装置、设备及计算机可读存储介质,本申请实施例中,利用Kubenetes Gateway器取代Kubenetes控制平面,通过Kubenetes Gateway器封装Kubenetes接口,调用方开发人员不需要了解Kubenetes后端集群的处理逻辑并根据处理逻辑进行定制化开发,减少了调用方开发人员的工作量;本实施例中Kubenetes Gateway器接收到操作任务时,Kubenetes Gateway器创建操作任务对应的容器,并将操作任务对应的运行参数发送至目标Kubenetes集群对应的目标Kubenetes接口,以将操作任务路由在目标Kubenetes集群,调用目标Kubenetes集群执行操作任务,实现了Kubenetes集群的管理;与此同时,Kubenetes Gateway器对硬件要求较低,Kubernetes硬件成本低。This application provides a task scheduling method, device, equipment, and computer-readable storage medium. In the embodiment of this application, the Kubenetes Gateway is used to replace the Kubenetes control plane, and the Kubenetes interface is encapsulated by the Kubenetes Gateway, and the caller developer does not need to know The processing logic of the Kubenetes back-end cluster is customized and developed according to the processing logic, which reduces the workload of the caller developer; in this embodiment, when the Kubenetes Gateway receives an operation task, the Kubenetes Gateway creates a container corresponding to the operation task, and The operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster to route the operation task to the target Kubenetes cluster, call the target Kubenetes cluster to execute the operation task, and realize the management of the Kubenetes cluster; at the same time, the Kubenetes Gateway device The hardware requirements are low, and Kubernetes hardware costs are low.
发明的有益效果The beneficial effects of the invention
对附图的简要说明Brief description of the drawings
附图说明Description of the drawings
图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图;FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application;
图2为本申请任务调度方法第一实施例具体场景示意图;2 is a schematic diagram of a specific scenario of the first embodiment of the task scheduling method of the application;
图3为本申请任务调度方法第一实施例的流程示意图;3 is a schematic flowchart of the first embodiment of the task scheduling method of this application;
图4为本申请任务调度装置一实施例的功能模块示意图。FIG. 4 is a schematic diagram of functional modules of an embodiment of a task scheduling device of this application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
发明实施例Invention embodiment
本发明的实施方式Embodiments of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and are not used to limit the application.
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图。As shown in FIG. 1, FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
本申请实施例任务调度设备可以是PC机或服务器设备,如图1所示,该任务调度设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。The task scheduling device in the embodiment of the present application may be a PC or a server device. As shown in FIG. 1, the task scheduling device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory. Optionally, the memory 1005 may also be a storage device independent of the foregoing processor 1001.
本领域技术人员可以理解,图1中示出的设备结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the device shown in FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作***、网络通信模块、用户接口模块以及任务调度对应的计算机程序。As shown in FIG. 1, a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a computer program corresponding to task scheduling.
在图1所示的设备中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的任务调度对应的计算机程序,并执行下述任务调度方法中的操作。In the device shown in FIG. 1, the network interface 1004 is mainly used to connect to a back-end server and communicate with the back-end server; the user interface 1003 is mainly used to connect to a client (user side) and communicate with the client; and the processor 1001 can be used to call a computer program corresponding to task scheduling stored in the memory 1005, and perform operations in the following task scheduling method.
基于上述硬件结构,提出本申请任务调度方法实施例。Based on the above hardware structure, an embodiment of the task scheduling method of this application is proposed.
本申请任务调度方法的第一实施例,包括:The first embodiment of the task scheduling method of this application includes:
在接收到操作任务时,创建所述操作任务对应的容器;When an operation task is received, a container corresponding to the operation task is created;
查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;Query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operating parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is based on the yaml file Perform the operation task.
本实施例中预设的Kubenetes Gateway器,如图2所示,Kubenetes Gateway器设置于各Kubenetes集群前端,Kubenetes Gateway器用于在接收到基于应用程序触发的操作请求时,Kubenetes Gateway器将操作任务转化为容器,并将操作任务对应的容器路由到处理该操作任务的目标Kubenetes集群,即,Kubenetes Gateway器通过封装各Kubenetes集群的底层Kubenetes接口,应用程序调用Kubenetes集群时,不需要应用程序开发者了解后端的Kubenetes集群和Kubenetes集群对应的yaml文件,利用预设的Kubenetes Gateway器对操作任务进行路由,实现对Kubernetes多集群架构集中管理,具体地:The preset Kubenetes Gateway device in this embodiment, as shown in Figure 2, the Kubenetes Gateway device is set at the front end of each Kubenetes cluster, and the Kubenetes Gateway device is used to convert the operation task to the Kubenetes Gateway device when it receives an operation request triggered by an application. It is a container, and routes the container corresponding to the operation task to the target Kubenetes cluster that processes the operation task, that is, the Kubenetes Gateway encapsulates the underlying Kubenetes interface of each Kubenetes cluster. When the application calls the Kubenetes cluster, the application developer does not need to understand The back-end Kubenetes cluster and the yaml file corresponding to the Kubenetes cluster use the preset Kubenetes Gateway to route operation tasks to achieve centralized management of the Kubernetes multi-cluster architecture, specifically:
参照图3,图3为本申请任务调度方法第一实施例的流程示意图,所述方法包括:Referring to Fig. 3, Fig. 3 is a schematic flowchart of a first embodiment of a task scheduling method according to this application. The method includes:
步骤S10,在接收到操作任务时,创建所述操作任务对应的容器;Step S10, when an operation task is received, a container corresponding to the operation task is created;
本实施例中,任务调度方法应用于任务调度设备,任务调度设备设置有Kubenetes Gateway器,该任务调度设备可以对JVM(Java Virtual Machine,Java虚拟机)或者实体机发送的操作任务进行处理调度。比如在金融行业的金融机构(金融机构包括但不仅限于银行机构、保险机构和证券机构)中,需要访问金融数据库表,如账务信息表,开户信息表,金融交易信息表等,这一过程中会用到触发操作任务,任务调度设备接收操作任务时,调用目标Kubenetes集群处理操作任务,以为操作任务分配处理资源,满足金融业务的并发性和访问速度要求。In this embodiment, the task scheduling method is applied to a task scheduling device, and the task scheduling device is provided with a Kubenetes Gateway. The task scheduling device can process and schedule operation tasks sent by a JVM (Java Virtual Machine, Java virtual machine) or a physical machine. For example, in financial institutions in the financial industry (financial institutions include but not limited to banking institutions, insurance institutions and securities institutions), it is necessary to access financial database tables, such as accounting information tables, account opening information tables, financial transaction information tables, etc. This process Trigger operation tasks are used in the process. When the task scheduling device receives the operation task, it calls the target Kubenetes cluster to process the operation task to allocate processing resources for the operation task to meet the concurrency and access speed requirements of financial services.
任务调度设备中Kubenetes Gateway器接收操作任务,操作任务的触发方式不作具体限定,即,操作任务可以是用户主动触发的,例如,用户在客户端的应用 程序中点击按键,触发操作任务,客户端将操作任务发送至任务调度设备;此外,操作任务还可以是客户端自动触发的,例如,客户端检测到符合预设的操作任务执行条件时,自动触发操作任务,客户端将操作任务发送至任务调度设备。The Kubenetes Gateway in the task scheduling device receives the operation task. The triggering method of the operation task is not specifically limited, that is, the operation task can be triggered by the user. For example, the user clicks a button in the client application to trigger the operation task. The operation task is sent to the task scheduling device; in addition, the operation task can also be automatically triggered by the client, for example, when the client detects that the preset operation task execution condition is met, the operation task is automatically triggered, and the client sends the operation task to the task Dispatch equipment.
任务调度设备在接收到操作任务时,任务调度设备中的Kubenetes Gateway器将操作任务打包成容器镜像,并配置该容器镜像的可读写层,即,Kubenetes Gateway器执行docker create命令为容器镜像(image)添加了一个可读写层,构成了一个容器。When the task scheduling device receives an operation task, the Kubenetes Gateway in the task scheduling device packages the operation task into a container image, and configures the read-write layer of the container image, that is, the Kubenetes Gateway executes the docker create command as the container image ( image) adds a read-write layer to form a container.
可以理解的是,任务调度设备中的Kubenetes Gateway器根据操作任务创建容器时,Kubenetes Gateway器会根据操作任务设置容器的运行参数和容器参数,其中,运行参数是容器运行的必要参数,根据运行参数可以确定容器如何运行,运行参数包括但仅限于:操作任务的入参,操作任务的出参,例如,操作任务是查询mysql数据库中王xx的联系方式,则该操作任务的运行参数是:mysql数据库、王xx和联系方式;容器参数是指容器的运行环境参数,根据容器参数可以确定在哪里运行容器,容器参数包括但不仅限于:容器名称参数、容器转发参数、容器IP参数、地理位置参数、程序结构参数和部署环境参数,例如,操作任务是查询mysql数据库中王xx的联系方式,则该操作任务的容器参数中地理位置参数为:广东省深圳市福田区,其中,地理位置参数可以根据该操作任务携带的网络IP确定。It is understandable that when the Kubenetes Gateway device in the task scheduling device creates a container based on the operation task, the Kubenetes Gateway device will set the container's running parameters and container parameters according to the operation task. Among them, the running parameters are the necessary parameters for the operation of the container. You can determine how the container runs. The operating parameters include but are limited to: input parameters of the operation task, and output parameters of the operation task. For example, if the operation task is to query the contact information of Wang xx in the mysql database, the operation parameter of the operation task is: mysql Database, king xx and contact information; container parameters refer to the operating environment parameters of the container. According to the container parameters, you can determine where to run the container. The container parameters include but are not limited to: container name parameters, container forwarding parameters, container IP parameters, geographic location parameters , Program structure parameters and deployment environment parameters. For example, if the operation task is to query the contact information of Wang xx in the mysql database, the geographic location parameter in the container parameter of the operation task is: Futian District, Shenzhen, Guangdong Province, where the geographic location parameter can be Determine according to the network IP carried by the operation task.
步骤S20,查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群。Step S20: Query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container.
Kubenetes Gateway器中预设映射关系表,预设映射关系表保存有容器参数与集群映射关系,例如,预设映射关系表中容器参数为:容器IP参数为001,容器名称为xxx,对应集群A;Kubenetes Gateway器获取容器的容器参数,Kubenetes Gateway器查询预设映射关系表,获取与容器参数对应的目标Kubenetes集群,具体地,包括:Kubenetes Gateway has a preset mapping relationship table. The preset mapping relationship table saves the container parameter and cluster mapping relationship. For example, the container parameter in the preset mapping relationship table is: the container IP parameter is 001, the container name is xxx, corresponding to cluster A The Kubenetes Gateway obtains the container parameters of the container, and the Kubenetes Gateway queries the preset mapping relationship table to obtain the target Kubenetes cluster corresponding to the container parameters. Specifically, it includes:
步骤a1,获取所述容器的容器参数,其中,所述容器参数包括地理位置参数、程序结构参数和部署环境参数;Step a1: Obtain container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
步骤a2,查询预设映射关系表,获取与所述程序结构信息、所述地理位置信息和所述部署环境信息匹配的目标Kubenetes集群。Step a2, query a preset mapping relationship table, and obtain a target Kubenetes cluster matching the program structure information, the geographic location information, and the deployment environment information.
本实施例中,Kubenetes Gateway器根据容器的容器参数确定目标Kubenetes集群,已将操作任务对应的容器路由到目标Kubenetes集群,并通过调用目标Kubenetes集群执行操作任务,具体地:In this embodiment, the Kubenetes Gateway determines the target Kubenetes cluster according to the container parameters of the container, has routed the container corresponding to the operation task to the target Kubenetes cluster, and executes the operation task by calling the target Kubenetes cluster, specifically:
步骤S30,将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。Step S30: Send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is The yaml file performs the operation task.
本实施例中,Kubenetes Gateway器预先统计各Kubenetes集群对应的Kubenetes接口,Kubenetes接口关联有预先定制的参数处理代码,即,Kubenetes集群只处理yaml文件格式的运行参数,Kubenetes接口预先关联数据处理代码,可以将操作任务的运行参数转化为yaml文件格式,具体地,包括:In this embodiment, the Kubenetes Gateway implements statistics on the Kubenetes interface corresponding to each Kubenetes cluster in advance. The Kubenetes interface is associated with pre-customized parameter processing code, that is, the Kubenetes cluster only processes operating parameters in the yaml file format, and the Kubenetes interface is pre-associated with data processing code. The operating parameters of the operation task can be converted into the yaml file format, specifically, including:
步骤b1,获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,根据所述Kubenetes接口的传参格式配置接口模板;Step b1: Obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter transfer format of the Kubenetes interface;
步骤b2,在所述接口模板校验通过时,将所述接口模板与对应的所述Kubernetes接口进行关联。Step b2: When the interface template passes the verification, the interface template is associated with the corresponding Kubernetes interface.
即,任务调度设备获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,任务调度设备根据Kubenetes接口的传参格式配置接口模板,例如,Kubenetes接口的传参格式为yaml文件格式,任务调度设备配置yaml模板;任务调度设备在接口模板配置完成时,对配置得到的接口模板进行校验,若接口模板校验不通过,任务调度设备进行重新配置;若接口模板校验通过,任务调度设备将接口模板与对应的Kubernetes接口进行关联。That is, the task scheduling device obtains the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and the task scheduling device configures the interface template according to the parameter passing format of the Kubenetes interface. For example, the parameter passing format of the Kubenetes interface is the yaml file format, and the task scheduling device configures the yaml template; When the interface template configuration is completed, the task scheduling device verifies the configured interface template. If the interface template verification fails, the task scheduling device reconfigures; if the interface template verification passes, the task scheduling device compares the interface template with the corresponding Kubernetes interface for association.
任务调度设备中的Kubenetes Gateway器将操作任务对应的运行参数(运行参数包括但不仅限于操作任务的入参出参)发送至目标Kubenetes集群对应的目标Kubenetes接口,目标Kubenetes接口处理运行参数,以使目标Kubenetes集群根据处理得到的运行参数执行该操作任务,具体地,包括:The Kubenetes Gateway device in the task scheduling device sends the operating parameters corresponding to the operating task (operating parameters include but not limited to the input and output parameters of the operating task) to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the target Kubenetes interface processes the operating parameters so that The target Kubenetes cluster executes the operation task according to the processed operating parameters, specifically, including:
步骤c1,获取所述操作任务对应的运行参数,从目标Kubenetes集群的Kubernetes接口中选择所述运行参数对应的目标Kubernetes接口;Step c1: Obtain the operating parameters corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster;
步骤c2,判断所述目标Kubernetes接口是否存在关联的接口模板;Step c2, judging whether the target Kubernetes interface has an associated interface template;
步骤c3,若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。Step c3: If there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that the target Kubenetes The cluster executes the operation task according to the yaml file.
即,Kubenetes Gateway器获取操作任务对应的运行参数,Kubenetes Gateway器从目标Kubenetes集群的各Kubernetes接口中选择运行参数对应的目标Kubernetes接口;Kubenetes Gateway器判断目标Kubernetes接口是否存在关联的接口模板,若目标Kubernetes接口存在关联的接口模板,则将运行参数输入至目标Kubernetes接口关联的接口模板中,得到包含运行参数的yaml文件,以使目标Kubenetes集群根据yaml文件执行操作任务。That is, the Kubenetes Gateway device obtains the operating parameters corresponding to the operation task, and the Kubenetes Gateway device selects the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster; the Kubenetes Gateway device determines whether the target Kubernetes interface has an associated interface template. If there is an interface template associated with the Kubernetes interface, the operating parameters are entered into the interface template associated with the target Kubernetes interface, and a yaml file containing the operating parameters is obtained, so that the target Kubenetes cluster can perform operation tasks according to the yaml file.
需要说明的是,现有的Federation是将分布在多个区域的Kubernetes集群整合成一个大的集群并统一管理与调度,这种管理与调度方式依赖于部署的Kubernetes控制平面,Kubernetes控制平面调度Kubernetes集群处理操作任务时,需要开发者定制开发操作任务相关的数据处理程序,不同用户定制的数据处理程序各不相同,且数据处理程序不规范,容易出现Kubernetes集群调度不及时,导致的Kubernetes控制平面出现性能瓶颈,且操作任务处理效率低的问题;本申请实施例中预先配置了Kubernetes接口的接口模板,通过Kubenetes接口的接口模板处理操作任务对应的运行参数,并将操作任务路由到Kubenetes集群,以使Kubenetes集群根据处理得到的运行参数执行该操作任务,本申请实施了中通过简化运行参数的处理过程,提高了Kubernetes集群调度效率,以提高了操作任务处理效率,本申请实施例的技术方案与现有的方式相比操作更加简单,且不容易出现由于操作任务路由不及时导致的瓶颈。It should be noted that the existing Federation integrates Kubernetes clusters distributed in multiple regions into a large cluster and unified management and scheduling. This management and scheduling method depends on the deployed Kubernetes control plane. The Kubernetes control plane schedules Kubernetes. When the cluster handles operation tasks, developers need to customize the data processing programs related to the development operation tasks. The data processing programs customized by different users are different, and the data processing programs are not standardized. It is prone to Kubernetes cluster scheduling not timely, resulting in the Kubernetes control plane There is a performance bottleneck and the problem of low efficiency of operation task processing; in the embodiment of this application, the interface template of the Kubernetes interface is pre-configured, and the operation parameters corresponding to the operation task are processed through the interface template of the Kubenetes interface, and the operation task is routed to the Kubenetes cluster. In order to enable the Kubenetes cluster to perform the operation task according to the operating parameters obtained by the processing, the implementation of this application improves the scheduling efficiency of the Kubernetes cluster by simplifying the processing process of the operating parameters, so as to improve the processing efficiency of the operation task. The technical solution of the embodiment of the application Compared with the existing method, the operation is simpler, and the bottleneck caused by the untimely routing of the operation task is not prone to occur.
本实施例中,利用Kubenetes Gateway器取代Kubenetes控制平面,通过Kubenetes Gateway器封装Kubenetes接口,调用方开发人员不需要了解Kubenetes后端集群的处理逻辑并根据处理逻辑进行定制化开发,减少了调用方开发人员的工作量;本实施例中Kubenetes Gateway器接收到操作任务时,Kubenetes Gateway器创建操作任务对应的容器,并将操作任务对应的运行参数发送至目标Kubenetes集群对应的目标Kubenetes接 口,以将操作任务路由在目标Kubenetes集群,调用目标Kubenetes集群执行操作任务,实现了Kubenetes集群的管理;与此同时,Kubenetes Gateway器对硬件要求较低,Kubernetes硬件成本低。In this embodiment, the Kubenetes Gateway is used to replace the Kubenetes control plane, and the Kubenetes interface is encapsulated by the Kubenetes Gateway. The caller developer does not need to understand the processing logic of the Kubenetes back-end cluster and develop customized development based on the processing logic, reducing caller development The workload of personnel; in this embodiment, when the Kubenetes Gateway device receives an operation task, the Kubenetes Gateway device creates a container corresponding to the operation task, and sends the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster to transfer the operation Task routing is in the target Kubenetes cluster, calling the target Kubenetes cluster to perform operation tasks, realizing the management of the Kubenetes cluster; at the same time, the Kubenetes Gateway has low hardware requirements and low Kubernetes hardware costs.
本实施例中将Kubenetes Gateway器应用于金融机构,减少了开发者的工作量,与此同时,可以通过Kubenetes Gateway器调用目标Kubenetes集群处理操作任务,提高了金融业务对应操作任务的处理效率。In this embodiment, the Kubenetes Gateway device is applied to a financial institution, which reduces the workload of developers. At the same time, the target Kubenetes cluster can be called through the Kubenetes Gateway device to process operation tasks, which improves the processing efficiency of financial business corresponding operation tasks.
进一步地,基于本申请任务调度方法第一实施例,提出本申请任务调度方法第二实施例。Further, based on the first embodiment of the task scheduling method of the present application, a second embodiment of the task scheduling method of the present application is proposed.
本实施例与第一实施例的区别在于,在第一实施例步骤c2,判断所述目标Kubernetes接口是否存在关联的接口模板之后的步骤,还包括:The difference between this embodiment and the first embodiment is that in step c2 of the first embodiment, the steps after judging whether the target Kubernetes interface has an associated interface template also include:
步骤c4,若所述目标Kubernetes接口不存在关联的接口模板,则基于所述目标Kubenetes接口生成模板配置提示,并将所述模板配置提示发送至所述操作任务对应的客户端,以使所述客户端对应的用户配置所述目标Kubenetes接口的接口模板。Step c4: If the target Kubernetes interface does not have an associated interface template, generate a template configuration prompt based on the target Kubenetes interface, and send the template configuration prompt to the client corresponding to the operation task, so that the The user corresponding to the client configures the interface template of the target Kubenetes interface.
本实施例中,由于Kubenetes Gateway器管理的Kubenetes集群数量较多,且Kubenetes集群对应的Kubenetes接口数量也较多,可能存在目标Kubenetes接口定制不完整的现象,本实施例中Kubenetes Gateway器确定目标Kubernetes接口不存在关联的接口模板时,Kubenetes Gateway器获取目标Kubernetes接口的传参模式,Kubenetes Gateway器生成包含该传参模式的模板配置提示,并将模板配置提示发送至触发操作任务的客户端,以使客户端对应的用户定制化开发配置目标Kubenetes接口的接口模板。In this embodiment, since the number of Kubenetes clusters managed by the Kubenetes Gateway device is large, and the number of Kubenetes interfaces corresponding to the Kubenetes cluster is also large, there may be a phenomenon of incomplete customization of the target Kubenetes interface. In this embodiment, the Kubenetes Gateway device determines the target Kubernetes When the interface does not have an associated interface template, the Kubenetes Gateway obtains the parameter transfer mode of the target Kubernetes interface. The Kubenetes Gateway generates a template configuration prompt containing the parameter transfer mode, and sends the template configuration prompt to the client that triggers the operation task. The interface template of the target Kubenetes interface is developed and configured by the client corresponding to the user customization.
在目标Kubenetes接口的接口模板配置完成时,Kubenetes Gateway器将接口模板与目标Kubenetes接口进行关联,并执行步骤c3,若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。When the interface template configuration of the target Kubenetes interface is completed, the Kubenetes Gateway device associates the interface template with the target Kubenetes interface, and executes step c3. If there is an associated interface template for the target Kubernetes interface, the operating parameters are input to all In the interface template associated with the target Kubernetes interface, a yaml file containing the operating parameters is obtained, so that the target Kubenetes cluster executes the operation task according to the yaml file.
本实施例中,Kubenetes Gateway器可以在操作任务执行的过程中实时地定制接口模板,使得Kubenetes Gateway器进行集群管理时更加灵活。In this embodiment, the Kubenetes Gateway can customize the interface template in real time during the execution of the operation task, making the Kubenetes Gateway more flexible in cluster management.
进一步地,基于本申请任务调度方法第一实施例,提出本申请任务调度方法第三实施例。Further, based on the first embodiment of the task scheduling method of the present application, a third embodiment of the task scheduling method of the present application is proposed.
本实施例是第一实施例中步骤S10:创建所述操作任务对应的容器之前的步骤,本实施例与第一实施例的区别在于:This embodiment is the step before step S10 in the first embodiment: creating the container corresponding to the operation task. The difference between this embodiment and the first embodiment is:
获取所述操作任务对应的任务标识,根据所述任务标识判断是否具有所述操作任务的操作权限;Acquiring a task identifier corresponding to the operation task, and judging whether it has operation authority of the operation task according to the task identifier;
在所述具有所述操作任务的操作权限时,执行所述创建所述操作任务对应的容器的步骤。When the operation authority of the operation task is obtained, the step of creating a container corresponding to the operation task is executed.
本实施例中,Kubenetes Gateway器接收到操作任务之后,Kubenetes Gateway器获取该操作任务对应的任务标识,任务标识可以为任务编码、任务名称等,Kubenetes Gateway器根据任务标识判断是否具有操作任务的操作权限,具体地,包括:In this embodiment, after the Kubenetes Gateway device receives the operation task, the Kubenetes Gateway device obtains the task ID corresponding to the operation task. The task ID can be a task code, task name, etc., and the Kubenetes Gateway device determines whether there is an operation task operation based on the task ID The permissions, specifically, include:
实现方式一:Kubenetes Gateway器中预设标识集合,该标识集合中包含有具有操作权限的标准标识,Kubenetes Gateway器将任务标识与预设标识集合中的标准标识进行比对,若预设标识集合中存在与任务标识相同的目标标准标识,则Kubenetes Gateway器判定具有操作任务的操作权限;反之则不具有。Implementation method 1: Kubenetes Gateway implements a preset logo set, which contains standard logos with operating permissions. Kubenettes Gateway compares the task logo with the standard logo in the preset logo set. If the default logo set If there is a target standard identifier that is the same as the task identifier, the Kubenetes Gateway device determines that it has the operation authority to operate the task; otherwise, it does not have it.
实现方式二,Kubenetes Gateway器中预先将具有操作权限的任务标识进行标记,若该任务标识中包含标记信息,则Kubenetes Gateway器判定具有操作任务的操作权限时;反之则不具有。Implementation mode two, the Kubenetes Gateway device pre-marks the task identifier with operation authority. If the task identifier contains marking information, the Kubenetes Gateway device determines that it has the operation authority for the operation task; otherwise, it does not have it.
Kubenetes Gateway器判定具有操作任务的操作权限时,Kubenetes Gateway器创建操作任务对应的容器;Kubenetes Gateway器判定不具有操作任务的操作权限时,Kubenetes Gateway器输出提示信息。When the Kubenetes Gateway determines that it has the operation authority for the operation task, the Kubenetes Gateway creates a container corresponding to the operation task; when the Kubenetes Gateway determines that it does not have the operation authority for the operation task, the Kubenetes Gateway outputs a prompt message.
本实施例中,Kubenetes Gateway器根据操作任务的任务标识,对操作任务进行鉴权,使得Kubenetes Gateway器对应部分操作任务路由,以保证Kubenetes Gateway器调用目标Kubenetes集群执行操作任务的安全性。In this embodiment, the Kubenetes Gateway device authenticates the operation task according to the task identifier of the operation task, so that the Kubenetes Gateway device corresponds to part of the operation task routing to ensure the security of the Kubenetes Gateway device calling the target Kubenetes cluster to perform the operation task.
进一步地,基于本申请任务调度方法上述实施例,提出本申请任务调度方法第四实施例。Further, based on the foregoing embodiments of the task scheduling method of the present application, a fourth embodiment of the task scheduling method of the present application is proposed.
本实施例是第一实施例中步骤S20之后的步骤,本实施例与第一实施例的区别 在于:This embodiment is a step after step S20 in the first embodiment. The difference between this embodiment and the first embodiment lies in:
统计所述目标Kubenetes集群当前待处理的任务量;Count the amount of tasks currently to be processed in the target Kubenetes cluster;
若当前待处理的所述任务量大于或等于预设阈值,则生成提示信息至发送所述操作任务对应的客户端;If the amount of tasks currently to be processed is greater than or equal to a preset threshold, generating prompt information to send the client corresponding to the operation task;
若当前待处理的所述任务量小于预设阈值时,则执行所述:将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤。If the amount of tasks currently to be processed is less than a preset threshold, then execute: send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and transfer all the tasks through the target Kubenetes interface The operating parameters are converted into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
本实施例中,Kubenetes Gateway器确定调用的目标Kubenetes集群之后,Kubenetes Gateway器不直接进行容器调用,而是统计目标Kubenetes集群当前待处理的任务量,Kubenetes Gateway器将当前待处理的任务量与预设阈值(预设阈值可以根据具体场景灵活设置,例如,Kubenetes Gateway器根据目标Kubenetes集群的处理效率设置,目标Kubenetes集群的处理效率为每秒1000个,则预设阈值设置为1000)进行比对;In this embodiment, after the Kubenetes Gateway device determines the target Kubenetes cluster to be called, the Kubenetes Gateway device does not directly call the container, but counts the number of tasks currently to be processed in the target Kubenetes cluster. The Kubenetes Gateway device compares the current number of tasks to be processed with the expected number of tasks. Set the threshold (the preset threshold can be flexibly set according to the specific scenario, for example, the Kubenetes Gateway device is set according to the processing efficiency of the target Kubenetes cluster, and the processing efficiency of the target Kubenetes cluster is 1000 per second, then the preset threshold is set to 1000) for comparison ;
若当前待处理的任务量大于或等于预设阈值,则生成提示信息至发送触发该操作任务的客户端,以使客户端用户了解任务执行情况。If the amount of tasks currently to be processed is greater than or equal to the preset threshold, a prompt message is generated to send the client that triggers the operation task, so that the client user can understand the task execution status.
若当前待处理的任务量小于预设阈值时,则执行第一实施例中步骤S30:将所述操作任务对应的运行参数发送至所述目标Kubenetes集群,以使所述目标Kubenetes集群执行所述操作,以执行操作任务。If the amount of tasks currently to be processed is less than the preset threshold, step S30 in the first embodiment is executed: the operating parameters corresponding to the operation tasks are sent to the target Kubenetes cluster, so that the target Kubenetes cluster executes the Operation to perform operational tasks.
本实施例中,Kubenetes Gateway器集中管理全部的Kubenetes集群,Kubenetes Gateway器确定目标Kubenetes集群之后,Kubenetes Gateway器统计目标Kubenetes集群当前待处理的任务量,并根据目标Kubenetes集群的当前待处理的任务量,判断是否将容器调度到目标Kubenetes集群,在前待处理的任务量大于预设阈值时,暂停将容器调度到目标Kubenetes集群上,以通过限流减少目标Kubenetes集群,保证操作任务的正常运行。In this embodiment, the Kubenetes Gateway centrally manages all the Kubenetes clusters. After the Kubenetes Gateway determines the target Kubenetes cluster, the Kubenetes Gateway counts the number of tasks currently to be processed in the target Kubenetes cluster, and based on the current number of tasks to be processed in the target Kubenetes cluster , Determine whether to schedule the container to the target Kubenetes cluster. When the amount of tasks to be processed before is greater than the preset threshold, suspend the scheduling of the container to the target Kubenetes cluster to reduce the target Kubenetes cluster through current limiting and ensure the normal operation of the operation tasks.
此外,Kubenetes Gateway器在确定目标Kubenetes集群当前待处理的任务量大于或等于预设阈值,Kubenetes Gateway器还可以调整各个容器参数的权重,以确 定新的目标Kubenetes集群,例如,容器参数有程序结构和地理位置,在程序结构和地理位置的权重分别为50%,得到第一目标Kubenetes集群;若第一目标Kubenetes集群当前待处理的任务量大于或等于预设阈值时,Kubenetes Gateway器将程序结构和地理位置的权重调整为40%和60%,得到第二目标Kubenetes集群,以执行第一实施例中步骤S30:操作任务对应的运行参数发送至第二目标Kubenetes集群对应的第二目标Kubenetes接口,通过第二目标Kubenetes接口将第二运行参数转化为yaml文件,以使第二目标Kubenetes集群根据yaml文件执行所述操作任务。In addition, when the Kubenetes Gateway device determines that the amount of tasks currently to be processed by the target Kubenetes cluster is greater than or equal to a preset threshold, the Kubenetes Gateway device can also adjust the weight of each container parameter to determine a new target Kubenetes cluster. For example, the container parameter has a program structure. And geographic location, when the weight of the program structure and geographic location are 50%, the first target Kubenetes cluster is obtained; if the current task volume of the first target Kubenetes cluster is greater than or equal to the preset threshold, the Kubenetes Gateway will change the program structure The weights of the geographic location and the geographic location are adjusted to 40% and 60% to obtain the second target Kubenetes cluster to execute step S30 in the first embodiment: the operating parameters corresponding to the operation task are sent to the second target Kubenetes interface corresponding to the second target Kubenetes cluster , Convert the second operating parameters into a yaml file through the second target Kubenetes interface, so that the second target Kubenetes cluster executes the operation task according to the yaml file.
本实施例中,Kubenetes Gateway器统一管理Kubenetes集群,可以对Kubenetes集群处理的操作任务量进行统计并调度,使得基于Kubenetes Gateway器实现的Kubenetes集群管理更加合理。In this embodiment, the Kubenetes Gateway unit manages the Kubenetes cluster in a unified manner, and can count and schedule the amount of operation tasks processed by the Kubenetes cluster, making the Kubenetes cluster management implemented based on the Kubenetes Gateway more reasonable.
参照图4,本申请还提供一种任务调度装置,所述任务调度装置包括:4, the present application also provides a task scheduling device, the task scheduling device includes:
容器创建模块10,用于在接收到操作任务时,创建所述操作任务对应的容器;The container creation module 10 is configured to create a container corresponding to the operation task when the operation task is received;
查询确定模块20,用于查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;The query determination module 20 is configured to query a preset mapping relationship table, and determine a target Kubenetes cluster according to the container parameters of the container;
发送执行模块30,用于将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The sending execution module 30 is configured to send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target The Kubenetes cluster executes the operation task according to the yaml file.
在一实施例中,所述任务调度装置还包括:In an embodiment, the task scheduling device further includes:
获取配置模块,用于获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,根据所述Kubenetes接口的传参格式配置接口模板;The obtaining configuration module is used to obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter passing format of the Kubenetes interface;
校验关联模块,用于在所述接口模板校验通过时,将所述接口模板与对应的所述Kubernetes接口进行关联。The verification association module is configured to associate the interface template with the corresponding Kubernetes interface when the interface template is verified.
在一实施例中,所述发送执行模块,包括:In an embodiment, the sending execution module includes:
接口选择单元,用于获取所述操作任务对应的运行参数,从目标Kubenetes集群的Kubernetes接口中选择所述运行参数对应的目标Kubernetes接口;The interface selection unit is configured to obtain the operating parameter corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameter from the Kubernetes interfaces of the target Kubenetes cluster;
关联判断单元,用于判断所述目标Kubernetes接口是否存在关联的接口模板;The association judgment unit is used to judge whether the target Kubernetes interface has an associated interface template;
发送执行单元,用于若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The sending execution unit is configured to, if there is an interface template associated with the target Kubernetes interface, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters, so that all The target Kubenetes cluster executes the operation task according to the yaml file.
在一实施例中,所述发送执行模块,包括:In an embodiment, the sending execution module includes:
模板配置单元,用于若所述目标Kubernetes接口不存在关联的接口模板,则基于所述目标Kubenetes接口生成模板配置提示,并将所述模板配置提示发送至所述操作任务对应的客户端,以使所述客户端对应的用户配置所述目标Kubenetes接口的接口模板。The template configuration unit is configured to generate a template configuration prompt based on the target Kubenetes interface if there is no associated interface template for the target Kubernetes interface, and send the template configuration prompt to the client corresponding to the operation task to Enable the user corresponding to the client to configure the interface template of the target Kubenetes interface.
在一实施例中,所述查询确定模块,包括:In an embodiment, the query determination module includes:
参数获取单元,用于获取所述容器的容器参数,其中,所述容器参数包括地理位置参数、程序结构参数和部署环境参数;A parameter acquisition unit for acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
集群查询单元,用于查询预设映射关系表,确定所述地理位置参数、所述程序结构参数和所述部署环境参数对应的目标Kubenetes集群。The cluster query unit is configured to query a preset mapping relationship table, and determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
在一实施例中,所述任务调度装置,包括:In an embodiment, the task scheduling device includes:
权限判断模块,用于获取所述操作任务对应的任务标识,根据所述任务标识判断是否具有所述操作任务的操作权限;The authority judgment module is used to obtain the task identifier corresponding to the operation task, and determine whether it has the operation authority of the operation task according to the task identifier;
判定执行模块,用于在所述具有所述操作任务的操作权限时,创建所述操作任务对应的容器。The determination execution module is configured to create a container corresponding to the operation task when the operation authority has the operation task.
在一实施例中,所述任务调度装置还包括:In an embodiment, the task scheduling device further includes:
统计模块,用于统计所述目标Kubenetes集群当前待处理的任务量;A statistics module, used to count the amount of tasks currently to be processed in the target Kubenetes cluster;
发送提示模块,用于若当前待处理的所述任务量大于或等于预设阈值,则生成提示信息至发送所述操作任务对应的客户端;A sending prompt module, configured to generate prompt information to the client corresponding to the operation task if the amount of tasks currently to be processed is greater than or equal to a preset threshold;
发送执行模块,用于若当前待处理的所述任务量小于预设阈值时,则执行所述:将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤。The sending execution module is configured to, if the task amount currently to be processed is less than a preset threshold, execute the: sending the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and pass the The target Kubenetes interface converts the operating parameters into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
上述各程序模块所执行的方法可参照本申请任务调度方法各个实施例,此处不 再赘述。For the methods executed by the above-mentioned program modules, please refer to the various embodiments of the task scheduling method of this application, and details are not described here.
本申请还提供一种计算机可读存储介质。The application also provides a computer-readable storage medium.
本申请计算机可读存储介质上存储有任务调度程序,所述任务调度程序被处理器执行时实现如上所述的任务调度方法的步骤。A task scheduling program is stored on the computer-readable storage medium of the present application, and when the task scheduling program is executed by a processor, the steps of the task scheduling method described above are implemented.
其中,在所述处理器上运行的任务调度程序被执行时所实现的方法可参照本申请任务调度方法各个实施例,此处不再赘述。For the method implemented when the task scheduling program running on the processor is executed, please refer to the various embodiments of the task scheduling method of this application, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者***不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者***所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的过程、方法、物品或者***中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. Without more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disk, optical disk), including several instructions to make a terminal device (can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (10)

  1. 一种任务调度方法,其中,所述任务调度方法基于预设的Kubenetes Gateway器,所述任务调度方法包括如下步骤:A task scheduling method, wherein the task scheduling method is based on a preset Kubenetes Gateway, and the task scheduling method includes the following steps:
    在接收到操作任务时,创建所述操作任务对应的容器;When an operation task is received, a container corresponding to the operation task is created;
    查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;Query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
    将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The operating parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operating parameters are converted into a yaml file through the target Kubenetes interface, so that the target Kubenetes cluster is based on the yaml file Perform the operation task.
  2. 如权利要求1所述的任务调度方法,其中,所述将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件的步骤之前,包括:The task scheduling method according to claim 1, wherein the operation parameter corresponding to the operation task is sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operation parameter is converted into Before the steps of yaml file, include:
    获取Kubernetes服务中各Kubenetes集群的Kubernetes接口,根据所述Kubenetes接口的传参格式配置接口模板;Obtain the Kubernetes interface of each Kubenetes cluster in the Kubernetes service, and configure the interface template according to the parameter transfer format of the Kubenetes interface;
    在所述接口模板校验通过时,将所述接口模板与对应的所述Kubernetes接口进行关联。When the interface template passes the verification, the interface template is associated with the corresponding Kubernetes interface.
  3. 如权利要求2所述的任务调度方法,其中,所述将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤,包括:The task scheduling method according to claim 2, wherein the operation parameter corresponding to the operation task is sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the operation parameter is converted into yaml file, so that the target Kubenetes cluster executes the operation task according to the yaml file, including:
    获取所述操作任务对应的运行参数,从目标Kubenetes集群的Kubernetes接口中选择所述运行参数对应的目标Kubernetes接口;Obtain the operating parameters corresponding to the operation task, and select the target Kubernetes interface corresponding to the operating parameters from the Kubernetes interfaces of the target Kubenetes cluster;
    判断所述目标Kubernetes接口是否存在关联的接口模板;Determine whether the target Kubernetes interface has an associated interface template;
    若所述目标Kubernetes接口存在关联的接口模板,则将所述运行参数输入至所述目标Kubernetes接口关联的接口模板中,得到包含所 述运行参数的yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。If the target Kubernetes interface has an associated interface template, input the operating parameters into the interface template associated with the target Kubernetes interface to obtain a yaml file containing the operating parameters so that the target Kubenetes cluster can be The yaml file performs the operation task.
  4. 如权利要求3所述的任务调度方法,其中,所述判断所述目标Kubernetes接口是否存在关联的接口模板的步骤之后,包括:The task scheduling method according to claim 3, wherein after the step of determining whether the target Kubernetes interface has an associated interface template, it comprises:
    若所述目标Kubernetes接口不存在关联的接口模板,则基于所述目标Kubenetes接口生成模板配置提示,并将所述模板配置提示发送至所述操作任务对应的客户端,以使所述客户端对应的用户配置所述目标Kubenetes接口的接口模板。If the target Kubernetes interface does not have an associated interface template, a template configuration prompt is generated based on the target Kubenetes interface, and the template configuration prompt is sent to the client corresponding to the operation task, so that the client corresponds The user configures the interface template of the target Kubenetes interface.
  5. 如权利要求1所述的任务调度方法,其中,所述查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群的步骤,包括:5. The task scheduling method according to claim 1, wherein the step of querying a preset mapping relationship table and determining a target Kubenetes cluster according to the container parameters of the container comprises:
    获取所述容器的容器参数,其中,所述容器参数包括地理位置参数、程序结构参数和部署环境参数;Acquiring container parameters of the container, where the container parameters include geographic location parameters, program structure parameters, and deployment environment parameters;
    查询预设映射关系表,确定所述地理位置参数、所述程序结构参数和所述部署环境参数对应的目标Kubenetes集群。Query a preset mapping relationship table to determine the target Kubenetes cluster corresponding to the geographic location parameter, the program structure parameter, and the deployment environment parameter.
  6. 如权利要求1所述的任务调度方法,其中,所述创建所述操作任务对应的容器的步骤之前,包括:The task scheduling method according to claim 1, wherein, before the step of creating a container corresponding to the operation task, the method comprises:
    获取所述操作任务对应的任务标识,根据所述任务标识判断是否具有所述操作任务的操作权限;Acquiring a task identifier corresponding to the operation task, and judging whether it has operation authority of the operation task according to the task identifier;
    在所述具有所述操作任务的操作权限时,执行所述创建所述操作任务对应的容器的步骤。When the operation authority of the operation task is obtained, the step of creating a container corresponding to the operation task is executed.
  7. 如权利要求1至6任意一项所述的任务调度方法,其中,所述查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群的步骤之后,包括:The task scheduling method according to any one of claims 1 to 6, wherein after the step of querying the preset mapping relationship table and determining the target Kubenetes cluster according to the container parameters of the container, the method comprises:
    统计所述目标Kubenetes集群当前待处理的任务量;Count the amount of tasks currently to be processed in the target Kubenetes cluster;
    若当前待处理的所述任务量大于或等于预设阈值,则生成提示信息至发送所述操作任务对应的客户端;If the amount of tasks currently to be processed is greater than or equal to a preset threshold, generating prompt information to send the client corresponding to the operation task;
    若当前待处理的所述任务量小于预设阈值时,则执行所述将所述 操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务的步骤。If the amount of tasks currently to be processed is less than a preset threshold, the operation parameters corresponding to the operation task are sent to the target Kubenetes interface corresponding to the target Kubenetes cluster, and the target Kubenetes interface is used to transfer the The operating parameters are converted into a yaml file, so that the target Kubenetes cluster executes the steps of the operation task according to the yaml file.
  8. 一种任务调度装置,其中,所述任务调度装置设置于Kubenetes Gateway器中,所述任务调度装置包括:A task scheduling device, wherein the task scheduling device is arranged in a Kubenetes Gateway device, and the task scheduling device includes:
    容器创建模块,用于在接收到操作任务时,创建所述操作任务对应的容器;The container creation module is used to create a container corresponding to the operation task when the operation task is received;
    查询确定模块,用于查询预设映射关系表,根据所述容器的容器参数确定目标Kubenetes集群;The query determination module is used to query a preset mapping relationship table, and determine the target Kubenetes cluster according to the container parameters of the container;
    发送执行模块,用于将所述操作任务对应的运行参数发送至所述目标Kubenetes集群对应的目标Kubenetes接口,通过所述目标Kubenetes接口将所述运行参数转化为yaml文件,以使所述目标Kubenetes集群根据所述yaml文件执行所述操作任务。The sending execution module is configured to send the operating parameters corresponding to the operation task to the target Kubenetes interface corresponding to the target Kubenetes cluster, and convert the operating parameters into a yaml file through the target Kubenetes interface, so that the target Kubenetes The cluster executes the operation task according to the yaml file.
  9. 一种任务调度设备,其中,所述任务调度设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的任务调度程序,所述任务调度程序被所述处理器执行时实现如权利要求1至7中任一项所述的任务调度方法的步骤。A task scheduling device, wherein the task scheduling device includes: a memory, a processor, and a task scheduling program stored in the memory and capable of running on the processor, and the task scheduling program is controlled by the processor The steps of the task scheduling method according to any one of claims 1 to 7 are realized during execution.
  10. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有任务调度程序,所述任务调度程序被处理器执行时实现如权利要求1至7中任一项所述的任务调度方法的步骤。A computer-readable storage medium, wherein a task scheduling program is stored on the computer-readable storage medium, and when the task scheduling program is executed by a processor, the task scheduling according to any one of claims 1 to 7 is realized Method steps.
PCT/CN2020/088126 2019-06-25 2020-04-30 Task scheduling method, apparatus, and device, and computer-readable storage medium WO2020259081A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910564385.7 2019-06-25
CN201910564385.7A CN110321207A (en) 2019-06-25 2019-06-25 Method for scheduling task, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2020259081A1 true WO2020259081A1 (en) 2020-12-30

Family

ID=68120455

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/088126 WO2020259081A1 (en) 2019-06-25 2020-04-30 Task scheduling method, apparatus, and device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN110321207A (en)
WO (1) WO2020259081A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321207A (en) * 2019-06-25 2019-10-11 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and computer readable storage medium
US11487555B2 (en) * 2020-06-09 2022-11-01 Tencent America LLC Running PBS jobs in kubernetes
CN111708610B (en) * 2020-06-19 2024-02-27 北京神州泰岳软件股份有限公司 Database client construction method and database operation method
CN114443059A (en) * 2020-10-30 2022-05-06 中国联合网络通信集团有限公司 Kubernets cluster deployment method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170820A (en) * 2018-01-02 2018-06-15 联想(北京)有限公司 A kind of container-treatment, control server and distributed type assemblies
CN109284184A (en) * 2018-03-07 2019-01-29 中山大学 A kind of building method of the distributed machines learning platform based on containerization technique
CN109471727A (en) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 A kind of task processing method, apparatus and system
WO2019056882A1 (en) * 2017-09-22 2019-03-28 华为技术有限公司 Method and system for cross-platform deployment
CN110321207A (en) * 2019-06-25 2019-10-11 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019056882A1 (en) * 2017-09-22 2019-03-28 华为技术有限公司 Method and system for cross-platform deployment
CN108170820A (en) * 2018-01-02 2018-06-15 联想(北京)有限公司 A kind of container-treatment, control server and distributed type assemblies
CN109284184A (en) * 2018-03-07 2019-01-29 中山大学 A kind of building method of the distributed machines learning platform based on containerization technique
CN109471727A (en) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 A kind of task processing method, apparatus and system
CN110321207A (en) * 2019-06-25 2019-10-11 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN110321207A (en) 2019-10-11

Similar Documents

Publication Publication Date Title
WO2020259081A1 (en) Task scheduling method, apparatus, and device, and computer-readable storage medium
CN111309374B (en) Micro-service system and service calling method in micro-service system
WO2021017301A1 (en) Management method and apparatus based on kubernetes cluster, and computer-readable storage medium
WO2021017279A1 (en) Cluster security management method and apparatus based on kubernetes and network domain, and storage medium
EP3461087B1 (en) Network-slice resource management method and apparatus
US9479400B2 (en) Servlet API and method for XMPP protocol
US9923992B2 (en) Inter-process communication method based on application layer of android and basic application communication system
US7475406B2 (en) Event notification structure for dynamically aggregated logical components
JP2015537307A (en) Component-oriented hybrid cloud operating system architecture and communication method thereof
EP4270204A1 (en) Multi-cloud interface adaptation method and system based on micro-service, and storage medium
WO2005116821A1 (en) System and method for implementing a general application program interface
US10778512B2 (en) System and method for network provisioning
WO2021013056A1 (en) Microservice-based data processing method and apparatus, and device and readable storage medium
WO2020108443A1 (en) Virtualization management method and device
WO2014176991A1 (en) Multimedia service processing apparatus, method and system
Chen et al. Scalable IoT/M2M platforms based on kubernetes-enabled NFV MANO architecture
US8458716B2 (en) Enterprise resource planning with asynchronous notifications of background processing events
CN116800616B (en) Management method and related device of virtualized network equipment
CN109947534A (en) A kind of Yunan County's global function scheduling system based on SDN
US11379416B1 (en) Systems and methods for common data ingestion
WO2021093671A1 (en) Task processing method, system, apparatus and device, and computer readable storage medium
EP2517439B1 (en) Method for coordinating the provision of a composite service
CN105260179A (en) Method for achieving flex and servlet interaction
WO2020220937A1 (en) Security policy management method and device
WO2015100655A1 (en) Interactive communication software implementation method and implementation platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20833177

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20833177

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20833177

Country of ref document: EP

Kind code of ref document: A1