CN116302453B - Task scheduling method and device for quantum electronic hybrid platform - Google Patents
Task scheduling method and device for quantum electronic hybrid platform Download PDFInfo
- Publication number
- CN116302453B CN116302453B CN202310571867.1A CN202310571867A CN116302453B CN 116302453 B CN116302453 B CN 116302453B CN 202310571867 A CN202310571867 A CN 202310571867A CN 116302453 B CN116302453 B CN 116302453B
- Authority
- CN
- China
- Prior art keywords
- node
- tasks
- virtual
- task
- time length
- 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
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/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation 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/5038—Allocation 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 execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- 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/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation 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/505—Allocation 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Computational Mathematics (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a task scheduling method and device of a quantum electronic hybrid platform, and relates to the technical field of quantum computing, wherein the method comprises the following steps: determining the current running state of each node in the quantum electronic hybrid platform; for each node, perform: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node; acquiring a current real task to be scheduled; and scheduling the real tasks according to the expected time for each node to complete each virtual task. According to the scheme, the task processing efficiency can be improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of quantum computing, in particular to a task scheduling method and device of a quantum electronic hybrid platform.
Background
Quantum computers have a great advantage over traditional electronic computers. The electronic computer has only two states of 0 and 1, while the quantum computer can comprise a coherent superposition state of 0 and 1, and for a computer with N bits, the quantum computer can operate 2N groups of data at a time, and the electronic computer can only process one group of data. Therefore, based on the parallel processing principle of quantum computers, the computation speed of quantum computers is faster than that of electronic computers.
At present, the system is a hybrid platform of a quantum computer and an electronic computer, and when task scheduling is carried out, the task scheduling is carried out according to the computing capacity of the computer, and the task is distributed to the computer with the maximum computing capacity. However, this approach may result in the most computationally powerful computer being full of tasks for a period of time, and another portion of the computers being idle or less task-efficient, resulting in less task processing.
Disclosure of Invention
The embodiment of the invention provides a task scheduling method and device for a quantum electronic hybrid platform, which can improve task processing efficiency.
In a first aspect, an embodiment of the present invention provides a task scheduling method for a quantum electronic hybrid platform, including:
determining the current running state of each node in the quantum electronic hybrid platform;
for each node, perform: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
acquiring a current real task to be scheduled;
and scheduling the real tasks according to the expected time for each node to complete each virtual task.
In one possible implementation, the specified number of scheduled virtual tasks varies for different nodes; before the determining the expected time for completing each virtual task after scheduling the specified number of virtual tasks for the node, further comprising:
determining a first processing time length required by the node for a task which is currently scheduled and not processed according to the current running state of the node;
judging whether the first processing time length is smaller than a set time length or not; if yes, determining the maximum number of the additional processing tasks within the set time length; the maximum number is determined as the specified number of scheduled virtual tasks for the node.
In one possible implementation, the determining the maximum number of additional processing tasks within the set length of time includes:
determining whether the node is a quantum node, if so, determining the quantum line number of the quantum node, determining the maximum number of the quantum node which can process tasks in a single quantum line within the residual time length, and determining the product of the maximum number and the quantum line number as the maximum number of the quantum node which can additionally process tasks within the set time length; the remaining time length is the difference value between the set time length and the first processing time length.
In one possible implementation, the determining the expected time to complete each virtual task after scheduling the specified number of virtual tasks for the node includes:
determining a second processing time length required by the node to process a single virtual task;
and determining the expected time for completing each virtual task after the virtual task with the specified number is scheduled for the node according to the first processing time length, the second processing time length and the specified number of the virtual tasks scheduled for the node.
In one possible implementation manner, the scheduling the real task according to the expected time for each node to complete each virtual task includes:
based on the expected time for each node to complete each virtual task, sequencing the virtual tasks according to the sequence of the expected time;
based on the receiving time of the real tasks, sequencing the real tasks according to the sequence of the receiving time;
establishing a one-to-one mapping relation between the ordered real tasks and the ordered virtual tasks;
and dispatching the real task to the node corresponding to the virtual task mapped by the real task according to the mapping relation.
In one possible implementation manner, the establishing a mapping relationship between the ordered real tasks and the ordered virtual tasks includes:
mapping the real tasks and the virtual tasks with the same sequencing positions to obtain an initial mapping relation;
determining whether at least one target virtual task sequenced last in the initial mapping relation corresponds to the same quantum node and the corresponding expected time is the same;
if yes, determining whether the ratio of the number of the at least one target virtual task to the number of the quantum circuits in the quantum node exceeds a set ratio; if the initial mapping relation is exceeded, the initial mapping relation is used as the established mapping relation; if the virtual tasks do not exceed the preset number, determining whether the electronic nodes corresponding to the virtual tasks with the preset number exist in the initial mapping relation according to the sequence from the rear to the front of the sequencing positions, if so, deleting the virtual tasks with the preset number from the sequencing, and mapping the real tasks and the virtual tasks with the same sequencing positions based on the virtual tasks after the re-sequencing to obtain the established mapping relation.
In one possible implementation, the ratio of the sum of the set number and the number of the at least one target virtual task to the number of quantum wires in the quantum node exceeds the set ratio and is not greater than 1.
In a second aspect, an embodiment of the present invention further provides a task scheduling device of a quantum electronic hybrid platform, including:
a state determining unit, configured to determine a current operation state of each node in the quantum electronic hybrid platform;
an expectation determining unit configured to perform, for each node: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
the task acquisition unit is used for acquiring a real task to be scheduled currently;
and the task scheduling unit is used for scheduling the real tasks according to the expected time for each node to complete each virtual task.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of the present specification is implemented.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform a method according to any of the embodiments of the present specification.
The embodiment of the invention provides a task scheduling method and device for a quantum electronic hybrid platform, which are used for determining the current running state of each node in the quantum electronic hybrid platform, so that the expected time for completing each virtual task after scheduling a specified number of virtual tasks for each node can be determined according to the running state, and real tasks are scheduled according to the expected time of the virtual tasks, so that the computing resources and load conditions of each node can be balanced, the real tasks can be processed as soon as possible, and the task processing efficiency can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a task scheduling method for a quantum electronic hybrid platform according to an embodiment of the present invention;
FIG. 2 is a hardware architecture diagram of an electronic device according to an embodiment of the present invention;
FIG. 3 is a diagram of a task scheduler of a quantum electronic hybrid platform according to an embodiment of the present invention;
fig. 4 is a block diagram of a task scheduling device of another quantum electronic hybrid platform according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a task scheduling method for a quantum electronic hybrid platform, where the method includes:
step 100, determining the current running state of each node in the quantum electronic hybrid platform;
step 102, for each node, performs: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
104, acquiring a real task to be currently scheduled;
and step 106, scheduling the real tasks according to the expected time for each node to complete each virtual task.
In the embodiment of the invention, the current running state of each node in the quantum electronic hybrid platform is determined, so that the expected time for completing each virtual task after scheduling the virtual tasks with the specified number for each node can be determined according to the running state, and the real tasks are scheduled according to the expected time of the virtual tasks, so that the computing resources and load conditions of each node can be balanced, the real tasks can be processed as soon as possible, and the task processing efficiency can be improved.
The manner in which the individual steps shown in fig. 1 are performed is described below.
First, for step 100 "determine the current operating state of each node in the quantum electronic hybrid platform" and step 102 "are performed for each node: according to the current running state of the node, the expected time for completing each virtual task after the node is scheduled with the specified number of virtual tasks is determined and explained simultaneously.
In the embodiment of the invention, the quantum electronic hybrid platform comprises a plurality of quantum nodes and a plurality of electronic nodes, and the quantum electronic hybrid platform also comprises a scheduling node for executing the task scheduling method in the embodiment, wherein the scheduling node is used for receiving real tasks respectively sent by a plurality of user servers, and the scheduling node evenly schedules the real tasks to each node based on the running state of each node in the quantum electronic hybrid platform.
In embodiments of the present invention, the operating state may include at least computing resources and load conditions. The computing resource may derive the computing power of the node to process the task, with the load condition being the task that is currently scheduled but not processed.
In order to ensure that the real tasks can be processed in time after the real tasks are scheduled to the corresponding nodes, and improve the processing efficiency of the real tasks, in the embodiment of the invention, the expected time for completing each virtual task after the virtual tasks with the specified number are scheduled for the nodes can be determined, so that the real tasks are scheduled according to the expected time of the virtual tasks. That is, if a specified number of virtual tasks are scheduled for each node, each virtual task corresponds to an expected time, for example, the number of virtual tasks is 30, and 30 virtual tasks are respectively scheduled to three nodes, then the expected time of the virtual tasks 1-30 after each node processes the virtual tasks can be obtained.
Considering that there may be tasks that are currently scheduled and not processed in the node, the node needs to process the tasks that are currently scheduled and not processed first, and when the tasks are processed, other tasks can be processed, so if the actual tasks that are currently needed to be scheduled are scheduled to the node, waiting is needed. Moreover, the computing resources and load states of the different nodes are different, so that the designated number of virtual tasks scheduled for the different nodes may also be different.
In one embodiment of the present invention, to determine a specified number of virtual tasks to schedule to each node, the following process may be performed for each node:
a1: determining a first processing time length required by the node for a task which is currently scheduled and not processed according to the current running state of the node;
a2: judging whether the first processing time length is smaller than a set time length or not; if yes, determining the maximum number of the additional processing tasks within the set time length; the maximum number is determined as the specified number of scheduled virtual tasks for the node.
In step A1, a first processing time length required by each node for the task which is currently scheduled and not processed is calculated, wherein the first processing time length is a waiting time length required by the real task which is scheduled to the node again.
In step A2, if the first processing duration is not less than the set time duration, the waiting duration is longer, and the task processing efficiency is affected, and the current real task to be scheduled does not need to be scheduled to the node.
The determination mode of the set time length is as follows:
for each node, perform: after all real tasks to be scheduled currently are scheduled to the node, calculating third processing time length for the node to process and complete all real tasks, and calculating fourth processing time length of the node; the fourth processing time length is the sum of the first processing time length and the third processing time length of the node;
and taking the minimum fourth processing duration in the plurality of nodes as the set time length.
If the first processing duration of a certain node is smaller than the set time length, the node can additionally process other tasks, and if the first processing duration of the certain node is not smaller than the set time length, the node does not process the tasks which are already scheduled and are not processed, and one node can process all real tasks to be scheduled currently, so that the node does not need to schedule new real tasks.
By determining the set time length in the above manner, instead of arbitrarily setting, the problem that the number of virtual tasks to be scheduled is large due to the overlong set time length, which results in increased calculation amount, and the problem that the number of virtual tasks to be scheduled is small due to the overlong set time length, which results in that part of real tasks cannot be mapped with the virtual tasks, can be avoided, and further the scheduling of the real tasks is affected.
In the embodiment of the invention, since the processing speeds of the quantum node and the electronic node are different when processing tasks, and the quantum node can process multiple groups of data at the same time each time, when determining the maximum number, specifically, determining the maximum number of the tasks which can be additionally processed within the set time length for the quantum node comprises the following steps:
determining whether the node is a quantum node, if so, determining the quantum line number of the quantum node, determining the maximum number of the quantum node which can process tasks in a single quantum line within the residual time length, and determining the product of the maximum number and the quantum line number as the maximum number of the quantum node which can additionally process tasks within the set time length; the remaining time length is the difference value between the set time length and the first processing time length.
For example, the number of quantum wires of the quantum node is 10, that is, the quantum node can process 10 tasks at the same time at the maximum, and the maximum number of tasks that can be processed by each quantum wire in the remaining time period is 2 tasks, so the designated number of the quantum node is 20. That is, if 20 virtual tasks are scheduled to the quantum node, every two virtual tasks are allocated to one quantum wire.
After determining the specified number for each node, in one embodiment of the present invention, the expected time to complete each virtual task after scheduling the specified number of virtual tasks for the node may be determined by:
b1: determining a second processing time length required by the node to process a single virtual task;
b2: and determining the expected time for completing each virtual task after the virtual task with the specified number is scheduled for the node according to the first processing time length, the second processing time length and the specified number of the virtual tasks scheduled for the node.
For the electronic node, in step B2, the expected time for each virtual task is:
T i (i=1,2,…,n)=T a +T b ×i。
wherein T is i For the expected time of the ith virtual task of a specified number n (n is a positive integer) of virtual tasks scheduled to the node, T a For a first processing time period, T, required by the node for the task which is currently scheduled and not processed b A second processing time period required to process a single virtual task for the node.
For a quantum node, in step B2, the specified number n of virtual tasks scheduled to the quantum node is evenly allocated into n/m groups in advance, where n/m is a positive integer, m is the number of quantum wires in the quantum node, and is a positive integer, and the expected time of the virtual tasks in each group is:
T j (j=1,2,…,n/m)=T a +T b ×j。
wherein T is j For the expected time of the j-th group of virtual tasks among the specified number n of virtual tasks scheduled to the node (n is a positive integer), T a For a first processing time period, T, required by the node for the task which is currently scheduled and not processed b A second processing time period required to process a single virtual task for a single quantum wire of the node.
Finally, the real tasks to be scheduled are scheduled according to the expected time of each node to complete each virtual task according to the step 104 and the step 106, and the simultaneous description is performed on the real tasks.
The current real tasks to be scheduled are sent by a plurality of user servers within a time period, and each real task corresponds to a receiving time.
In one embodiment of the present invention, the real tasks may be scheduled in the following manner:
c1: based on the expected time for each node to complete each virtual task, sequencing the virtual tasks according to the sequence of the expected time;
c2: based on the receiving time of the real tasks, sequencing the real tasks according to the sequence of the receiving time;
and C3: establishing a one-to-one mapping relation between the ordered real tasks and the ordered virtual tasks;
and C4: and dispatching the real task to the node corresponding to the virtual task mapped by the real task according to the mapping relation.
It can be seen that, after the virtual tasks are ordered according to the expected time sequence and the real tasks are ordered according to the receiving time sequence, the real tasks arranged at the forefront position are received first, and the virtual tasks arranged at the forefront position are processed and completed first, so that the real tasks and the virtual tasks with the same ordering position can be mapped based on the first-in first-out principle, and the mapping relation is obtained. After the real tasks are scheduled according to the mapping relation, the real tasks received first can be processed and completed first, so that timeliness of task processing can be guaranteed.
Considering that the resource loss of the quantum node is large in the operation process, and in order to ensure the maximum utilization rate of the quantum node computing resource, all quantum circuits can be used as much as possible when task processing is performed each time, so that in one embodiment of the invention, the mapping relation can be established by the following way:
c31: mapping the real tasks and the virtual tasks with the same sequencing positions to obtain an initial mapping relation;
because the number of virtual tasks is greater than the number of real tasks, the initial mapping relationship contains all real tasks and part of virtual tasks.
C32: determining whether at least one target virtual task sequenced last in the initial mapping relation corresponds to the same quantum node and the corresponding expected time is the same;
if yes, determining whether the ratio of the number of the at least one target virtual task to the number of the quantum circuits in the quantum node exceeds a set ratio; if the initial mapping relation is exceeded, the initial mapping relation is used as the established mapping relation; if the virtual tasks do not exceed the preset number, determining whether the electronic nodes corresponding to the virtual tasks with the preset number exist in the initial mapping relation according to the sequence from the rear to the front of the sequencing positions, if so, deleting the virtual tasks with the preset number from the sequencing, and mapping the real tasks and the virtual tasks with the same sequencing positions based on the virtual tasks after the re-sequencing to obtain the established mapping relation.
In step C32, when determining whether the last at least one target virtual task in the initial mapping relationship corresponds to the same quantum node and the corresponding expected time is the same, specifically, the method may include: judging whether a last virtual task sequenced in an initial mapping relation corresponds to a quantum node, if so, taking the quantum node as a target quantum node, taking the last virtual task sequenced in the initial mapping relation as a first virtual task, judging whether at least one second virtual task continuous with the first virtual task simultaneously corresponds to the target quantum node, and taking the first virtual task and at least one second virtual task as target virtual tasks if the second virtual task is the same as the expected time corresponding to the first virtual task; and if the virtual task does not exist, taking the first virtual task as a target virtual task.
And the ratio of the sum of the set number and the number of the at least one target virtual task to the number of quantum circuits in the quantum node exceeds the set ratio and is not more than 1.
For example, after 10 real tasks to be scheduled are ordered according to the sequence of the receiving time, the real tasks are respectively P1, P2, P3, …, and P10, and 30 virtual tasks are ordered according to the sequence of the expected time, and then the real tasks are respectively Q1, Q2, Q3, …, and Q30, and then the initial mapping relationship is as shown in table 1:
table 1:
the virtual tasks Q8-Q10 correspond to the quantum nodes and have the same expected time, the quantum nodes are provided with 5 quantum circuits, at the moment, the ratio of the number of the at least one target virtual task to the number of the quantum circuits in the quantum nodes is 0.6, and the set ratio is 0.8, so that the set number is 1 or 2. If the virtual tasks Q3 and Q4 correspond to the electronic nodes, the mapping relationship re-established after deleting the virtual tasks Q3 and Q4 is shown in table 2:
table 2:
therefore, the real tasks P6-P10 can be scheduled to the same quantum node, so that the maximum utilization rate of the quantum node computing resources is ensured, and the processing efficiency of each real task can be ensured.
As shown in fig. 2 and 3, the embodiment of the invention provides a task scheduling device of a quantum electronic hybrid platform. The apparatus embodiments may be implemented by software, or may be implemented by hardware or a combination of hardware and software. In terms of hardware, as shown in fig. 2, a hardware architecture diagram of an electronic device where a task scheduling device of a quantum electronic hybrid platform provided by an embodiment of the present invention is located, where the electronic device where the embodiment is located may include other hardware, such as a forwarding chip responsible for processing a packet, besides a processor, a memory, a network interface, and a nonvolatile memory shown in fig. 2. Taking a software implementation as an example, as shown in fig. 3, the device in a logic sense is formed by reading a corresponding computer program in a nonvolatile memory into a memory by a CPU of an electronic device where the device is located and running the computer program. The task scheduling device of the quantum electronic hybrid platform provided in this embodiment includes:
a state determining unit 301, configured to determine a current operation state of each node in the quantum electronic hybrid platform;
the expectation determining unit 302 is configured to perform, for each node: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
a task obtaining unit 303, configured to obtain a real task to be currently scheduled;
and the task scheduling unit 304 is configured to schedule the real task according to an expected time for each node to complete each virtual task.
In one embodiment of the invention, the number of assignments of virtual tasks scheduled for different nodes is different; referring to fig. 4, the apparatus may further include:
a number determining unit 305, configured to determine, according to a current running state of the node, a first processing duration required by the node for a task that is currently scheduled and not processed to be completed; judging whether the first processing time length is smaller than a set time length or not; if yes, determining the maximum number of the additional processing tasks within the set time length; the maximum number is determined as the specified number of scheduled virtual tasks for the node.
In one embodiment of the present invention, the number determining unit, when determining the maximum number of additional processing tasks within the set time period, specifically includes:
determining whether the node is a quantum node, if so, determining the quantum line number of the quantum node, determining the maximum number of the quantum node which can process tasks in a single quantum line within the residual time length, and determining the product of the maximum number and the quantum line number as the maximum number of the quantum node which can additionally process tasks within the set time length; the remaining time length is the difference value between the set time length and the first processing time length.
In one embodiment of the present invention, the expected determining unit, when determining an expected time for completing each virtual task after scheduling a specified number of virtual tasks for the node, specifically includes:
determining a second processing time length required by the node to process a single virtual task; and determining the expected time for completing each virtual task after the virtual task with the specified number is scheduled for the node according to the first processing time length, the second processing time length and the specified number of the virtual tasks scheduled for the node.
In one embodiment of the present invention, the task scheduling unit is specifically configured to: based on the expected time for each node to complete each virtual task, sequencing the virtual tasks according to the sequence of the expected time; based on the receiving time of the real tasks, sequencing the real tasks according to the sequence of the receiving time; establishing a one-to-one mapping relation between the ordered real tasks and the ordered virtual tasks; and dispatching the real task to the node corresponding to the virtual task mapped by the real task according to the mapping relation.
In one embodiment of the present invention, when executing the mapping relationship that establishes a one-to-one correspondence between the ordered real tasks and the ordered virtual tasks, the task scheduling unit specifically includes:
mapping the real tasks and the virtual tasks with the same sequencing positions to obtain an initial mapping relation;
determining whether at least one target virtual task sequenced last in the initial mapping relation corresponds to the same quantum node and the corresponding expected time is the same;
if yes, determining whether the ratio of the number of the at least one target virtual task to the number of the quantum circuits in the quantum node exceeds a set ratio; if the initial mapping relation is exceeded, the initial mapping relation is used as the established mapping relation; if the virtual tasks do not exceed the preset number, determining whether the electronic nodes corresponding to the virtual tasks with the preset number exist in the initial mapping relation according to the sequence from the rear to the front of the sequencing positions, if so, deleting the virtual tasks with the preset number from the sequencing, and mapping the real tasks and the virtual tasks with the same sequencing positions based on the virtual tasks after the re-sequencing to obtain the established mapping relation.
In one embodiment of the present invention, the ratio of the sum of the set number and the number of the at least one target virtual task to the number of quantum wires in the quantum node exceeds the set ratio and is not greater than 1.
It will be appreciated that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on a task scheduling device of a quantum electronic hybrid platform. In other embodiments of the invention, a task scheduler of a quantum electronic hybrid platform may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the modules in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
The embodiment of the invention also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the task scheduling method of the quantum electronic hybrid platform in any embodiment of the invention is realized.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the task scheduling method of the quantum electronic hybrid platform in any embodiment of the invention.
Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion module connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion module is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
It is noted that relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of additional identical elements in a process, method, article or apparatus that comprises the element.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: various media in which program code may be stored, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (9)
1. The task scheduling method of the quantum electronic hybrid platform is characterized by comprising the following steps of:
determining the current running state of each node in the quantum electronic hybrid platform;
for each node, perform: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
acquiring a current real task to be scheduled;
scheduling the real tasks according to the expected time for each node to complete each virtual task;
scheduling the specified number of virtual tasks for different nodes is different; before the determining the expected time for completing each virtual task after scheduling the specified number of virtual tasks for the node, further comprising: determining a first processing time length required by the node for a task which is currently scheduled and not processed according to the current running state of the node; judging whether the first processing time length is smaller than a set time length or not; if yes, determining the maximum number of the additional processing tasks within the set time length; determining the maximum number as a specified number of scheduled virtual tasks for the node; calculating a first processing time length required by each node for a task which is currently scheduled and not processed, wherein the first processing time length is a waiting time length required by a real task which is scheduled to the node again;
the determination mode of the set time length is as follows: for each node, perform: after all real tasks to be scheduled currently are scheduled to the node, calculating third processing time length for the node to process and complete all real tasks, and calculating fourth processing time length of the node; the fourth processing time length is the sum of the first processing time length and the third processing time length of the node; and taking the minimum fourth processing duration in the plurality of nodes as the set time length.
2. The method of claim 1, wherein the determining the maximum number of additional processing tasks within the set length of time comprises:
determining whether the node is a quantum node, if so, determining the quantum line number of the quantum node, determining the maximum number of the quantum node which can process tasks in a single quantum line within the residual time length, and determining the product of the maximum number and the quantum line number as the maximum number of the quantum node which can additionally process tasks within the set time length; the remaining time length is the difference value between the set time length and the first processing time length.
3. The method of claim 2, wherein determining the expected time to complete each virtual task after scheduling a specified number of virtual tasks for the node comprises:
determining a second processing time length required by the node to process a single virtual task;
and determining the expected time for completing each virtual task after the virtual task with the specified number is scheduled for the node according to the first processing time length, the second processing time length and the specified number of the virtual tasks scheduled for the node.
4. The method of claim 1, wherein scheduling the real tasks according to the expected time for each node to complete each virtual task comprises:
based on the expected time for each node to complete each virtual task, sequencing the virtual tasks according to the sequence of the expected time;
based on the receiving time of the real tasks, sequencing the real tasks according to the sequence of the receiving time;
establishing a one-to-one mapping relation between the ordered real tasks and the ordered virtual tasks;
and dispatching the real task to the node corresponding to the virtual task mapped by the real task according to the mapping relation.
5. The method of claim 4, wherein the establishing a one-to-one mapping relationship between the ordered real tasks and the ordered virtual tasks comprises:
mapping the real tasks and the virtual tasks with the same sequencing positions to obtain an initial mapping relation;
determining whether at least one target virtual task sequenced last in the initial mapping relation corresponds to the same quantum node and the corresponding expected time is the same;
if yes, determining whether the ratio of the number of the at least one target virtual task to the number of the quantum circuits in the quantum node exceeds a set ratio; if the initial mapping relation is exceeded, the initial mapping relation is used as the established mapping relation; if the virtual tasks do not exceed the preset number, determining whether the electronic nodes corresponding to the virtual tasks with the preset number exist in the initial mapping relation according to the sequence from the rear to the front of the sequencing positions, if so, deleting the virtual tasks with the preset number from the sequencing, and mapping the real tasks and the virtual tasks with the same sequencing positions based on the virtual tasks after the re-sequencing to obtain the established mapping relation.
6. The method of claim 5, wherein a ratio of a sum of the set number and the number of the at least one target virtual task to a number of quantum wires in the quantum node exceeds the set ratio and is no greater than 1.
7. A task scheduling device of a quantum electronic hybrid platform, comprising:
a state determining unit, configured to determine a current operation state of each node in the quantum electronic hybrid platform;
an expectation determining unit configured to perform, for each node: determining the expected time for completing each virtual task after dispatching the virtual tasks with the designated number for the node according to the current running state of the node;
the task acquisition unit is used for acquiring a real task to be scheduled currently;
the task scheduling unit is used for scheduling the real tasks according to the expected time for each node to complete each virtual task;
scheduling the specified number of virtual tasks for different nodes is different; the apparatus further comprises: the quantity determining unit is used for determining a first processing time length required by the node for the task which is currently scheduled and is not processed according to the current running state of the node; judging whether the first processing time length is smaller than a set time length or not; if yes, determining the maximum number of the additional processing tasks within the set time length; determining the maximum number as a specified number of scheduled virtual tasks for the node; calculating a first processing time length required by each node for a task which is currently scheduled and not processed, wherein the first processing time length is a waiting time length required by a real task which is scheduled to the node again;
the determination mode of the set time length is as follows: for each node, perform: after all real tasks to be scheduled currently are scheduled to the node, calculating third processing time length for the node to process and complete all real tasks, and calculating fourth processing time length of the node; the fourth processing time length is the sum of the first processing time length and the third processing time length of the node; and taking the minimum fourth processing duration in the plurality of nodes as the set time length.
8. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method of any of claims 1-6 when the computer program is executed.
9. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310571867.1A CN116302453B (en) | 2023-05-22 | 2023-05-22 | Task scheduling method and device for quantum electronic hybrid platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310571867.1A CN116302453B (en) | 2023-05-22 | 2023-05-22 | Task scheduling method and device for quantum electronic hybrid platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116302453A CN116302453A (en) | 2023-06-23 |
CN116302453B true CN116302453B (en) | 2023-08-01 |
Family
ID=86794583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310571867.1A Active CN116302453B (en) | 2023-05-22 | 2023-05-22 | Task scheduling method and device for quantum electronic hybrid platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116302453B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117234696B (en) * | 2023-11-13 | 2024-01-19 | 北京控制工程研究所 | Determination method and device for multitasking execution strategy of high-frequency GNC system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108628674A (en) * | 2018-05-11 | 2018-10-09 | 深圳市零度智控科技有限公司 | Method for scheduling task, cloud platform based on cloud platform and computer storage media |
CN108874538B (en) * | 2018-05-31 | 2020-10-13 | 合肥本源量子计算科技有限责任公司 | Scheduling server, scheduling method and application method for scheduling quantum computer |
CN113010302B (en) * | 2021-02-02 | 2022-11-01 | 中国人民解放军战略支援部队信息工程大学 | Multi-task scheduling method and system under quantum-classical hybrid architecture and quantum computer system architecture |
CN113326111A (en) * | 2021-05-11 | 2021-08-31 | 山东浪潮科学研究院有限公司 | Distributed monitoring and scheduling method for quantum computer cluster |
-
2023
- 2023-05-22 CN CN202310571867.1A patent/CN116302453B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN116302453A (en) | 2023-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111768006B (en) | Training method, device, equipment and storage medium for artificial intelligent model | |
CN115328663B (en) | Method, device, equipment and storage medium for scheduling resources based on PaaS platform | |
CN103348640B (en) | Relay | |
US8843929B1 (en) | Scheduling in computer clusters | |
CN113138860B (en) | Message queue management method and device | |
CN116302453B (en) | Task scheduling method and device for quantum electronic hybrid platform | |
CN115134371A (en) | Scheduling method, system, equipment and medium containing edge network computing resources | |
CN113762830B (en) | Order splitting processing method, device, equipment and readable storage medium | |
CN105824705B (en) | A kind of method for allocating tasks and electronic equipment | |
CN113835823A (en) | Resource scheduling method and device, electronic equipment and computer readable storage medium | |
CN110166304A (en) | A kind of method of combination, device, electronic equipment and the storage medium of cross-domain SFC | |
CN111367655B (en) | Method, system and storage medium for GPU resource scheduling in cloud computing environment | |
CN101374109B (en) | Method and apparatus for scheduling packets | |
CN112650449B (en) | Method and system for releasing cache space, electronic device and storage medium | |
CN107741873A (en) | Method for processing business and device | |
CN112491742B (en) | Method and device for scheduling edge computing terminal resources | |
CN110958192B (en) | Virtual data center resource allocation system and method based on virtual switch | |
CN107402812A (en) | Cluster resource dispatching method, device, equipment and storage medium | |
CN111522647B (en) | Public cloud service leasing method capable of minimizing leasing cost | |
CN115509715A (en) | Distributed task scheduling method and device and electronic equipment | |
CN114610465A (en) | Task processing method and device and storage medium | |
CN107045457A (en) | A kind of method and device of multi-tenant resource-sharing | |
CN118349336B (en) | Method, device, equipment, medium and product for task processing in cloud computing platform | |
Skulysh et al. | Management of multiple stage queuing systems | |
CN113535388B (en) | Task-oriented service function aggregation method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |