Task execution method and device, electronic equipment and storage medium

By introducing parallel threads and two lists into the task execution device, the parallel execution of quantum computing tasks is realized, which solves the problem of long execution time when multiple users send tasks at the same time, improves quantum computing efficiency and prioritizes high-priority tasks.

CN119539106AActive Publication Date: 2025-02-28ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311124180.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-02-28
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

During the quantum computing process, when multiple users send quantum computing tasks at the same time, the task execution device needs to perform tasks one by one, resulting in a long execution time and affecting the efficiency of quantum computing.

Method used

Parallel execution of tasks is achieved by introducing parallel threads and two lists in the task execution device (the first list is used to cache tasks queued and waiting for execution, and the second list is used to cache tasks that meet preset parallel requirements). The specific steps include obtaining judgment results based on the current state, finding and cacheing tasks that meet the parallel requirements, and executing these tasks in parallel when there are idle threads.

Benefits of technology

The parallel execution of multiple quantum computing tasks is realized, which significantly improves the efficiency of quantum computing, reduces the time required for task acquisition, and prioritizes tasks with higher priority.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539106A_ABST
    Figure CN119539106A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task execution method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a first judgment result; when the first judgment result indicates that the search operation is performed in the first list, searching a quantum computing task meeting a preset parallel requirement in the first list according to a third quantum computing task which is being executed at the current moment in the parallel thread; obtaining the quantum computing task with the highest priority from the quantum computing tasks meeting the preset parallel requirement, and caching the quantum computing task to a second list; when it is determined that an idle thread exists in the parallel threads according to the fourth state, a fifth quantum computing task capable of being executed in parallel with the fourth quantum computing task is obtained from the second list; and executing the fifth quantum computing task by using the idle thread. Through the technical scheme provided by the embodiment of the invention, parallel execution of a plurality of quantum computing tasks is realized, and the quantum computing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of quantum computing technology, and in particular to a task execution method, device, electronic device and storage medium. Background Art

[0002] Quantum computing is a computational model that uses the basic properties of quantum mechanics to solve problems. It is achieved by building a quantum physics hardware system that can be precisely operated and running quantum computing software to implement quantum algorithms, solve computational problems, and apply quantum computing to specific problems or fields.

[0003] During the quantum computing process, users can directly send quantum computing tasks to the task execution device, which will execute the received quantum computing tasks and obtain the task execution results. For example, when the task execution device is a measurement and control device in a quantum computing measurement and control system, when the measurement and control device receives a quantum computing task such as a quantum state test sent by the user, it will execute the quantum computing task and obtain the corresponding task execution results.

[0004] In related technologies, when multiple users send quantum computing tasks to a task execution device at the same time, the task execution device will execute each quantum computing task in sequence according to the order of the received quantum computing tasks. The execution time of all quantum computing tasks is relatively long, which affects the efficiency of quantum computing. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a task execution method, device, electronic device and storage medium to realize the parallel execution of multiple quantum computing tasks and improve the efficiency of quantum computing. The specific technical solution is as follows:

[0006] The present application provides a task execution method, the method comprising:

[0007] Obtain a first judgment result according to a first state of the first list, a second state of the second list, and a third state of the parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel;

[0008] When the first judgment result indicates to perform a search operation in the first list, searching the first list for a quantum computing task that meets a preset parallel requirement according to a third quantum computing task currently being executed in the parallel thread;

[0009] From the quantum computing tasks that meet the preset parallel requirements, obtain the quantum computing task with the highest priority and cache it in the second list;

[0010] When it is determined according to the fourth state that there is an idle thread in the parallel thread, obtaining a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task from the second list, the fourth state being the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task being the quantum computing task being executed in the parallel thread at the current moment;

[0011] The fifth quantum computing task is performed using the idle thread.

[0012] The present application also provides a task execution device, the device comprising:

[0013] A first acquisition module is used to acquire a first judgment result according to a first state of a first list, a second state of a second list, and a third state of a parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes a plurality of threads for executing quantum computing tasks in parallel;

[0014] A first search module, configured to search the first list for a quantum computing task that meets a preset parallel requirement according to a third quantum computing task currently being executed in the parallel thread when the first judgment result indicates that a search operation is to be performed in the first list;

[0015] A first cache module, configured to obtain a quantum computing task with the highest priority from quantum computing tasks that meet the preset parallel requirement and cache it in the second list;

[0016] a second acquisition module, configured to acquire, from the second list, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task when it is determined according to a fourth state that there is an idle thread in the parallel thread, wherein the fourth state is a thread state corresponding to each thread in the parallel thread at a current moment, and the fourth quantum computing task is a quantum computing task being executed in the parallel thread at a current moment;

[0017] An execution module is used to use the idle thread to execute the fifth quantum computing task.

[0018] The embodiment of the present application further provides an electronic device, characterized in that it includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0019] Memory, used to store computer programs;

[0020] The processor is used to implement any of the above-mentioned task execution method steps when executing the program stored in the memory.

[0021] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned task execution method steps is implemented.

[0022] An embodiment of the present application also provides a quantum computer to implement any of the task execution methods described above.

[0023] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned task execution methods.

[0024] Beneficial effects of the embodiments of the present invention:

[0025] The technical solution provided by the embodiment of the present invention, when the first judgment result indicates to perform a search operation in the first list, can search for quantum computing tasks that meet the preset parallel requirements in the first list according to the quantum computing tasks being executed in the parallel thread at the current moment, and cache the quantum computing tasks that meet the preset parallel requirements and have the highest priority to the second list. When it is determined that there are idle threads in the parallel threads according to the thread state corresponding to the parallel threads at the current moment, a quantum computing task that can be executed in parallel with the quantum computing task being executed at the current moment is obtained from the second list, that is, the fifth quantum computing task is obtained, and the fifth quantum computing task is executed using the idle thread. This allows the fifth quantum computing task to be executed in parallel with the quantum computing task currently being executed in the parallel thread, realizes the parallel execution of multiple quantum computing tasks, and improves the efficiency of quantum computing.

[0026] In addition, since the quantum computing tasks cached in the second list are second quantum computing tasks that meet the preset parallel requirements, the preset parallel requirements can be used to implement preliminary screening of the first quantum computing tasks cached in the first list, effectively reducing the number of quantum computing tasks cached in the second list. When there are idle threads in the parallel threads, the fifth quantum computing task can be directly obtained from the second list. Compared with the method of obtaining the fifth quantum computing task from the first list, the number of quantum computing tasks included in the screening sample is effectively reduced, and the time required to obtain the fifth quantum computing task is shortened, thereby shortening the idle time of the thread and improving the quantum computing efficiency.

[0027] Furthermore, since the priority corresponding to the quantum computing tasks cached in the second list is relatively high, this increases the probability that the quantum computing tasks with higher priority are cached in the second list, thereby increasing the probability that the quantum computing tasks with higher priority are executed first.

[0028] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A structural diagram of a task execution system in the related technology;

[0031] Figure 2 A schematic diagram of a first flow chart of a task execution method provided in an embodiment of the present application;

[0032] Figure 3 A second flowchart of the task execution method provided in an embodiment of the present application;

[0033] Figure 4 A third flow chart of the task execution method provided in the embodiment of the present application;

[0034] Figure 5 A fourth flow chart of the task execution method provided in the embodiment of the present application;

[0035] Figure 6 A fifth flow chart of the task execution method provided in the embodiment of the present application;

[0036] Figure 7 A sixth flow chart of the task execution method provided in the embodiment of the present application;

[0037] Figure 8 A seventh flow chart of the task execution method provided in the embodiment of the present application;

[0038] Fig. 9 An eighth flow chart of the task execution method provided in the embodiment of the present application;

[0039] Fig.10 A ninth flow chart of the task execution method provided in the embodiment of the present application;

[0040] Fig.11 A schematic diagram of the structure of a task execution device provided in an embodiment of the present application;

[0041] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] like Figure 1 As shown, Figure 1 FIG. 1 is a structural diagram of a task execution system in the related art. The task execution system includes a user terminal 101 and a task execution device 102. The task execution device 102 can be connected to multiple user terminals 101 for communication ( Figure 1 not shown).

[0044] Different users can send quantum computing tasks to be executed to the task execution device through their respective user terminals. The task execution device needs to process the quantum computing tasks it receives one by one to obtain the task execution results. Since all quantum computing tasks in the task execution device need to be executed one by one, it will take a long time to complete all quantum computing tasks.

[0045] In addition, with the increasing number of connected user terminals and the increasing number of quantum computing tasks that users need to perform, quantum computing tasks may be queued in the task execution devices, resulting in the inability to execute quantum computing tasks for a long time, affecting the user experience.

[0046] In order to solve the problems in the related art, the embodiment of the present application provides a task execution method. The method can be applied to any electronic device. Figure 2 As shown, Figure 2 A first flow chart of a task execution method provided in an embodiment of the present application. The method comprises the following steps.

[0047] Step S201, obtaining a first judgment result according to a first state of the first list at the current moment, a second state of the second list, and a third state of the parallel thread, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel.

[0048] Step S202: When the first judgment result indicates to perform a search operation in the first list, a quantum computing task that meets the preset parallel requirement is searched in the first list according to the third quantum computing task currently being executed in the parallel thread.

[0049] Step S203, obtaining the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements and caching it in the second list.

[0050] Step S204: When it is determined that there is an idle thread in the parallel thread according to the fourth state, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment.

[0051] Step S205, using the idle thread to execute the fifth quantum computing task.

[0052] In the embodiment of the present application, the electronic device may be the Figure 1 The task execution device that performs quantum computing tasks in the process may also be a server that connects the user end and the task execution device. The above electronic device is not specifically limited here.

[0053] In the above steps S201-S205, multi-level scheduling of quantum computing tasks is implemented. Among them, steps S201-S202 are high-level scheduling processes, step S203 is a mid-level scheduling process, and steps S204-S205 are low-level scheduling processes. For details about the scheduling process of each level, please refer to the description below, which will not be repeated here.

[0054] Through the method provided by the embodiment of the present application, when the first judgment result indicates that a search operation is to be performed in the first list, the quantum computing tasks in the first list that meet the preset parallel requirements can be searched according to the quantum computing tasks being executed in the parallel thread at the current moment, and the quantum computing tasks that meet the preset parallel requirements and have the highest priority are cached in the second list. When it is determined that there are idle threads in the parallel threads according to the thread state corresponding to the parallel threads at the current moment, a quantum computing task that can be executed in parallel with the quantum computing task being executed at the current moment is obtained from the second list, that is, the fifth quantum computing task is obtained, and the fifth quantum computing task is executed using the idle thread. This allows the fifth quantum computing task to be executed in parallel with the quantum computing task currently being executed in the parallel thread, realizing the parallel execution of multiple quantum computing tasks and improving the efficiency of quantum computing.

[0055] In addition, since the quantum computing tasks cached in the second list are second quantum computing tasks that meet the preset parallel requirements, the preset parallel requirements can be used to implement preliminary screening of the first quantum computing tasks cached in the first list, effectively reducing the number of quantum computing tasks cached in the second list. When there are idle threads in the parallel threads, the fifth quantum computing task can be directly obtained from the second list. Compared with the method of obtaining the fifth quantum computing task from the first list, the number of quantum computing tasks included in the screening sample is effectively reduced, and the time required to obtain the fifth quantum computing task is shortened, thereby shortening the idle time of the thread and improving the quantum computing efficiency.

[0056] Furthermore, since the priority corresponding to the quantum computing tasks cached in the second list is relatively high, this increases the probability that the quantum computing tasks with higher priority are cached in the second list, thereby increasing the probability that the quantum computing tasks with higher priority are executed first.

[0057] The embodiments of the present application are described below through specific examples.

[0058] For the above step S201, that is, according to the first state of the first list at the current moment, the second state of the second list and the third state of the parallel thread, a first judgment result is obtained, the first list is used to cache the first quantum computing tasks queued for execution, the second list is used to cache the second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel.

[0059] In the embodiment of the present application, a first list and a second list are cached in the electronic device.

[0060] For the above-mentioned first list, the first list is used to cache quantum computing tasks waiting to be executed (recorded as first quantum computing tasks). Each first quantum computing task is sent by a user to the above-mentioned electronic device through a user terminal. The electronic device can be connected to one or more user terminals at the same time. Whenever a user triggers a quantum computing task through a user terminal, the user terminal will send the quantum computing task to the electronic device. After receiving the quantum computing tasks sent by each user terminal, the electronic device can cache each quantum computing task in the first list according to the reception time of each quantum computing task.

[0061] For the above-mentioned second list, the second list is used to cache the second quantum computing task obtained from the first list. The second quantum computing task is the first quantum computing task in the first list that meets the preset parallel requirement and has the highest priority. Through the above-mentioned advanced scheduling process and intermediate scheduling process, the above-mentioned electronic device can filter out the second quantum computing task from the first list and cache the second quantum computing task to the second list.

[0062] The second quantum computing tasks cached in the second list may include: parallelizable quantum computing tasks and / or replaceable quantum computing tasks. The parallelizable quantum computing tasks are quantum computing tasks that can be executed in parallel with all quantum computing tasks currently being executed when searching for quantum computing tasks that meet the preset parallel requirements; the replaceable quantum computing tasks are quantum computing tasks that can replace the target quantum computing task in all quantum computing tasks currently being executed and executed in parallel with other quantum computing tasks when searching for quantum computing tasks that meet the preset parallel requirements.

[0063] For ease of understanding, when searching for quantum computing tasks that meet the preset parallel requirements, the quantum computing tasks being executed in the parallel threads are tasks 1-task 5 as an example for explanation. In the first list, the quantum computing tasks that can be executed in parallel with all quantum computing tasks in tasks 1-task 5 are parallelizable quantum computing tasks that meet the preset parallel requirements; for any quantum computing task in tasks 1-task 5, such as task 1, the quantum computing tasks that can be executed in parallel with the remaining quantum computing tasks (i.e., tasks 2-task 5) are replaceable quantum computing tasks that meet the preset parallel requirements (recorded as replaceable quantum computing tasks corresponding to task 1). The method for searching for quantum computing tasks that meet the preset parallel requirements can be found in the description below and will not be described in detail here.

[0064] In an optional embodiment, the number of second quantum computing tasks cached in the above second list is limited, that is, the number is a first preset number. Among them, the number of cached parallel quantum computing tasks is at most one, and the number of cached replaceable quantum computing tasks (recorded as the second preset number) is at most: the number of threads included in the above parallel threads. The first preset number is equal to the second preset number plus one. Here, the first preset number and the second preset number are not specifically limited.

[0065] For the first list, the second list, and the parallel threads, the electronic device can obtain a first judgment result based on the cache state of the first list (recorded as the first state), the cache state of the second list (recorded as the second state), and the thread state corresponding to each thread in the parallel threads (recorded as the third state) at the current moment. The first judgment result is used to indicate whether to perform a search operation in the first list.

[0066] In an optional embodiment, the first judgment result may indicate not to perform a search operation in the first list, or to perform a search operation in the first list. When the first judgment result indicates to perform a search operation in the first list, the first judgment result may indicate to search for parallelizable quantum computing tasks in the first list, or the first judgment result may indicate to search for replaceable quantum computing tasks in the first list. The determination of the first state, the second state, the third state and the first judgment result may be referred to the description below, which will not be described in detail here.

[0067] In an optional embodiment, the cached quantum computing tasks in the first list and the second list can be represented as: task information of the quantum computing tasks. The task information may include: the task identifier of the quantum computing task, and the parallel judgment data of the quantum computing task. The parallel judgment data is used to judge whether different quantum computing tasks can be executed in parallel. Alternatively, the task information may also include: the task identifier of the quantum computing task, and all the computing data required for the execution of the quantum computing task. Among them, the parallel judgment data is part of the total computing data. Here, the representation form of the quantum computing tasks cached in the first list and the second list is not specifically limited.

[0068] In the embodiment of the present application, the first list and the second list may be queues, data tables, etc. Here, the representation method of the first list and the second list is not specifically limited.

[0069] With respect to the above step S202, that is, when the first judgment result indicates to perform a search operation in the first list, a quantum computing task that meets the preset parallel requirement is searched in the first list according to the third quantum computing task currently being executed in the parallel thread.

[0070] In an optional embodiment, when the above-mentioned first judgment result indicates to search for parallel quantum computing tasks in the first category list, the electronic device can search for quantum computing tasks that can be executed in parallel with all third quantum computing tasks in the first list based on the quantum computing tasks being executed in the parallel thread at the current moment (recorded as third quantum computing tasks). That is, the quantum computing tasks in the first list that can be executed in parallel with the currently executing quantum computing tasks are the quantum computing tasks that meet the preset parallel requirements.

[0071] In another optional embodiment, when the first judgment result indicates to search for a replaceable quantum computing task in the first list, the electronic device can search for a replaceable second quantum computing task corresponding to a target quantum computing task that is being executed in a parallel thread and for which there is no corresponding replaceable quantum computing task in the first list. That is, in the first list, the quantum computing task that can be executed in parallel with all other third quantum computing tasks except the target quantum computing task is the quantum computing task that meets the preset parallel requirement.

[0072] The above-mentioned preset parallel requirement is used to measure whether any first quantum computing task in the first list can be executed in parallel with all quantum computing tasks currently being executed, or to measure whether any first quantum computing task in the first list can take over the target quantum computing task and be executed in parallel with other quantum computing tasks currently being executed.

[0073] In an optional embodiment, considering that the above parallel judgment data is used to judge whether different quantum computing tasks can be executed in parallel. Therefore, the above preset parallel requirement can be set according to the above parallel judgment data. For different parallel judgment data, the above preset parallel requirement will also be different. For the setting of the preset parallel requirement, please refer to the description below, which will not be described in detail here.

[0074] After executing the above steps S201-S202, the electronic device completes the above high-level scheduling process. At this time, according to the number of quantum computing tasks that meet the preset parallel requirements found in the above step S202, the electronic device can choose to enter the above intermediate scheduling process, or choose to skip the intermediate scheduling process and directly enter the low-level scheduling process. For details, please refer to the following description, which will not be repeated here.

[0075] Through the above-mentioned high-level scheduling process, the electronic device can preliminarily screen the quantum computing tasks in the first list that meet the preset parallel requirements. This allows the electronic device to directly obtain quantum computing tasks that can be executed in parallel from the second list that stores a relatively small number of quantum computing tasks, instead of obtaining quantum computing tasks that can be executed in parallel from the first list that stores a relatively large number of quantum computing tasks, once an idle thread appears in the later low-level scheduling execution process. This effectively shortens the time required to obtain quantum computing tasks in the later stage and improves the execution efficiency of quantum computing tasks.

[0076] With respect to the above step S203, that is, from the quantum computing tasks that meet the preset parallel requirements, the quantum computing tasks with the highest priority are obtained and cached in the second list.

[0077] In this step, when the electronic device executes the above step S202, if the number of quantum computing tasks that meet the preset parallel requirements is determined to be multiple, the electronic device can enter the intermediate scheduling process, that is, select the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements as the second quantum computing task, and cache the second quantum computing task in the second list.

[0078] In an embodiment of the present application, for each first quantum computing task in the first list above, the electronic device may determine the priority corresponding to each first quantum computing task according to the attribute information corresponding to the first quantum computing task.

[0079] The above attribute information includes, but is not limited to, the user authority level corresponding to the user who triggers the first quantum computing task, the queuing time of the first quantum computing task, and the expected execution time of the first quantum computing task. Here, the attribute information of the quantum computing task is not specifically limited.

[0080] In an optional embodiment, the electronic device may perform weighted calculation according to the numerical value corresponding to each dimension data in the above attribute information and the preset weight, and use the calculated weighted sum as the priority of the quantum computing task. Here, the method for determining the priority corresponding to each first quantum computing task is not specifically limited.

[0081] In an optional embodiment, when the number of quantum computing tasks that meet the preset parallel requirements found in the above step S202 is one, the electronic device can directly obtain the quantum computing task and cache the quantum computing task as a second quantum computing task in the above second list.

[0082] In another optional embodiment, when the number of quantum computing tasks that meet the preset parallel requirements found in the above step S202 is empty, that is, when no quantum computing tasks that meet the preset parallel requirements are found in the first list, the electronic device can skip the above intermediate scheduling process and directly enter the low-level scheduling process.

[0083] In an embodiment of the present application, once the above-mentioned high-level scheduling process finds that there are multiple quantum computing tasks that meet the preset parallel requirements, by executing the above-mentioned intermediate scheduling process, the number of quantum computing tasks cached in the second list can be effectively reduced, thereby shortening the time it takes for the subsequent low-level scheduling process to obtain quantum computing tasks that can be executed in parallel, thereby improving the execution efficiency of quantum computing tasks.

[0084] Furthermore, since the intermediate scheduling process is performed according to the priority of the quantum computing task, the probability that the quantum computing task with a higher priority is cached in the second list is increased, thereby increasing the probability that the quantum computing task with a higher priority is executed preferentially.

[0085] For the above step S204, that is, when it is determined according to the fourth state that there is an idle thread in the parallel thread, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment.

[0086] After caching the second quantum computing task to the second list, the electronic device can directly enter the low-level scheduling process. At this time, the electronic device can obtain the thread state corresponding to each thread in the parallel thread at the current moment (recorded as the fourth state).

[0087] According to the fourth state, the electronic device can determine the state information of each thread in the parallel threads at the current moment, such as the occupied / locked state or the idle state. For each thread in the occupied / locked state, the electronic device can determine the quantum computing task (referred to as the fourth quantum computing task) being executed by the thread at the current moment according to the thread state of the thread.

[0088] In the fourth state, if the thread state corresponding to a certain thread is the idle state, the electronic device can determine that there is an idle thread in the parallel threads. When the electronic device determines that there is an idle thread in the parallel threads according to the fourth state, it can obtain a quantum computing task (referred to as the fifth quantum computing task) that can be executed in parallel with all the currently executing quantum computing tasks (referred to as the fourth quantum computing task) from the second list. The method for obtaining the fifth quantum computing task can be found in the following description, which will not be elaborated here.

[0089] In an optional embodiment, for the above step S204, if the electronic device does not find the above fifth quantum computing task in the second list, the electronic device can return to execute the above step S201, that is, execute the step of obtaining the first judgment result according to the first state of the first list at the current moment, the second state of the second list and the third state of the parallel thread.

[0090] In an optional embodiment, when the electronic device determines that there is no idle thread in the parallel threads according to the fourth state, that is, when each thread is executing a quantum computing task, the electronic device may return to execute the step S201, that is, return to execute the step of obtaining the first judgment result according to the first state of the first list at the current moment, the second state of the second list and the third state of the parallel threads.

[0091] With respect to the above step S205, the fifth quantum computing task is executed by utilizing the idle thread.

[0092] In an optional embodiment, when the electronic device is the server, the electronic device may send the fifth quantum computing task obtained in step S204 to the task execution device. When the task execution device receives the fifth quantum computing task, it calls an idle thread to execute the fifth quantum computing task and obtains a task execution result.

[0093] In another optional embodiment, when the electronic device is the task execution device, the electronic device may directly call an idle thread to execute the fifth quantum computing task obtained in step S204 to obtain a task execution result.

[0094] In the embodiment of the present application, the process of the above-mentioned parallel threads executing quantum computing tasks is not described in detail.

[0095] In an optional embodiment, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Figure 3 As shown, Figure 3 A second flow chart of a task execution method provided in an embodiment of the present application. The method includes the following steps.

[0096] Step S301, obtaining the cache state of the first list at the current moment as the first state.

[0097] The first state is the cache state of the first list, and the cache state may include state information and cache information corresponding to each storage space in the first list. The state information may include: an idle state indicating that no quantum computing tasks are cached, and an occupied state indicating that a quantum computing task is cached. The cache information is the quantum computing tasks cached in the corresponding storage space.

[0098] Step S302: Acquire the cache state of the second list at the current moment as the second state.

[0099] The second state is the cache state of the second list, and the cache state includes the state information and cache information of each storage space corresponding to the second list. The description of the second state can refer to the description of the first state, and no specific description is given here.

[0100] Step S303, obtaining the thread state corresponding to each thread in the parallel threads at the current moment as the third state.

[0101] The third state is the thread state of each thread in the parallel thread, and the thread state may include the state information and thread information of the corresponding thread. The state information may include: an occupied state / locked state indicating that the thread is executing a quantum computing task, and an idle state indicating that the thread is not executing a quantum computing task. The thread information may be relevant information about the quantum computing task being executed by the thread when the thread is in an occupied state / locked state, such as the task identifier of the quantum computing task. Here, the thread information in the third state is not specifically limited.

[0102] In the embodiment of the present application, the above steps S301 to S303 are executed simultaneously, that is, the current moments in the above steps S301 to S303 are the same moment.

[0103] Step S304: judging whether to perform a search operation in the first list according to the first state, the second state and the third state, and obtaining a first judgment result.

[0104] For the above-mentioned first state, the electronic device can determine whether the first quantum computing task cached in the above-mentioned first list is empty according to the state information in the first state, and obtain a first determination result. That is, when each state information included in the first state is the above-mentioned idle state, the electronic device can determine that no quantum computing task is stored in the first list. At this time, the electronic device can obtain a first determination result indicating that the first list is empty. When any one or more state information included in the first state is the above-mentioned occupied state, the electronic device can determine that there is a quantum computing task cached in the cache space corresponding to the occupied state. At this time, the electronic device can obtain a first determination result indicating that the first list is not empty.

[0105] For the second state, the electronic device can determine whether the second quantum computing task cached in the second list is empty according to the state information in the second state, and obtain a second determination result. The determination method of the second determination result can refer to the determination method of the first determination result, and will not be described in detail here.

[0106] In addition, considering that the second quantum computing tasks cached in the second list include the parallelizable quantum computing tasks and the replaceable quantum computing tasks. For the convenience of distinction, the electronic device may cache the parallelizable quantum computing tasks in the first cache space and cache the replaceable quantum computing tasks in the second cache space. Therefore, according to the state information in the second state, the second determination result may also indicate whether there are parallelizable quantum computing tasks cached in the second list, and whether the cached replaceable quantum computing tasks in the second list are equal to the second preset number.

[0107] In an optional embodiment, for the second state, when the state information corresponding to the first cache space is the occupied state, the electronic device can determine that the first cache space has the parallel quantum computing task cached, and at this time, the electronic device can obtain an indication that the second list has the parallel quantum computing task cached. When the state information corresponding to the first cache space is the idle state, the electronic device can determine that the first cache space does not have the parallel quantum computing task cached, and at this time, the electronic device can obtain an indication that the second list does not have the parallel quantum computing task cached.

[0108] In the embodiment of the present application, since the number of replaceable quantum computing tasks cached in the second list is the second preset number, the number of the second cache space may be the second preset number.

[0109] For the above-mentioned second state, when the state information corresponding to each second cache space in the second list is the above-mentioned occupied state, the electronic device can determine that each second cache space in the second list has a quantum computing task cached therein, and at this time, the electronic device can obtain a second determination result indicating that the number of replaceable quantum computing tasks cached in the second list is equal to the second preset number. When the state information corresponding to any one or more second cache spaces in the second list is the above-mentioned idle state, the electronic device can determine that no replaceable quantum computing task is cached in the second cache space corresponding to the idle state, and at this time, the electronic device can obtain a second determination result indicating that the number of replaceable quantum computing tasks cached in the second list is less than the second preset number.

[0110] For the third state, the electronic device can determine whether there is an idle thread in the parallel threads according to the state information in the third state, and obtain a third determination result. That is, when each thread state included in the third state is the occupied state / locked state, the electronic device can obtain a third determination result indicating that there is no idle thread in the parallel threads; when any one or more thread states included in the third state are the idle threads, the electronic device can obtain a third determination result indicating that there is an idle thread in the parallel threads.

[0111] According to the first determination result, the second determination result and the third determination result, the electronic device can determine whether to perform a search operation in the first list to obtain a first determination result.

[0112] There are at least the following situations for the above-mentioned first determination result, second determination result and third determination result.

[0113] Case 1: The first determination result indicates that the first list is empty, that is, there is no quantum computing task cached in the first list.

[0114] When the situation 1 occurs, the electronic device may not consider the second determination result and the third determination result described above.

[0115] In case 2, the first determination result indicates that the first list is not empty, and the second determination result indicates that the number of second quantum computing tasks cached in the second list is equal to the first preset number. That is, the first list caches the first quantum computing task, and each cache space in the second list caches the second quantum computing task.

[0116] When the second situation occurs, for each of the parallel threads, the thread may be executing a quantum computing task or not executing a quantum computing task. That is, at this time, the third determination result may indicate that there is an idle thread or that there is no idle thread.

[0117] Case 3: The first determination result indicates that the first list is not empty, the second determination result indicates that there is no second quantum computing task that can be cached in parallel in the second list, and the third determination result indicates that there is an idle thread. That is, the first quantum computing task is cached in the first list, and there is no quantum computing task cached in the first cache space of the second list. At this time, the second list can be empty, that is, no quantum computing task is stored; the second list can also be non-empty, that is, there is a quantum computing task that can be cached in the second cache space of the second list.

[0118] Case 4: The first determination result indicates that the first list is not empty, the second determination result indicates that the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, and the third determination result indicates that there are no idle threads. That is, the first quantum computing task is cached in the first list, the number of replaceable quantum computing tasks cached in the second list does not reach the maximum value, and there are no idle threads in the parallel threads. At this time, the second list can be empty or store some of the second quantum computing tasks.

[0119] Case 5: The first determination result indicates that the first list is not empty, and the second determination result indicates that there are parallelizable quantum computing tasks cached in the second list. That is, there are first quantum computing tasks cached in the first list, and there are parallelizable quantum computing tasks cached in the first cache space of the second list.

[0120] When the fifth situation mentioned above occurs, there may or may not be idle threads in the above parallel threads.

[0121] For the above five situations, the electronic device will obtain different first judgment results, which can be seen in the following description for details and will not be elaborated here.

[0122] The above steps S301 to S304 are refinements of the above step S201.

[0123] Through the above steps S301-S304, the electronic device can determine whether to perform a search operation in the first list according to the cache status of the first list, the cache status of the second list and the thread status of each thread in the parallel threads at the current moment. This enables the electronic device to cache the first quantum computing tasks that meet the requirements in the first list to the second list in a timely manner, thereby maintaining the stability of the second quantum computing tasks cached in the second list.

[0124] Step S305: When the first judgment result indicates to perform a search operation in the first list, search the first list for a quantum computing task that meets the preset parallel requirement according to the third quantum computing task currently being executed in the parallel thread.

[0125] Step S306, obtaining the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements and caching it in the second list.

[0126] Step S307, when it is determined according to the fourth state that there is an idle thread in the parallel thread, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment.

[0127] Step S308, using the idle thread to execute the fifth quantum computing task.

[0128] The above steps S305 to S308 are the same as the above steps S202 to S205.

[0129] In an optional embodiment, according to the above Figure 3 The method shown in the embodiment of the present application also provides a task execution method. Figure 4 As shown, Figure 4 The third flow chart of the task execution method provided in the embodiment of the present application is as follows. Figure 4 In the method shown, the above step S304 is subdivided into the following steps, namely, step S3041 to step S3043.

[0130] Step S3041, when it is determined according to the first state that the first list is empty, or when it is determined according to the first state that the first list is not empty and it is determined according to the second state that the number of second quantum computing tasks cached in the second list is equal to the first preset number, a first judgment result indicating that a search operation is not performed in the first list is obtained.

[0131] In the embodiment of the present application, after the electronic device determines the first determination result, the second determination result and the third determination result respectively according to the first state, the second state and the third state, any one of the above situations 1 to 5 may occur.

[0132] When the above situation 1 or situation 2 occurs, the first determination result obtained by the electronic device may indicate that a search operation is not performed in the first list.

[0133] In the embodiment of the present application, the electronic device will perform other steps ( Figure 4 For details, please refer to the following description and will not be elaborated here.

[0134] Step S3042, when it is determined according to the first state that the first list is not empty, it is determined according to the second state that no parallel quantum computing tasks are cached in the second list, and it is determined according to the third state that there are idle threads in the parallel threads, a first judgment result indicating searching for parallel quantum computing tasks in the first list is obtained.

[0135] In this step, for the above situations 1 to 5, when the above situation 3 occurs, the first judgment result obtained by the electronic device may indicate to search for parallelizable quantum computing tasks in the first list.

[0136] Step S3043, when it is determined according to the first state that the first list is not empty, it is determined according to the second state that the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, and it is determined according to the third state that there are no idle threads among the multiple threads, or when it is determined according to the first state that the first list is not empty, it is determined according to the second state that there are parallelizable quantum computing tasks cached in the second list and the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, a first judgment result indicating searching for replaceable quantum computing tasks in the first list is obtained.

[0137] In this step, for the above situations 1 to 5, when the above situation 4 or 5 occurs, the first judgment result obtained by the electronic device can indicate to search the first list for a replaceable quantum computing task.

[0138] In the embodiment of the present application, the above steps S3041 to S3043 are steps respectively performed by the electronic device according to the differences among the above first determination result, the second determination result and the third determination result. Here, the execution of the above steps S3041 to S3043 is not specifically limited.

[0139] In the above Figure 4 In the illustrated embodiment, the electronic device may execute the above step S305 after executing the above step S3042 or step S3043.

[0140] Through the above steps S3041 to S3043, the electronic device can obtain different first judgment results for different situations, thereby executing the above advanced scheduling process according to different first judgment results, thereby improving the flexibility of quantum computing task scheduling.

[0141] In the above embodiment, the electronic device determines the first judgment result based on the above first state, second state and third state. In addition, the electronic device can also determine the first judgment result based on the result of the previous round of advanced scheduling process. For example, in the previous round of advanced scheduling process, the first judgment result indicates to search for parallel quantum computing tasks in the first list. However, the electronic device did not find the parallel quantum computing tasks in the first list. At this time, in the new round of advanced scheduling process, the electronic device can directly obtain the first judgment result indicating to search for the replaceable quantum computing tasks in the first list.

[0142] In an optional embodiment, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Figure 5 As shown, Figure 5 A fourth flow chart of the task execution method provided in the embodiment of the present application. Figure 5 The following steps are added to the method shown, namely step S206 to step S208.

[0143] Step S206, when the first judgment result indicates that the search operation is not to be performed in the first list, the thread state of each thread in the parallel threads at the current moment is obtained as the fifth state.

[0144] In this step, when the first judgment result indicates that the search operation is not to be performed in the first list, the electronic device can skip the intermediate scheduling process and perform the low-level scheduling process. At this time, considering that it takes a certain amount of time to obtain the first judgment result, during this period, the thread state of each thread in the parallel threads may be updated or not. Therefore, in order to ensure the accuracy of task execution, when the first judgment result indicates that the search operation is not to be performed in the first list, the electronic device can re-acquire the thread state corresponding to each thread in the parallel threads at the current moment as the fifth state.

[0145] The fifth state may be the same as or different from the third state.

[0146] In the embodiment of the present application, the above step S206 and the above step S202 are steps respectively executed when the first judgment result is different. Here, the execution of the above step S202 and step S206 is not specifically limited.

[0147] Step S207, when it is determined according to the fifth state that there is an idle thread in the parallel threads and it is determined according to the second state that the second list is not empty, execute the step of obtaining a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task from the second list.

[0148] In the embodiment of the present application, after obtaining the fifth state, the electronic device can determine whether there is an idle thread in the parallel threads according to the fifth state, and obtain a fourth determination result. The determination method of the fourth determination result can refer to the determination method of the third determination result, which is not described in detail here.

[0149] According to the difference between the fourth determination result and the second determination result, the electronic device will respectively perform different steps. The determination results corresponding to the fourth determination result and the second determination result may include the following situations.

[0150] Case six: the fourth determination result indicates that there is an idle thread in the parallel threads, and the second determination result indicates that the second list is not empty.

[0151] Case seven: the fourth determination result indicates that there is an idle thread in the parallel threads, and the second determination result indicates that the second list is empty.

[0152] Case eight: the fourth determination result indicates that there is no idle thread in the parallel threads, and the second determination result indicates that the second list is empty.

[0153] Case nine: the fourth determination result indicates that there is no idle thread in the parallel threads, and the second determination result indicates that the second list is not empty.

[0154] In the embodiment of the present application, considering that when the first judgment result indicates that the search operation is not to be performed in the first list, since the electronic device will not execute the above step S203 and has not yet started to execute the above step S204, the cache state of the second list at the current moment has not changed, that is, the cache state is still the above second state. Therefore, in the above step S206, the cache state of the second list at the current moment is not re-obtained when the fifth state is obtained.

[0155] In an optional embodiment, in order to ensure the accuracy of the cache status of the second list at the current moment, the electronic device may simultaneously acquire the cache status of the second list while acquiring the fifth status.

[0156] In the embodiment of the present application, when the fourth determination result and the second determination result satisfy the above situation six, the electronic device can determine that there is an idle thread in the parallel thread that can be used to execute the quantum computing task, and the second list also caches parallel quantum computing tasks and / or replaceable quantum computing tasks waiting to be executed. At this time, the electronic device can execute the above step S204, and obtain the quantum computing task executed in parallel with the fourth quantum computing task from the second list as a step of the fifth quantum computing task.

[0157] Step S208, when it is determined according to the fifth state that there are no idle threads in the parallel threads, and / or when it is determined according to the second state that the second list is empty, return to the step of obtaining the first judgment result according to the first state of the first list at the current moment, the second state of the second list and the third state of the parallel threads.

[0158] In this step, when the fourth determination result and the second determination result satisfy any one of the above-mentioned situations seven, eight or nine, the electronic device can return to execute the above-mentioned step S201, that is, return to execute the step of executing the first state of the first list at the current moment, the second state of the second list and the third state of the parallel thread.

[0159] In the embodiment of the present application, the above steps S207 to S208 are steps respectively executed when the above fourth determination result and the second determination result are different. Here, the execution of the above steps S207 to S208 is not specifically limited.

[0160] Through the above steps S206 to S208, when the electronic device determines that no search operation is to be performed on the first list, it can directly enter the low-level scheduling process, so that according to the thread state at the current moment and the cache state of the second list, it can choose to obtain a quantum computing task that can be executed in parallel with the currently executing quantum computing task and execute the quantum computing task, or choose to re-enter the high-level scheduling process, which improves the flexibility of multi-level scheduling while ensuring the orderly execution of the quantum computing tasks cached in the second list.

[0161] In an optional embodiment, when the first judgment result indicates to search for parallelizable quantum computing tasks in the first list, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Figure 6 As shown, Figure 6 The fifth flow chart of the task execution method provided in the embodiment of the present application. Figure 6 In the method shown, the above step S202 is refined into the following steps, namely step S2021.

[0162] Step S2021, when the first judgment result indicates to search for parallel quantum computing tasks in the first list, according to the task information corresponding to each first quantum computing task and the task information corresponding to each third quantum computing task currently being executed in the parallel thread, search for the quantum computing tasks in the first list that can be executed in parallel with all the third quantum computing tasks as the quantum computing tasks that meet the preset parallel requirements.

[0163] In this step, when the first judgment result indicates that a parallelizable quantum computing task is to be searched in the first list, the electronic device may traverse each first quantum computing task in the first list. For each traversed first quantum computing task, the electronic device may determine whether the first quantum computing task can be executed in parallel with all third quantum computing tasks based on the task information of the first quantum computing task and the task information corresponding to each third quantum computing task being executed in the parallel thread at the current moment. When the first quantum computing task can be executed in parallel with all third quantum computing tasks, the electronic device may determine that the first quantum computing task meets the preset parallel requirement; when the first quantum computing task cannot be executed in parallel with all third quantum computing tasks, the electronic device may determine that the first quantum computing task does not meet the preset parallel requirement. The electronic device may determine that all first quantum computing tasks in the first list that meet the preset parallel requirement are all determined parallelizable quantum computing tasks.

[0164] In an optional embodiment, the task information may include a quantum bit identifier. The quantum bit identifier is an identifier of all quantum bits required for executing the corresponding quantum computing task. In addition, the task information may also include other information, such as a reading frequency of a reading cavity. Here, the information included in the task information of the quantum computing task is not specifically limited.

[0165] In an optional embodiment, when the task information includes a quantum bit identifier, the step S2021 may be specifically expressed as:

[0166] When the first judgment result indicates that parallelizable quantum computing tasks are to be searched in the first list, based on the first quantum bit identifier in the task information corresponding to each first quantum computing task in the first list and the second quantum bit identifier in the task information corresponding to each third quantum computing task currently being executed in the parallel thread, the first quantum computing task whose corresponding task information does not include the second quantum bit identifier is searched in the first list as the quantum computing task that meets the preset parallel requirement.

[0167] In this step, if the above-mentioned first judgment result indicates to search for parallel quantum computing tasks in the first list, then for each first quantum computing task in the first list, the electronic device can compare the quantum bit identifier (recorded as the first quantum bit identifier) ​​in the task information corresponding to the first quantum computing task with the quantum bit identifier (recorded as the second quantum bit identifier) ​​in the task information corresponding to all third quantum computing tasks being executed in the parallel thread at the current moment. When the first quantum bit identifier is different from the second quantum bit identifier, the electronic device can determine that the first quantum computing task corresponding to the first quantum bit identifier can be executed in parallel with all third quantum computing tasks. When the first quantum bit identifier and the second quantum bit identifier have the same quantum bit identifier, the electronic device can determine that the first quantum computing task corresponding to the first quantum bit cannot be executed in parallel with all third quantum computing tasks. The electronic device selects all first quantum computing tasks that can be executed in parallel with the third quantum computing tasks as quantum computing tasks that meet the preset parallel requirements.

[0168] Through the above-mentioned step S2021, when the first judgment result indicates that the electronic device searches for parallelizable quantum computing tasks in the first list, by comparing the first quantum bit identifier corresponding to the first quantum computing task with the second quantum bit identifiers corresponding to all third quantum computing tasks, it is possible to determine whether there is a bit conflict problem between the quantum bits required for executing the first quantum computing task and the quantum bits required for executing all third quantum computing tasks, thereby avoiding the impact of the quantum bit conflict problem on the parallel execution of quantum computing tasks, providing a guarantee for the parallel execution of different quantum computing tasks, and improving the accuracy and effectiveness of the second quantum computing task cached in the second list at a later time.

[0169] In an optional embodiment, when the first judgment result indicates to search for a replaceable quantum computing task in the first list, according to Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Figure 7 As shown, Figure 7 The sixth flow chart of the task execution method provided in the embodiment of the present application. Figure 7 In the method shown, the above step S202 is refined into the following steps, namely step S2022 to step S2024.

[0170] Step S2022, when the first judgment result indicates to search for a replaceable quantum computing task in the first list, for each third quantum computing task currently being executed in the parallel thread, determine whether a replaceable quantum computing task corresponding to the third quantum computing task is cached in the second list to obtain a second judgment result.

[0171] In an embodiment of the present application, for each replaceable quantum computing task cached in the second cache space of the second list, the second list may also record the quantum computing task being executed corresponding to each replaceable quantum computing task. For ease of understanding, the third quantum computing task is used as an example for explanation. The electronic device may cache the replaceable quantum computing task in the second list according to the corresponding relationship between the third quantum computing task and the replaceable quantum computing task corresponding to the third quantum computing task.

[0172] For each third quantum computing task being executed in the parallel thread at the current moment, the electronic device can determine whether a replaceable quantum computing task corresponding to the third quantum computing task is cached in the above second list to obtain a second determination result.

[0173] The above second judgment result can indicate whether each third quantum computing task has a corresponding replaceable quantum computing task.

[0174] Step S2023: Based on the second judgment result, the sixth quantum computing task with the shortest remaining execution time is selected as the target quantum computing task; the sixth quantum computing task is the third quantum computing task for which there is no corresponding quantum computing task that can take over.

[0175] In the embodiment of the present application, according to the above second judgment result, the electronic device can determine whether there are replaceable quantum computing tasks corresponding to each third quantum computing task in the second list. Among them, the third quantum computing task that does not correspond to the corresponding replaceable quantum computing task is recorded as the sixth quantum computing task.

[0176] For each third quantum computing task, the electronic device can determine the remaining execution time corresponding to the third quantum computing task. The remaining execution time corresponding to each third quantum computing task can be determined based on the historical execution time of historical quantum computing tasks and the task execution time corresponding to the third quantum computing task at the current moment. For example, for a third quantum computing task, the electronic device can obtain the historical execution time of the same historical quantum computing task as the third quantum computing task as the expected execution time of the third quantum computing task. The electronic device can calculate the difference between the expected execution time and the task execution time of the third quantum computing task at the current moment to obtain the remaining execution time corresponding to the third quantum computing task.

[0177] According to the remaining execution time corresponding to each third quantum computing task, the electronic device can determine the quantum computing task with the shortest remaining execution time among the sixth quantum computing tasks as the target quantum computing task.

[0178] Step S2024, according to the task information corresponding to each first quantum computing task and the task information corresponding to each seventh quantum computing task, search in the first list for a quantum computing task that can be executed in parallel with all seventh quantum computing tasks as a quantum computing task that meets the preset parallel requirement; the seventh quantum computing task is the third quantum computing task other than the target quantum computing task.

[0179] In an optional embodiment, the above step S2024 can be specifically expressed as:

[0180] According to the first quantum bit identifier in the task information corresponding to each first quantum computing task and the third quantum bit identifier in the task information corresponding to each seventh quantum computing task, the first quantum computing task whose corresponding task information does not include the third quantum bit identifier is searched in the first list as the quantum computing task that meets the preset parallel requirements.

[0181] The quantum computing task that meets the preset parallel requirement determined in the above step S2024 is the replaceable quantum computing task corresponding to the above target quantum computing task.

[0182] Through the above steps S2022 to S2024, when it is determined to search for a replaceable quantum computing task in the first list, the sixth quantum computing task with the shortest remaining execution time is selected as the target quantum computing task, so as to search for the replaceable quantum computing task corresponding to the target quantum computing task in the first list. This allows the quantum computing task with a relatively short remaining execution time to preferentially determine its corresponding replaceable quantum computing task, so that after the execution of the quantum computing task is completed, the replaceable quantum computing task corresponding to the quantum computing task can be executed in time, so as to achieve seamless connection between the execution of the target quantum computing task and the replaceable quantum computing task, thereby improving the execution efficiency of the quantum computing task.

[0183] In an optional embodiment, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Figure 8 As shown, Figure 8 The seventh flow chart of the task execution method provided in the embodiment of the present application. Figure 8 The above step S204 is refined into the following steps, namely step S2041-step S2044.

[0184] Step S2041, when it is determined according to the fourth state that there is an idle thread in the parallel threads, it is determined whether there is a target replaceable quantum computing task cached in the second list, and a third judgment result is obtained, and the target replaceable quantum computing task corresponds to the eighth quantum computing task executed before the idle thread state is updated.

[0185] In an optional embodiment, for each thread in the parallel threads, when the thread state of the thread is updated, the electronic device can record the update information of the thread. When it is determined according to the fourth state that there is an idle thread in the parallel threads, the electronic device can determine the quantum computing task (recorded as the eighth quantum computing task) executed before the idle thread state is updated according to the recorded update information.

[0186] For the eighth quantum computing task, the electronic device may search the second list to see whether there is a replaceable quantum computing task (recorded as the target replaceable quantum computing task) corresponding to the eighth quantum computing task, and obtain a third judgment result.

[0187] The third judgment result is used to indicate whether there is a replaceable quantum computing task corresponding to the eighth quantum computing task cached in the second list.

[0188] Step S2042: If the third judgment result is yes, when the target replaceable quantum computing task meets the preset parallel requirement, the target replaceable quantum computing task is obtained as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task.

[0189] In an embodiment of the present application, when the above-mentioned third judgment result is yes, that is, when the third judgment result indicates that the target replaceable quantum computing task corresponding to the above-mentioned eighth quantum computing task is cached in the second list, the electronic device can determine whether the target replaceable quantum computing task meets the above-mentioned preset parallel requirements, that is, determine whether the target replaceable quantum computing task can be executed in parallel with the quantum computing task currently being executed.

[0190] When the target replaceable quantum computing task meets the preset parallel requirement, the electronic device can determine that the target replaceable quantum computing task can be executed in parallel with the fourth quantum computing task currently being executed. At this time, the electronic device can obtain the target replaceable quantum computing task as the fifth quantum computing task.

[0191] Step S2043: If the third judgment result is no, or if the target replaceable quantum computing task does not meet the preset parallel requirement, then obtain the parallelizable quantum computing tasks cached in the second list.

[0192] In an optional embodiment, when the third judgment result is no, that is, when the third judgment result indicates that the target replaceable quantum computing task corresponding to the eighth quantum computing task is not cached in the second list, the electronic device can obtain the parallelizable quantum computing task from the first cache space of the second list.

[0193] In another optional embodiment, when the target replaceable quantum computing task does not meet the preset parallel requirement, that is, when the target replaceable quantum computing task cannot be executed in parallel with the fourth quantum computing task currently being executed, the electronic device can obtain the parallelizable quantum computing task from the first cache space of the second list.

[0194] In the embodiment of the present application, the above step S2043 can be performed after the above step S2041, that is, when the above third judgment result is No. The above step S2043 can also be performed after step S2042, that is, when the above target replaceable quantum computing task does not meet the preset parallel requirement.

[0195] Step S2044: when the obtained parallelizable quantum computing task meets the preset parallel requirement, the parallelizable quantum computing task is determined as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task.

[0196] In this step, after obtaining the parallelizable quantum computing tasks in the second list, the electronic device can determine whether the parallelizable quantum computing tasks meet the preset parallel requirements, that is, determine whether the parallelizable quantum computing tasks can be executed in parallel with all fourth quantum computing tasks. If the parallelizable quantum computing tasks meet the above preset parallel requirements, the electronic device can determine that the parallelizable quantum computing tasks can be executed in parallel with all fourth quantum computing tasks. At this time, the electronic device can determine the parallelizable quantum computing task as the fifth quantum computing task.

[0197] In an optional embodiment, when the parallelizable quantum computing task obtained in the above step S2023 does not meet the above preset parallel requirement, the electronic device may return to execute the above step S201, that is, return to execute the above step of obtaining the first judgment result based on the first state of the first list at the current moment, the second state of the second list and the third state of the parallel thread.

[0198] Through the above steps S2041 to S2044, in the process of executing low-level scheduling, the electronic device re-determines whether the quantum computing task obtained from the second list meets the preset parallel requirements, that is, re-determines whether the quantum computing task can be executed in parallel with the currently executing quantum computing task, which ensures that the determined fifth quantum computing task can be executed in parallel with all fourth quantum computing tasks, improves the accuracy of the determined fifth quantum computing task, and provides guarantee for the parallel execution of different quantum computing tasks.

[0199] In an optional embodiment, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Fig. 9 As shown, Fig. 9 The eighth flow chart of the task execution method provided in the embodiment of the present application includes the following steps.

[0200] Step S901, obtaining a first judgment result according to a first state of the first list at the current moment, a second state of the second list, and a third state of the parallel thread, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel.

[0201] Step S902: When the first judgment result indicates to perform a search operation in the first list, a quantum computing task that meets the preset parallel requirement is searched in the first list according to the third quantum computing task currently being executed in the parallel thread.

[0202] Step S903, obtaining the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements and caching it in the second list.

[0203] Step S904, when it is determined according to the fourth state that there is an idle thread in the parallel thread, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment.

[0204] Step S905, using the idle thread to execute the fifth quantum computing task.

[0205] The above steps S901 to S905 are the same as the above steps S201 to S205.

[0206] Step S906: searching the second list for a tenth quantum computing task that does not meet the preset parallel requirement based on the ninth quantum computing task being executed in the parallel thread at the current moment.

[0207] In the embodiment of the present application, when the electronic device uses the idle thread to execute the fifth quantum computing task, since the quantum computing tasks executed in parallel in the parallel thread are changed, the quantum computing task being executed in the parallel thread at this time is recorded as the ninth quantum computing task.

[0208] In an optional embodiment, for the parallelizable quantum computing tasks in the second list, the electronic device may determine whether the parallelizable quantum computing task can be executed in parallel with all the ninth quantum computing tasks, thereby determining whether the parallelizable quantum computing task meets the preset parallel requirement. When it is determined that the parallelizable quantum computing task cannot be executed in parallel with all the ninth quantum computing tasks, the electronic device may determine that the parallelizable quantum computing task is a tenth quantum computing task that does not meet the preset parallel requirement.

[0209] In another optional embodiment, for the replaceable quantum computing tasks in the above-mentioned second list, the electronic device can determine whether the replaceable quantum computing task can replace its corresponding ninth quantum computing task and be executed in parallel with other ninth quantum computing tasks, and determine the replaceable quantum computing task that cannot be executed in parallel with other ninth quantum computing tasks as the tenth quantum computing task that does not meet the preset parallel requirements.

[0210] Step S907, caching the tenth quantum computing task into the first list.

[0211] In this step, since the tenth quantum computing task does not meet the preset parallel requirement, in order to avoid the tenth quantum computing task in the second list interfering with the subsequent low-level scheduling process, the electronic device can cache the tenth quantum computing task determined in step S906 to the first list.

[0212] In an optional embodiment, when re-caching the tenth quantum computing task to the first list, the electronic device may re-cache the tenth quantum computing task to the same position in the first list according to the position of the tenth quantum computing task in the first list before it is cached to the second list.

[0213] Through the above steps S906 and S907, the electronic device can re-cache the tenth quantum computing task in the second list into the first list when the quantum computing task currently being executed in parallel changes. This effectively avoids the impact of the conflict between the ninth quantum computing task and the tenth quantum computing task in the second list on the parallel execution of quantum computing tasks, and improves the accuracy and effectiveness of the second quantum computing task cached in the second list.

[0214] In an optional embodiment, according to the above Figure 2 The method shown in the embodiment of the present application also provides a task execution method. Fig.10 As shown, Fig.10 The ninth flow chart of the task execution method provided in the embodiment of the present application includes the following steps.

[0215] Step S1001, obtaining a first judgment result according to a first state of the first list at the current moment, a second state of the second list, and a third state of the parallel thread, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel.

[0216] Step S1002: When the first judgment result indicates to perform a search operation in the first list, a quantum computing task that meets the preset parallel requirement is searched in the first list according to the third quantum computing task currently being executed in the parallel thread.

[0217] Step S1003, obtaining the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements and caching it in the second list.

[0218] Step S1004: When it is determined that there is an idle thread in the parallel thread according to the fourth state, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment.

[0219] Step S1005, using the idle thread to execute the fifth quantum computing task.

[0220] The above steps S1001 to S1005 are the same as the above steps S201 to S205.

[0221] Step S1006: Based on the task information of the fifth quantum computing task, lock the idle thread to obtain a locked thread.

[0222] In an optional embodiment, when the electronic device uses an idle thread to execute the fifth quantum computing task, it can lock the idle thread according to the quantum bit identifier in the task information corresponding to the fifth quantum computing task to obtain a locked thread.

[0223] Step S1007: for each locked thread, when the locking time corresponding to the locked thread is greater than a preset time threshold, release the locked thread.

[0224] In this step, for each locked thread, the electronic device can determine the lock duration corresponding to the locked thread, and compare the lock duration corresponding to the locked thread with the preset duration threshold. When the lock duration corresponding to the locked thread is greater than the preset duration threshold, the electronic device can determine that the locked thread is an abnormal thread. At this time, the electronic device can release the locked thread.

[0225] The above-mentioned preset duration threshold can be set according to the expected execution duration of the quantum computing task corresponding to the locked thread. Here, the above-mentioned preset duration threshold is not specifically limited.

[0226] In an embodiment of the present application, when the electronic device releases the above-mentioned locked thread, the quantum computing task corresponding to the locked thread is an abnormal task. The electronic device can discard the abnormal task, or issue an abnormal alarm to the user who triggered the task for the abnormal task.

[0227] In addition, when the electronic device releases the locked thread, the thread state of the locked thread will change, that is, from the locked state to the idle state.

[0228] In an optional embodiment, when the locking time duration corresponding to the locking thread is not greater than a preset time duration threshold, the electronic device may not perform any processing.

[0229] Through the above steps S1006 and S1007, the electronic device can release the thread in time when the locking time of the thread is greater than the preset time threshold, thereby avoiding the influence of abnormal threads on the quantum computing task process and improving the fault tolerance of the task execution process.

[0230] In the above Fig.10 In the illustrated embodiment, the abnormal thread is determined by comparing the lock duration with a preset duration threshold. In addition, for each locked thread, the electronic device can also extend the thread lock corresponding to the locked thread when the lock duration of the locked thread is equal to the expected execution duration of the corresponding quantum computing task. When the extension times are greater than the preset times threshold, the electronic device can determine that the locked thread is an abnormal thread, thereby releasing the locked thread.

[0231] Based on the same inventive concept, according to the task execution method provided in the above embodiment of the present application, the embodiment of the present application also provides a task execution device. Fig.11 As shown, Fig.11 A schematic diagram of a structure of a task execution device provided in an embodiment of the present application. The method includes the following modules.

[0232] A first acquisition module 1101 is used to acquire a first judgment result according to a first state of a first list, a second state of a second list, and a third state of a parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel;

[0233] A first search module 1102 is configured to search the first list for a quantum computing task that meets a preset parallel requirement according to a third quantum computing task currently being executed in the parallel thread when the first judgment result indicates that a search operation is to be performed in the first list;

[0234] A first cache module 1103 is used to obtain the quantum computing task with the highest priority from the quantum computing tasks that meet the preset parallel requirements and cache it in the second list;

[0235] A second acquisition module 1104 is configured to acquire, from the second list, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task when it is determined according to the fourth state that there is an idle thread in the parallel thread, the fourth state being a thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task being a quantum computing task being executed in the parallel thread at the current moment;

[0236] The execution module 1105 is used to execute the fifth quantum computing task using the idle thread.

[0237] Optionally, the first acquisition module 1101 may be specifically used to acquire a cache state of the first list at a current moment as the first state;

[0238] Obtain the cache state of the second list at the current moment as the second state;

[0239] Obtaining the thread state corresponding to each thread in the parallel threads at the current moment as the third state;

[0240] According to the first state, the second state and the third state, it is determined whether to perform a search operation in the first list to obtain a first determination result.

[0241] Optionally, the first acquisition module 1101 may be specifically configured to obtain a first judgment result indicating that a search operation is not performed in the first list when the first list is determined to be empty according to the first state, or when the first list is determined to be not empty according to the first state and the number of second quantum computing tasks cached in the second list is determined to be equal to a first preset number according to the second state;

[0242] When it is determined according to the first state that the first list is not empty, it is determined according to the second state that no parallelizable quantum computing tasks are cached in the second list, and it is determined according to the third state that there are idle threads in the parallel threads, a first judgment result indicating searching the first list for parallelizable quantum computing tasks is obtained;

[0243] When it is determined according to the first state that the first list is not empty, it is determined according to the second state that the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, and it is determined according to the third state that there are no idle threads among the multiple threads, or when it is determined according to the first state that the first list is not empty, it is determined according to the second state that there are parallelizable quantum computing tasks cached in the second list and the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, a first judgment result indicating searching the first list for replaceable quantum computing tasks is obtained;

[0244] Among them, the parallelizable quantum computing task is a quantum computing task that is determined to be able to be executed in parallel with all quantum computing tasks being executed at the current moment when searching for a quantum computing task that meets the preset parallel requirements; the replaceable quantum computing task is a quantum computing task that is determined to be able to replace the target quantum computing task among all quantum computing tasks being executed at the current moment and be executed in parallel with other quantum computing tasks when searching for a quantum computing task that meets the preset parallel requirements.

[0245] Optionally, the task execution device may further include:

[0246] A third acquisition module, configured to acquire, when the first judgment result indicates that the search operation is not to be performed in the first list, the thread state of each thread in the parallel threads at the current moment as a fifth state;

[0247] A first calling module, configured to, when it is determined according to the fifth state that there is an idle thread in the parallel threads and it is determined according to the second state that the second list is not empty, call the second obtaining module 1104 to execute the step of obtaining a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task from the second list;

[0248] The second calling module is used to call the first acquisition module 1101 to return to execute the step of acquiring the first judgment result based on the first state of the first list at the current moment, the second state of the second list, and the third state of the parallel thread when it is determined that there are no idle threads in the parallel threads according to the fifth state and / or when it is determined that the second list is empty according to the second state.

[0249] Optionally, the first search module 1102 may be specifically used to search, when the first judgment result indicates searching for parallelizable quantum computing tasks in the first list, for quantum computing tasks in the first list that can be executed in parallel with all third quantum computing tasks, based on task information corresponding to each first quantum computing task and task information corresponding to each third quantum computing task currently being executed in the parallel thread, as quantum computing tasks that meet preset parallel requirements.

[0250] Optionally, the first search module 1102 may be specifically configured to determine, for each third quantum computing task currently being executed in the parallel thread, whether a replaceable quantum computing task corresponding to the third quantum computing task is cached in the second list, to obtain a second judgment result when the first judgment result indicates searching for a replaceable quantum computing task in the first list, to obtain a second judgment result;

[0251] Based on the second judgment result, the sixth quantum computing task with the shortest remaining execution time is selected as the target quantum computing task; the sixth quantum computing task is the third quantum computing task for which there is no corresponding quantum computing task that can take over;

[0252] According to the task information corresponding to each first quantum computing task and the task information corresponding to each seventh quantum computing task, a quantum computing task that can be executed in parallel with all seventh quantum computing tasks is searched in the first list as a quantum computing task that meets the preset parallel requirements; the seventh quantum computing task is the third quantum computing task other than the target quantum computing task.

[0253] Optionally, the above task information may include a quantum bit identifier;

[0254] The first search module 1102 may be specifically configured to search the first list for a first quantum computing task whose corresponding task information does not include the second quantum bit identifier, as a quantum computing task that meets the preset parallel requirement, according to the first quantum bit identifier in the task information corresponding to each first quantum computing task in the first list and the second quantum bit identifier in the task information corresponding to each third quantum computing task currently being executed in the parallel thread.

[0255] The step of searching, in the first list, for a quantum computing task that can be executed in parallel with all the seventh quantum computing tasks according to the task information corresponding to each first quantum computing task and the task information corresponding to each seventh quantum computing task as a quantum computing task that meets the preset parallel requirement includes:

[0256] According to the first quantum bit identifier in the task information corresponding to each first quantum computing task and the third quantum bit identifier in the task information corresponding to each seventh quantum computing task, the first quantum computing task whose corresponding task information does not include the third quantum bit identifier is searched in the first list as the quantum computing task that meets the preset parallel requirements.

[0257] Optionally, the second acquisition module 1104 may be specifically used to determine whether there is a target replaceable quantum computing task cached in the second list, and obtain a third determination result, where the target replaceable quantum computing task corresponds to the eighth quantum computing task executed before the idle thread state is updated;

[0258] If the third judgment result is yes, then when the target replaceable quantum computing task meets the preset parallel requirement, the target replaceable quantum computing task is obtained as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task;

[0259] If the third judgment result is no, or if the target replaceable quantum computing task does not meet the preset parallel requirement, obtaining the cached parallel quantum computing tasks in the second list;

[0260] When the obtained parallelizable quantum computing task meets the preset parallel requirement, the parallelizable quantum computing task is determined as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task.

[0261] Optionally, the task execution device may further include:

[0262] A second search module is used to search the second list for a tenth quantum computing task that does not meet the preset parallel requirement according to the ninth quantum computing task being executed in the parallel thread at the current moment after executing the fifth quantum computing task using the idle thread;

[0263] The second cache module is used to cache the tenth quantum computing task into the first list.

[0264] Optionally, the task execution device may further include:

[0265] A locking module, configured to lock the idle thread based on the task information of the fifth quantum computing task after executing the fifth quantum computing task using the idle thread, so as to obtain a locked thread;

[0266] The task execution device may further include:

[0267] The release module is used to release each locked thread when the locking time length corresponding to the locked thread is greater than a preset time length threshold.

[0268] Through the device provided by the embodiment of the present application, when the first judgment result indicates that a search operation is to be performed in the first list, the quantum computing tasks in the first list that meet the preset parallel requirements can be searched according to the quantum computing tasks being executed in the parallel thread at the current moment, and the quantum computing tasks that meet the preset parallel requirements and have the highest priority are cached in the second list. When it is determined that there are idle threads in the parallel threads according to the thread state corresponding to the parallel threads at the current moment, a quantum computing task that can be executed in parallel with the quantum computing task being executed at the current moment is obtained from the second list, that is, the fifth quantum computing task is obtained, and the fifth quantum computing task is executed using the idle thread. This allows the fifth quantum computing task to be executed in parallel with the quantum computing task currently being executed in the parallel thread, realizing the parallel execution of multiple quantum computing tasks and improving the efficiency of quantum computing.

[0269] In addition, since the quantum computing tasks cached in the second list are second quantum computing tasks that meet the preset parallel requirements, the preset parallel requirements can be used to implement preliminary screening of the first quantum computing tasks cached in the first list, effectively reducing the number of quantum computing tasks cached in the second list. When there are idle threads in the parallel threads, the fifth quantum computing task can be directly obtained from the second list. Compared with the method of obtaining the fifth quantum computing task from the first list, the number of quantum computing tasks included in the screening sample is effectively reduced, and the time required to obtain the fifth quantum computing task is shortened, thereby shortening the idle time of the thread and improving the quantum computing efficiency.

[0270] Furthermore, since the priority corresponding to the quantum computing tasks cached in the second list is relatively high, this increases the probability that the quantum computing tasks with higher priority are cached in the second list, thereby increasing the probability that the quantum computing tasks with higher priority are executed first.

[0271] Based on the same inventive concept, according to the task execution method provided in the above embodiment of the present application, the embodiment of the present application also provides an electronic device, such as Fig.12 As shown, it includes a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204.

[0272] Memory 1203, used for storing computer programs;

[0273] The processor 1201 is used to execute the program stored in the memory 1203 to implement the following steps:

[0274] Obtain a first judgment result according to a first state of the first list, a second state of the second list, and a third state of the parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel;

[0275] When the first judgment result indicates to perform a search operation in the first list, searching the first list for a quantum computing task that meets the preset parallel requirement according to the third quantum computing task currently being executed in the parallel thread;

[0276] From the quantum computing tasks that meet the preset parallel requirements, obtain the quantum computing task with the highest priority and cache it in the second list;

[0277] When it is determined according to the fourth state that there is an idle thread in the parallel thread, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task is obtained from the second list, the fourth state is the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task is the quantum computing task being executed in the parallel thread at the current moment;

[0278] The fifth quantum computing task is performed using the idle thread.

[0279] Through the electronic device provided by the embodiment of the present application, when the first judgment result indicates to perform a search operation in the first list, the quantum computing tasks in the first list that meet the preset parallel requirements can be searched according to the quantum computing tasks being executed in the parallel thread at the current moment, and the quantum computing tasks that meet the preset parallel requirements and have the highest priority are cached in the second list. When it is determined that there are idle threads in the parallel threads according to the thread state corresponding to the parallel threads at the current moment, a quantum computing task that can be executed in parallel with the quantum computing task being executed at the current moment is obtained from the second list, that is, the fifth quantum computing task is obtained, and the fifth quantum computing task is executed using the idle thread. This allows the fifth quantum computing task to be executed in parallel with the quantum computing task currently being executed in the parallel thread, realizes the parallel execution of multiple quantum computing tasks, and improves the efficiency of quantum computing.

[0280] In addition, since the quantum computing tasks cached in the second list are second quantum computing tasks that meet the preset parallel requirements, the preset parallel requirements can be used to implement preliminary screening of the first quantum computing tasks cached in the first list, effectively reducing the number of quantum computing tasks cached in the second list. When there are idle threads in the parallel threads, the fifth quantum computing task can be directly obtained from the second list. Compared with the method of obtaining the fifth quantum computing task from the first list, the number of quantum computing tasks included in the screening sample is effectively reduced, and the time required to obtain the fifth quantum computing task is shortened, thereby shortening the idle time of the thread and improving the quantum computing efficiency.

[0281] Furthermore, since the priority corresponding to the quantum computing tasks cached in the second list is relatively high, this increases the probability that the quantum computing tasks with higher priority are cached in the second list, thereby increasing the probability that the quantum computing tasks with higher priority are executed first.

[0282] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0283] The communication interface is used for communication between the above electronic device and other devices.

[0284] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0285] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0286] Based on the same inventive concept, according to the task execution method provided in the above-mentioned embodiments of the present application, the embodiments of the present application also provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned task execution methods are implemented.

[0287] Based on the same inventive concept, according to the task execution method provided in the above-mentioned embodiments of the present application, the embodiments of the present application also provide a quantum computer to implement any of the above-mentioned task execution methods.

[0288] Based on the same inventive concept, according to the task execution method provided in the above-mentioned embodiments of the present application, the embodiments of the present application also provide a computer program product containing instructions, which, when executed on a computer, enables the computer to execute any of the task execution methods in the above-mentioned embodiments.

[0289] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0290] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0291] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for embodiments such as devices, electronic devices, computer-readable storage media, quantum computers, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0292] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A task execution method, characterized in that: The method comprises: Obtain a first judgment result according to a first state of the first list, a second state of the second list, and a third state of the parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes multiple threads for executing quantum computing tasks in parallel; When the first judgment result indicates to perform a search operation in the first list, searching the first list for a quantum computing task that meets a preset parallel requirement according to a third quantum computing task currently being executed in the parallel thread; From the quantum computing tasks that meet the preset parallel requirements, obtain the quantum computing task with the highest priority and cache it in the second list; When it is determined according to the fourth state that there is an idle thread in the parallel thread, obtaining a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task from the second list, the fourth state being the thread state corresponding to each thread in the parallel thread at the current moment, and the fourth quantum computing task being the quantum computing task being executed in the parallel thread at the current moment; The fifth quantum computing task is performed using the idle thread.

2. The method according to claim 1, characterized in that The step of obtaining the first judgment result according to the first state of the first list, the second state of the second list and the third state of the parallel thread at the current moment includes: Get the cache state of the first list at the current moment as the first state; Obtain the cache state of the second list at the current moment as the second state; Obtaining the thread state corresponding to each thread in the parallel threads at the current moment as the third state; According to the first state, the second state and the third state, it is determined whether to perform a search operation in the first list to obtain a first determination result.

3. The method according to claim 2, characterized in that The step of determining whether to perform a search operation in the first list according to the first state, the second state, and the third state to obtain a first determination result includes: When it is determined according to the first state that the first list is empty, or when it is determined according to the first state that the first list is not empty and it is determined according to the second state that the number of second quantum computing tasks cached in the second list is equal to a first preset number, obtaining a first judgment result indicating that a search operation is not performed in the first list; When it is determined according to the first state that the first list is not empty, when it is determined according to the second state that no parallelizable quantum computing tasks are cached in the second list, and when it is determined according to the third state that there are idle threads in the parallel threads, a first judgment result indicating searching the first list for parallelizable quantum computing tasks is obtained; When it is determined according to the first state that the first list is not empty, it is determined according to the second state that the number of replaceable quantum computing tasks cached in the second list is less than a second preset number, and it is determined according to the third state that there is no idle thread among the multiple threads, or when it is determined according to the first state that the first list is not empty, it is determined according to the second state that there are parallelizable quantum computing tasks cached in the second list and the number of replaceable quantum computing tasks cached in the second list is less than the second preset number, a first judgment result indicating searching the first list for replaceable quantum computing tasks is obtained; Among them, the parallelizable quantum computing task is a quantum computing task that is determined to be able to be executed in parallel with all quantum computing tasks being executed at the current moment when searching for a quantum computing task that meets the preset parallel requirements; the replaceable quantum computing task is a quantum computing task that is determined to be able to replace the target quantum computing task among all quantum computing tasks being executed at the current moment and be executed in parallel with other quantum computing tasks when searching for a quantum computing task that meets the preset parallel requirements.

4. The method according to claim 3, characterized in that The method further comprises: When the first judgment result indicates that a search operation is not to be performed in the first list, obtaining a thread state of each thread in the parallel threads at the current moment as a fifth state; When it is determined according to the fifth state that there is an idle thread in the parallel threads, and when it is determined according to the second state that the second list is not empty, performing the step of acquiring from the second list a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task; When it is determined that there are no idle threads in the parallel threads according to the fifth state, and / or when it is determined that the second list is empty according to the second state, return to execute the step of obtaining the first judgment result according to the first state of the first list at the current moment, the second state of the second list and the third state of the parallel threads.

5. The method according to claim 3, characterized in that: When the first judgment result indicates that a search operation is to be performed in the first list, the step of searching the first list for a quantum computing task that meets a preset parallel requirement according to the third quantum computing task currently being executed in the parallel thread includes: When the first judgment result indicates to search for parallel quantum computing tasks in the first list, according to the task information corresponding to each first quantum computing task and the task information corresponding to each third quantum computing task currently being executed in the parallel thread, search for a quantum computing task in the first list that can be executed in parallel with all the third quantum computing tasks as a quantum computing task that meets the preset parallel requirement.

6. The method according to claim 3, characterized in that When the first judgment result indicates that a search operation is to be performed in the first list, the step of searching the first list for a quantum computing task that meets a preset parallel requirement according to the third quantum computing task currently being executed in the parallel thread includes: When the first judgment result indicates searching for a replaceable quantum computing task in the first list, for each third quantum computing task currently being executed in the parallel thread, determining whether a replaceable quantum computing task corresponding to the third quantum computing task is cached in the second list, to obtain a second judgment result; Based on the second judgment result, a sixth quantum computing task with the shortest remaining execution time is selected as the target quantum computing task; the sixth quantum computing task is a third quantum computing task for which there is no corresponding quantum computing task that can be replaced; According to the task information corresponding to each first quantum computing task and the task information corresponding to each seventh quantum computing task, a quantum computing task that can be executed in parallel with all seventh quantum computing tasks is searched in the first list as a quantum computing task that meets the preset parallel requirements; the seventh quantum computing task is the third quantum computing task other than the target quantum computing task.

7. The method according to claim 5 or 6, characterized in that: The task information includes a quantum bit identifier; The step of searching, according to the task information corresponding to each first quantum computing task and the task information corresponding to each third quantum computing task currently being executed in the parallel thread, for a quantum computing task in the first list that can be executed in parallel with all the third quantum computing tasks as a quantum computing task that meets the preset parallel requirement includes: According to the first quantum bit identifier in the task information corresponding to each first quantum computing task in the first list, and the second quantum bit identifier in the task information corresponding to each third quantum computing task currently being executed in the parallel thread, searching in the first list for a first quantum computing task whose corresponding task information does not include the second quantum bit identifier as a quantum computing task that meets the preset parallel requirement; The step of searching, in the first list according to the task information corresponding to each first quantum computing task and the task information corresponding to each seventh quantum computing task, for a quantum computing task that can be executed in parallel with all the seventh quantum computing tasks as a quantum computing task that meets the preset parallel requirement includes: According to the first quantum bit identifier in the task information corresponding to each first quantum computing task, and the third quantum bit identifier in the task information corresponding to each seventh quantum computing task, the first quantum computing task whose corresponding task information does not include the third quantum bit identifier is searched in the first list as the quantum computing task that meets the preset parallel requirements.

8. The method according to claim 1, characterized in that The step of acquiring from the second list a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task comprises: Determine whether there is a target replaceable quantum computing task cached in the second list, and obtain a third determination result, wherein the target replaceable quantum computing task corresponds to the eighth quantum computing task executed before the idle thread state is updated; If the third judgment result is yes, then when the target replaceable quantum computing task meets the preset parallel requirement, the target replaceable quantum computing task is obtained as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task; If the third judgment result is no, or if the target replaceable quantum computing task does not meet the preset parallel requirement, obtaining the parallelizable quantum computing tasks cached in the second list; When the obtained parallelizable quantum computing task meets the preset parallel requirement, the parallelizable quantum computing task is determined as a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task.

9. The method according to claim 1, characterized in that: After executing the fifth quantum computing task using the idle thread, the method further includes: According to the ninth quantum computing task being executed in the parallel thread at the current moment, searching the second list for a tenth quantum computing task that does not meet the preset parallel requirement; The tenth quantum computing task is cached in the first list.

10. The method according to claim 1, characterized in that After executing the fifth quantum computing task using the idle thread, the method further includes: Based on the task information of the fifth quantum computing task, locking the idle thread to obtain a locked thread; The method further comprises: For each locked thread, when the locking time length corresponding to the locked thread is greater than a preset time length threshold, the locked thread is released.

11. A task execution device, characterized in that: The device comprises: A first acquisition module is used to acquire a first judgment result according to a first state of a first list, a second state of a second list, and a third state of a parallel thread at a current moment, wherein the first list is used to cache first quantum computing tasks queued for execution, the second list is used to cache second quantum computing tasks obtained from the first list, and the parallel thread includes a plurality of threads for executing quantum computing tasks in parallel; A first search module, configured to search the first list for a quantum computing task that meets a preset parallel requirement according to a third quantum computing task currently being executed in the parallel thread when the first judgment result indicates that a search operation is to be performed in the first list; A first cache module, configured to obtain a quantum computing task with the highest priority from quantum computing tasks that meet the preset parallel requirement and cache it in the second list; a second acquisition module, configured to acquire, from the second list, a fifth quantum computing task that can be executed in parallel with the fourth quantum computing task when it is determined according to a fourth state that there is an idle thread in the parallel thread, wherein the fourth state is a thread state corresponding to each thread in the parallel thread at a current moment, and the fourth quantum computing task is a quantum computing task being executed in the parallel thread at a current moment; An execution module is used to use the idle thread to execute the fifth quantum computing task.

12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 10 when executing a program stored in a memory.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Thread scheduling method and device

    CN112395064A

  • Task processing method, working node device, main node device and storage medium

    CN114756356A

  • Quantum computing task computing method and device and quantum computer operating system

    CN115204399A

  • Network resource display method and device, electronic equipment and storage medium

    CN115237532A

  • Scheduling device and method of quantum control system and quantum computer

    CN115469979A