A method, apparatus and system for task parallelism
By deploying a service control module in the server to judge quantum computing tasks in parallel, and utilizing multiple threads of the task execution device to achieve parallel execution of tasks, the problem of low efficiency in quantum computing is solved, and the computing efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202311124123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-08-31
AI Technical Summary
In quantum computing, when multiple users send tasks simultaneously, the task execution device executes the tasks sequentially, resulting in low computational efficiency and affecting the user experience.
A service control module is deployed in the server. The first service submodule and the second service submodule determine the parallel execution of quantum computing tasks, and the parallel execution of tasks is achieved by using multiple threads in the task execution device.
It effectively shortens the execution time of quantum computing tasks, improves computing efficiency, and saves computing resources of task execution equipment.
Smart Images

Figure CN119539104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing technology, and in particular to a method, apparatus and system for parallel execution of tasks. Background Technology
[0002] Quantum computing is a computational paradigm that utilizes the fundamental properties of quantum mechanics to solve problems. By constructing precisely operable quantum physics hardware systems and running quantum computing software to implement quantum algorithms, computational problems can be solved, enabling the application of quantum computing in specific problems or fields.
[0003] In quantum computing, users can directly send quantum computing tasks to the task execution device, which then executes the received tasks and obtains the results. For example, when the task execution device is a measurement and control device in a quantum computing measurement and control system, upon receiving a quantum computing task such as quantum state testing from the user, the measurement and control device will execute the task and obtain the corresponding 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 in which the quantum computing tasks are received. 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 this invention is to provide a method, apparatus, and system for parallel task execution, thereby shortening the execution time of all quantum computing tasks and improving quantum computing efficiency. The specific technical solution is as follows:
[0006] This application provides a method for parallel task execution, applied to a service control module in a server. The service control module includes a first service submodule and a second service submodule. The first service submodule is communicatively connected to a task execution device, which includes multiple threads for parallel execution of quantum computing tasks. The method includes:
[0007] The second service submodule obtains first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes task identifier and parallel judgment data.
[0008] The second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains a first judgment result;
[0009] When the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule;
[0010] The first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0011] This application embodiment also provides a task parallel execution device, the device being a server, the server including a service control module, the service control module including a first service sub-module and a second service sub-module, the first service sub-module being communicatively connected to a task execution device, the task execution device including multiple threads for parallel execution of quantum computing tasks;
[0012] The second service submodule is used to obtain first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule.
[0013] The first service submodule is used to forward the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0014] This application embodiment also provides a task parallel execution system, the system including a server and a task execution device, the server including a service control module, the service control module including a first service submodule and a second service submodule, the first service submodule being communicatively connected to the task execution device, the task execution device including multiple threads for parallel execution of quantum computing tasks;
[0015] The second service submodule is used to obtain first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule.
[0016] The first service submodule is used to forward the received task identifier to the task execution device;
[0017] The task execution device is used to invoke an idle thread to execute the first task based on the received task identifier.
[0018] This application also provides a quantum control system that implements the task parallel execution method steps described in any of the above claims.
[0019] This application also provides a quantum computer, including the aforementioned quantum control system.
[0020] Beneficial effects of the embodiments of the present invention:
[0021] The technical solution provided by this invention can deploy multiple threads for parallel execution of quantum computing tasks in a task execution device. A second service submodule in the service control module determines the parallel execution of the first and second tasks based on parallel judgment data in the information of the first task to be executed and the parallel judgment data in the information of the second task currently being executed in parallel in the task execution device. A first judgment result is obtained, and when the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier in the first task information is sent to the first service submodule in the service control module. The first service submodule then forwards the task identifier to the task execution module. The task execution module, based on the received task identifier, executes the first task while simultaneously executing the second task, thus achieving parallel execution of the first and second tasks.
[0022] Compared to related technologies where each quantum computing task needs to be executed one by one, the task execution device provided in this application has multiple threads that can execute quantum computing tasks in parallel. This allows the task execution device to execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the efficiency of quantum computing task execution, and thus improving the efficiency of quantum computing.
[0023] In addition, the process of determining parallel execution of tasks is deployed in a server that communicates with the task execution device. Compared with the method of directly determining parallel execution of tasks by the task execution device, this method saves the computing resources of the task execution device and improves the processing capability of the task execution device for quantum computing tasks while ensuring the parallel execution of quantum computing tasks.
[0024] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of a task execution system in related technologies;
[0027] Figure 2 This is a first signaling diagram for a task parallel execution method provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a first structure of a task parallel execution system provided in an embodiment of this application;
[0029] Figure 4 This is a second signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0030] Figure 5 A third signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0031] Figure 6 A fourth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0032] Figure 7 A fifth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0033] Figure 8 A sixth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0034] Figure 9 A seventh signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0035] Figure 10An eighth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0036] Figure 11 A ninth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0037] Figure 12 A tenth signaling diagram for the task parallel execution method provided in the embodiments of this application;
[0038] Figure 13 A schematic diagram of a task parallel execution device provided in an embodiment of this application;
[0039] Figure 14 This is a schematic diagram of a second structure of the parallel task execution system provided in the embodiments of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] like Figure 1 As shown, Figure 1 This is a schematic diagram of a task execution system in related technologies. The task execution system includes a user terminal 101 and a task execution device 102. The task execution device 102 can communicate with multiple user terminals 101. Figure 1 (Not shown in the image).
[0042] Different users can send quantum computing tasks to the task execution device through their respective client terminals. The task execution device needs to process each received quantum computing task one by one to obtain the task execution result. Since all quantum computing tasks need to be executed one by one in the task execution device, it will take a considerable amount of time to complete all quantum computing tasks.
[0043] In addition, as the number of connected users continues to grow, and the number of quantum computing tasks that users need to perform increases, queuing may occur in the task execution devices, causing quantum computing tasks to be unable to be executed for a long time, which affects the user experience.
[0044] To address the problems in related technologies, embodiments of this application provide a method for parallel task execution. For example... Figure 2 As shown, Figure 2This is a first signaling diagram for a task parallel execution method provided in an embodiment of this application. The method is applied to a service control module in a server, which includes a first service submodule and a second service submodule. The first service submodule is communicatively connected to a task execution device, which includes multiple threads for parallel execution of quantum computing tasks. Figure 2 The method shown includes the following steps.
[0045] Step S201: The second service submodule obtains the first task information and the second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task executed in parallel in the current thread. The task information includes task identifier and parallel judgment data.
[0046] In step S202, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0047] In step S203, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0048] In step S204, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0049] In this embodiment, the user terminal, server, and task execution device can together constitute a parallel task execution system. For example... Figure 3 As shown, Figure 3 This is a schematic diagram of a first structure of a task parallel execution system provided in an embodiment of this application.
[0050] The aforementioned server can be composed of a service module and a service control module. The service control module may include a first service submodule, a second service submodule, and a third service submodule.
[0051] In the above-mentioned parallel task execution system, the server is connected to both the user terminal and the task execution device. Specifically, the user terminal is connected to the service module in the server, the service module is connected to the first service sub-module and the third service sub-module in the service control module, and the first service sub-module is connected to the task execution device.
[0052] The above Figure 3The parallel task execution system shown only illustrates the communication connection between the user client and the server. In addition, the user client can also communicate with the task execution device. For example, after the task execution device performs parallel execution of a quantum computing task and obtains the task execution result, the user client can directly communicate with the task execution device to retrieve the task execution result of its corresponding quantum computing task.
[0053] The aforementioned task execution device pre-deploys multiple threads for parallel execution of quantum computing tasks. The specific number of threads in the task execution device is not limited here.
[0054] In this embodiment, the service control module in the server can be a service instance or a hardware unit. Furthermore, the number of service control modules in the server can be multiple. When there are multiple service control modules in the server, the number of corresponding task execution devices is also multiple; that is, there is a one-to-one correspondence between the task execution devices and the service control modules in the server. Here, the specific form of the service control modules in the parallel task execution system, as well as the number of service control modules and task execution devices, are not limited.
[0055] Regarding the above Figure 3 The information exchange process between different devices can be found in the following description, and will not be explained in detail here.
[0056] The method provided in this application embodiment allows for the deployment of multiple threads for parallel execution of quantum computing tasks in a task execution device. A second service submodule in the service control module determines the parallel execution of the first and second tasks based on parallel judgment data in the first task information corresponding to the first task to be executed and parallel judgment data in the second task information corresponding to the currently parallel-executed second task in the task execution device. A first judgment result is obtained, and when the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier in the first task information is sent to the first service submodule in the service control module. The first service submodule then forwards the task identifier to the task execution module. The task execution module, based on the received task identifier, executes the first task while simultaneously executing the second task, thus achieving parallel execution of the first and second tasks.
[0057] Compared to related technologies where each quantum computing task needs to be executed one by one, the task execution device provided in this application has multiple threads that can execute quantum computing tasks in parallel. This allows the task execution device to execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the efficiency of quantum computing task execution, and thus improving the efficiency of quantum computing.
[0058] In addition, the process of determining parallel execution of tasks is deployed in a server that communicates with the task execution device. Compared with the method of directly determining parallel execution of tasks by the task execution device, this method saves the computing resources of the task execution device and improves the processing capability of the task execution device for quantum computing tasks while ensuring the parallel execution of quantum computing tasks.
[0059] The embodiments of this application will be described below through specific examples.
[0060] Regarding step S201 above, the second service submodule obtains the first task information and the second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task executed in parallel in the current thread. The task information includes task identifier and parallel judgment data.
[0061] In this embodiment, the task execution module includes a preset database that stores pre-registered quantum computing tasks. The preset database stores at least the task identifier for each quantum computing task and all task data required for the execution of each quantum computing task.
[0062] Users can obtain the task identifier of the quantum computing task they want to execute through queries or other means. When issuing a quantum computing task to be executed to the task execution device, the user can send the task information of the quantum computing task to be executed to the service module in the server through the user terminal. The task information includes the task identifier of the quantum computing task to be executed, as well as the parallel judgment data of the quantum computing task to be executed.
[0063] After receiving task information from the user, the service module can forward the task information to the first service submodule in the service control module. The first service submodule can cache the received task information and obtain a list of quantum computing tasks to be executed (denoted as the first list).
[0064] In an optional embodiment, the first service submodule may send multiple task information to the second service submodule according to the caching order of the task information in the first list. After receiving the multiple task information sent by the first service submodule, the second service submodule may cache the received task information to obtain a list of quantum computing tasks to be executed (denoted as the second list).
[0065] When obtaining the first task information, the second service submodule can obtain the task information of any quantum computing task to be executed (denoted as the first task) from the second list above, and thus obtain the first task information.
[0066] In an optional embodiment, the first list and the second list can be task queues. When the first list and the second list are task queues, both the first service submodule and the second service submodule will retrieve task information from the first list and the second list in a first-in-first-out order.
[0067] In an optional embodiment, the second service submodule pre-caches task status information (denoted as second task information) of the quantum computing tasks (denoted as second tasks) being executed in parallel by each thread in the task execution device at the current moment. When obtaining the second task information, the second service submodule can directly obtain the second task information stored within itself.
[0068] Depending on the progress of task execution in each thread of the aforementioned task execution device, the number of quantum computing tasks executed in parallel at different points in time also varies. Therefore, when the aforementioned second service submodule obtains the aforementioned second task information, the number of pieces of second task information it obtains can be empty or one or more. Here, no specific limit is placed on the number of pieces of second task information obtained by the aforementioned second service submodule.
[0069] In an optional embodiment, the parallel judgment data in each of the above task information may include one or more of the following: the qubit identifier corresponding to the quantum computing task and the qubit common oscillator data. The qubit common oscillator data may include the frequency and channel information corresponding to the qubit.
[0070] In this embodiment, the aforementioned qubit identifier is the identifier corresponding to the qubit used to perform quantum computing. This qubit identifier is used to determine whether the qubits used by parallel quantum computing tasks conflict.
[0071] The aforementioned qubit co-oscillator data is used to determine whether oscillator conflicts exist in parallel quantum computing tasks. In related technologies, since the frequency range of a signal generated by a single oscillator source is limited, multiple qubits in a quantum chip often share a single oscillator source to reduce the increased cost caused by configuring a separate oscillator source for each qubit. The aforementioned quantum co-eigenvalue data can be used to detect oscillator conflicts, thereby determining whether the qubits corresponding to parallel quantum computing tasks share the same eigensource.
[0072] In the embodiments of this application, the parallel judgment data may vary depending on the different tests and calculations involved in the quantum computing process, as well as the different designs of the quantum chip. For example, in addition to the aforementioned qubit identifier and qubit common oscillator data, the parallel judgment data may also include parameters such as signal readout frequency and amplitude. Here, no specific limitation is made on the parameters included in the aforementioned parallel judgment data and the aforementioned qubit common oscillator data.
[0073] In the above embodiments, the first task information and the second task information can be acquired simultaneously or sequentially. Here, there is no specific limitation on the acquisition time of the first task information and the second task information.
[0074] Regarding step S202 above, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0075] In an optional embodiment, when the number of second task information obtained by the second service submodule is empty, the second service submodule can directly determine that the first task can be executed in parallel with other tasks. In this case, the first service submodule can execute the step of sending the task identifier of the first task to the first service submodule in step S203.
[0076] In another optional embodiment, when the number of second task information obtained by the second service submodule is one or more, the second service submodule can compare each type of parameter in the parallel judgment data included in the first task information with each type of parameter in the parallel judgment data included in the second task information, and determine whether the first task and the second task can be executed in parallel based on the comparison result corresponding to each type of parameter, and obtain the judgment result (denoted as the first judgment result).
[0077] The aforementioned first judgment result can indicate whether the first task can be executed in parallel with the second task, or it can indicate whether the first task cannot be executed in parallel with the second task.
[0078] The method for determining the first judgment result mentioned above can be found in the following description, and will not be repeated here.
[0079] Regarding step S203 above, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0080] In this step, when the first determination result indicates that the first task can be executed in parallel with the second task, the second service submodule can determine that the first task can be sent to the task execution device for parallel execution with the second task. At this time, the second service submodule can send the task identifier of the first task to the first service submodule.
[0081] In an optional embodiment, when the first determination result indicates that the first task cannot be executed in parallel with the second task, the second service submodule can determine that the first task cannot be sent to the task execution device for parallel execution with the second task. At this time, the second service submodule can retrieve new task information from the second list as the first task information and return to execute step S202.
[0082] In an optional embodiment, when the first determination result indicates that the first task cannot be executed in parallel with the second task, the second service submodule can re-cache the first task information into the second queue. Here, the processing method for the first task information is not specifically limited.
[0083] Regarding step S204 above, the first service submodule forwards the received task identifier to the task execution device so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0084] In this step, after the second service submodule sends the task identifier corresponding to the first task to the first service submodule, the first service submodule will receive the task identifier. At this time, the first service submodule can forward the task identifier to the task execution device.
[0085] When the task execution device receives the task identifier corresponding to the first task sent by the first service submodule, it can retrieve all task data corresponding to the first task from the aforementioned preset database based on the task identifier. The task execution device can then use an idle thread to execute the first task based on the retrieved task data. At this time, the first task and the aforementioned second task are executed in parallel.
[0086] The data for all tasks corresponding to the first task mentioned above may include the information for the first task. Here, no specific limitation is made on the total data for each quantum computing task.
[0087] In an optional embodiment, when the parallel judgment data includes the qubit identifier and the qubit common oscillator data, according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 4 As shown, Figure 4 This is a second signaling diagram for the task parallel execution method provided in the embodiments of this application. Figure 4 The method shown is further refined into the following steps: step S202.
[0088] In step S2021, the second service submodule compares the qubit identifier in each second task information with the qubit identifier in the first task information to obtain the comparison result.
[0089] In this step, for each second task, the second service submodule can compare the qubit identifier in the second task information of the second task with the qubit identifier in the first task information of the first task to obtain the comparison result corresponding to the second task.
[0090] The comparison results corresponding to the first task in step S2021 above can include the following two cases:
[0091] Scenario 1: The comparison results indicate that the qubit identifiers in each of the second task information do not include the qubit identifiers in the first task information.
[0092] Scenario 2: The comparison results indicate that the qubit identifier in the second task information includes the qubit identifier in the first task information.
[0093] In step S2022, the second service submodule determines whether the first task and the second task meet the preset co-oscillation condition based on the qubit co-oscillation data in each second task information and the qubit co-oscillation data in the first task information, and obtains the second judgment result.
[0094] In one optional embodiment, the aforementioned qubit co-oscillator data may include the frequency and channel information corresponding to the qubit. A preset co-oscillator condition can be that the frequency differences between the qubits performing quantum computing in parallel are the same.
[0095] The second service submodule can determine adjacent qubits based on the channel information included in the common oscillator data of the qubits corresponding to the first and second task information. Then, based on the frequency in the common oscillator data, it calculates the frequency difference between adjacent qubits. The second service submodule can compare the calculated frequency differences between adjacent qubits to determine whether the frequency differences are the same value, thereby determining whether the first task and each of the second tasks meet the preset common oscillator condition, and obtaining a second judgment result.
[0096] The second judgment result mentioned above can include the following two situations:
[0097] Scenario 3: The second judgment result indicates that the first task and the second task meet the preset common oscillator condition; that is, the frequency difference between the adjacent qubits is the same value.
[0098] Case 4: The second judgment result indicates that the first task and the second task do not meet the preset common oscillator condition; that is, the frequency difference between the adjacent qubits is not the same data.
[0099] In this embodiment, based on the difference between the comparison result and the second judgment result, the second service submodule will execute different steps respectively. That is, the second service submodule can determine whether the first task can be executed in parallel with the second task based on the comparison result and the second judgment result, and obtain the first judgment result. Depending on the first judgment result, the second service submodule will execute step S2023 or step S2024 respectively. Here, the execution of steps S2023 and S2024 is not specifically limited.
[0100] exist Figure 4 In the illustrated embodiment, step S2021 is performed before step S2022. Alternatively, step S2022 may be performed before or simultaneously with step S2021. The specific execution order of steps S2021 and S2022 is not specifically limited here.
[0101] In step S2023, when the comparison result indicates that the qubit identifier in each second task information does not include the qubit identifier in the first task information, and the second judgment result indicates that the first task and the second task meet the preset common oscillation condition, the second service submodule obtains a first judgment result indicating that the first task can be executed in parallel with the second task.
[0102] In this step, regarding scenarios one and two, and scenarios three and four, when both scenario one and scenario three are satisfied, the second service submodule can determine that the first task and the second task can be executed in parallel. At this time, the second service submodule can obtain a first judgment result indicating that the first task can be executed in parallel with the second task.
[0103] In step S2024, the second service submodule obtains a first judgment result indicating that the first task cannot be executed in parallel with the second task when the comparison result indicates that the qubit identifier in the second task information includes the qubit identifier in the first task information, and / or the second judgment result indicates that the first task and the second task do not meet the preset common oscillation condition.
[0104] In this step, regarding scenarios one and two, and scenarios three and four, if any of scenarios two and four occur, the second service submodule can determine that the first task and the second task cannot be executed in parallel. At this point, the second service submodule can obtain a first judgment result indicating that the first task cannot be executed in parallel with the second task.
[0105] Through the above steps S2021-S2024, the second service submodule can determine whether the qubits required for the execution of the first task are occupied, and whether the quantum computing tasks executed in parallel are in sync, based on the qubit identifier and qubit co-oscillation data in the parallel judgment data, thereby determining whether the first task and the second task can be executed in parallel.
[0106] In steps S2021-S2024 above, the determination of the first judgment result is explained using only the example of parallel judgment data including qubit identifiers and qubit co-oscillator data. In addition, the second service submodule may also consider the impact of other factors on the parallel execution of quantum computing tasks.
[0107] For ease of understanding, the above parallel judgment data also includes reading frequency and amplitude as an example.
[0108] In an optional embodiment, in a known quantum chip, signals in the readout cavity corresponding to each qubit can be read through the same readout bus using frequency division multiplexing (FDM) technology. Demodulation of the signals in the readout bus can determine the task execution result obtained after each qubit performs a quantum computing task. Therefore, for this quantum chip, the aforementioned parallel judgment data can further include readout frequency and amplitude. The second service submodule can perform parallel judgments on the first and second tasks in the FDM dimension based on the readout frequency and amplitude in the first task information corresponding to the first task, and the readout frequency and amplitude in the second task information corresponding to the second task, thereby determining whether the first and second tasks meet the FDM requirements and obtaining a third judgment result. The second service submodule can determine the aforementioned first judgment result based on the aforementioned comparison result, the second judgment result, and the third judgment result.
[0109] In this embodiment, the parameters included in the parallel judgment data in the task information will vary depending on the quantum chip, application scenario, user needs, etc. When the parameters included in the parallel judgment parameters are different, the method for determining the first judgment result based on those parameters will also differ. Here, the method for obtaining the first judgment result is not specifically limited.
[0110] In this embodiment of the application, the kernel of the first service submodule caches the thread state information of each thread in the task execution device, and the thread state information includes the thread occupancy status of each thread.
[0111] The thread occupancy status of each thread indicates whether it is currently executing a quantum computing task. For example, when a thread's occupancy status is active, it indicates that the thread is currently executing a quantum computing task. When a thread's occupancy status is idle, it indicates that the thread is idle, meaning that the thread is not currently executing a quantum computing task.
[0112] In addition to the thread occupancy status mentioned above, the thread state information may also include the task identifier corresponding to the quantum computing task currently being executed by each thread. For example, when a thread's occupancy status is in the "occupancy" state, the thread state information for that thread may include the task identifier of the quantum computing task currently being executed by that thread. When a thread's occupancy status is in the "idle" state, the position of the task identifier in the thread state information for that thread will be empty.
[0113] In an optional embodiment, the thread state information cached in the kernel of the first service submodule is determined according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 5 As shown, Figure 5 A third signaling diagram for a task parallel execution method provided in embodiments of this application. The method includes the following steps.
[0114] In step S501, the second service submodule reads the thread status information cached by the first service submodule, and based on the thread occupancy status in the thread status information, detects whether there are idle threads in the task execution device and obtains the detection result.
[0115] In this step, the second service submodule has read permission for the thread state information cached in the first service submodule. The second service submodule can determine the thread occupancy status of each thread in the task execution device at the current moment by reading this thread state information in real time, and based on the thread occupancy status of each thread, determine whether there are idle threads in the task execution device, thus obtaining a detection result. In other words, the second service submodule can determine whether there are threads in the task execution device with the aforementioned idle state based on the thread occupancy status in the thread state information, and obtain a detection result.
[0116] In this embodiment of the application, the above detection result can indicate whether there is an idle thread in the task execution device or whether there is no idle thread in the task execution device.
[0117] In step S502, when the detection result indicates that there is an idle thread in the task execution device, the second service submodule obtains the first task information and the second task information.
[0118] In this step, when the detection result in step S501 indicates that there is an idle thread in the task execution device, that is, when there is a thread in the task execution device whose thread occupancy state is the aforementioned idle state, the second service submodule can obtain the first task information and the second task information.
[0119] The acquisition of the first task information and the second task information in step S502 above can be referred to the acquisition method of the first task information and the second task information in step S201 above, and will not be repeated here.
[0120] Through steps S501-S502, the second service submodule can accurately determine the thread occupancy status of each thread in the task execution device at the current moment based on the thread status information maintained in the first service submodule. Thus, when there are idle threads in the task execution device, the first service submodule can obtain the first task information and the second task information. This allows the first service submodule to directly send quantum computing tasks that can run in parallel with the second task to the task execution device once an idle thread appears, ensuring the parallel execution of different quantum computing tasks in the task execution device and improving the resource utilization of the task execution device.
[0121] In step S503, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0122] In step S504, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0123] In step S505, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0124] The steps S503-S505 described above are the same as steps S202-S204.
[0125] In an optional embodiment, when the monitoring result indicates that there is an idle thread in the task execution device, the second service submodule can obtain the thread identifier of the idle thread, and when performing the step of sending the task identifier of the first task to the first service submodule in step S504, send the task identifier of the first task and the thread identifier of the idle thread to the first service submodule, so that the first service submodule can send the received task identifier and thread identifier to the task execution device together.
[0126] In an optional embodiment, when the detection result indicates that there are no idle threads in the task execution device, the second service submodule may not perform any processing. That is, the second service submodule will not execute the steps of obtaining the first and second task information.
[0127] In another alternative embodiment, according to the above... Figure 5 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 6 As shown, Figure 6 A fourth signaling diagram for a task parallel execution method provided in embodiments of this application. The method includes the following steps.
[0128] In step S601, the second service submodule reads the thread status information cached by the first service submodule, and based on the thread occupancy status in the thread status information, detects whether there are idle threads in the task execution device and obtains the detection result.
[0129] The above step S601 is the same as the above step S501.
[0130] In step S602, when the detection result indicates that there are no idle threads in the task execution device, the second service submodule obtains the estimated end time of the quantum computing task execution corresponding to each thread in the task execution device.
[0131] In an optional embodiment, in addition to the thread occupancy status of each thread, the thread state information may also include the estimated completion time of the quantum computing task corresponding to each thread. This estimated completion time can be estimated based on the historical execution times of similar quantum computing tasks.
[0132] When the above detection results indicate that there are no idle threads in the task execution device, that is, when every thread in the task execution device is executing a quantum computing task at the current moment, the second service submodule can determine the estimated end time of the execution of the quantum computing task corresponding to each thread based on the above thread status information.
[0133] In another optional embodiment, for each thread, the second service submodule can obtain the historical execution time of the same type of quantum computing task based on the task identifier corresponding to the quantum computing task currently being executed by the thread in the thread status information, and estimate the estimated end time of the quantum computing task corresponding to the thread based on the historical execution time.
[0134] In one optional embodiment, when estimating the estimated end time of a quantum computing task based on the historical execution times of similar quantum computing tasks, the average historical execution times of similar quantum computing tasks can be calculated. The difference between this average and the already executed time of the corresponding quantum computing task can be calculated to obtain the remaining time required for the execution of the quantum computing task. Based on the remaining time and a preset time error, the estimated end time of the quantum computing task can be estimated. Alternatively, the remaining time can be directly determined as the estimated end time of the quantum computing task. Here, the method for determining the estimated end time is not specifically limited.
[0135] In step S603, when the estimated end time is less than a preset time threshold, the second service submodule obtains the first task information and the second task information.
[0136] In this embodiment of the application, after the second service submodule determines the estimated end time of the quantum computing task (i.e. the second task mentioned above) corresponding to each thread, it can compare the estimated end time with a preset time threshold.
[0137] The aforementioned preset time threshold can be determined based on the duration of information interaction between the second service submodule, the first service submodule, and the task execution device.
[0138] When the estimated completion time of a quantum computing task corresponding to a certain thread is less than the aforementioned preset time threshold, the second service submodule can determine that the quantum computing task corresponding to that thread is about to be completed. At this time, the second service submodule can obtain the first task information and the second task information.
[0139] In an optional embodiment, when none of the aforementioned threads has an estimated end time not less than a preset time threshold (i.e., the estimated end time for each thread is greater than or equal to the preset time threshold), the second service submodule can determine that the quantum computing tasks corresponding to the aforementioned threads still need to be executed for a period of time. In this case, the second service submodule can perform no processing. That is, the second service sub-model will not execute the steps of obtaining the first task information and the second task information.
[0140] Through steps S601-S603 above, when there are no idle threads in the above detection results, the second service submodule can complete the parallel task acquisition process before the quantum computing tasks of each thread are completed by comparing the estimated end time of each thread with the preset time threshold. This allows the execution of quantum computing tasks to be seamlessly connected, improves the parallel execution efficiency of quantum computing tasks, and improves resource utilization.
[0141] In step S604, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0142] In step S605, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0143] In step S606, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0144] Steps S604-S606 are the same as steps S503-S505.
[0145] In an optional embodiment, according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 7 As shown, Figure 7 This is a fifth signaling diagram for the task parallel execution method provided in the embodiments of this application. Figure 7 The method shown has been augmented with the following steps, namely steps S205-S206.
[0146] In step S205, the first service submodule receives a thread state update instruction, which is sent by the task execution device when the thread state is updated.
[0147] In this step, the task execution device can monitor the thread status of the multiple threads in real time. When a thread status update is detected, the task execution device can send a thread status update command to the first service submodule. At this time, the first service submodule will receive the thread status update command.
[0148] The thread state update instruction mentioned above can include the thread identifier of the thread to be updated. This thread state update instruction can be a thread acquisition instruction or a thread release instruction.
[0149] In this embodiment, the thread occupancy instruction can be sent by the task execution device when it calls an idle thread to execute a quantum computing task. The thread release instruction can be sent by a thread in the task execution device when it completes the execution of the quantum computing task.
[0150] In step S206, the first service submodule updates the thread status information based on the thread status update instruction.
[0151] In an optional embodiment, when the thread state update instruction is a thread occupancy instruction, the thread state occupancy instruction may include the task identifier of the quantum computing task occupying the thread. Upon receiving the thread state update instruction, the first service submodule can update the thread state information according to the thread identifier and task identifier in the thread state update instruction. That is, the first service submodule can update the current state of the thread to be updated corresponding to the thread identifier from idle to occupied, and add the task identifier of the quantum computing task corresponding to the thread to be updated to the thread state information.
[0152] In another optional embodiment, when the thread state update instruction is the thread release instruction, the first service submodule can update the thread state information corresponding to the thread to be updated according to the received thread state update instruction. For example, the first service submodule updates the current state of the thread to be updated in the above thread state information from occupied state to idle state, and deletes the task identifier of the quantum computing task corresponding to the thread to be updated.
[0153] Through steps S205-S206, the task execution device can promptly notify the first service submodule when the thread status of each thread is updated. This allows the first service submodule to update the thread status information in a timely manner according to the thread status update instruction, ensuring the accuracy of the thread status information and the accuracy of the detection results of the second service submodule on each thread in the task execution device.
[0154] exist Figure 7 In the illustrated embodiment, the update times of the thread states in the task execution device will vary depending on the execution time of different quantum computing tasks and the start time of the quantum computing tasks in the task execution device. Therefore, the timing of the thread update instruction received by the first service submodule will also vary. That is, during the parallel execution of tasks, the first service submodule can receive the aforementioned thread update instruction at any time. Here, the execution time of steps S205-S206 is not specifically limited.
[0155] In an optional embodiment, the thread state information above also includes the task identifier corresponding to the quantum computing task currently being executed by each thread; the second service submodule caches the second task information of the second task.
[0156] In an optional embodiment, when the above thread state update instruction is a thread release instruction, according to the above... Figure 7 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 8 As shown, Figure 8 This is a sixth signaling diagram for the task parallel execution method provided in the embodiments of this application. Figure 8 The method shown has been augmented with the following steps, namely steps S207-S208.
[0157] Step S207: When the second service submodule detects that the first service submodule has updated the thread status information based on the thread release instruction, it obtains the task identifier of the third task corresponding to the thread whose status is updated.
[0158] In this step, when the thread state update instruction is the same as the thread release instruction, the first service submodule updates the thread state information according to the release instruction. Since the second service submodule has read permissions for the thread state information, it can synchronously detect this update operation. The second service submodule can obtain the task identifier of the third task corresponding to the thread performing the state update; that is, it obtains the task identifier of the quantum computing task corresponding to the thread to be updated before the thread state information update. The third task is the second task that the thread performing the state update was executing before the state update.
[0159] In this embodiment of the application, step S207 can be executed simultaneously with step S206.
[0160] In step S208, the second service submodule deletes the task information of the third task from its own cached second task information based on the task identifier of the third task.
[0161] In this step, after obtaining the task identifier of the third task, the second service submodule can determine that the third task has been completed in the task execution device. At this time, the second service submodule can delete the task information of the third task from its own cached second task information.
[0162] Through steps S207-S208, when the second service submodule detects that the first service submodule updates the thread state information according to the received thread release instruction, it also updates its own stored second task information. This effectively ensures the accuracy of its stored second task information, thereby ensuring the accuracy of the first judgment result and laying the foundation for the parallel execution of different quantum computing tasks.
[0163] In an optional embodiment, when the second service submodule caches the second task information, according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 9 As shown, Figure 9 This is the seventh signaling diagram for the task parallel execution method provided in the embodiments of this application. Figure 7 The method shown includes the addition of the following step, namely step S209.
[0164] In step S209, the second service submodule caches the first task information of the first task as the second task information.
[0165] In this step, after the second service submodule sends the task identifier of the first task to the first service submodule, the second service submodule can determine that the task execution device will execute the first task and the second task in parallel. At this time, the second service submodule can update its stored second task information, that is, cache the first task information of the first task as the second task information of the aforementioned second task.
[0166] Through the above step S209, the second service submodule can update the first task to the second task being executed by the task execution device after determining that the first task and the second task can be executed in parallel, effectively ensuring the accuracy of the stored second task information, thereby ensuring the accuracy of the above first judgment result and laying the foundation for the parallel execution of different quantum computing tasks.
[0167] Step S209 is executed after step S203. The specific execution order of steps S204 and S209 is not specified here.
[0168] In the above Figure 9 In the illustrated embodiment, the update of the second task information cached in the second service submodule is performed when the second service submodule sends the task identifier of the quantum computing task that is executed in parallel with the second task to the first service submodule. In addition, considering that the second service submodule can detect the aforementioned thread state information in real time, the second service submodule can also update the second task information when the first service submodule updates the thread state information according to the received thread occupancy instruction.
[0169] In this embodiment of the application, the method of updating the second task information cached by the second service submodule itself is not specifically limited.
[0170] In an optional embodiment, according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 10 As shown, Figure 10 This is the eighth signaling diagram for the task parallel execution method provided in the embodiments of this application. Figure 10 The method shown has been augmented with the following steps, namely steps S210-S211.
[0171] Step S210: The first service submodule receives a status query instruction sent by the user through the service module. The status query instruction includes the task identifier of the task to be queried.
[0172] In this embodiment, after the user terminal establishes a communication connection with the service module in the server, the user can trigger a status query operation for a specific task (denoted as the task to be queried) on the user terminal. At this time, the user terminal will send a status query instruction for the task to be queried to the service module. This status query instruction includes the task identifier of the task to be queried.
[0173] After receiving a status query command from the user terminal, the service module can forward the command to the first service submodule with which it has a communication connection. At this point, the first service submodule will receive the status query command.
[0174] In step S211, the first service submodule determines the current task status of the task to be queried based on the task identifier in the status query instruction and the task identifier in the thread status information, and sends the current task status of the task to be queried to the service module.
[0175] In this embodiment of the application, after receiving the above-mentioned status query instruction, the first service submodule can query whether the task identifier of the quantum computing task corresponding to each thread in the above-mentioned thread status information includes the task identifier, based on the task identifier carried in the status query instruction.
[0176] In an optional embodiment, if the thread status information includes a task identifier carried by the status query command, the first service submodule can determine that the current task status of the task to be queried is in the execution state. The first service submodule can send the current task status to the service module. The service module returns the received current task status to the user terminal.
[0177] In another optional embodiment, if the thread status information does not include the task identifier carried by the status query instruction, the first service submodule can determine whether the current status of the task to be queried is a waiting state or a completed state. The waiting state indicates that the quantum computing task is waiting to be sent to the task execution device, while the completed state indicates that the task execution device has completed the execution process of the quantum computing task.
[0178] In an optional embodiment, for the above-mentioned waiting state and end state, the first service submodule can determine whether to send the task identifier of the task to be queried to the task execution device based on the log information.
[0179] If the first service submodule does not send the task identifier of the task to be queried to the task execution device, the first service submodule can determine that the current status of the task to be queried is a waiting state. If the first service submodule sends the task identifier of the task to be queried to the task execution device, the first service submodule can determine that the current status of the task to be queried is a completed state.
[0180] Through steps S210-S211 above, when the first service submodule receives a status query instruction, it can promptly and accurately determine the current task status of the task to be queried based on the task identifier, and provide feedback on the current task status to the user, so that the user can understand the task execution status in a timely manner.
[0181] In an optional embodiment, according to the above... Figure 2 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 11 As shown, Figure 11 A ninth signaling diagram for a task parallel execution method provided in this application embodiment. The method includes the following steps.
[0182] Step S1101: The third service submodule receives an initialization instruction sent by the service module. The initialization instruction includes initialization parameters and the address information of the task execution module.
[0183] In this embodiment, the service modules in the server can communicate with the third service submodule in addition to the first service submodule. For each service control module included in the server, the user can trigger an initialization operation on that service control module through a client. At this time, the client will send an initialization command to the service module in the server. This initialization command includes the module identifier of the service control module, initialization parameters, and the address information of the task execution module.
[0184] After receiving the initialization command from the user, the service module can forward the command to the third service submodule within the corresponding service control module (denoted as the target service control module) based on the module identifier. At this point, the third service submodule will receive the initialization command.
[0185] In step S1102, the third service submodule initializes and configures the first and second service submodules in the target service control module based on the initialization parameters, and establishes a communication connection between the task execution module and the first service submodule in the target service control module based on the address information. The target service control module is the service control module where the third service submodule is located.
[0186] The initialization configuration process and communication connection establishment process described above will not be explained in detail here.
[0187] Through the above steps S1101-S1102, the third service submodule in the service control module can complete the initialization process of the first and second service submodules in the service control module, so that the configured first and second service submodules can run normally.
[0188] Step S1103: The second service submodule obtains the first task information and the second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task executed in parallel in the current thread. The task information includes task identifier and parallel judgment data.
[0189] In step S1104, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0190] In step S1105, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0191] In step S1106, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0192] The steps S1103-S1106 described above are the same as the steps S201-S204 described above.
[0193] In an optional embodiment, according to the above... Figure 11 The method shown in this application embodiment also provides a method for parallel execution of tasks. For example... Figure 12 As shown, Figure 12 A tenth signaling diagram for a task parallel execution method provided in this application embodiment. The method includes the following steps.
[0194] In step S1201, the third service submodule receives an initialization instruction sent by the service module. The initialization instruction includes initialization parameters and the address information of the task execution module.
[0195] In step S1202, the third service submodule initializes and configures the first and second service submodules in the target service control module based on the initialization parameters, and establishes a communication connection between the task execution module and the first service submodule in the target service control module based on the address information. The target service control module is the service control module where the third service submodule is located.
[0196] The steps S1201-S1202 described above are the same as the steps S1101-S1102 described above.
[0197] In step S1203, when the third service submodule detects the start command triggered by the user through the service module, it starts the first service submodule and the second service submodule in the target service control module where the third service submodule is located.
[0198] In an optional embodiment, the user terminal may have application software for the service module of the server installed. The user can trigger a startup command through this application software. The startup command may include the module identifier of the service control module.
[0199] Upon receiving the aforementioned startup command, the service module can forward the startup instruction to the corresponding service control module based on the module identifier in the startup command. At this point, the third service submodule will detect the startup instruction and determine that the user triggered the startup command through the service module. The third service submodule can then start the first and second service submodules within its target service control module.
[0200] By detecting the above startup command, the third service submodule can start the first and second service submodules in the service control module according to user needs.
[0201] Step S1204: The second service submodule obtains the first task information and the second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task executed in parallel in the current thread. The task information includes task identifier and parallel judgment data.
[0202] In step S1205, the second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains the first judgment result.
[0203] In step S1206, when the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule.
[0204] In step S1207, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0205] The steps S1204-S1207 described above are the same as the steps S1103-S1106 described above.
[0206] In step S1208, when the third service submodule receives a stop command sent by the user through the service module, it stops the first and second service submodules in the target service control module where the third service submodule is located.
[0207] In this embodiment, a user can send a stop command to the server via a client. This stop command includes a module identifier for the service control module. Upon receiving the stop command, the service module on the server can forward it to the corresponding target service control module based on the module identifier. At this time, the third service submodule will receive the stop command and, according to the command, stop its own first and second service submodules within the target service control module.
[0208] By sending and receiving the aforementioned stop command, the third service submodule can stop the first and second service submodules in the service control module according to user needs, thereby controlling the service control module.
[0209] Based on the same inventive concept, and according to the task parallel execution method provided in the above embodiments of this application, this application also provides a task parallel execution apparatus, such as... Figure 13 As shown, Figure 13 This is a schematic diagram of a task parallel execution device provided in an embodiment of this application. The device is a server 1301, which includes a service control module 1302. The service control module 1302 includes a first service submodule 1303 and a second service submodule 1304. The first service submodule 1303 is communicatively connected to a task execution device, which includes multiple threads for parallel execution of quantum computing tasks.
[0210] The aforementioned second service submodule 1304 is used to obtain first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule 1303.
[0211] The aforementioned first service submodule 1303 is used to forward the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
[0212] Optionally, the aforementioned parallel judgment data includes one or more of the qubit identifiers corresponding to the quantum computing task and the qubit common oscillator data.
[0213] Optionally, the second service submodule 1304 mentioned above can be used to compare the qubit identifier in each second task information with the qubit identifier in the first task information if the parallel judgment data includes qubit identifier and qubit common oscillation data, and obtain the comparison result.
[0214] Based on the qubit co-oscillation data in each second task information and the qubit co-oscillation data in the first task information, determine whether the first task and the second task meet the preset co-oscillation condition, and obtain the second judgment result;
[0215] When the comparison result indicates that the qubit identifier in each second task information does not include the qubit identifier in the first task information, and the second judgment result indicates that the first task and the second task meet the preset common oscillator condition, a first judgment result indicating that the first task can be executed in parallel with the second task is obtained.
[0216] When the comparison result indicates that the qubit identifier in the second task information includes the qubit identifier in the first task information, and / or the second judgment result indicates that the first task and the second task do not meet the preset common oscillation condition, a first judgment result indicating that the first task cannot be executed in parallel with the second task is obtained.
[0217] Optionally, the server 1301 includes a service module and multiple service control modules 1302; each service control module 1302 further includes a third service sub-module.
[0218] The aforementioned third service submodule is used to receive initialization instructions sent by the service module. The initialization instructions include initialization parameters and address information of the task execution module. Based on the initialization parameters, the first service submodule 1303 and the second service submodule 1304 in the target service control module are initialized and configured. Based on the address information, a communication connection is established between the task execution module and the first service submodule 1303 in the target service control module. The target service control module is the service control module where the third service submodule is located.
[0219] Optionally, the aforementioned third service submodule can also be used to start the first service submodule 1303 and the second service submodule 1304 in the target service control module where the third service submodule is located when a start command triggered by the user through the service module is detected.
[0220] or,
[0221] The aforementioned third service submodule can also be used to stop the first service submodule 1303 and the second service submodule 1304 in the target service control module where the third service submodule is located when a stop command is received from the user through the service module.
[0222] Optionally, the kernel of the first service submodule 1303 above caches the thread state information of each thread in the task execution device, including the thread occupancy status.
[0223] The aforementioned second service submodule 1304 can also be used to read the thread status information cached by the first service submodule 1303 before obtaining the first task information and the second task information, and to detect whether there are idle threads in the task execution device based on the thread occupancy status in the thread status information, and obtain the detection result.
[0224] Optionally, the first service submodule 1303 mentioned above can be used to obtain first task information and second task information when the detection result indicates that there is an idle thread in the task execution device.
[0225] Optionally, the second service submodule 1304 can also be used to obtain the estimated end time of the quantum computing task execution corresponding to each thread in the task execution device when the detection result indicates that there is no idle thread in the task execution device; and to execute the steps of obtaining the first task information and the second task information when the estimated end time is less than a preset time threshold.
[0226] Optionally, the first service submodule 1303 can also be used to receive thread state update instructions, which are sent by the task execution device when the thread state is updated; the first service submodule 1303 updates the thread state information based on the thread state update instructions.
[0227] Optionally, the above thread status information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread; the second service submodule 1304 caches the second task information of the second task;
[0228] The second service submodule 1304 can also be used to obtain the task identifier of the third task corresponding to the thread whose status is updated when the first service submodule 1303 updates the thread status information based on the thread release instruction if the thread status update instruction is a thread release instruction; and delete the task information of the third task from the second task information cached by itself based on the task identifier of the third task.
[0229] Optionally, the second service submodule 1304 can also be used to cache the first task information of the first task as the second task information after sending the task identifier of the first task to the first service submodule 1303.
[0230] Optionally, the server 1301 also includes a service module; the kernel of the first service submodule 1303 caches the thread state information of each thread in the task execution device, and the thread state information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread.
[0231] The first service submodule 1303 mentioned above can also be used to receive a status query instruction sent by the user through the service module. The status query instruction includes the task identifier of the task to be queried. Based on the task identifier in the status query instruction and the task identifier in the thread status information, the current task status of the task to be queried is determined, and the current task status of the task to be queried is sent to the service module.
[0232] The apparatus provided in this application embodiment allows for the deployment of multiple threads for parallel execution of quantum computing tasks in a task execution device. A second service submodule in the service control module determines the parallel execution of the first and second tasks based on parallel judgment data in the first task information corresponding to the first task to be executed and parallel judgment data in the second task information corresponding to the currently parallel-executed second task in the task execution device. A first judgment result is obtained, and when the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier in the first task information is sent to the first service submodule in the service control module. The first service submodule then forwards the task identifier to the task execution module. The task execution module, based on the received task identifier, executes the first task while simultaneously executing the second task, thus achieving parallel execution of the first and second tasks.
[0233] Compared to related technologies where each quantum computing task needs to be executed one by one, the task execution device provided in this application has multiple threads that can execute quantum computing tasks in parallel. This allows the task execution device to execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the efficiency of quantum computing task execution, and thus improving the efficiency of quantum computing.
[0234] In addition, the process of determining parallel execution of tasks is deployed in a server that communicates with the task execution device. Compared with the method of directly determining parallel execution of tasks by the task execution device, this method saves the computing resources of the task execution device and improves the processing capability of the task execution device for quantum computing tasks while ensuring the parallel execution of quantum computing tasks.
[0235] Based on the same inventive concept, and according to the task parallel execution method provided in the above embodiments of this application, this application also provides a task parallel execution system. For example... Figure 14 As shown, Figure 14This is a schematic diagram of a second structure of a task parallel execution system provided in an embodiment of this application. The system includes a server 1401 and a task execution device 1402. The server 1401 includes a service control module 1403, which includes a first service submodule 1404 and a second service submodule 1405. The first service submodule 1404 is communicatively connected to the task execution device 1402. The task execution device 1402 includes multiple threads for parallel execution of quantum computing tasks.
[0236] The aforementioned second service submodule 1405 is used to obtain first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule 1404.
[0237] The aforementioned first service submodule 1404 is used to forward the received task identifier to the task execution device 1402;
[0238] The aforementioned task execution device 1402 is used to invoke an idle thread to execute the first task based on the received task identifier.
[0239] Optionally, the aforementioned parallel judgment data includes one or more of the qubit identifiers corresponding to the quantum computing task and the qubit common oscillator data.
[0240] Optionally, the second service submodule 1405 mentioned above can be used to compare the qubit identifier in each second task information with the qubit identifier in the first task information if the parallel judgment data includes qubit identifier and qubit common oscillation data, and obtain the comparison result.
[0241] Based on the qubit co-oscillation data in each second task information and the qubit co-oscillation data in the first task information, determine whether the first task and the second task meet the preset co-oscillation condition, and obtain the second judgment result;
[0242] When the comparison result indicates that the qubit identifier in each second task information does not include the qubit identifier in the first task information, and the second judgment result indicates that the first task and the second task meet the preset common oscillator condition, a first judgment result indicating that the first task can be executed in parallel with the second task is obtained.
[0243] When the comparison result indicates that the qubit identifier in the second task information includes the qubit identifier in the first task information, and / or the second judgment result indicates that the first task and the second task do not meet the preset common oscillation condition, a first judgment result indicating that the first task cannot be executed in parallel with the second task is obtained.
[0244] Optionally, the server 1401 includes a service module and multiple service control modules 1403; each service control module 1403 further includes a third service sub-module.
[0245] The aforementioned service module is used to send an initialization command to the third service submodule. This initialization command includes initialization parameters and the address information of the task execution module.
[0246] The aforementioned third service submodule is used to receive initialization instructions sent by the service module; based on the initialization parameters, it initializes and configures the first service submodule 1404 and the second service submodule 1405 in the target service control module, and establishes a communication connection between the task execution module and the first service submodule 1404 in the target service control module based on the address information. The target service control module is the service control module where the third service submodule is located.
[0247] Optionally, the aforementioned third service submodule can also be used to start the first service submodule 1404 and the second service submodule 1405 in the target service control module where the third service submodule is located when a start command triggered by the user through the service module is detected.
[0248] or,
[0249] The aforementioned third service submodule can also be used to stop the first service submodule 1404 and the second service submodule 1405 in the target service control module where the third service submodule is located when a stop command is received from the user through the service module.
[0250] Optionally, the kernel of the first service submodule 1404 caches the thread state information of each thread in the task execution device 1402, including the thread occupancy status.
[0251] The aforementioned second service submodule 1405 can also be used to read the thread status information cached by the first service submodule 1404 before obtaining the first task information and the second task information, and based on the thread occupancy status in the thread status information, detect whether there is an idle thread in the task execution device 1402, and obtain the detection result.
[0252] Optionally, the aforementioned second service submodule 1405 can be used to obtain first task information and second task information when the detection result indicates that there is an idle thread in the task execution device 1402.
[0253] Optionally, the second service submodule 1405 can also be used to obtain the estimated end time of the quantum computing task execution corresponding to each thread in the task execution device 1402 when the detection result indicates that there is no idle thread in the task execution device; and to execute the steps of obtaining the first task information and the second task information when the estimated end time is less than a preset time threshold.
[0254] Optionally, the task execution device 1402 described above is also used to send a thread state update instruction to the first service submodule when the thread state of the thread is updated.
[0255] The aforementioned first service submodule 1404 can also be used to receive thread state update instructions and update thread state information based on the thread state update instructions.
[0256] Optionally, the above thread status information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread; the second service submodule 1405 caches the second task information of the second task;
[0257] The aforementioned second service submodule 1405 can also be used to, if the thread state update instruction is a thread release instruction, obtain the task identifier of the third task corresponding to the thread whose state is updated when the first service submodule 1404 updates the thread state information based on the thread release instruction; and delete the task information of the third task from the second task information cached by itself based on the task identifier of the third task.
[0258] Optionally, the second service submodule 1405 can also be used to cache the first task information of the first task as the second task information after sending the task identifier of the first task to the first service submodule 1404.
[0259] Optionally, the server 1401 also includes a service module; the kernel of the first service submodule 1404 caches the thread state information of each thread in the task execution device 1402, and the thread state information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread.
[0260] The aforementioned first service submodule 1404 can also be used to receive a status query instruction sent by the user through the service module, the status query instruction including the task identifier of the task to be queried; based on the task identifier in the status query instruction and the task identifier in the thread status information, determine the current task status of the task to be queried, and send the current task status of the task to be queried to the service module.
[0261] The system provided in this application embodiment allows for the deployment of multiple threads for parallel execution of quantum computing tasks in a task execution device. A second service submodule within the service control module determines the parallel execution of the first and second tasks based on parallel judgment data in the information of the first task to be executed and the parallel judgment data in the information of the second task currently being executed in parallel within the task execution device. A first judgment result is obtained, and when the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier in the first task information is sent to the first service submodule within the service control module. The first service submodule then forwards the task identifier to the task execution module. Based on the received task identifier, the task execution module executes the first task while simultaneously executing the second task, thus achieving parallel execution of the first and second tasks.
[0262] Compared to related technologies where each quantum computing task needs to be executed one by one, the task execution device provided in this application has multiple threads that can execute quantum computing tasks in parallel. This allows the task execution device to execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the efficiency of quantum computing task execution, and thus improving the efficiency of quantum computing.
[0263] In addition, the process of determining parallel execution of tasks is deployed in a server that communicates with the task execution device. Compared with the method of directly determining parallel execution of tasks by the task execution device, this method saves the computing resources of the task execution device and improves the processing capability of the task execution device for quantum computing tasks while ensuring the parallel execution of quantum computing tasks.
[0264] Based on the same inventive concept, and according to the task parallel execution method provided in the above embodiments of this application, this application also provides a quantum control system to implement the task parallel execution method steps described in any of the above claims.
[0265] Based on the same inventive concept, and according to the task parallel execution method provided in the above embodiments of this application, this application also provides a quantum computer, including the aforementioned quantum control system.
[0266] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of the present invention are generated. 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. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0267] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0268] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, embodiments such as apparatuses, systems, quantum control systems, and quantum computers are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0269] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for parallel execution of tasks, characterized in that, A service control module applied in a server, the service control module including a first service submodule and a second service submodule, the first service submodule being communicatively connected to a task execution device, the task execution device including multiple threads for parallel execution of quantum computing tasks, the method including: The second service submodule acquires first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. The parallel judgment data includes one or more of the qubit identifier corresponding to the quantum computing task and qubit co-oscillator data. The qubit identifier is used to determine whether the qubits used by the parallel quantum computing task are conflicting, and the qubit co-oscillator data is used to determine whether there is a local oscillator conflict in the parallel quantum computing task. The second service submodule judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, and obtains a first judgment result; When the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends the task identifier of the first task to the first service submodule; The first service submodule forwards the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
2. The method according to claim 1, characterized in that, If the parallel judgment data includes the qubit identifier and the qubit common oscillator data, then the step of judging the parallel execution of the first task and the second task based on the parallel judgment data in the first task information and the parallel judgment data in the second task information to obtain a first judgment result includes: The qubit identifier in each second task information is compared with the qubit identifier in the first task information to obtain the comparison results; Based on the qubit co-oscillator data in each second task information and the qubit co-oscillator data in the first task information, determine whether the first task and the second task meet the preset co-oscillator condition, and obtain the second judgment result; When the comparison result indicates that the qubit identifier in each second task information does not include the qubit identifier in the first task information, and the second judgment result indicates that the first task and the second task satisfy the preset common oscillator condition, a first judgment result indicating that the first task can be executed in parallel with the second task is obtained. When the comparison result indicates that the qubit identifier in the second task information includes the qubit identifier in the first task information, and / or the second judgment result indicates that the first task and the second task do not meet the preset common oscillator condition, a first judgment result indicating that the first task cannot be executed in parallel with the second task is obtained.
3. The method according to claim 1, characterized in that, The server includes a service module and multiple service control modules; each service control module also includes a third service sub-module. The method further includes: The third service submodule receives an initialization instruction sent by the service module, the initialization instruction including initialization parameters and the address information of the task execution module; The third service submodule initializes and configures the first and second service submodules in the target service control module based on the initialization parameters, and establishes a communication connection between the task execution module and the first service submodule in the target service control module based on the address information. The target service control module is the service control module where the third service submodule is located.
4. The method according to claim 3, characterized in that, The method further includes: When the third service submodule detects a startup command triggered by the user through the service module, it starts the first and second service submodules in the target service control module where the third service submodule is located. or, When the third service submodule receives a stop command sent by the user through the service module, it stops the first and second service submodules in the target service control module where the third service submodule is located.
5. The method according to claim 1, characterized in that, The kernel of the first service submodule caches the thread state information of each thread in the task execution device, and the thread state information includes the thread occupancy status. Before obtaining the first task information and the second task information, the method further includes: The second service submodule reads the thread status information cached by the first service submodule, and based on the thread occupancy status in the thread status information, detects whether there are idle threads in the task execution device, and obtains the detection result.
6. The method according to claim 5, characterized in that, The steps of obtaining the first task information and the second task information include: When the detection result indicates that there is an idle thread in the task execution device, first task information and second task information are obtained.
7. The method according to claim 5, characterized in that, The method further includes: When the detection result indicates that there are no idle threads in the task execution device, the second service submodule obtains the estimated end time of the quantum computing task execution corresponding to each thread in the task execution device; When the estimated end time is less than a preset time threshold, the second service submodule performs the step of obtaining the first task information and the second task information.
8. The method according to claim 5, characterized in that, The method further includes: The first service submodule receives a thread state update instruction, which is sent by the task execution device when the thread's thread state is updated; The first service submodule updates the thread state information based on the thread state update instruction.
9. The method according to claim 8, characterized in that, The thread state information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread; the second service submodule caches the second task information of the second task; If the thread state update instruction is a thread release instruction, then the method further includes: When the second service submodule detects that the first service submodule updates the thread status information based on the thread release instruction, it obtains the task identifier of the third task corresponding to the thread whose status is updated. The second service submodule deletes the task information of the third task from its cached second task information based on the task identifier of the third task.
10. The method according to claim 1, characterized in that, After sending the task identifier of the first task to the first service submodule, the method further includes: The second service submodule caches the first task information of the first task as the second task information.
11. The method according to claim 1, characterized in that, The server also includes a service module; the kernel of the first service submodule caches the thread state information of each thread in the task execution device, and the thread state information also includes the task identifier corresponding to the quantum computing task currently being executed by each thread; The method further includes: The first service submodule receives a status query instruction sent by the user through the service module, the status query instruction including the task identifier of the task to be queried; The first service submodule determines the current task status of the task to be queried based on the task identifier in the status query instruction and the task identifier in the thread status information, and sends the current task status of the task to be queried to the service module.
12. A task parallel execution device, characterized in that, The device is a server, which includes a service control module. The service control module includes a first service submodule and a second service submodule. The first service submodule is communicatively connected to a task execution device, which includes multiple threads for parallel execution of quantum computing tasks. The second service submodule is used to acquire first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule. The parallel judgment data includes one or more of the qubit identifier corresponding to the quantum computing task and qubit co-oscillator data. The qubit identifier is used to determine whether the qubits used by the parallel quantum computing tasks conflict, and the qubit co-oscillator data is used to determine whether there is a local oscillator conflict in the parallel quantum computing tasks. The first service submodule is used to forward the received task identifier to the task execution device, so that the task execution device can call an idle thread to execute the first task based on the received task identifier.
13. A task parallel execution system, characterized in that, The system includes a server and a task execution device. The server includes a service control module, which includes a first service submodule and a second service submodule. The first service submodule is communicatively connected to the task execution device. The task execution device includes multiple threads for parallel execution of quantum computing tasks. The second service submodule is used to acquire first task information and second task information. The first task information is the task information of the first task in the quantum computing task to be executed, and the second task information is the task information of the second task being executed in parallel in the current thread. The task information includes a task identifier and parallel judgment data. Based on the parallel judgment data in the first task information and the parallel judgment data in the second task information, the parallel execution of the first task and the second task is judged to obtain a first judgment result. When the first judgment result indicates that the first task can be executed in parallel with the second task, the task identifier of the first task is sent to the first service submodule. The parallel judgment data includes one or more of the qubit identifier corresponding to the quantum computing task and qubit co-oscillator data. The qubit identifier is used to determine whether the qubits used by the parallel quantum computing tasks conflict, and the qubit co-oscillator data is used to determine whether there is a local oscillator conflict in the parallel quantum computing tasks. The first service submodule is used to forward the received task identifier to the task execution device; The task execution device is used to invoke an idle thread to execute the first task based on the received task identifier.
Citation Information
Patent Citations
Server system of quantum computer and implementation method thereof
CN115470915A
Task scheduling method and system, electronic equipment, quantum cloud system and storage medium
CN116149831A