CN109445923A - A kind of method and device of micro services task schedule - Google Patents
A kind of method and device of micro services task schedule Download PDFInfo
- Publication number
- CN109445923A CN109445923A CN201811291960.2A CN201811291960A CN109445923A CN 109445923 A CN109445923 A CN 109445923A CN 201811291960 A CN201811291960 A CN 201811291960A CN 109445923 A CN109445923 A CN 109445923A
- Authority
- CN
- China
- Prior art keywords
- resource
- dependence
- micro services
- registration information
- scheduling
- 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
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- 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/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a kind of methods of micro services task schedule, comprising: receives the registration information of each micro services resource;According to the dependence in registration information, layout go out on missions in each resource dependence resource;It is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, the dependence for relying on the resource is deleted, until all scheduling of resource finish.Also disclose a kind of device of micro services task schedule.The unified layout scheduling that service resources may be implemented in this programme executes, and realizes once-through operation creation multiple resources.
Description
Technical field
The present invention relates to cloud service technology, espespecially a kind of method and device of micro services task schedule.
Background technique
Micro services framework based on restful (transfer of performance layer state) interface specification has become the master of current Java exploitation
Stream architecture is widely used.Each micro services are a kind of resources, such as virtual machine, network, storage in cloud platform etc..Currently
In system platform, due to not having dispatching platform, often once-through operation can only create single resource, be unable to satisfy user and once grasp
It is created that the demand of a variety of required resources.To solve the above-mentioned problems, current way is: itself process resource of each micro services
Between scheduling, this to intercouple between each micro services and become extremely complex.For example, creation creates virtually in cloud platform
Machine, current implementation method is: virtual machine micro services will first go to search the virtual machines dependences such as available host, creation hard disk, network
Resource could execute creation virtual machine operations after relying on resource on deck.This makes virtual machine micro services go processing very much
With the not related logic of resources of virtual machine itself, business complexity is both increased, does not also meet restful interface specification, and
And a small amount of resource can only be also created, effect is unobvious.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method and devices of micro services task schedule, can
It realizes more resource tasks United Dispatchings, is individually handled without each micro services.
In order to reach the object of the invention, the present invention provides a kind of methods of micro services task schedule, wherein includes:
Receive the registration information of each micro services resource;
According to the dependence in registration information, layout go out on missions in each resource dependence resource;
It is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, delete the dependence pass for relying on the resource
System, until all scheduling of resource finish.
Optionally, the registration information includes: resource type, resource Uniform Resource identifier, relies on resource.
Optionally, after the registration information for receiving all resources being related in micro services task, further includes:
The uniqueness of resource type is verified, if resource type is unique, then database is written into the resource type.
Optionally, such as resource without dependence has multiple, then for each no dependence resource generate respectively a thread into
Row scheduling.
It is optionally, described since the resource of no dependence during scheduling, comprising:
It such as dispatches and fails, then all resources for relying on the resource are marked.
A kind of device of micro services task schedule, comprising: memory and processor;Wherein:
The memory, for saving the program for being used for micro services task schedule;
The processor executes the program for being used for micro services task schedule for reading, performs the following operations:
Receive the registration information of each micro services resource;
According to the dependence in registration information, layout go out on missions in each resource dependence resource;
It is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, delete the dependence pass for relying on the resource
System, until all scheduling of resource finish.
Optionally, the registration information includes: resource type, resource Uniform Resource identifier, relies on resource.
Optionally, after the registration information for receiving all resources being related in micro services task, further includes:
The uniqueness of resource type is verified, if resource type is unique, then database is written into the resource type.
Optionally, such as resource without dependence has multiple, then for each no dependence resource generate respectively a thread into
Row scheduling.
It is optionally, described since the resource of no dependence during scheduling, comprising:
It such as dispatches and fails, then all resources for relying on the resource are marked.
The resource-based each micro services of dependence United Dispatching of method through this embodiment, may be implemented service resources
Unified layout dispatch and execute, realize once-through operation creation multiple resources, each micro services are not necessarily to that the complexity of resource is implemented separately
Scheduling, greatly simplifies the business logic processing of each micro services, micro services platform is made to be easier to development and application.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right
Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this
The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is a kind of flow chart of the method for micro services task schedule of the embodiment of the present invention;
Fig. 2 a- Fig. 2 d is a kind of schematic diagram of the method for micro services task schedule of the embodiment of the present invention;
Fig. 3 is that the present invention applies a kind of exemplary flow chart of the method for micro services task schedule.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions
It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable
Sequence executes shown or described step.
Fig. 1 is a kind of flow chart of the method for micro services task schedule of the embodiment of the present invention, as shown in Figure 1, this implementation
Example method may include:
Step 101, the registration information for receiving each micro services resource;
Step 102, according to the dependence in registration information, layout go out on missions in each resource dependence resource;
Step 103 is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, is deleted and is relied on the resource
Dependence, until all scheduling of resource finish.
Since each business is made of several resources, can there are dependence, the embodiment of the present invention between these resources
The method of proposition carries out layout scheduling based on the dependence between resource, and only scheduling executes the resource without dependence every time, until
All resources are disposed, and task terminates, and treatment process is as follows:
Fig. 2 a: task starts, and includes 5 resources, and arrow indicates dependence, first resource 2 and money of the scheduling without dependence
Source 5, establishing resource 2 and resource 5;
Fig. 2 b: resource 2 and resource 5 are completed after the completion of dispatching, and are deleted the dependence for relying on resource 2 and resource 5, are then looked into
The resource 3 and resource 4 for finding no dependence are scheduled, establishing resource 3 and resource 4;
Fig. 2 c: resource 3 and resource 4 are completed after the completion of dispatching, and are deleted the dependence for relying on resource 3 and resource 4, are then looked into
The resource 1 for finding no dependence is scheduled, establishing resource 1;
Fig. 2 d: resource Recursion process, until all asset creations are completed, task terminates.
A kind of method of micro services task schedule of the present embodiment mainly includes resource registering, arranging service, traffic scheduling
Three big steps.
Firstly, all business micro services modules will first carry out resource registering when starting, registration content include resource type,
Resource URI, resource is relied on;Dependence of the resource for different resource in arranging service business is relied on, resource URI is for business tune
Degree issues use.
Secondly, arranging service is mainly responsible for the Resource Dependence relationship according to registration, the dependence resource of each resource is arranged;
The two, traffic scheduling are realized based on multithreading, comprising pretreatment thread and execution thread, pretreatment thread be responsible for by
Task storage, from database lookup task, then successively screening scheduling executes the resource without dependence to execution thread, until task is complete
At.
Specific implementation process is as follows:
1) resource registering
A. when business micro services module starts, resource registering interface is called to be registered, registration content includes resource type
(resourceKey), resource URI (Uniform Resource Identifier, uniform resource identifier), dependence resource;
B. resource registering module verification resourceKey is not repeated uniquely, and write-in database saves;
2) arranging service
The task that UI is issued includes multiple resources, and arranging service module generates each resource according to the dependence of registration
Dependence resource, insert dependence (rely) field of resource, at the same verify guarantee do not generate Circular dependency;
Whether in the present embodiment, can be verified using the ergodic algorithm of digraph has the dependence of circulation to close between resource
System.
3) traffic scheduling, as shown in Figure 3
Mission bit stream is written database first, and is set to init state by step 301, pretreatment thread;
Mission bit stream may include task id, task status and task definition.Task definition is by a pile resource information group
At each resource includes resource type, asset creation parameter, relies on resource.
Step 302, execution thread go the task of database lookup init state to start scheduling execution, while more by task
New is state in executing.
Step 303 is searched without the resource for being rely field for sky is relied on, and can generate a thread tune for each resource
Degree is created corresponding resource, is improved efficiency using multithreading.
It after the completion of step 304, asset creation, first determines whether all resources of task are all completed, if completing, generates and appoint
Business implementing result, and task is set to completion (finished) state;If task is not finished, step 305 is executed.
Step 305, the execution state for judging resource update the rely field of surplus resources if run succeeded, and delete
Resource a is relied on dependent on the dependence for creating successful resource, such as resource b, the rely field of resource b includes resource a, money
After source a successful execution is complete, this resource for indicating that resource b is relied on is had been completed, therefore removes from the rely field of resource b
Then resource a calls execution thread to search and goes to dispatch without dependence resource;If executing failure, owning for the dependence resource
Resource whole table is failure.
It is executed by the unified layout scheduling that service resources may be implemented in this method, each micro services are without being implemented separately resource
Complicated scheduling, greatly simplify the business logic processing of each micro services, micro services platform made to be easier to development and application.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored with computer executable instructions,
The computer executable instructions are performed the method for realizing the micro services task schedule.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove
Functional module/unit in setting may be implemented as software, firmware, hardware and its combination appropriate.In hardware embodiment,
Division between the functional module/unit referred in the above description not necessarily corresponds to the division of physical assemblies;For example, one
Physical assemblies can have multiple functions or a function or step and can be executed by several physical assemblies cooperations.Certain groups
Part or all components may be implemented as by processor, such as the software that digital signal processor or microprocessor execute, or by
It is embodied as hardware, or is implemented as integrated circuit, such as specific integrated circuit.Such software can be distributed in computer-readable
On medium, computer-readable medium may include computer storage medium (or non-transitory medium) and communication media (or temporarily
Property medium).As known to a person of ordinary skill in the art, term computer storage medium is included in for storing information (such as
Computer readable instructions, data structure, program module or other data) any method or technique in the volatibility implemented and non-
Volatibility, removable and nonremovable medium.Computer storage medium include but is not limited to RAM, ROM, EEPROM, flash memory or its
His memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other
Magnetic memory apparatus or any other medium that can be used for storing desired information and can be accessed by a computer.This
Outside, known to a person of ordinary skill in the art to be, communication media generally comprises computer readable instructions, data structure, program mould
Other data in the modulated data signal of block or such as carrier wave or other transmission mechanisms etc, and may include any information
Delivery media.
Claims (10)
1. a kind of method of micro services task schedule characterized by comprising
Receive the registration information of each micro services resource;
According to the dependence in registration information, layout go out on missions in each resource dependence resource;
It is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, delete the dependence for relying on the resource,
Until all scheduling of resource finish.
2. the method according to claim 1, wherein
The registration information includes: resource type, resource Uniform Resource identifier, relies on resource.
3. according to the method described in claim 2, it is characterized in that, described receive all resources being related in micro services task
Registration information after, further includes:
The uniqueness of resource type is verified, if resource type is unique, then database is written into the resource type.
4. the method according to claim 1, wherein
Such as the resource without dependence has multiple, then generates a thread respectively for the resource of each no dependence and be scheduled.
5. the method according to claim 1, wherein described since the resource of no dependence during scheduling,
Include:
It such as dispatches and fails, then all resources for relying on the resource are marked.
6. a kind of device of micro services task schedule, comprising: memory and processor;It is characterized by:
The memory, for saving the program for being used for micro services task schedule;
The processor executes the program for being used for micro services task schedule for reading, performs the following operations:
Receive the registration information of each micro services resource;
According to the dependence in registration information, layout go out on missions in each resource dependence resource;
It is dispatched since the resource of no dependence, creates corresponding resource, after the completion of creation, delete the dependence for relying on the resource,
Until all scheduling of resource finish.
7. device according to claim 6, which is characterized in that
The registration information includes: resource type, resource Uniform Resource identifier, relies on resource.
8. device according to claim 7, which is characterized in that described to receive all resources being related in micro services task
Registration information after, further includes:
The uniqueness of resource type is verified, if resource type is unique, then database is written into the resource type.
9. device according to claim 6, which is characterized in that
Such as the resource without dependence has multiple, then generates a thread respectively for the resource of each no dependence and be scheduled.
10. device according to claim 6, which is characterized in that it is described since the resource of no dependence during scheduling,
Include:
It such as dispatches and fails, then all resources for relying on the resource are marked.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811291960.2A CN109445923A (en) | 2018-11-01 | 2018-11-01 | A kind of method and device of micro services task schedule |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811291960.2A CN109445923A (en) | 2018-11-01 | 2018-11-01 | A kind of method and device of micro services task schedule |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109445923A true CN109445923A (en) | 2019-03-08 |
Family
ID=65550654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811291960.2A Pending CN109445923A (en) | 2018-11-01 | 2018-11-01 | A kind of method and device of micro services task schedule |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109445923A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110149283A (en) * | 2019-05-22 | 2019-08-20 | 无锡华云数据技术服务有限公司 | A kind of resource layout implementation method and device |
CN112416612A (en) * | 2020-08-13 | 2021-02-26 | 上海哔哩哔哩科技有限公司 | Service calling method and device, computer equipment and readable storage medium |
CN112511596A (en) * | 2020-11-05 | 2021-03-16 | 苏州浪潮智能科技有限公司 | Method and equipment for creating cloud resources in cloud platform |
CN113312164A (en) * | 2021-07-28 | 2021-08-27 | 浙江九州云信息科技有限公司 | Resource data reading method suitable for cloud computing system |
CN113516301A (en) * | 2021-06-22 | 2021-10-19 | 中国联合网络通信集团有限公司 | Task scheduling method facing automatic driving, terminal equipment and storage medium |
CN114780228A (en) * | 2022-06-23 | 2022-07-22 | 浙江九州云信息科技有限公司 | Hybrid cloud resource creation method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347191A1 (en) * | 2010-08-13 | 2015-12-03 | International Business Machines Corporation | System and method for dynamic rescheduling of multiple varying resources with user social mapping |
CN107526639A (en) * | 2017-08-16 | 2017-12-29 | 杭州朗和科技有限公司 | Method, medium, device and the computing device of resource layout |
CN108287758A (en) * | 2017-01-09 | 2018-07-17 | 阿里巴巴集团控股有限公司 | A kind of application resource management method, application method and device |
CN108574592A (en) * | 2017-03-13 | 2018-09-25 | 中兴通讯股份有限公司 | A kind of method for managing resource and device based on telecom cloud |
-
2018
- 2018-11-01 CN CN201811291960.2A patent/CN109445923A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347191A1 (en) * | 2010-08-13 | 2015-12-03 | International Business Machines Corporation | System and method for dynamic rescheduling of multiple varying resources with user social mapping |
CN108287758A (en) * | 2017-01-09 | 2018-07-17 | 阿里巴巴集团控股有限公司 | A kind of application resource management method, application method and device |
CN108574592A (en) * | 2017-03-13 | 2018-09-25 | 中兴通讯股份有限公司 | A kind of method for managing resource and device based on telecom cloud |
CN107526639A (en) * | 2017-08-16 | 2017-12-29 | 杭州朗和科技有限公司 | Method, medium, device and the computing device of resource layout |
Non-Patent Citations (1)
Title |
---|
姜维,庞秀丽: "《分布式网络***与Multi-Agent***编程框架》", 31 January 2015 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110149283A (en) * | 2019-05-22 | 2019-08-20 | 无锡华云数据技术服务有限公司 | A kind of resource layout implementation method and device |
CN112416612A (en) * | 2020-08-13 | 2021-02-26 | 上海哔哩哔哩科技有限公司 | Service calling method and device, computer equipment and readable storage medium |
CN112416612B (en) * | 2020-08-13 | 2023-03-28 | 上海哔哩哔哩科技有限公司 | Service calling method and device, computer equipment and readable storage medium |
CN112511596A (en) * | 2020-11-05 | 2021-03-16 | 苏州浪潮智能科技有限公司 | Method and equipment for creating cloud resources in cloud platform |
CN113516301A (en) * | 2021-06-22 | 2021-10-19 | 中国联合网络通信集团有限公司 | Task scheduling method facing automatic driving, terminal equipment and storage medium |
CN113516301B (en) * | 2021-06-22 | 2023-06-27 | 中国联合网络通信集团有限公司 | Automatic driving-oriented task scheduling method, terminal equipment and storage medium |
CN113312164A (en) * | 2021-07-28 | 2021-08-27 | 浙江九州云信息科技有限公司 | Resource data reading method suitable for cloud computing system |
CN114780228A (en) * | 2022-06-23 | 2022-07-22 | 浙江九州云信息科技有限公司 | Hybrid cloud resource creation method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109445923A (en) | A kind of method and device of micro services task schedule | |
CN108462746B (en) | Container deployment method and framework based on openstack | |
US11061925B2 (en) | Multi-task scheduling method and system, application server and computer-readable storage medium | |
CN108614726B (en) | Virtual machine creation method and device | |
CN108733476B (en) | Method and device for executing multiple tasks | |
CN109684065B (en) | Resource scheduling method, device and system | |
US10681116B2 (en) | Providing services as resources for other services | |
US20210389970A1 (en) | Vnf lifecycle management method and apparatus | |
CN105515872B (en) | The update method of configuration information, apparatus and system | |
US10013340B1 (en) | Testing in virtualized computing environments | |
CN108134690B (en) | Network service deployment process control method, device and system | |
WO2021073516A1 (en) | Blockchain-based workflow node certification method and device | |
CN104793981B (en) | A kind of online snapshot management method and device of cluster virtual machine | |
CN111416727A (en) | VNF uploading instantiation method and device | |
CN114489954A (en) | Tenant creation method based on virtualization platform, tenant access method and equipment | |
CN111143041B (en) | Data consistency method, distributed coordinator and central coordinator | |
CN108804202A (en) | A kind of enterprise-level container mirror image management method and system | |
CN111399866B (en) | Updating method and device of VNF (virtual network function) package | |
CN109522092A (en) | A kind of cloud pipe platform receives pipe virtual machine method and apparatus | |
CN115480910A (en) | Multi-cluster resource management method and device and electronic equipment | |
CN114721801A (en) | Dynamic scheduling method and device for batch task execution time | |
US7159012B2 (en) | Computational data processing system and computational process implemented by means of such a system | |
CN111192100A (en) | Workflow scheduling method, device and system | |
CN109189583B (en) | Distributed lock implementation method and device | |
CN110806895A (en) | Project creation method and device and computer readable storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190308 |