CN110321207A - Method for scheduling task, device, equipment and computer readable storage medium - Google Patents
Method for scheduling task, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110321207A CN110321207A CN201910564385.7A CN201910564385A CN110321207A CN 110321207 A CN110321207 A CN 110321207A CN 201910564385 A CN201910564385 A CN 201910564385A CN 110321207 A CN110321207 A CN 110321207A
- Authority
- CN
- China
- Prior art keywords
- kubenetes
- task
- target
- interface
- cluster
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
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
This application involves financial technology (Fintech) technical fields, and this application discloses a kind of method for scheduling task, comprising: when receiving operation task, the corresponding container of creation operation task;Default mapping table is inquired, determines target Kubenetes cluster according to the container parameters of container;The corresponding operating parameter of operation task is sent to the corresponding target Kubenetes interface of target Kubenetes cluster, yaml file is converted by operating parameter by target Kubenetes interface, so that target Kubenetes cluster executes operation task according to yaml file.Disclosed herein as well is a kind of task scheduling apparatus, equipment and computer readable storage mediums.Plane is controlled with Kubenetes Gateway device substitution Kubernetes in the application, Kubenetes cluster is realized and efficiently manages.
Description
Technical field
This application involves financial technology (Fintech) technical field more particularly to method for scheduling task, device, equipment and
Computer readable storage medium.
Background technique
With Internet technology, the especially rapid development of internet financial technology (Fintech), more and more technologies
(big data, distribution, block chain Blockchain, artificial intelligence etc.) is applied in financial field.
By taking bank in financial field as an example, usually they possess hundreds and thousands of a business applications, if each apply journey
The corresponding operation task of the corresponding server process application program of sequence setting, it is possible that operation task is super compared with multiserver negative
Lotus or operation task server-less resources idle;Kubernetes can be behaviour as a container cluster management system
Make task and dynamically distribute corresponding process resource, that is, Kubernetes cluster includes Kubernetes control plane (main section
Point) and Kubernetes from node, Kubernetes control plane is responsible for carrying out pipe to all resources in Kubernetes cluster
Control and scheduling, Kubernetes are used for the execution of operation task from node;Therefore Kubernetes is used to dispose first
Kubernetes controls plane, and Kubernetes control plane deployment needs developer's (being called called side) of application program to be directed to
The Kubernetes interface that Kubernetes control plane provides writes code, and the operation of the developer of application program is more numb
It is tired, and Kubernetes control plane is higher to hardware requirement, so that hardware cost is high.
Summary of the invention
The main purpose of the application is to propose a kind of method for scheduling task, device, equipment and computer-readable storage medium
Matter, it is intended to when solving the current control plane progress Kubernetes cluster calling by Kubernetes, the exploitation of application program
The technical problem that person is troublesome in poeration, hardware cost is high.
To achieve the above object, the application provides a kind of method for scheduling task, and the method for scheduling task includes following step
It is rapid:
When receiving operation task, the corresponding container of the operation task is created;
Default mapping table is inquired, determines target Kubenetes cluster according to the container parameters of the container;
The corresponding operating parameter of the operation task is sent to the corresponding target of the target Kubenetes cluster
Kubenetes interface converts yaml file for the operating parameter by the target Kubenetes interface, so that described
Target Kubenetes cluster executes the operation task according to the yaml file.
Optionally, described that the corresponding operating parameter of the operation task is sent to the target Kubenetes cluster pair
The target Kubenetes interface answered converts yaml file for the operating parameter by the target Kubenetes interface
Before step, comprising:
The Kubernetes interface for obtaining each Kubenetes cluster in Kubernetes service, according to the Kubenetes
The biography ginseng format of interface configures interface model;
When interface model verification passes through, the interface model is carried out with the corresponding Kubernetes interface
Association.
Optionally, described that the corresponding operating parameter of the operation task is sent to the target Kubenetes cluster pair
The target Kubenetes interface answered converts yaml file for the operating parameter by the target Kubenetes interface,
So that the step of target Kubenetes cluster executes the operation task according to the yaml file, comprising:
The corresponding operating parameter of the operation task is obtained, from the Kubernetes interface of target Kubenetes cluster
Select the corresponding target Kubernetes interface of the operating parameter;
Judge the target Kubernetes interface with the presence or absence of associated interface model;
If there are associated interface models for the target Kubernetes interface, the operating parameter is input to described
In the interface model of target Kubernetes interface conjunctionn, the yaml file comprising the operating parameter is obtained, so that the mesh
It marks Kubenetes cluster and the operation task is executed according to the yaml file.
Optionally, the step of judgement target Kubernetes interface whether there is associated interface model it
Afterwards, comprising:
If associated interface model is not present in the target Kubernetes interface, it is based on the target Kubenetes
Interface generates template configuration prompt, and template configuration prompt is sent to the corresponding client of the operation task, so that
The interface model of target Kubenetes interface described in the corresponding user configuration of the client.
Optionally, described to inquire default mapping table, target Kubenetes is determined according to the container parameters of the container
The step of cluster, comprising:
Obtain the container parameters of the container, wherein the container parameters include geo-location parameter, program structure parameter
With deployed environment parameter;
Default mapping table is inquired, determines the geo-location parameter, described program structural parameters and the deployment ring
The corresponding target Kubenetes cluster of border parameter.
Optionally, before the step of creation operation task corresponding container, comprising:
The corresponding task identification of the operation task is obtained, judges whether that there is the operation to appoint according to the task identification
The operating right of business;
In the operating right with the operation task, the corresponding container of the creation operation task is executed
The step of.
Optionally, described to inquire default mapping table, target Kubenetes is determined according to the container parameters of the container
After the step of cluster, comprising:
Count the currently pending task amount of the target Kubenetes cluster;
If the currently pending task amount is greater than or equal to preset threshold, prompt information is generated to sending the behaviour
Make the corresponding client of task;
If the currently pending task amount is less than preset threshold, described in execution: the operation task is corresponding
Operating parameter be sent to the corresponding target Kubenetes interface of the target Kubenetes cluster, pass through the target
The operating parameter is converted yaml file by Kubenetes interface, so that the target Kubenetes cluster is according to
Yaml file executes the step of operation task.
In addition, to achieve the above object, the application also provides a kind of task scheduling apparatus, the task scheduling apparatus setting
In Kubenetes Gateway device, the task scheduling apparatus includes:
Container creation module, for when receiving operation task, creating the corresponding container of the operation task;
It inquires determining module and determines target according to the container parameters of the container for inquiring default mapping table
Kubenetes cluster;
Execution module is sent, for the corresponding operating parameter of the operation task to be sent to the target Kubenetes
The corresponding target Kubenetes interface of cluster converts yaml for the operating parameter by the target Kubenetes interface
File, so that the target Kubenetes cluster executes the operation task according to the yaml file.
Optionally, the task scheduling apparatus further include:
Configuration module is obtained, for obtaining the Kubernetes interface of each Kubenetes cluster in Kubernetes service,
Join format according to the biography of the Kubenetes interface and configures interface model;
Verify relating module, for the interface model verification pass through when, by the interface model with it is corresponding described
Kubernetes interface is associated.
Optionally, the transmission execution module, comprising:
Interface selecting unit, for obtaining the corresponding operating parameter of the operation task, from target Kubenetes cluster
The corresponding target Kubernetes interface of the operating parameter is selected in Kubernetes interface;
It is associated with judging unit, for judging the target Kubernetes interface with the presence or absence of associated interface model;
Execution unit is sent, it, will be described if there are associated interface models for the target Kubernetes interface
Operating parameter is input in the interface model of the target Kubernetes interface conjunctionn, is obtained comprising the operating parameter
Yaml file, so that the target Kubenetes cluster executes the operation task according to the yaml file.
Optionally, the transmission execution module, comprising:
Template configuration unit is based on if associated interface model is not present for the target Kubernetes interface
The target Kubenetes interface generates template configuration prompt, and template configuration prompt is sent to the operation task
Corresponding client, so that the interface model of target Kubenetes interface described in the corresponding user configuration of the client.
Optionally, the inquiry determining module, comprising:
Parameter acquiring unit, for obtaining the container parameters of the container, wherein the container parameters include geographical location
Parameter, program structure parameter and deployed environment parameter;
Cluster query unit determines the geo-location parameter, described program structure for inquiring default mapping table
Parameter and the corresponding target Kubenetes cluster of the deployed environment parameter.
Optionally, the task scheduling apparatus, comprising:
Permission judgment module judges for obtaining the corresponding task identification of the operation task according to the task identification
Whether there is the operating right of the operation task;
Predicated execution module, for creating the operation task in the operating right with the operation task
Corresponding container.
Optionally, the task scheduling apparatus, further includes:
Statistical module, for counting the currently pending task amount of the target Kubenetes cluster;
Cue module is sent, if being greater than or equal to preset threshold for the currently pending task amount, generation is mentioned
Show information to sending the corresponding client of the operation task;
Execution module is sent, if be less than preset threshold for the currently pending task amount, described in execution: will
The corresponding operating parameter of the operation task is sent to the corresponding target Kubenetes interface of the target Kubenetes cluster,
Yaml file is converted by the operating parameter by the target Kubenetes interface, so that the target Kubenetes collection
The step of group executes the operation task according to the yaml file.
In addition, to achieve the above object, the application also provides a kind of task scheduling equipment, the task scheduling equipment packet
It includes: memory, processor and being stored in the task dispatch that can be run on the memory and on the processor, it is described
The step of task dispatch realizes method for scheduling task as described above when being executed by the processor.
In addition, to achieve the above object, the application also provides a kind of computer readable storage medium, described computer-readable
Task dispatch is stored on storage medium, the task dispatch realizes task as described above when being executed by processor
The step of dispatching method.
This application provides a kind of method for scheduling task, device, equipment and computer readable storage medium, the application is implemented
In example, replaces Kubenetes to control plane using Kubenetes Gateway device, encapsulated by Kubenetes Gateway device
Kubenetes interface, called side developer are not required to it is to be understood that the processing logic of the rear end Kubenetes cluster and being patrolled according to processing
It collects to be customized and melts hair, reduce the workload of called side developer;Kubenetes Gateway device connects in the present embodiment
When receiving operation task, Kubenetes Gateway device creates the corresponding container of operation task, and by the corresponding fortune of operation task
Row parameter is sent to the corresponding target Kubenetes interface of target Kubenetes cluster, and operation task is routed in target
Kubenetes cluster, invocation target Kubenetes cluster execute operation task, realize the management of Kubenetes cluster;With
This simultaneously, Kubenetes Gateway device is lower to hardware requirement, and Kubernetes hardware cost is low.
Detailed description of the invention
Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present application scheme is related to;
Fig. 2 is the application method for scheduling task first embodiment concrete scene schematic diagram;
Fig. 3 is the flow diagram of the application method for scheduling task first embodiment;
Fig. 4 is the functional block diagram of one embodiment of the application task scheduling apparatus.
The embodiments will be further described with reference to the accompanying drawings for realization, functional characteristics and the advantage of the application purpose.
Specific embodiment
It should be appreciated that specific embodiment described herein is only used to explain the application, it is not used to limit the application.
As shown in Figure 1, Fig. 1 is the device structure schematic diagram for the hardware running environment that the embodiment of the present application scheme is related to.
The embodiment of the present application task scheduling equipment can be PC machine or server apparatus, as shown in Figure 1, the task schedule is set
Standby may include: processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus
1002.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display
Shield (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include that the wired of standard connects
Mouth, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as WI-FI interface).It deposits
Reservoir 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic
Disk storage.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that device structure shown in Fig. 1 does not constitute the restriction to equipment, can wrap
It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe module, Subscriber Interface Module SIM and the corresponding computer program of task schedule.
In equipment shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background server
Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor
1001 can be used for calling the corresponding computer program of the task schedule stored in memory 1005, and execute following task schedules
Operation in method.
Based on above-mentioned hardware configuration, the application method for scheduling task embodiment is proposed.
The first embodiment of the application method for scheduling task, comprising:
When receiving operation task, the corresponding container of the operation task is created;
Default mapping table is inquired, determines target Kubenetes cluster according to the container parameters of the container;
The corresponding operating parameter of the operation task is sent to the corresponding target of the target Kubenetes cluster
Kubenetes interface converts yaml file for the operating parameter by the target Kubenetes interface, so that described
Target Kubenetes cluster executes the operation task according to the yaml file.
Preset Kubenetes Gateway device in the present embodiment, as shown in Fig. 2, Kubenetes Gateway device is arranged
In each Kubenetes cluster front end, Kubenetes Gateway device is used to ask receiving the operation based on application triggers
When asking, operation task is converted container by Kubenetes Gateway device, and the corresponding container of operation task is routed to processing
The target Kubenetes cluster of the operation task, that is, Kubenetes Gateway device is by encapsulating each Kubenetes cluster
Bottom Kubenetes interface when application call Kubenetes cluster, does not need application developer and understands rear end
Kubenetes cluster and the corresponding yaml file of Kubenetes cluster, using preset Kubenetes Gateway device to behaviour
It is routed as task, realizes and the more aggregated structures of Kubernetes are managed concentratedly, specifically:
It is the flow diagram of the application method for scheduling task first embodiment referring to Fig. 3, Fig. 3, which comprises
Step S10 creates the corresponding container of the operation task when receiving operation task;
In the present embodiment, method for scheduling task is applied to task scheduling equipment, and task scheduling equipment is provided with Kubenetes
Gateway device, the task scheduling equipment can be to JVM (Java Virtual Machine, Java Virtual Machine) or physical machines
The operation task of transmission carries out processing scheduling.For example (financial institution includes but are not limited to silver in the financial institution of financial industry
Row mechanism, insurance institution and security organization) in, need to access financial database table, such as account information table, information table of opening an account, gold
Melt Transaction Information table etc., this can use trigger action task in the process, when task scheduling equipment receives operation task, call mesh
Kubenetes cluster processing operation task is marked, to meet the concurrency and visit of financial business for operation task allocation processing resource
Ask rate request.
Kubenetes Gateway device receives operation task in task scheduling equipment, and the triggering mode of operation task is not made
It is specific to limit, that is, operation task can be what user actively triggered, press for example, user clicks in the application program of client
Operation task is sent to task scheduling equipment by key, trigger action task, client;In addition, operation task can also be client
Automatic trigger is held, for example, when client detects that meeting preset operation task executes condition, automatic trigger operation task,
Operation task is sent to task scheduling equipment by client.
For task scheduling equipment when receiving operation task, the Kubenetes Gateway device in task scheduling equipment will
Operation task is packaged into container mirror image, and configures the read-write layer of the container mirror image, that is, Kubenetes Gateway device executes
Docker create order is that container mirror image (image) is added to a read-write layer, constitutes a container.
It is understood that the Kubenetes Gateway device in task scheduling equipment creates container according to operation task
When, the operating parameter and container parameters of container can be arranged in Kubenetes Gateway device according to operation task, wherein operation ginseng
Number is the call parameter of container operation, can determine how container runs according to operating parameter, operating parameter includes but is only limitted to:
Operation task enters ginseng, and operation task goes out to join, for example, operation task is to inquire the contact method of king xx in mysql database,
Then the operating parameter of the operation task is: mysql database, king xx and contact method;Container parameters refer to the operation ring of container
Border parameter can determine where to operation container according to container parameters, and container parameters include but are not limited to: Container Name ginseng
Number, container retransmitting paramater, container IP parameter, geo-location parameter, program structure parameter and deployed environment parameter, for example, operation
Task is to inquire the contact method of king xx in mysql database, then geo-location parameter in the container parameters of the operation task are as follows:
Shenzhen City, Guangdong Province Futian District, wherein the network IP that geo-location parameter can be carried according to the operation task is determined.
Step S20 inquires default mapping table, determines target Kubenetes collection according to the container parameters of the container
Group.
Mapping table is preset in Kubenetes Gateway device, default mapping table preserves container parameters and collection
Group's mapping relations, for example, container parameters in default mapping table are as follows: container IP parameter is 001, Container Name xxx, is corresponded to
Cluster A;Kubenetes Gateway device obtains the container parameters of container, and the default mapping of Kubenetes Gateway device inquiry is closed
It is table, obtains target Kubenetes cluster corresponding with container parameters, specifically, comprising:
Step a1 obtains the container parameters of the container, wherein the container parameters include geo-location parameter, program
Structural parameters and deployed environment parameter;
Step a2 inquires default mapping table, obtains and described program structural information, the geographical location information and institute
State the target Kubenetes cluster of deployed environment information matches.
In the present embodiment, Kubenetes Gateway device determines target Kubenetes collection according to the container parameters of container
The corresponding container of operation task is routed to target Kubenetes cluster, and passes through invocation target Kubenetes cluster by group
Operation task is executed, specifically:
It is corresponding to be sent to the target Kubenetes cluster by step S30 for the corresponding operating parameter of the operation task
Target Kubenetes interface converts yaml file for the operating parameter by the target Kubenetes interface, so that
The target Kubenetes cluster executes the operation task according to the yaml file.
In the present embodiment, Kubenetes Gateway device counts the corresponding Kubenetes of each Kubenetes cluster in advance
Interface, Kubenetes interface conjunctionn have the parameter processing code customized in advance, that is, Kubenetes cluster only handles yaml file
The operating parameter of format, the preparatory associated data of Kubenetes interface handle code, the operating parameter of operation task can be converted
For yaml file format, specifically, comprising:
Step b1 obtains the Kubernetes interface of each Kubenetes cluster in Kubernetes service, according to described
The biography ginseng format of Kubenetes interface configures interface model;
Step b2, when interface model verification passes through, by the interface model and the corresponding Kubernetes
Interface is associated.
That is, task scheduling equipment obtains the Kubernetes interface of each Kubenetes cluster in Kubernetes service, appoint
Controlling equipment be engaged according to the biography of Kubenetes interface ginseng format configuration interface model, for example, the biography of Kubenetes interface joins lattice
Formula is yaml file format, and task scheduling equipment configures yaml template;Task scheduling equipment is right when interface model configures completion
It configures obtained interface model to be verified, if interface model verification does not pass through, task scheduling equipment is reconfigured;If connecing
Mouth template verification passes through, and interface model is associated by task scheduling equipment with corresponding Kubernetes interface.
Kubenetes Gateway device in task scheduling equipment is by the corresponding operating parameter (operating parameter of operation task
Include but are not limited to operation task enter to join join out) be sent to the corresponding target Kubenetes of target Kubenetes cluster and connect
Mouthful, target Kubenetes interface handles operating parameter, so that the operating parameter that target Kubenetes cluster is obtained according to processing
The operation task is executed, specifically, comprising:
Step c1 obtains the corresponding operating parameter of the operation task, from the Kubernetes of target Kubenetes cluster
The corresponding target Kubernetes interface of the operating parameter is selected in interface;
Step c2 judges the target Kubernetes interface with the presence or absence of associated interface model;
Step c3, it is if the target Kubernetes interface is there are associated interface model, the operating parameter is defeated
Enter into the interface model of the target Kubernetes interface conjunctionn, obtains the yaml file comprising the operating parameter, with
The target Kubenetes cluster is set to execute the operation task according to the yaml file.
That is, Kubenetes Gateway device obtains the corresponding operating parameter of operation task, Kubenetes Gateway device
The corresponding target Kubernetes interface of operating parameter is selected from each Kubernetes interface of target Kubenetes cluster;
Kubenetes Gateway device judges target Kubernetes interface with the presence or absence of associated interface model, if target
There are associated interface models for Kubernetes interface, then operating parameter are input to connecing for target Kubernetes interface conjunctionn
In mouth template, the yaml file comprising operating parameter is obtained, so that target Kubenetes cluster executes operation according to yaml file
Task.
It should be noted that existing Federation is to will be distributed over the Kubernetes clusters of multiple regions to be integrated into
One big cluster is simultaneously managed collectively and dispatches, and this management controls with scheduling mode dependent on the Kubernetes of deployment flat
Face needs developer's customized development to operate when Kubernetes controls plane scheduling Kubernetes cluster processing operation task
The data processor of the relevant data processor of task, different user customization is different, and data processor is not advised
Model is easy to appear Kubernetes colony dispatching not in time, and performance bottleneck occurs in caused Kubernetes control plane, and grasps
Make the low problem of task treatment effeciency;It has been pre-configured with the interface model of Kubernetes interface in the embodiment of the present application, has passed through
The corresponding operating parameter of interface model processing operation task of Kubenetes interface, and operation task is routed to Kubenetes
Cluster so that Kubenetes cluster executes the operation task according to the obtained operating parameter of processing, the application implement in pass through
The treatment process for simplifying operating parameter, improves Kubernetes colony dispatching efficiency, to improve operation task treatment effeciency,
The technical solution of the embodiment of the present application operated compared with existing mode it is simpler, and be not easy occur due to operation task road
The bottleneck caused by not in time.
In the present embodiment, replaces Kubenetes to control plane using Kubenetes Gateway device, pass through Kubenetes
Gateway device encapsulates Kubenetes interface, and called side developer is not required to it is to be understood that the processing of the rear end Kubenetes cluster is patrolled
It collects and is customized according to processing logic and melt hair, reduce the workload of called side developer;In the present embodiment
When Kubenetes Gateway device receives operation task, Kubenetes Gateway device creates the corresponding appearance of operation task
Device, and the corresponding operating parameter of operation task is sent to the corresponding target Kubenetes interface of target Kubenetes cluster,
With by operation task routing, in target Kubenetes cluster, invocation target Kubenetes cluster executes operation task, realizes
The management of Kubenetes cluster;At the same time, Kubenetes Gateway device is lower to hardware requirement, Kubernetes hardware
It is at low cost.
Kubenetes Gateway device is applied to financial institution in the present embodiment, reduces the workload of developer, with
This can improve gold by Kubenetes Gateway device invocation target Kubenetes cluster processing operation task simultaneously
Melt the treatment effeciency of business respective operations task.
Further, it is based on the application method for scheduling task first embodiment, proposes the application method for scheduling task second
Embodiment.
The difference of the present embodiment and first embodiment is, in first embodiment step c2, judges the target
The step of Kubernetes interface is with the presence or absence of after associated interface model, further includes:
Step c4 is based on the target if associated interface model is not present in the target Kubernetes interface
Kubenetes interface generates template configuration prompt, and template configuration prompt is sent to the corresponding visitor of the operation task
Family end, so that the interface model of target Kubenetes interface described in the corresponding user configuration of the client.
In the present embodiment, since the Kubenetes number of clusters of Kubenetes Gateway device management is more, and
The corresponding Kubenetes interface quantity of Kubenetes cluster is also more, it is understood that there may be the customization of target Kubenetes interface is endless
Whole phenomenon, Kubenetes Gateway device determines target Kubernetes interface there is no associated interfaces in the present embodiment
When template, Kubenetes Gateway device obtains the biography moduli formula of target Kubernetes interface, Kubenetes Gateway
Device generates the template configuration comprising the biography moduli formula and prompts, and template configuration prompt is sent to the client of trigger action task
End, so that the interface model of the corresponding user's customized development configuration target Kubenetes interface of client.
The interface model of target Kubenetes interface configure complete when, Kubenetes Gateway device is by interface model
It is associated with target Kubenetes interface, and executes step c3, if the target Kubernetes interface connects there are associated
The operating parameter is then input in the interface model of the target Kubernetes interface conjunctionn, is included by mouth template
The yaml file of the operating parameter, so that the target Kubenetes cluster executes the operation according to the yaml file
Task.
In the present embodiment, Kubenetes Gateway device can customization be connect in real time during operation task executes
Mouth template, so that more flexible when Kubenetes Gateway device progress cluster management.
Further, it is based on the application method for scheduling task first embodiment, proposes the application method for scheduling task third
Embodiment.
The present embodiment is step S10 in first embodiment: the step of creating before the corresponding container of the operation task, this
The difference of embodiment and first embodiment is:
The corresponding task identification of the operation task is obtained, judges whether that there is the operation to appoint according to the task identification
The operating right of business;
In the operating right with the operation task, the corresponding container of the creation operation task is executed
The step of.
In the present embodiment, after Kubenetes Gateway device receives operation task, Kubenetes Gateway device
The corresponding task identification of the operation task is obtained, task identification can be task encoding, task names etc., Kubenetes
Gateway device judges whether the operating right with operation task according to task identification, specifically, comprising:
Logo collection is preset in one: Kubenetes Gateway device of implementation, includes that there is behaviour in the logo collection
Make the standard logo of permission, Kubenetes Gateway device carries out the standard logo in task identification and default logo collection
It compares, is identified if there is target criteria identical with task identification in default logo collection, Kubenetes Gateway device is sentenced
Surely with the operating right of operation task;It is on the contrary then do not have.
Implementation two task identification with operating right is marked in advance in Kubenetes Gateway device,
If in the task identification including mark information, when Kubenetes Gateway device determines to have the operating right of operation task;
It is on the contrary then do not have.
When Kubenetes Gateway device determines to have the operating right of operation task, Kubenetes Gateway device wound
Build the corresponding container of operation task;When Kubenetes Gateway device determines the operating right without operation task,
Kubenetes Gateway device exports prompt information.
In the present embodiment, Kubenetes Gateway device reflects to operation task according to the task identification of operation task
Power, so that Kubenetes Gateway device corresponding part operation task routes, to guarantee that Kubenetes Gateway device calls
The safety of target Kubenetes cluster execution operation task.
Further, it is based on the application method for scheduling task above-described embodiment, proposes the application method for scheduling task the 4th
Embodiment.
The present embodiment be in first embodiment after step S20 the step of, the difference of the present embodiment and first embodiment exists
In:
Count the currently pending task amount of the target Kubenetes cluster;
If the currently pending task amount is greater than or equal to preset threshold, prompt information is generated to sending the behaviour
Make the corresponding client of task;
If the currently pending task amount is less than preset threshold, described in execution: the operation task is corresponding
Operating parameter be sent to the corresponding target Kubenetes interface of the target Kubenetes cluster, pass through the target
The operating parameter is converted yaml file by Kubenetes interface, so that the target Kubenetes cluster is according to
Yaml file executes the step of operation task.
In the present embodiment, after Kubenetes Gateway device determines the target Kubenetes cluster called,
Kubenetes Gateway device does not carry out container calling directly, but counts currently pending times of target Kubenetes cluster
Business amount, (preset threshold can be according to specific field with preset threshold by currently pending task amount for Kubenetes Gateway device
Scape flexible setting, for example, Kubenetes Gateway device is arranged according to the treatment effeciency of target Kubenetes cluster, target
The treatment effeciency of Kubenetes cluster is 1000 per second, then preset threshold is set as 1000) being compared;
If currently pending task amount is greater than or equal to preset threshold, generates prompt information to transmission and trigger the operation
The client of task, so that client user understands task execution situation.
If currently pending task amount is less than preset threshold, step S30 in first embodiment is executed: by the behaviour
Make the corresponding operating parameter of task and be sent to the target Kubenetes cluster, so that the target Kubenetes cluster executes
The operation, to execute operation task.
In the present embodiment, the whole Kubenetes cluster of Kubenetes Gateway device centralized management, Kubenetes
After Gateway device determines target Kubenetes cluster, Kubenetes Gateway device statistics target Kubenetes cluster is worked as
Preceding task amount to be processed, and according to the currently pending task amount of target Kubenetes cluster, judge whether container tune
Target Kubenetes cluster is spent, when preceding task amount to be processed is greater than preset threshold, container is dispatched to target by pause
On Kubenetes cluster, to reduce target Kubenetes cluster by current limliting, guarantee the normal operation of operation task.
In addition, Kubenetes Gateway device is determining that the currently pending task amount of target Kubenetes cluster is greater than
Or it is equal to preset threshold, Kubenetes Gateway device can also adjust the weight of each container parameters, with the new target of determination
Kubenetes cluster, for example, container parameters have program structure and geographical location, the weight point in program structure and geographical location
Not Wei 50%, obtain first object Kubenetes cluster;If the currently pending task amount of first object Kubenetes cluster
When more than or equal to preset threshold, the weight in program structure and geographical location is adjusted to 40% by Kubenetes Gateway device
With 60%, the second target Kubenetes cluster is obtained, to execute step S30 in first embodiment: the corresponding operation of operation task
Parameter is sent to the corresponding second target Kubenetes interface of the second target Kubenetes cluster, passes through the second target
The second operating parameter is converted yaml file by Kubenetes interface, so that the second target Kubenetes cluster is according to yaml text
Part executes the operation task.
In the present embodiment, Kubenetes Gateway device is managed collectively Kubenetes cluster, can be to Kubenetes collection
The operation task amount of group's processing is counted and is dispatched, so that the Kubenetes collection realized based on Kubenetes Gateway device
Group's management is more reasonable.
Referring to Fig. 4, the application also provides a kind of task scheduling apparatus, and the task scheduling apparatus includes:
Container creation module 10, for when receiving operation task, creating the corresponding container of the operation task;
It inquires determining module 20 and determines target according to the container parameters of the container for inquiring default mapping table
Kubenetes cluster;
Execution module 30 is sent, for the corresponding operating parameter of the operation task to be sent to the target
The corresponding target Kubenetes interface of Kubenetes cluster, by the target Kubenetes interface by the operating parameter
It is converted into yaml file, so that the target Kubenetes cluster executes the operation task according to the yaml file.
In one embodiment, the task scheduling apparatus further include:
Configuration module is obtained, for obtaining the Kubernetes interface of each Kubenetes cluster in Kubernetes service,
Join format according to the biography of the Kubenetes interface and configures interface model;
Verify relating module, for the interface model verification pass through when, by the interface model with it is corresponding described
Kubernetes interface is associated.
In one embodiment, the transmission execution module, comprising:
Interface selecting unit, for obtaining the corresponding operating parameter of the operation task, from target Kubenetes cluster
The corresponding target Kubernetes interface of the operating parameter is selected in Kubernetes interface;
It is associated with judging unit, for judging the target Kubernetes interface with the presence or absence of associated interface model;
Execution unit is sent, it, will be described if there are associated interface models for the target Kubernetes interface
Operating parameter is input in the interface model of the target Kubernetes interface conjunctionn, is obtained comprising the operating parameter
Yaml file, so that the target Kubenetes cluster executes the operation task according to the yaml file.
In one embodiment, the transmission execution module, comprising:
Template configuration unit is based on if associated interface model is not present for the target Kubernetes interface
The target Kubenetes interface generates template configuration prompt, and template configuration prompt is sent to the operation task
Corresponding client, so that the interface model of target Kubenetes interface described in the corresponding user configuration of the client.
In one embodiment, the inquiry determining module, comprising:
Parameter acquiring unit, for obtaining the container parameters of the container, wherein the container parameters include geographical location
Parameter, program structure parameter and deployed environment parameter;
Cluster query unit determines the geo-location parameter, described program structure for inquiring default mapping table
Parameter and the corresponding target Kubenetes cluster of the deployed environment parameter.
In one embodiment, the task scheduling apparatus, comprising:
Permission judgment module judges for obtaining the corresponding task identification of the operation task according to the task identification
Whether there is the operating right of the operation task;
Predicated execution module, for creating the operation task in the operating right with the operation task
Corresponding container.
In one embodiment, the task scheduling apparatus further include:
Statistical module, for counting the currently pending task amount of the target Kubenetes cluster;
Cue module is sent, if being greater than or equal to preset threshold for the currently pending task amount, generation is mentioned
Show information to sending the corresponding client of the operation task;
Execution module is sent, if be less than preset threshold for the currently pending task amount, described in execution: will
The corresponding operating parameter of the operation task is sent to the corresponding target Kubenetes interface of the target Kubenetes cluster,
Yaml file is converted by the operating parameter by the target Kubenetes interface, so that the target Kubenetes collection
The step of group executes the operation task according to the yaml file.
Method performed by above-mentioned each program module can refer to each embodiment of the application method for scheduling task, herein no longer
It repeats.
The application also provides a kind of computer readable storage medium.
Task dispatch is stored on the application computer readable storage medium, the task dispatch is by processor
The step of method for scheduling task as described above is realized when execution.
Wherein, the task dispatch run on the processor, which is performed realized method, can refer to the application
The each embodiment of method for scheduling task, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, the technical solution of the application substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the application.
The above is only preferred embodiment of the present application, are not intended to limit the scope of the patents of the application, all to utilize this Shen
Please equivalent structure or equivalent flow shift made by specification and accompanying drawing content, be applied directly or indirectly in other relevant skills
Art field similarly includes in the scope of patent protection of the application.
Claims (10)
1. a kind of method for scheduling task, which is characterized in that the method for scheduling task is based on preset Kubenetes Gateway
Device, the method for scheduling task include the following steps:
When receiving operation task, the corresponding container of the operation task is created;
Default mapping table is inquired, determines target Kubenetes cluster according to the container parameters of the container;
The corresponding operating parameter of the operation task is sent to the corresponding target of the target Kubenetes cluster
Kubenetes interface converts yaml file for the operating parameter by the target Kubenetes interface, so that described
Target Kubenetes cluster executes the operation task according to the yaml file.
2. method for scheduling task as described in claim 1, which is characterized in that described to join the corresponding operation of the operation task
Number is sent to the corresponding target Kubenetes interface of the target Kubenetes cluster, is connect by the target Kubenetes
Before the step of operating parameter is converted yaml file by mouth, comprising:
The Kubernetes interface for obtaining each Kubenetes cluster in Kubernetes service, according to the Kubenetes interface
Biography ginseng format configure interface model;
When interface model verification passes through, the interface model is closed with the corresponding Kubernetes interface
Connection.
3. method for scheduling task as claimed in claim 2, which is characterized in that described to join the corresponding operation of the operation task
Number is sent to the corresponding target Kubenetes interface of the target Kubenetes cluster, is connect by the target Kubenetes
The operating parameter is converted yaml file by mouth, so that the target Kubenetes cluster is executed according to the yaml file
The step of operation task, comprising:
The corresponding operating parameter of the operation task is obtained, is selected from the Kubernetes interface of target Kubenetes cluster
The corresponding target Kubernetes interface of the operating parameter;
Judge the target Kubernetes interface with the presence or absence of associated interface model;
If there are associated interface models for the target Kubernetes interface, the operating parameter is input to the target
In the interface model of Kubernetes interface conjunctionn, the yaml file comprising the operating parameter is obtained, so that the target
Kubenetes cluster executes the operation task according to the yaml file.
4. method for scheduling task as claimed in claim 3, which is characterized in that the judgement target Kubernetes interface
After the step of with the presence or absence of associated interface model, comprising:
If associated interface model is not present in the target Kubernetes interface, it is based on the target Kubenetes interface
Template configuration prompt is generated, and template configuration prompt is sent to the corresponding client of the operation task, so that described
The interface model of target Kubenetes interface described in the corresponding user configuration of client.
5. method for scheduling task as described in claim 1, which is characterized in that it is described to inquire default mapping table, according to institute
State the step of container parameters of container determine target Kubenetes cluster, comprising:
Obtain the container parameters of the container, wherein the container parameters include geo-location parameter, program structure parameter and portion
Affix one's name to environmental parameter;
Default mapping table is inquired, determines the geo-location parameter, described program structural parameters and deployed environment ginseng
The corresponding target Kubenetes cluster of number.
6. method for scheduling task as described in claim 1, which is characterized in that described to create the corresponding container of the operation task
The step of before, comprising:
The corresponding task identification of the operation task is obtained, judges whether that there is the operation task according to the task identification
Operating right;
In the operating right with the operation task, the step of the corresponding container of the creation operation task is executed
Suddenly.
7. the method for scheduling task as described in claim 1 to 6 any one, which is characterized in that the default mapping of inquiry is closed
After the step of being table, determining target Kubenetes cluster according to the container parameters of the container, comprising:
Count the currently pending task amount of the target Kubenetes cluster;
If the currently pending task amount is greater than or equal to preset threshold, generates prompt information and appoint to the operation is sent
It is engaged in corresponding client;
If the currently pending task amount is less than preset threshold, execute described by the corresponding operation of the operation task
Parameter is sent to the corresponding target Kubenetes interface of the target Kubenetes cluster, passes through the target Kubenetes
The operating parameter is converted yaml file by interface, so that the target Kubenetes cluster is held according to the yaml file
The step of row operation task.
8. a kind of task scheduling apparatus, which is characterized in that the task scheduling apparatus is set to Kubenetes Gateway device
In, the task scheduling apparatus includes:
Container creation module, for when receiving operation task, creating the corresponding container of the operation task;
It inquires determining module and determines target according to the container parameters of the container for inquiring default mapping table
Kubenetes cluster;
Execution module is sent, for the corresponding operating parameter of the operation task to be sent to the target Kubenetes cluster
Corresponding target Kubenetes interface converts yaml text for the operating parameter by the target Kubenetes interface
Part, so that the target Kubenetes cluster executes the operation task according to the yaml file.
9. a kind of task scheduling equipment, which is characterized in that the task scheduling equipment includes: memory, processor and is stored in
On the memory and the task dispatch that can run on the processor, the task dispatch is by the processor
The step of method for scheduling task as described in any one of claims 1 to 7 is realized when execution.
10. a kind of computer readable storage medium, which is characterized in that be stored with task tune on the computer readable storage medium
Program is spent, the task schedule as described in any one of claims 1 to 7 is realized when the task dispatch is executed by processor
The step of method.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910564385.7A CN110321207A (en) | 2019-06-25 | 2019-06-25 | Method for scheduling task, device, equipment and computer readable storage medium |
PCT/CN2020/088126 WO2020259081A1 (en) | 2019-06-25 | 2020-04-30 | Task scheduling method, apparatus, and device, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
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 |
---|---|
CN110321207A true CN110321207A (en) | 2019-10-11 |
Family
ID=68120455
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910564385.7A Pending CN110321207A (en) | 2019-06-25 | 2019-06-25 | Method for scheduling task, device, equipment and computer readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110321207A (en) |
WO (1) | WO2020259081A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111708610A (en) * | 2020-06-19 | 2020-09-25 | 北京神州泰岳软件股份有限公司 | Database client construction method and database operation method |
WO2020259081A1 (en) * | 2019-06-25 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Task scheduling method, apparatus, and device, and computer-readable storage medium |
CN114443059A (en) * | 2020-10-30 | 2022-05-06 | 中国联合网络通信集团有限公司 | Kubernets cluster deployment method, device and equipment |
US11487555B2 (en) * | 2020-06-09 | 2022-11-01 | Tencent America LLC | Running PBS jobs in kubernetes |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827241A (en) * | 2017-09-22 | 2022-07-29 | 华为技术有限公司 | Cross-platform deployment method and system |
CN108170820B (en) * | 2018-01-02 | 2022-04-22 | 联想(北京)有限公司 | Container processing method, control server and distributed cluster |
CN109284184A (en) * | 2018-03-07 | 2019-01-29 | 中山大学 | A kind of building method of the distributed machines learning platform based on containerization technique |
CN109471727B (en) * | 2018-10-29 | 2021-01-22 | 北京金山云网络技术有限公司 | Task processing method, device and system |
CN110321207A (en) * | 2019-06-25 | 2019-10-11 | 深圳前海微众银行股份有限公司 | Method for scheduling task, device, equipment and computer readable storage medium |
-
2019
- 2019-06-25 CN CN201910564385.7A patent/CN110321207A/en active Pending
-
2020
- 2020-04-30 WO PCT/CN2020/088126 patent/WO2020259081A1/en active Application Filing
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020259081A1 (en) * | 2019-06-25 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Task scheduling method, apparatus, and device, and computer-readable storage medium |
US11487555B2 (en) * | 2020-06-09 | 2022-11-01 | Tencent America LLC | Running PBS jobs in kubernetes |
CN111708610A (en) * | 2020-06-19 | 2020-09-25 | 北京神州泰岳软件股份有限公司 | Database client construction method and database operation method |
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 |
Also Published As
Publication number | Publication date |
---|---|
WO2020259081A1 (en) | 2020-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110321207A (en) | Method for scheduling task, device, equipment and computer readable storage medium | |
CN108510389A (en) | Intelligent contract call method, equipment and readable storage medium storing program for executing based on block chain | |
CN107894920A (en) | Resource allocation method and Related product | |
CN1292127A (en) | Telephony call-center scripting by petri net principles and techniques | |
CN105847020A (en) | Message pushing method and device | |
CN104216912A (en) | Method and device for achieving non-intrusive service form workflow | |
CN101686425B (en) | Method for providing service to whole network and service network system | |
CN101156360A (en) | Management based on policy in communication network | |
CN107977820A (en) | Intelligent logistics express system | |
CN101778013A (en) | Website testing system and method | |
CN111884807A (en) | Article reservation method, apparatus, device and medium based on block chain | |
CN110351182A (en) | E-mail sending method, device, equipment and computer readable storage medium | |
CN110347494A (en) | Context information management method, apparatus, system and computer readable storage medium | |
CN106576345A (en) | Propagating communication awareness over a cellular network | |
CN106358065A (en) | Multimedia information processing method and system | |
CN109117609A (en) | A kind of request hold-up interception method and device | |
CN107423223A (en) | Test and management system | |
CN107621981A (en) | Resource allocation method and Related product | |
CN106453139A (en) | Method and device of data packet scheduling | |
CN113055416B (en) | Management method and device for container cluster node resource pool | |
CN111680993A (en) | Data processing method and device, computer and readable storage medium | |
CN112799970B (en) | Test data processing method, device, electronic equipment and medium | |
EP1179928B1 (en) | Information Routing | |
CN105978858B (en) | Using method, apparatus and the application server of registering | |
CN101621758B (en) | Service container system for SP/CP |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |