CN110806930B - Micro-service scheduling method, device, equipment and storage device - Google Patents

Micro-service scheduling method, device, equipment and storage device Download PDF

Info

Publication number
CN110806930B
CN110806930B CN201911040189.6A CN201911040189A CN110806930B CN 110806930 B CN110806930 B CN 110806930B CN 201911040189 A CN201911040189 A CN 201911040189A CN 110806930 B CN110806930 B CN 110806930B
Authority
CN
China
Prior art keywords
server
micro
service
scheduling
selecting
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.)
Active
Application number
CN201911040189.6A
Other languages
Chinese (zh)
Other versions
CN110806930A (en
Inventor
沈佳
杨莉
胡典荣
罗兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201911040189.6A priority Critical patent/CN110806930B/en
Publication of CN110806930A publication Critical patent/CN110806930A/en
Application granted granted Critical
Publication of CN110806930B publication Critical patent/CN110806930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a micro-service scheduling method, which comprises the following steps: acquiring server information, wherein the server information comprises at least one of the online state, the working state and the executable microservice of a server; receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for selecting and executing the first micro service based on at least one set in the server information; and selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the micro-service. By the mode, the invention can provide various scheduling strategies based on different scheduling particles and dimensions, is suitable for various scenes, and aims to improve the rationality of strategy issuing, the scheduling accuracy and the resource utilization rate.

Description

Micro-service scheduling method, device, equipment and storage device
Technical Field
The present application relates to the field of intelligent scheduling, and in particular, to a method, an apparatus, a device, and a storage apparatus for scheduling a micro service.
Background
In recent years, information technologies represented by big data, cloud computing, the internet of things, and the mobile internet have been developed vigorously, and the scale of a task machine (i.e., a server) supporting the development of the information technologies has become larger. And with the continuous expansion of the information technology application field, different task machines often need to execute multiple applications (i.e. tasks) of a user at the same time. Therefore, how to manage, maintain and schedule the service relationship of the applications executed by the cross-task machines efficiently and reasonably becomes a problem which needs to be solved urgently.
With the development of information technology, aiming at complex computing tasks of mass data, the configuration of a vertically upgraded task machine cannot meet the operation requirement of the tasks, a horizontally expanded task machine cluster is acknowledged to be the best method for solving the problem, but a multi-task machine executes the tasks, the scheduling complexity is multiplied, and the problems of coarse scheduling granularity, unreasonable strategy issuing, less scheduling strategy dimensionality and less applicable scenes exist in task scheduling (especially in the field of distributed memory computing) in the existing distributed system.
Disclosure of Invention
The application provides a micro-service scheduling method, a device, equipment and a storage device, which can provide various scheduling strategies based on different scheduling particles and dimensions, are suitable for various scenes, and can improve the purposes of the rationality of strategy issuing, the scheduling accuracy and the resource utilization rate.
In order to solve the technical problem, the application adopts a technical scheme that: the micro-service scheduling method comprises the following steps:
acquiring server information, wherein the server information comprises at least one of the online state, the working state and the executable microservice of a server;
receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for selecting and executing the first micro service based on at least one set in the server information;
and selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the first micro service.
In order to solve the above technical problem, another technical solution adopted by the present application is: provided is a micro-service scheduling apparatus including:
the acquisition module acquires server information, wherein the server information comprises at least one of the online state, the working state and the executable microservice of the server;
a receiving module, configured to receive a first instruction for starting a first micro service, where the first instruction includes the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for selectively executing the first micro service based on at least one set in the server information;
and the selection module is used for selecting a preferred server meeting the scheduling strategy from the servers according to the server information and the first instruction to serve as the server for executing the micro-service.
In order to solve the above technical problem, another technical solution adopted by the present application is: providing a micro-service scheduling device comprising a processor, a memory coupled to the processor, wherein the memory stores program instructions for implementing the micro-service scheduling method; the processor is configured to execute the program instructions stored by the memory to select a server to execute a microservice.
In order to solve the above technical problem, the present application adopts another technical solution that: a storage device is provided, which stores a program file capable of implementing the micro-service scheduling method.
The beneficial effect of this application is: according to the micro-service scheduling method, device, equipment and storage device, the server information and the scheduling strategy specified in the first instruction are obtained, the preferred server meeting the scheduling strategy is selected from the servers as the server for executing the micro-service, the server information is refined from multiple dimensions, the server meeting the conditions is selected according to the scheduling strategy to start the micro-service, the applicable scenes are more, the scheduling accuracy is improved, and the user experience is improved.
Drawings
Fig. 1 is a flowchart illustrating a method for scheduling micro-services according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for scheduling microservice according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for scheduling microservice according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a micro-service scheduling method of a load mode scheduling policy according to a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a micro-service scheduling method of a full load mode scheduling policy according to a third embodiment of the present invention;
FIG. 6 is a flowchart illustrating a micro-service scheduling method for a custom mode scheduling policy according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a micro-service scheduling apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a microservice scheduling apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a memory device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise. All directional indications (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, and the like in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indication is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Fig. 1 is a flowchart illustrating a method for scheduling micro-services according to a first embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 1 if the results are substantially the same. As shown in fig. 1, the method comprises the steps of:
step S101: and acquiring server information, wherein the server information comprises at least one of the online state, the working state and the executable microservice of the server.
It should be noted that the server includes at least one server in the network that can provide the microservice. The server information comprises at least one of an online state, a working state and an executable micro service of the server, wherein the online state comprises online and offline, the working state comprises ready and not ready, the executable micro service is the micro service deployed on the server, and the micro services deployed on different servers can be the same or different.
Step S102: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for executing the first micro service based on at least one set selection in the server information.
In step S102, the first instruction may be obtained by providing an operation platform or an operation interface for a user, and generating an instruction for starting the first micro service through a real-time operation input device (a mouse, a keyboard, a touch screen, or the like) corresponding to the operation platform or the operation interface by the user, or may be obtained by receiving an instruction for starting the first micro service issued by an app installed in a remote device or another terminal device.
In this embodiment, the first instruction includes a scheduling policy specifying the first micro-service to be started and starting the first micro-service, the scheduling policy is a rule set based on at least one of the server information to select a server that executes the first micro-service, the scheduling policy may include patterns of load, full load, custom, etc. based on the server information, the server with the lowest selected load set based on at least one piece of information in the server information is the server for executing the first micro service, the server with the highest selected load set based on at least one piece of information in the server information is the server for executing the first micro service, and the server with the highest selected load set based on at least one piece of information in the server information is the server for executing the first micro service.
Step S103: and selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the first micro service.
Specifically, in step S103, according to the server information, the candidate servers meeting the condition are selected as: the online state is online, the working state is ready, and the executable microservice comprises the server of the first microservice.
Further, the server which meets the scheduling policy is calculated in the candidate servers according to the server information and is the server which executes the first micro service.
According to the first embodiment of the invention, the optimal server meeting the scheduling strategy is selected from the servers as the server for executing the micro-service according to the server information and the first instruction, so that the scheduling accuracy is improved, the scheduling strategy comprises multiple scheduling strategies such as load balancing, full load and self-definition, the scheduling strategies can be adapted to various intelligent operator task scheduling scenes, scene differentiation is avoided, a self-definition mode is provided for a user, the user can flexibly set according to the self-requirement, and the user experience is improved.
Fig. 2 is a flowchart illustrating a method for scheduling microservice according to a second embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 2 if the results are substantially the same. As shown in fig. 2, the method comprises the steps of:
step S201: and acquiring server information, wherein the server information comprises at least one of the online state, the working state, the executable microservice and an internal label corresponding to the executable microservice of the server.
It should be noted that, in step S201, the server information may further include an internal tag corresponding to an executable micro service, where the internal tag is used to indicate whether the server allows starting the micro service, a value of the internal tag is a first preset value or a second preset value, the internal tag is allowed to be started when the internal tag is the first preset value, the internal tag is not allowed to be started when the internal tag is the second preset value, the first preset value and the second preset value may be manually set, and if the first preset value is set to 0 and the second preset value is set to 1, the server does not allow starting the first micro service when the internal tag of the first micro service of the server is set to 1.
Step S202: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for executing the first micro service based on at least one set selection in the server information.
Step S203: and selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the first micro service.
Specifically, in this embodiment, in step S203, according to the server information, the candidate servers meeting the condition are selected as: the online state is online, the working state is ready, the executable microservice comprises the first microservice, and the internal label corresponding to the executable microservice is the server with the first preset value.
In this embodiment, steps S201, S202, and S203 in fig. 2 are similar to steps S101, S102, and S103 in fig. 1, and are not repeated herein for brevity.
In the second embodiment of the present invention, on the basis of the first embodiment, the internal tag of the micro-service is added as a selection for the server information to participate in the scheduling policy, and the user can plan the type of the micro-service executed by the server through the internal tag without redeploying or deleting the micro-service on the server, so that the user can deploy the micro-service conveniently, and the user experience is improved.
Fig. 3 is a flowchart illustrating a method for scheduling micro-services according to a third embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 3 if the results are substantially the same. As shown in fig. 3, the method comprises the steps of:
step S301: the method comprises the steps of obtaining server information, wherein the server information comprises at least one of the online state, the working state, the executable micro-service, an internal label corresponding to the executable micro-service, hardware resources, hardware resource scores, residual hardware resources and residual hardware resource total scores of the server.
In this embodiment, in step S301, the hardware resource is a hardware configuration resource of the server, such as gpu, cpu, and the like, the hardware resource score is a score set by different hardware types, such as a gpu single card 100 score, a cpu logic single core 30 score, and the hardware resource score may be set manually, and when a user does not set the score, a preset default score may be taken, where the remaining hardware resource is a remaining hardware resource obtained by subtracting a hardware resource occupied by the executable micro service started on the server from the hardware resource, and the remaining hardware resource is a total of the hardware resource scores of the remaining hardware resource.
Step S302: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service, a corresponding scheduling strategy and a first micro service resource configuration corresponding to the first micro service.
It should be noted that the first instruction further includes a first micro service resource configuration corresponding to the first micro service, where the first micro service resource configuration is the minimum hardware resource that the user has to possess to start the micro service server.
Step S303: and selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the first micro service.
Specifically, in this embodiment, in step S303, according to the server information, the candidate servers meeting the condition are selected as: the online state is online, the working state is ready, the executable microservice comprises the first microservice, the internal label corresponding to the executable microservice is the first preset value, and the residual hardware resources meet the server configured by the first microservice resources.
In this embodiment, steps S301, S302, and S303 in fig. 3 are similar to steps S101, S102, and S103 in fig. 1, and are not repeated herein for brevity.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for scheduling a micro service according to a load mode scheduling policy in a third embodiment of the present invention, and how to select a server for executing the first micro service when the scheduling policy is in a load mode is described in this embodiment.
Step S401: the method comprises the steps of obtaining server information, wherein the server information comprises at least one of the online state, the working state, the executable micro-service, an internal label corresponding to the executable micro-service, hardware resources, hardware resource scores, residual hardware resources and residual hardware resource total scores of the server.
Step S402: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service, a corresponding scheduling strategy and a first micro service resource configuration corresponding to the first micro service.
Steps S401 and S402 in fig. 4 are similar to steps S301 and S302 in fig. 3, and for brevity, are not repeated herein
In this embodiment, when the scheduling policy is in a load mode, after the online state is online, the working state is ready, the executable microservice includes the first microservice, the internal tag corresponding to the executable microservice is the first preset value, and the server whose remaining hardware resources satisfy the configuration of the first microservice resources is selected as a candidate server through steps S403a-S403 f:
step S403 g: the scheduling strategy comprises the step of selecting a server with the least number of the micro services with the same first micro service type in the candidate servers as the preferred server to execute the first micro service;
specifically, in step S403g, the candidate servers are calculated to include the number of the micro services with the same first micro service type, and the candidate server with the smallest number of the micro services with the same first micro service type in the candidate servers is selected as the preferred server to execute the first micro service when the scheduling policy is in the load mode.
Step S403 h: if the server with the smallest number of the micro services with the same first micro service type exists in the candidate servers, selecting the server with the highest total residual resource score as the preferred server to execute the first micro service;
it should be noted that, if there are a plurality of servers with the smallest number of micro services including the same first micro service type in the candidate server, the remaining resource total score of the server may be calculated, and the calculation of the remaining hardware resource total score of the server is based on the preset default score, that is, the remaining hardware resource total score is the sum of the preset default scores of the remaining resources. And selecting the server with the highest total residual resource score from the servers with the least number of the micro services as the preferred server to execute the first micro service.
Referring to fig. 5, fig. 5 is a flowchart illustrating a micro-service scheduling method of a full load mode scheduling policy according to a third embodiment of the present invention, and how to select a server executing the first micro-service when the scheduling policy is in the full load mode is described below in this embodiment.
Step S501: the method comprises the steps of obtaining server information, wherein the server information comprises at least one of the online state, the working state, the executable micro-service, an internal label corresponding to the executable micro-service, hardware resources, hardware resource scores, residual hardware resources and residual hardware resource total scores of the server.
Step S502: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service, a corresponding scheduling strategy and a first micro service resource configuration corresponding to the first micro service.
Steps S501 and S502 in fig. 5 are similar to steps S301 and S302 in fig. 3, and for brevity, are not repeated herein
In this embodiment, when the scheduling policy is in a full load mode, after the online state is online, the working state is ready, the executable microservice includes the first microservice, the internal tag corresponding to the executable microservice is the first preset value, and the server whose remaining hardware resources satisfy the configuration of the first microservice resources is selected as a candidate server through steps S503a-S503 f:
step S503 g: the scheduling strategy comprises selecting the candidate server with the lowest total score of the residual resources as the preferred server to be used as the server for executing the first micro service;
specifically, the total score of the remaining hardware resources of the server is calculated based on a preset default score, that is, the total score of the remaining hardware resources is the sum of the preset default scores of the remaining resources. And selecting the server with the lowest total score of the residual resources in the candidate servers as the preferred server to be used as the server for executing the first micro-service.
Referring to fig. 6, fig. 6 is a flowchart illustrating a micro-service scheduling method of a scheduling policy in a custom mode according to a third embodiment of the present invention, and how to select a server for executing the first micro-service when the scheduling policy is in the custom mode is described below in this embodiment.
Step S601: the method comprises the steps of obtaining server information, wherein the server information comprises at least one of the online state, the working state, the executable micro-service, an internal label corresponding to the executable micro-service, hardware resources, hardware resource scores, residual hardware resources and residual hardware resource total scores of the server.
Step S602 a: receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service, a corresponding scheduling strategy and a first micro service resource configuration corresponding to the first micro service.
Steps S601 and S602a in fig. 6 are similar to steps S301 and S302 in fig. 3, and for brevity, are not repeated herein
Step S602 b: receiving a third instruction for starting micro-service, wherein the third instruction comprises setting the hardware resource score and the corresponding hardware resource weight.
Specifically, in the custom mode, the third instruction includes setting the hardware resource score, that is, the user configures the hardware resource score according to the self-requirement, for example, the default score of the single smart card is 100 scores, and the default score of the cpu logic single core is 30 scores, the user can set the single smart card to 30 scores and the cpu logic single core to 100 scores in the custom mode according to the self-requirement, then in the custom mode, the remaining hardware resources are always the sum of the scores of the remaining hardware resources configured according to the third instruction, the third instruction further includes the weight corresponding to the hardware resource configured by the user according to the self-requirement, if the gpu weight is set to 40%, the cpu logic single core weight is 60%, then in the custom mode, the total score of the remaining hardware resources is the sum of the hardware resource configured according to the third instruction multiplied by the corresponding weight thereof, i.e. score ═ w 1 R gpu +w 2 R cpu +…,w 1 、w 2 Is the weight of gpu, cpu, R gpu 、R cpu The scores of gpu and cpu.
In this embodiment, when the scheduling policy is in the user-defined mode, after the online status is online, the working status is ready, the executable microservice includes the first microservice, the internal tag corresponding to the executable microservice is the first preset value, and the server whose remaining hardware resources satisfy the configuration of the first microservice resources is selected as the candidate server through steps S603a-S603 f:
step S603 g: the scheduling strategy comprises the steps of calculating the total score of the residual resources according to the hardware resource score, the hardware resource weight and the residual hardware resources, and selecting the candidate server with the highest total score of the residual resources as the preferred server to be used as the server for executing the first micro service.
Specifically, the total score of the remaining resources is calculated according to the hardware resource score, the hardware resource weight, and the remaining hardware resources in the third instruction, and the server with the lowest total score of the remaining resources in the candidate servers is selected as the preferred server to execute the first micro service.
In the third embodiment of the present invention, based on the previous embodiment, the server information increases the granularity of hardware resources, the score of the hardware resources, the remaining hardware resources, the total grade of the remaining hardware resources, and the like, and refines the server information from multiple dimensions, thereby providing a more accurate reference index for intelligent scheduling, improving the scheduling accuracy, and improving the resource utilization rate.
Fig. 7 is a schematic structural diagram of a micro-service scheduling apparatus according to an embodiment of the present invention. As shown in fig. 7, the apparatus includes an obtaining module 31, a receiving module 32, and a selecting module 33.
The acquisition module 31 acquires server information, wherein the server information comprises at least one of an online state, a working state and executable microservice of a server;
optionally, the obtaining module 31 obtains the server information, where the server information includes at least one of an online state, a working state, an executable microservice, remaining hardware resources, and a total score of the remaining hardware resources, where the executable microservice in the server information further includes an internal tag corresponding to the executable microservice, where the internal tag is used to indicate whether the server allows starting the microservice, a value of the internal tag is a first preset value or a second preset value, when the internal tag is the first preset value, the microservice is allowed to be started, and when the internal tag is the second preset value, the microservice is not allowed to be started.
A receiving module 32, configured to receive a first instruction for starting a first micro service, where the first instruction includes the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for selectively executing the first micro service based on at least one set in the server information;
optionally, the receiving module 32 receives the first instruction, and includes a scheduling policy for specifying the micro service, and further includes a first micro service resource configuration corresponding to the first micro service, where the first micro service resource configuration is a resource configuration that a user specifies to be provided for starting the micro service server.
And a selecting module 33, configured to select, according to the server information and the first instruction, a preferred server that meets the scheduling policy from the servers, as a server for executing the micro service.
Optionally, the selecting module 33 selects, according to the server information, a server that meets at least one of the following conditions as a candidate server: the online state is online, the working state is ready, the executable micro-service comprises the first micro-service, the internal label is the first preset value, the residual hardware resources meet the first micro-service resource configuration, the number of the micro-services with the same type as the first micro-service is calculated in the candidate server, and the preferred server is selected from the candidate servers according to the number of the micro-services, the scheduling strategy and the total score of the residual hardware resources.
It can be understood that specific ways for the modules of the micro service scheduling apparatus to implement the functions may refer to specific steps corresponding to the above embodiments, and therefore, are not described herein again.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a micro service scheduling apparatus according to an embodiment of the present invention. As shown in fig. 8, the micro-service scheduling apparatus 60 includes a processor 61 and a memory 62 coupled to the processor 61.
The memory 62 stores program instructions for implementing the micro-service scheduling method according to any of the above embodiments.
The processor 61 is operable to execute program instructions stored in the memory 62 to select a server to execute a microservice.
The processor 61 may also be referred to as a CPU (Central Processing Unit). The processor 61 may be an integrated circuit chip having signal processing capabilities. The processor 61 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a memory device according to an embodiment of the invention. The storage device of the embodiment of the present invention stores a program file 71 capable of implementing all the methods described above, wherein the program file 71 may be stored in the storage device in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (11)

1. A micro-service scheduling method is characterized by comprising the following steps:
acquiring server information, wherein the server information comprises at least one of the online state, the working state and the executable microservice of a server;
receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling policy, and the scheduling policy is a server rule for selecting and executing the first micro service based on at least one set in the server information;
selecting a preferred server meeting the scheduling policy from the servers according to the server information and the first instruction as a server for executing the first micro-service;
wherein the scheduling policy comprises: three modes of load, full load and self-definition;
if the scheduling strategy is acquired to be in a self-defined mode:
receiving a third instruction for starting the micro service, wherein the third instruction comprises setting a hardware resource score and a corresponding hardware resource weight;
the scheduling strategy comprises the step of calculating the total score of the remaining hardware resources according to the hardware resource score, the hardware resource weight and the remaining hardware resources;
and selecting the candidate server with the highest total score of the remaining hardware resources as the preferred server.
2. The micro-service scheduling method according to claim 1, wherein the online status comprises online and offline, the working status comprises ready and not ready, and the selecting a preferred server among the servers that satisfies the scheduling policy according to the server information and the first instruction comprises the following steps:
according to the server information, selecting a server with the online state being online, the working state being ready, and the executable micro-service including the first micro-service as a candidate server;
and selecting the preferred server from the candidate servers according to the scheduling strategy.
3. The micro-service scheduling method of claim 1, wherein:
the server information further comprises an internal label corresponding to the executable micro service, wherein the internal label is used for indicating whether the server allows the micro service to be started or not, the value of the internal label is a first preset value or a second preset value, the start is allowed when the value of the internal label is the first preset value, and the start is not allowed when the value of the internal label is the second preset value.
4. The micro-service scheduling method according to claim 3, wherein the online status comprises online and offline, the working status comprises ready and not ready, and the selecting a preferred server among the servers that satisfies the scheduling policy according to the server information and the first instruction comprises the following steps:
according to the server information, selecting a server with the online state being online, the working state being ready, the executable micro-service comprising the first micro-service and the value of the internal label being the first preset value as a candidate server;
and selecting the preferred server from the candidate servers according to the scheduling strategy.
5. The micro-service scheduling method of claim 1, wherein:
the first instruction comprises a first micro-service resource configuration corresponding to the first micro-service;
the server information further includes hardware resources, the hardware resource score, the remaining hardware resources, and the remaining hardware resource total score, where the hardware resources are hardware configuration resources of the server, the hardware resource score is scores set for different hardware types, the remaining hardware resources are remaining hardware resources obtained by subtracting occupied hardware resources of the executable micro service started on the server from the hardware resources, and the remaining hardware resources are the total of the hardware resource scores of the remaining hardware resources.
6. The micro-service scheduling method according to claim 5, wherein the selecting a preferred server among the servers that satisfies the scheduling policy according to the server information and the first instruction comprises:
according to the server information, selecting a server with the online state being online, the working state being ready, the executable micro service comprising the first micro service and the residual hardware resources meeting the first micro service resource configuration as a candidate server;
calculating the number of the micro services with the same first micro service type in the candidate server;
and selecting the preferred server from the candidate servers according to the number of the micro-services, the scheduling strategy and the total residual hardware resource score.
7. The micro-service scheduling method according to claim 6, wherein the selecting a preferred server among the servers that satisfies the scheduling policy according to the server information and the first instruction comprises:
according to the server information, selecting a server with the online state being online, the working state being ready, the executable micro service comprising the first micro service, the value of the internal label being a first preset value, and the remaining hardware resources meeting the first micro service resource configuration as a candidate server;
calculating the number of the micro services with the same first micro service type in the candidate server;
and selecting the preferred server from the candidate servers according to the number of the micro-services, the scheduling strategy and the total residual hardware resource score.
8. The micro-service scheduling method of claim 7, wherein the scheduling policy comprises: three modes of load, full load and self-definition;
if the scheduling policy is a load mode:
the scheduling strategy comprises selecting the server with the least number of the micro services with the same first micro service type from the candidate servers as the preferred server;
if the server with the minimum number of the micro services with the same first micro service type exists in the candidate servers, selecting the server with the highest total score of the remaining hardware resources as the preferred server;
if the scheduling policy is full load mode:
the scheduling policy comprises selecting the candidate server with the lowest total score of the remaining hardware resources as the preferred server.
9. A micro-service scheduling apparatus, comprising:
the system comprises an acquisition module, a scheduling module and a processing module, wherein the acquisition module is used for acquiring server information, the server information comprises at least one of the online state, the working state and the executable microservice of a server, and the acquisition module is also used for acquiring a scheduling strategy, and the scheduling strategy comprises three modes of load, full load and self-definition;
the receiving module is used for receiving a first instruction for starting a first micro service, wherein the first instruction comprises the first micro service and a corresponding scheduling strategy, the scheduling strategy is a server rule for selecting and executing the first micro service based on at least one set in the server information, the receiving module is also used for receiving a third instruction for starting the micro service when the scheduling strategy is in a user-defined mode, and the third instruction comprises a hardware resource score and a corresponding hardware resource weight;
and the selection module is used for selecting a preferred server meeting the scheduling strategy from the servers according to the server information and the first instruction to serve as a server for executing the first micro service, and is also used for calculating a total score of remaining hardware resources according to the hardware resource score, the hardware resource weight and the remaining hardware resources of the third instruction, and selecting a candidate server with the highest total score of the remaining hardware resources as the preferred server.
10. A microservice scheduling apparatus comprising a processor, a memory coupled to the processor, wherein the memory stores program instructions for implementing the microservice scheduling method of any of claims 1-8;
the processor is configured to execute the program instructions stored by the memory to select a server to execute a microservice.
11. A storage device, characterized in that a program file capable of implementing the micro-service scheduling method according to any one of claims 1 to 8 is stored.
CN201911040189.6A 2019-10-29 2019-10-29 Micro-service scheduling method, device, equipment and storage device Active CN110806930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911040189.6A CN110806930B (en) 2019-10-29 2019-10-29 Micro-service scheduling method, device, equipment and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911040189.6A CN110806930B (en) 2019-10-29 2019-10-29 Micro-service scheduling method, device, equipment and storage device

Publications (2)

Publication Number Publication Date
CN110806930A CN110806930A (en) 2020-02-18
CN110806930B true CN110806930B (en) 2022-08-09

Family

ID=69489495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911040189.6A Active CN110806930B (en) 2019-10-29 2019-10-29 Micro-service scheduling method, device, equipment and storage device

Country Status (1)

Country Link
CN (1) CN110806930B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568411B (en) * 2021-07-30 2023-10-27 深圳市新盒科技有限公司 Machine trolley scheduling system for track map
CN115145734B (en) * 2022-08-31 2022-11-25 北京睿企信息科技有限公司 Data processing system for distributing GPU

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833580A (en) * 2018-07-02 2018-11-16 北京天华星航科技有限公司 A kind of cloud data processing method, device and cloud computing system
CN109656699A (en) * 2018-12-14 2019-04-19 平安医疗健康管理股份有限公司 Distributed computing method, device, system, equipment and readable storage medium storing program for executing
CN109729131A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of processing method of application request, device and router
CN109933420A (en) * 2019-04-02 2019-06-25 深圳市网心科技有限公司 Node tasks dispatching method, electronic equipment and system
CN110008024A (en) * 2019-04-02 2019-07-12 广西大学 Container dispatching method and device based on Delayed Decision under a kind of Multi-dimensional constraint
CN110311987A (en) * 2019-07-24 2019-10-08 中南民族大学 Node scheduling method, apparatus, equipment and the storage medium of microserver

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9917746B2 (en) * 2014-11-04 2018-03-13 Futurewei Technologies, Inc. Adaptive allocation of server resources

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109729131A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of processing method of application request, device and router
CN108833580A (en) * 2018-07-02 2018-11-16 北京天华星航科技有限公司 A kind of cloud data processing method, device and cloud computing system
CN109656699A (en) * 2018-12-14 2019-04-19 平安医疗健康管理股份有限公司 Distributed computing method, device, system, equipment and readable storage medium storing program for executing
CN109933420A (en) * 2019-04-02 2019-06-25 深圳市网心科技有限公司 Node tasks dispatching method, electronic equipment and system
CN110008024A (en) * 2019-04-02 2019-07-12 广西大学 Container dispatching method and device based on Delayed Decision under a kind of Multi-dimensional constraint
CN110311987A (en) * 2019-07-24 2019-10-08 中南民族大学 Node scheduling method, apparatus, equipment and the storage medium of microserver

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Application deployment using Microservice and Docker containers: Framework and optimization;Wan, Xili;《JOURNAL OF NETWORK AND COMPUTER APPLICATIONS》;20181001;第119卷;第97-109页 *
基于微服务的工作流技术在云管平台的应用;罗钦凯;《计算机技术与发展》;20191014;第29卷(第9期);第122-127页 *

Also Published As

Publication number Publication date
CN110806930A (en) 2020-02-18

Similar Documents

Publication Publication Date Title
US10877639B2 (en) Page shortcut display method, apparatus, terminal, and server, and storage medium
CN109992422A (en) A kind of method for scheduling task towards GPU resource, device and system
CN110806930B (en) Micro-service scheduling method, device, equipment and storage device
CN110286838B (en) Processing method, device, terminal and storage medium of session object
CN112114950A (en) Task scheduling method and device and cluster management system
KR20180009352A (en) Method and apparatus for data processing for mobile games
CN109213493B (en) Container deployment method, special resource management terminal and readable storage medium
CN114416352A (en) Computing resource allocation method and device, electronic equipment and storage medium
CN114461382A (en) Flexibly configurable computing power scheduling implementation method and device and storage medium
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN115033352A (en) Task scheduling method, device and equipment for multi-core processor and storage medium
CN112364005B (en) Data synchronization method, device, computer equipment and storage medium
CN102511041A (en) Attributing causality to program execution capacity modifications and dynamically modifying program execution capacity
CN109658187A (en) Recommend method, apparatus, storage medium and the electronic equipment of cloud service provider
CN113034178A (en) Multi-system integral calculation method and device, terminal equipment and storage medium
CN117331668A (en) Job scheduling method, device, equipment and storage medium
CN111475251A (en) Cluster container scheduling method, system, terminal and storage medium
CN109634812A (en) Process CPU usage control method, terminal device and the storage medium of linux system
CN109960572B (en) Equipment resource management method and device and intelligent terminal
US11950173B2 (en) Method of determining shared service index based on shared service of communication credential
CN110119300A (en) The load-balancing method and device of dummy unit cluster
US10601905B2 (en) Priority switching based on resource usage patterns
CN109688177B (en) Data synchronization method and device, equipment and storage medium
CN112104682A (en) Intelligent distribution method and system for cloud desktop server, storage medium and central control server
CN111831130A (en) Input content recommendation method, terminal device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant