Task parallel execution method, device and system
By deploying parallel execution threads in quantum computing task execution equipment and performing parallel task judgment and forwarding in service control module, the problem of long execution time when multiple users send quantum computing tasks at the same time is solved, and the effect of improving quantum computing efficiency is achieved.
Patent Information
- Application Number
- CN202311124123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-31
AI Technical Summary
In the process of quantum computing, when multiple users send quantum computing tasks to task execution devices at the same time, the task execution device needs to perform each quantum computing task one by one, resulting in a long execution time and affecting the quantum computing efficiency.
By deploying a plurality of threads for executing quantum computing tasks in parallel in the task execution device, and setting a second service submodule in the server's service control module, based on the parallel judgment data of the task to be executed and the task information in the current thread, it determines whether the task can be executed in parallel, and forwards the task identification to the task execution device to call the idle thread to execute the task.
The task execution device executes multiple quantum computing tasks at the same time, effectively shortening the execution time of all quantum computing tasks and improving the execution efficiency of quantum computing tasks.
Smart Images

Figure CN119539104A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum computing technology, and in particular to a method, device and system for parallel execution of tasks. Background Art
[0002] Quantum computing is a computational model that uses the basic properties of quantum mechanics to solve problems. It is achieved by building a quantum physics hardware system that can be precisely operated and running quantum computing software to implement quantum algorithms, solve computational problems, and apply quantum computing to specific problems or fields.
[0003] During the quantum computing process, users can directly send quantum computing tasks to the task execution device, which will execute the received quantum computing tasks and obtain the task execution results. For example, when the task execution device is a measurement and control device in a quantum computing measurement and control system, when the measurement and control device receives a quantum computing task such as a quantum state test sent by the user, it will execute the quantum computing task and obtain the corresponding task execution results.
[0004] In related technologies, when multiple users send quantum computing tasks to a task execution device at the same time, the task execution device will execute each quantum computing task in sequence according to the order of the received quantum computing tasks. The execution time of all quantum computing tasks is relatively long, which affects the efficiency of quantum computing. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method, device and system for executing tasks in parallel, so as to shorten the time required for executing all quantum computing tasks and improve the efficiency of quantum computing. The specific technical solution is as follows:
[0006] The embodiment of the present application provides a method for executing tasks in parallel, which is applied to a service control module in a server, wherein the service control module includes a first service submodule and a second service submodule, wherein the first service submodule is communicatively connected to a task execution device, and the task execution device includes a plurality of threads for executing quantum computing tasks in parallel, wherein the method includes:
[0007] The second service submodule obtains first task information and second task information, wherein the first task information is task information of a first task in a to-be-executed quantum computing task, and the second task information is task information of a second task currently being executed in parallel in the thread, wherein the task information includes a task identifier and parallel judgment data;
[0008] The second service submodule judges the parallel execution of the first task and the second task according to 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;
[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 a 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 calls an idle thread to execute the first task based on the received task identifier.
[0011] The embodiment of the present application also provides a task parallel execution device, the device is a server, the server 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 with a task execution device, and the task execution device includes a plurality of threads for executing quantum computing tasks in parallel;
[0012] The second service submodule is used to obtain first task information and second task information, wherein the first task information is task information of the first task in the quantum computing task to be executed, and the second task information is task information of the second task executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data; according to 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 calls an idle thread to execute the first task based on the received task identifier.
[0014] The embodiment of the present application also provides a task parallel execution system, the system includes a server and a task execution device, the server 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 with the task execution device, and the task execution device includes a plurality of threads for executing quantum computing tasks in parallel;
[0015] The second service submodule is used to obtain first task information and second task information, wherein the first task information is task information of the first task in the quantum computing task to be executed, and the second task information is task information of the second task executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data; according to 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 call an idle thread to execute the first task based on the received task identifier.
[0018] An embodiment of the present application also provides a quantum control system to implement any of the above-mentioned task parallel execution method steps.
[0019] An embodiment of the present application also provides a quantum computer, including the quantum control system.
[0020] Beneficial effects of the embodiments of the present invention:
[0021] The technical solution provided by the embodiment of the present invention can deploy multiple threads for executing quantum computing tasks in parallel in a task execution device, and the second service submodule in the service control module judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information corresponding to the first task to be executed, and the parallel judgment data in the second task information corresponding to the second task currently executed in parallel in the task execution device, to obtain a first judgment result, 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, and the first service submodule forwards the task identifier to the task execution module, and the task execution module executes the first task while executing the above-mentioned second task based on the received task identifier, thereby realizing the parallel execution of the first task and the second task.
[0022] Compared with the method in which the task execution device of the related technology needs to execute each quantum computing task one by one, the task execution device provided in the embodiment of the present application deploys multiple threads that can execute quantum computing tasks in parallel, so that the task execution device can execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the execution efficiency of quantum computing tasks, and thus improving the efficiency of quantum computing.
[0023] In addition, the judgment process of parallel execution of tasks is deployed in a server that is communicatively connected to the task execution device. Compared with the method in which the task execution device directly judges the parallel execution of tasks, it saves the computing resources of the task execution device while ensuring the parallel execution of quantum computing tasks, and improves the task execution device's processing capabilities for quantum computing tasks.
[0024] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A structural diagram of a task execution system in the related technology;
[0027] Figure 2 A first signaling diagram of a method for executing tasks in parallel provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of the first structure of a task parallel execution system provided in an embodiment of the present application;
[0029] Figure 4 A second signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0030] Figure 5 A third signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0031] Figure 6 A fourth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0032] Figure 7 A fifth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0033] Figure 8 A sixth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0034] Fig. 9 A seventh signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0035] Fig.10An eighth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0036] Fig.11 A ninth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0037] Fig.12 A tenth signaling diagram of the task parallel execution method provided in an embodiment of the present application;
[0038] Fig.13 A schematic diagram of a structure of a task parallel execution device provided in an embodiment of the present application;
[0039] Fig.14 A second structural diagram of the task parallel execution system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] like Figure 1 As shown, Figure 1 FIG. 1 is a structural diagram of a task execution system in the related art. The task execution system includes a user terminal 101 and a task execution device 102. The task execution device 102 can be connected to multiple user terminals 101 for communication ( Figure 1 not shown).
[0042] Different users can send quantum computing tasks to be executed to the task execution device through their respective user terminals. The task execution device needs to process the quantum computing tasks it receives one by one to obtain the task execution results. Since all quantum computing tasks in the task execution device need to be executed one by one, it will take a long time to complete all quantum computing tasks.
[0043] In addition, with the increasing number of connected user terminals and the increasing number of quantum computing tasks that users need to perform, quantum computing tasks may be queued in the task execution devices, resulting in the inability to execute quantum computing tasks for a long time, affecting the user experience.
[0044] In order to solve the problems in the related art, the present application embodiment provides a method for executing tasks in parallel. Figure 2 As shown, Figure 2The first signaling diagram of the task parallel execution method provided in the embodiment of the present application. The method is applied to the service control module in the server, and the service control module includes a first service submodule and a second service submodule. The first service submodule is connected to the task execution device in communication, and the task execution device includes multiple threads for executing quantum computing tasks in parallel. Figure 2 The method shown includes the following steps.
[0045] Step S201, 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 executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data.
[0046] Step S202: The second service submodule judges the parallel execution of the first task and the second task according to 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.
[0047] 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 a task identifier of the first task to the first service submodule.
[0048] Step S204: the first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0049] In the embodiment of the present application, the user terminal, the server and the task execution device can together constitute a task parallel execution system. Figure 3 As shown, Figure 3 A first structural diagram of a task parallel execution system provided in an embodiment of the present application.
[0050] The server may be composed of a service module and a service control module, wherein the service control module may include a first service submodule, a second service submodule and a third service submodule.
[0051] The server in the above-mentioned task parallel execution system is respectively communicated with the user end and the task execution device, which can be specifically expressed as: the user end is communicated with the service module in the server, the service module is communicated with the first service sub-module and the third service sub-module in the service control module, and the first service sub-module is communicated with the task execution device.
[0052] Above Figure 3The task parallel execution system shown only shows the communication connection between the user end and the server. In addition, the user end can also be connected to the task execution device. For example, after the task execution device executes the quantum computing task in parallel and obtains the task execution result, the user end can directly communicate with the task execution device to obtain the task execution result of its corresponding quantum computing task.
[0053] The task execution device is pre-deployed with a plurality of threads for executing quantum computing tasks in parallel. Here, the number of threads in the task execution device is not specifically limited.
[0054] In an embodiment of the present application, the service control module in the above-mentioned server can be a service instance or a hardware unit. In addition, the number of the service control modules in the above-mentioned server can be multiple. When the number of the service control modules in the server is multiple, the number of the corresponding task execution devices is also multiple, that is, the task execution devices and the service control modules in the server are one-to-one corresponding. Here, the expression form of the service control module in the above-mentioned task parallel execution system, as well as the number of service control modules and task execution devices are not specifically limited.
[0055] Regarding the above Figure 3 The information interaction process between different devices can be found in the following description and will not be described in detail here.
[0056] Through the method provided in the embodiment of the present application, multiple threads for executing quantum computing tasks in parallel can be deployed in the task execution device, and the second service submodule in the service control module judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information corresponding to the first task to be executed, and the parallel judgment data in the second task information corresponding to the second task currently executed in parallel in the task execution device, to obtain a first judgment result, 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, and the first service submodule forwards the task identifier to the task execution module, and the task execution module executes the first task while executing the above-mentioned second task based on the received task identifier, thereby realizing the parallel execution of the first task and the second task.
[0057] Compared with the method in which the task execution device of the related technology needs to execute each quantum computing task one by one, the task execution device provided in the embodiment of the present application deploys multiple threads that can execute quantum computing tasks in parallel, so that the task execution device can execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the execution efficiency of quantum computing tasks, and thus improving the efficiency of quantum computing.
[0058] In addition, the judgment process of parallel execution of tasks is deployed in a server that is communicatively connected to the task execution device. Compared with the method in which the task execution device directly judges the parallel execution of tasks, it saves the computing resources of the task execution device while ensuring the parallel execution of quantum computing tasks, and improves the task execution device's processing capabilities for quantum computing tasks.
[0059] The embodiments of the present application are described below through specific examples.
[0060] With respect to the above step S201, that is, 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, and the task information includes a task identifier and parallel judgment data.
[0061] In the embodiment of the present application, the task execution module includes a preset database, which stores pre-registered quantum computing tasks. The preset database stores at least the task identifier of each quantum computing task and all the task data required for the execution of each quantum computing task.
[0062] The user can obtain the task identifier of the quantum computing task to be issued by querying and other means. When issuing the 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, and the task information includes the task identifier of the quantum computing task to be executed and the parallel judgment data of the quantum computing task to be executed.
[0063] After receiving the task information sent by the user end, 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 to obtain a list of quantum computing tasks to be executed (recorded 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 cache order of each 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 (recorded as the second list).
[0065] When obtaining the above-mentioned first task information, the second service submodule can obtain the task information of any quantum computing task to be executed (recorded as the first task) from the above-mentioned second list to obtain the first task information.
[0066] In an optional embodiment, the first list and the second list may be task queues. When the first list and the second list are task queues, the first service submodule and the second service submodule will obtain 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 the task status information (referred to as the second task information) of the quantum computing task (referred to as the second task) executed in parallel by each thread in the task execution device at the current moment. When acquiring the second task information, the second service submodule can directly acquire the second task information stored in itself.
[0068] According to the different progress of task execution in each thread in the task execution device, the number of quantum computing tasks executed in parallel at different time points is also different. Therefore, when the second service submodule obtains the second task information, the number of second task information obtained can be empty or one or more. Here, the number of second task information obtained by the second service submodule is not specifically limited.
[0069] In an optional embodiment, the parallel determination data in each of the above task information may include: one or more of the quantum bit identification corresponding to the quantum computing task and the quantum bit co-local oscillation data. The quantum bit co-local oscillation data may include the frequency and channel information corresponding to the quantum bit.
[0070] In the embodiment of the present application, the above-mentioned quantum bit identification is the identification corresponding to the quantum bit used to perform quantum computing. The quantum bit identification is used to determine whether the quantum bits used in the quantum computing tasks executed in parallel conflict.
[0071] The above-mentioned quantum bit co-local oscillator data is used to determine whether there is a local oscillator conflict problem in quantum computing tasks executed in parallel. In related technologies, since the frequency range of the signal that can be generated by a local oscillator source is limited, in order to reduce the cost increase caused by configuring a separate local oscillator source for each quantum bit, multiple quantum bits in a quantum chip often share a local oscillator source. The above-mentioned quantum co-intrinsic data can be used to detect local oscillator conflicts, thereby determining whether the quantum bits corresponding to the quantum computing tasks executed in parallel share the same extrinsic source.
[0072] In the embodiment of the present application, the above parallel judgment data may be different according to the various tests and calculations included in the quantum computing process, as well as the differences in the quantum chip design. For example, in addition to the above quantum bit identification and quantum bit common local oscillation data, the above parallel judgment data may also include parameters such as signal reading frequency and amplitude. Here, the parameters included in the above parallel judgment data and the above quantum bit common local oscillation data are not specifically limited.
[0073] In the above embodiment, the first task information and the second task information may be obtained simultaneously or successively. Here, the time of obtaining the first task information and the second task information is not specifically limited.
[0074] With respect to the above step S202, the second service submodule determines the parallel execution of the first task and the second task according to the parallel determination data in the first task information and the parallel determination data in the second task information to obtain a first determination result.
[0075] In an optional embodiment, when the amount 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. At this time, 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 above-mentioned second service sub-module is one or more, the second service sub-module can respectively 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 judge whether the first task and the second task can be executed in parallel based on the comparison results corresponding to each type of parameter, and obtain a judgment result (recorded as the first judgment result).
[0077] The first determination result may indicate that the first task can be executed in parallel with the second task, or may indicate that the first task cannot be executed in parallel with the second task.
[0078] The method for determining the above-mentioned first judgment result can be found in the description below and will not be elaborated here.
[0079] With respect to the above step S203, that is, 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 judgment 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 to be executed in parallel 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 judgment 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 to be executed in parallel with the second task. At this time, the second service submodule can re-acquire new task information from the second list as the first task information, and return to execute the above step S202.
[0082] In an optional embodiment, when the first judgment result indicates that the first task cannot be executed in parallel with the second task, the second service submodule can cache the first task information again in the second queue. Here, the processing method of the first task information is not specifically limited.
[0083] With respect to the above step S204, the first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls the 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 and 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 obtain all the task data corresponding to the first task from the above-mentioned preset database according to the task identifier. The task execution device can call the idle thread to execute the first task based on all the obtained task data. At this time, the first task is executed in parallel with the above-mentioned second task.
[0086] The above-mentioned first task information may be included in all task data corresponding to the above-mentioned first task. Here, no specific limitation is made to all task data corresponding to each quantum computing task.
[0087] In an optional embodiment, when the parallel determination data includes the quantum bit identifier and the quantum bit common local oscillation data, according to the above Figure 2 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Figure 4 As shown, Figure 4 The second signaling diagram of the task parallel execution method provided in the embodiment of the present application. Figure 4 In the method shown, the above step S202 is refined into the following steps.
[0088] Step S2021: The second service submodule compares the quantum bit identifier in each second task information with the quantum bit identifier in the first task information to obtain a comparison result.
[0089] In this step, for each second task, the second service submodule may compare the quantum bit identifier in the second task information of the second task with the quantum bit identifier in the first task information of the first task to obtain a comparison result corresponding to the second task.
[0090] The comparison result corresponding to the first task in step S2021 may include the following two situations:
[0091] In case 1, the comparison result indicates that the quantum bit identifier in each second task information does not include the quantum bit identifier in the first task information.
[0092] Case 2: The comparison result indicates that the quantum bit identifier in the second task information includes the quantum bit identifier in the first task information.
[0093] Step S2022, the second service submodule determines whether the first task and the second task meet a preset co-local oscillation condition based on the quantum bit co-local oscillation data in each second task information and the quantum bit co-local oscillation data in the first task information, and obtains a second judgment result.
[0094] In an optional embodiment, the qubit co-local oscillation data may include frequency and channel information corresponding to the qubit. The preset co-local oscillation condition may be that the difference between the frequencies corresponding to the qubits executing quantum computation in parallel is the same.
[0095] The second service submodule can determine the adjacent quantum bits according to the channel information included in the quantum bit common local oscillation data corresponding to the first task information and the second task information, thereby calculating the frequency difference between the adjacent quantum bits according to the frequency in the quantum bit common local oscillation data. The second service submodule can compare the calculated frequency differences between adjacent quantum bits to determine whether the frequency differences between adjacent quantum bits are the same value, thereby determining whether the preset common local oscillation conditions are met between the first task and each second task, and obtaining a second judgment result.
[0096] The second judgment result may include the following two situations:
[0097] Case three, the second judgment result indicates that the first task and the second task meet the preset common local oscillation condition; that is, the frequency difference between the adjacent quantum bits 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 local oscillation condition; that is, the frequency difference between the above adjacent quantum bits is not the same data.
[0099] In the embodiment of the present application, according to the difference between the above comparison result and the second judgment result, the second service submodule will respectively execute different steps, that is, the second service submodule can determine whether the first task can be executed in parallel with the second task according to the above comparison result and the above second judgment result, and obtain the first judgment result. According to the difference in the first judgment result, the second service submodule will respectively execute step S2023 or step S2024. Here, the execution of step S2023 and step S2024 is not specifically limited.
[0100] exist Figure 4 In the illustrated embodiment, the above step S2021 is performed before step S2022. In addition, the above step S2022 may also be performed before step S2021, or simultaneously with step S2021. Here, the execution order of the above step S2021 and step S2022 is not specifically limited.
[0101] Step S2023, when the comparison result indicates that the quantum bit identifiers in each second task information do not include the quantum bit identifiers in the first task information, and the second judgment result indicates that the first task and the second task meet the preset common local oscillation condition, the second service submodule obtains the first judgment result indicating that the first task can be executed in parallel with the second task.
[0102] In this step, for the above situation 1 and situation 2, and situation 3 and situation 4, when situation 1 and situation 3 are satisfied at the same time, the second service submodule can determine that the above 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] Step S2024, when the comparison result indicates that the quantum bit identifier in the second task information includes the quantum bit 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 local oscillation condition, the second service submodule obtains a first judgment result indicating that the first task cannot be executed in parallel with the second task.
[0104] In this step, for the above-mentioned situation 1 and situation 2, and situation 3 and situation 4, when any one of situation 2 and situation 4 occurs, the second service submodule can determine that the above-mentioned first task and the second task cannot be executed in parallel. At this time, 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 sub-module can judge whether the quantum bits required for executing the first task are occupied and whether the quantum computing tasks executed in parallel share a common local oscillation based on the quantum bit identification and quantum bit co-local oscillation data in the parallel judgment data, thereby determining whether the above-mentioned first task and the above-mentioned second task can be executed in parallel.
[0106] In the above steps S2021 to S2024, only the case where the parallel judgment data includes the quantum bit identifier and the quantum bit common local oscillation data is taken as an example to illustrate the determination of the above first judgment result. In addition, the second service submodule can also consider the influence of other factors on the parallel execution of quantum computing tasks.
[0107] For ease of understanding, the above-mentioned parallel determination data also includes reading frequency and amplitude as an example for explanation.
[0108] In an optional embodiment, in a known quantum chip, the signal in the reading cavity corresponding to each quantum bit can be read through the same reading bus according to the frequency division multiplexing technology, and the demodulation of the signal in the reading bus can determine the task execution result obtained after each quantum bit performs the quantum computing task. Therefore, for this quantum chip, the above-mentioned parallel judgment data can also include the reading frequency and amplitude. The second service submodule can perform parallel judgment on the first task and the second task in the frequency division multiplexing dimension according to the reading frequency and amplitude in the first task information corresponding to the first task, and the reading frequency and amplitude in the second task information corresponding to the second task, so as to determine whether the first task and the second task meet the frequency division multiplexing requirements and obtain the third judgment result. The second service submodule can determine the above-mentioned first judgment result according to the above-mentioned comparison result, the second judgment result and the third judgment result.
[0109] In the embodiment of the present application, the parameters included in the parallel judgment data in the task information will also be different according to the differences in the above-mentioned quantum chip, application scenario, user needs, etc. When the parameters included in the parallel judgment parameters are different, the method of determining the above-mentioned first judgment result based on the parallel judgment parameters will also be different. Here, the method of obtaining the above-mentioned first judgment result is not specifically limited.
[0110] In the embodiment of the present application, the kernel of the first service submodule caches thread status information of each thread in the task execution device, and the thread status information includes the thread occupancy status corresponding to each thread.
[0111] The thread occupancy state corresponding to each of the above threads is used to indicate whether each thread is currently executing a quantum computing task. For example, when the thread occupancy state of a thread is occupied, it indicates that the thread is currently executing a quantum computing task. When the thread occupancy state of a thread is idle, it indicates that the thread is an idle thread, that is, the thread is not currently executing a quantum computing task.
[0112] In addition to the thread occupancy state, the thread state information may also include the task identifier corresponding to the quantum computing task currently executed by each thread. For example, when the thread occupancy state of a thread is the above-mentioned occupancy state, the thread state information corresponding to the thread may include the task identifier of the quantum computing task currently executed by the thread. When the thread occupancy state of a thread is the above-mentioned idle state, the position of the task identifier in the thread state information corresponding to the thread is empty.
[0113] In an optional embodiment, for the thread state information of the kernel cache of the first service submodule, according to the above Figure 2 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Figure 5 As shown, Figure 5 A third signaling diagram of the task parallel execution method provided in an embodiment of the present application. The method includes the following steps.
[0114] Step S501: The second service submodule reads the thread status information cached by the first service submodule, and detects whether there is an idle thread in the task execution device based on the thread occupancy status in the thread status information to obtain a detection result.
[0115] In this step, the second service submodule has the read permission for the thread status 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 the thread status information in real time, and determine whether there is an idle thread in the task execution device according to the thread occupancy status corresponding to each thread, and obtain the detection result. That is, the second service submodule can determine whether there is a thread in the task execution device whose thread occupancy status is the idle state according to the thread occupancy status in the thread status information, and obtain the detection result.
[0116] In the embodiment of the present application, the above detection result may indicate that there is an idle thread in the task execution device, or may indicate that there is no idle thread in the task execution device.
[0117] 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 the above 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 above 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 the above step S502 may refer to the acquisition method of the first task information and the second task information in the above step S201, and will not be described in detail here.
[0120] Through the above steps S501-S502, the second service submodule can timely and accurately determine the thread occupancy of each thread in the task execution device at the current moment according to the thread status information maintained in the first service submodule, thereby obtaining the first task information and the second task information when there are idle threads in the task execution device. This allows the first service submodule to directly send the quantum computing task that can be carried out in parallel with the second task to the task execution device once an idle thread appears in the task execution device, thereby providing guarantee for the parallel execution of different quantum computing tasks in the task execution device and improving the resource utilization of the task execution device.
[0121] Step S503: The second service submodule judges the parallel execution of the first task and the second task according to 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.
[0122] 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 a task identifier of the first task to the first service submodule.
[0123] Step S505: The first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0124] The above steps S503 to S505 are the same as steps S202 to S204.
[0125] In an optional embodiment, when the above monitoring results indicate that there is an idle thread in the task execution device, the second service sub-module can obtain the thread identifier of the idle thread, and when executing the step of sending the task identifier of the first task to the first service sub-module in the above step S504, the second service sub-module sends the task identifier of the first task and the thread identifier of the idle thread to the first service sub-module, so that the first service sub-module 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 is no idle thread 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 task information and the second task information.
[0127] In another optional embodiment, according to the above Figure 5 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Figure 6 As shown, Figure 6 A fourth signaling diagram of the task parallel execution method provided in an embodiment of the present application. The method comprises the following steps.
[0128] 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 is an idle thread in the task execution device to obtain a detection result.
[0129] The above step S601 is the same as the above step S501.
[0130] Step S602: When the detection result indicates that there is no idle thread in the task execution device, the second service submodule obtains the estimated end time of the execution of the quantum computing task corresponding to each thread in the task execution device.
[0131] In an optional embodiment, the thread status information may include, in addition to the thread occupancy status of each thread, an estimated end time of execution of the quantum computing task corresponding to each thread. The estimated end time may be estimated based on the historical execution time of the same type of quantum computing task.
[0132] When the above detection result indicates that there are no idle threads in the task execution device, that is, when each thread in the above task execution device is executing a quantum computing task at the current moment, the second service sub-module 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 executed by the thread in the thread state information, and estimate the estimated end time of the quantum computing corresponding to the thread based on the historical execution time.
[0134] In an optional embodiment, when estimating the estimated end time of a quantum computing task based on the historical execution time of quantum computing tasks of the same type, the average of the historical execution time of quantum computing tasks of the same type can be calculated, and the difference between the average and the corresponding execution time of the quantum computing task can be calculated to obtain the remaining time required for the execution of the quantum computing task; the estimated end time of the quantum computing task can be estimated based on the remaining time and the preset time error; or 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] Step S603: When the estimated end time is less than the preset time threshold, the second service submodule obtains the first task information and the second task information.
[0136] In an embodiment of the present application, after the second service submodule determines the estimated end time of the quantum computing task (i.e., the second task) corresponding to each thread, the estimated end time can be compared with a preset time threshold.
[0137] The preset time threshold may be determined according to the duration of information interaction among the second service submodule, the first service submodule and the task execution device.
[0138] When the estimated end time of the quantum computing task corresponding to a certain thread is less than the preset time threshold, the second service submodule can determine that the quantum computing task corresponding to the 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 there is no thread among the above-mentioned multiple threads whose estimated end time is not less than the preset time threshold, that is, when the estimated end time corresponding to 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 above-mentioned multiple threads still need to be executed for a period of time. At this time, the second service submodule may not perform any processing. That is, the second service submodule will not execute the steps of obtaining the first task information and the second task information.
[0140] Through the above steps S601-S603, when there are no idle threads in the above detection results, the second service sub-module can complete the parallel task acquisition process before the quantum computing tasks of each thread are completed by comparing the estimated end time corresponding to each thread with the preset time threshold, so that the execution of quantum computing tasks can be seamlessly connected, thereby improving the parallel execution efficiency of quantum computing tasks and improving resource utilization.
[0141] Step S604: the second service submodule judges the parallel execution of the first task and the second task according to 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.
[0142] 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 a task identifier of the first task to the first service submodule.
[0143] Step S606: The first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0144] The above steps S604 to S606 are the same as the above steps S503 to S505.
[0145] In an optional embodiment, according to the above Figure 2 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Figure 7 As shown, Figure 7 The fifth signaling diagram of the task parallel execution method provided in the embodiment of the present application. Figure 7 The following steps are added to the method shown, namely step S205 to step S206.
[0146] Step S205: The first service submodule receives a thread state update instruction, where the thread state update instruction is sent by the task execution device when the thread state of the thread is updated.
[0147] In this step, the task execution device can monitor the thread states of the multiple threads in real time, and when a thread state update is detected, the task execution device can send a thread state update instruction to the first service submodule. At this time, the first service submodule will receive the thread state update instruction.
[0148] The thread status update instruction may include the thread identifier of the thread to be updated. The thread status update instruction may be a thread occupy instruction or a thread release instruction.
[0149] In the embodiment of the present application, the thread occupation instruction may be sent when the task execution device calls an idle thread to execute a quantum computing task. The thread release instruction may be sent when a thread in the task execution device completes the execution process of the quantum computing task.
[0150] Step S206: The first service submodule updates the thread state information based on the thread state update instruction.
[0151] In an optional embodiment, when the thread state update instruction is a thread occupation instruction, the thread state occupation instruction may include a task identifier of the quantum computing task that occupies the thread. After receiving the thread state update instruction, the first service submodule may 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 may update the current state of the thread to be updated corresponding to the thread identifier from an idle state to an occupied state, 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 may 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 thread state information from the occupied state to the idle state, and deletes the task identifier of the quantum computing task corresponding to the thread to be updated.
[0153] Through the above steps S205-S206, the task execution device can promptly notify the first service sub-module when the thread status of each thread is updated, so that the first service sub-module can promptly update the above thread status information according to the above thread status update instruction, thereby ensuring the accuracy of the thread status information and the accuracy of the detection results of the second service sub-module on each thread in the task execution device.
[0154] exist Figure 7 In the illustrated embodiment, according to the execution time of different quantum computing tasks and the time when the quantum computing tasks are started in the task execution device, the time of updating the states of the threads in the task execution device will also be different. Therefore, the time when the thread update instruction is received by the first service submodule will also be different. That is, during the parallel execution of tasks, the first service submodule can receive the above-mentioned thread update instruction at any time. Here, the execution time of the above-mentioned steps S205-S206 is not specifically limited.
[0155] In an optional embodiment, the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread; and the second task information of the second task is cached in the second service submodule.
[0156] In an optional embodiment, when the thread state update instruction is a thread release instruction, according to the above Figure 7 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Figure 8 As shown, Figure 8 The sixth signaling diagram of the task parallel execution method provided in the embodiment of the present application. Figure 8 The following steps are added to the method shown, namely step S207 to step S208.
[0157] Step S207 , when the second service submodule detects that the first service submodule updates the thread status information based on the thread release instruction, the second service submodule obtains the task identifier of the third task corresponding to the thread with the updated status.
[0158] In this step, when the thread state update instruction is the thread release instruction, when the first service submodule updates the thread state information according to the thread release instruction, since the second service submodule has the read permission of the thread state information, at this time, the second service submodule can synchronously detect the update operation. The second service submodule can obtain the task identifier of the third task corresponding to the thread for status update, that is, obtain the task identifier of the quantum computing task corresponding to the thread to be updated before the thread state information is updated. Among them, the third task is the second task that the thread for status update is executing before the status update.
[0159] In the embodiment of the present application, the above step S207 can be performed simultaneously with the above step S206.
[0160] Step S208: the second service submodule deletes the task information of the third task from the second task information cached in itself 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 the second task information cached by itself.
[0162] Through the above steps S207-S208, when the second service submodule detects that the first service submodule updates the above thread status information according to the received thread release instruction, it also synchronously updates the second task information stored in itself, which effectively ensures the accuracy of the second task information stored by it, thereby ensuring the accuracy of the above first judgment result, 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 second Figure 2 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Fig. 9 As shown, Fig. 9 The seventh signaling diagram of the task parallel execution method provided in the embodiment of the present application. Figure 7 In the method shown, the following step is added, namely step S209.
[0164] Step S209: the second service submodule caches the first task information of the first task as 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 the second task information stored therein, that is, cache the first task information of the first task as the second task information of the second task.
[0166] Through the above-mentioned step S209, after determining that the first task and the second task can be executed in parallel, the second service submodule can update the first task to the second task being executed by the task execution device, thereby effectively ensuring the accuracy of the second task information stored therein, thereby ensuring the accuracy of the above-mentioned first judgment result, and laying the foundation for the parallel execution of different quantum computing tasks.
[0167] The above step S209 is performed after step S203. Here, the execution order of the above step S204 and step S209 is not specifically limited.
[0168] In the above Fig. 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 executed in parallel with the second task to the first service submodule. In addition, considering that the second service submodule can detect the thread status information in real time, the second service submodule can also update the second task information when the first service submodule updates the thread status information according to the received thread occupation instruction.
[0169] In the embodiment of the present application, the updating method of 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 the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Fig.10 As shown, Fig.10 The eighth signaling diagram of the task parallel execution method provided in the embodiment of the present application. Fig.10 The following steps are added to the method shown, namely step S210 - step S211 .
[0171] Step S210: The first service submodule receives a status query instruction sent by the user through the service module, wherein the status query instruction includes a task identifier of the task to be queried.
[0172] In the embodiment of the present application, after the user terminal is connected to the service module in the server, the user can trigger a status query operation for a certain task (recorded as the task to be queried) in 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. The status query instruction includes the task identifier of the task to be queried.
[0173] After receiving the status query instruction sent by the user terminal, the service module can forward the status query instruction to the first service submodule connected to the communication module. At this time, the first service submodule receives the status query instruction.
[0174] 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 an embodiment of the present 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 according to the task identifier carried in the status query instruction.
[0176] In an optional embodiment, if the thread state information includes the task identifier carried by the state query instruction, the first service submodule can determine that the current task state of the task to be queried is the execution state. The first service submodule can send the current task state to the service module. The service module returns the received current task state to the user end.
[0177] In another optional embodiment, if the thread state information does not include the task identifier carried by the state query instruction, the first service submodule can determine that the current state of the task to be queried is a waiting state or an end state. The waiting state indicates that the quantum computing task is waiting to be sent to the task execution device, and the end 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 may determine whether to send the task identifier of the task to be queried to the task execution device according to 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 state 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 state of the task to be queried is a finished state.
[0180] Through the above steps S210-S211, when the first service submodule receives the status query instruction, it can promptly and accurately determine the current task status of the task to be queried according to the task identifier, and feedback 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 the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Fig.11 As shown, Fig.11 The ninth signaling diagram of the task parallel execution method provided in the embodiment of the present application. The method comprises the following steps.
[0182] Step S1101: The third service submodule receives an initialization instruction sent by the service module, where the initialization instruction includes initialization parameters and address information of the task execution module.
[0183] In the embodiment of the present application, the service module in the above-mentioned server can also be communicated with the third service submodule in addition to being communicated with the above-mentioned first service submodule. For each service control module included in the server, the user can trigger the initialization operation of the service control module through the user terminal. At this time, the user terminal will send an initialization instruction to the service module in the server. The initialization instruction includes the module identification of the service control module, initialization parameters and address information of the task execution module.
[0184] After receiving the initialization instruction sent by the user end, the service module can forward the initialization instruction to the third service submodule in the corresponding service control module (recorded as the target service control module) according to the module identifier. At this time, the third service submodule will receive the initialization instruction.
[0185] Step S1102, the third service sub-module initializes the configuration of the first service sub-module and the second service sub-module 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 sub-module 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 sub-module is located.
[0186] Here, the above-mentioned initialization configuration process and communication connection establishment process are not described in detail.
[0187] Through the above steps S1101-S1102, the third service submodule in the service control module can complete the initialization process of the first service submodule and the second service submodule in the service control module, so that the configured first service submodule and the second service submodule can operate normally.
[0188] Step S1103, 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 executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data.
[0189] Step S1104: the second service submodule judges the parallel execution of the first task and the second task according to 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.
[0190] 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 a task identifier of the first task to the first service submodule.
[0191] Step S1106: The first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0192] The above steps S1103 to S1106 are the same as the above steps S201 to S204.
[0193] In an optional embodiment, according to the above Fig.11 The method shown in the figure, the embodiment of the present application also provides a method for executing tasks in parallel. Fig.12 As shown, Fig.12 The tenth signaling diagram of the task parallel execution method provided in the embodiment of the present application. The method comprises the following steps.
[0194] Step S1201: The third service submodule receives an initialization instruction sent by the service module, where the initialization instruction includes initialization parameters and address information of the task execution module.
[0195] In step S1202, the third service sub-module initializes and configures the first service sub-module and the second service sub-module 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 sub-module 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 sub-module is located.
[0196] The above steps S1201 to S1202 are the same as the above steps S1101 to S1102.
[0197] Step S1203: When the third service submodule detects a start command triggered by the user through the service module, the third service submodule 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 be installed with application software of the service module in the server. The user may trigger a start command through the application software. The start command may include a module identifier of the service control module.
[0199] After receiving the above-mentioned start command, the service module can forward the start instruction to the corresponding service control module according to the module identifier in the start command. At this time, the third service submodule will detect the start instruction and determine that the user has triggered the start command through the service module. At this time, the third service submodule can start the first service submodule and the second service submodule in the target service control module where it is located.
[0200] By detecting the above startup command, the third service submodule can start the first service submodule and the second service submodule in the service control module according to user requirements.
[0201] Step S1204, 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 executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data.
[0202] Step S1205: The second service submodule judges the parallel execution of the first task and the second task according to 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.
[0203] 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 a task identifier of the first task to the first service submodule.
[0204] Step S1207: The first service submodule forwards the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0205] The above steps S1204 to S1207 are the same as the above steps S1103 to S1106.
[0206] Step S1208: When receiving the stop instruction sent by the user through the service module, the third service submodule stops the first service submodule and the second service submodule in the target service control module where the third service submodule is located.
[0207] In an embodiment of the present application, a user may send a stop instruction to a server through a user terminal, wherein the stop instruction includes a module identifier of a service control module. When receiving the stop instruction, the service module in the server may forward the stop instruction to a corresponding target service control module according to the module identifier in the stop instruction. At this time, the third service submodule will receive the stop instruction and stop the first service submodule and the second service submodule in the target service control module where the third service submodule is located according to the stop instruction.
[0208] By sending and receiving the above-mentioned stop instruction, the third service submodule can stop the first service submodule and the second service submodule in the service control module according to user requirements, thereby realizing control over the service control module.
[0209] Based on the same inventive concept, according to the task parallel execution method provided in the above embodiment of the present application, the embodiment of the present application also provides a task parallel execution device, such as Fig.13 As shown, Fig.13 A structural diagram of a task parallel execution device provided in an embodiment of the present application. The device is a server 1301, and the server 1301 includes a service control module 1302, and the service control module 1302 includes a first service submodule 1303 and a second service submodule 1304, and the first service submodule 1303 is connected to a task execution device in communication, and the task execution device includes multiple threads for executing quantum computing tasks in parallel;
[0210] The second service submodule 1304 is used to obtain the first task information and the second task information, where 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, and the task information includes a task identifier and parallel judgment data; according to 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 first service submodule 1303 is configured to forward the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
[0212] Optionally, the above-mentioned parallel judgment data includes one or more of the quantum bit identification and quantum bit common local oscillation data corresponding to the quantum computing task.
[0213] Optionally, the second service submodule 1304 may be specifically used to compare the quantum bit identifier in each second task information with the quantum bit identifier in the first task information to obtain a comparison result if the parallel determination data includes the quantum bit identifier and the quantum bit common local oscillation data;
[0214] According to the quantum bit common local oscillation data in each second task information and the quantum bit common local oscillation data in the first task information, it is determined whether the first task and the second task meet a preset common local oscillation condition, and a second determination result is obtained;
[0215] When the comparison result indicates that the quantum bit identifiers in each second task information do not include the quantum bit identifiers in the first task information, and the second judgment result indicates that the first task and the second task meet a preset common local oscillation 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 quantum bit identifier in the second task information includes the quantum bit 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 local 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 also includes a third service submodule;
[0218] The above-mentioned third service sub-module is used to receive the initialization instruction sent by the service module, and the initialization instruction includes initialization parameters and address information of the task execution module; based on the initialization parameters, the first service sub-module 1303 and the second service sub-module 1304 in the target service control module are initialized and configured, and based on the address information, a communication connection is established between the task execution module and the first service sub-module 1303 in the target service control module, and the target service control module is the service control module where the third service sub-module is located.
[0219] Optionally, the third service submodule may 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 third service submodule may 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 receiving a stop instruction sent by the user through the service module.
[0222] Optionally, the kernel of the first service submodule 1303 caches thread status information of each thread in the task execution device, and the thread status information includes thread occupancy status;
[0223] The above-mentioned 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 based on the thread occupancy status in the thread status information, detect whether there is an idle thread in the task execution device to obtain a detection result.
[0224] Optionally, the first service submodule 1303 may be specifically configured to obtain the first task information and the second task information when the detection result indicates that there is an idle thread in the task execution device.
[0225] Optionally, the above-mentioned second service sub-module 1304 can also be used to obtain the estimated end time of the execution of the quantum computing task 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; when the estimated end time is less than a preset time threshold, execute the steps of obtaining the first task information and the second task information.
[0226] Optionally, the first service submodule 1303 may also be used to receive a thread status update instruction, which is sent by the task execution device when the thread status of the thread is updated; the first service submodule 1303 updates the thread status information based on the thread status update instruction.
[0227] Optionally, the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread; the second service submodule 1304 caches the second task information of the second task;
[0228] The second service sub-module 1304 can also be used to obtain the task identifier of the third task corresponding to the thread with updated status when it detects that the first service sub-module 1303 updates the thread status information based on the thread release instruction if the thread status update instruction is a thread release instruction; based on the task identifier of the third task, delete the task information of the third task from the second task information cached in itself.
[0229] Optionally, the second service submodule 1304 may also be configured to cache first task information of the first task as second task information after sending the task identifier of the first task to the first service submodule 1303 .
[0230] Optionally, the server 1301 further includes a service module; the kernel of the first service submodule 1303 caches thread state information of each thread in the task execution device, and the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread;
[0231] The above-mentioned first service sub-module 1303 can also be used to receive a status query instruction sent by the user through the service module, where the status query instruction includes a 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.
[0232] Through the apparatus provided in the embodiment of the present application, multiple threads for executing quantum computing tasks in parallel can be deployed in the task execution device, and the second service submodule in the service control module judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information corresponding to the first task to be executed, and the parallel judgment data in the second task information corresponding to the second task currently executed in parallel in the task execution device, to obtain a first judgment result, 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, and the first service submodule forwards the task identifier to the task execution module, and the task execution module executes the first task while executing the above-mentioned second task based on the received task identifier, thereby realizing the parallel execution of the first task and the second task.
[0233] Compared with the method in which the task execution device of the related technology needs to execute each quantum computing task one by one, the task execution device provided in the embodiment of the present application deploys multiple threads that can execute quantum computing tasks in parallel, so that the task execution device can execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the execution efficiency of quantum computing tasks, and thus improving the efficiency of quantum computing.
[0234] In addition, the judgment process of parallel execution of tasks is deployed in a server that is communicatively connected to the task execution device. Compared with the method in which the task execution device directly judges the parallel execution of tasks, it saves the computing resources of the task execution device while ensuring the parallel execution of quantum computing tasks, and improves the task execution device's processing capabilities for quantum computing tasks.
[0235] Based on the same inventive concept, according to the task parallel execution method provided in the above embodiment of the present application, the embodiment of the present application also provides a task parallel execution system. Fig.14 As shown, Fig.14A second structural diagram of a task parallel execution system provided in an embodiment of the present application. The system includes a server 1401 and a task execution device 1402, the server 1401 includes a service control module 1403, the service control module 1403 includes a first service submodule 1404 and a second service submodule 1405, the first service submodule 1404 is in communication with the task execution device 1402, and the task execution device 1402 includes multiple threads for executing quantum computing tasks in parallel;
[0236] The second service submodule 1405 is used to obtain the first task information and the second task information, where 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, and the task information includes a task identifier and parallel judgment data; according to 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 first service submodule 1404 is used to forward the received task identifier to the task execution device 1402;
[0238] The task execution device 1402 is used to call an idle thread to execute the first task based on the received task identifier.
[0239] Optionally, the above-mentioned parallel judgment data includes one or more of the quantum bit identification and quantum bit common local oscillation data corresponding to the quantum computing task.
[0240] Optionally, the second service submodule 1405 may be specifically used to compare the quantum bit identifier in each second task information with the quantum bit identifier in the first task information to obtain a comparison result if the parallel determination data includes the quantum bit identifier and the quantum bit common local oscillation data;
[0241] According to the quantum bit common local oscillation data in each second task information and the quantum bit common local oscillation data in the first task information, it is determined whether the first task and the second task meet a preset common local oscillation condition, and a second determination result is obtained;
[0242] When the comparison result indicates that the quantum bit identifiers in each second task information do not include the quantum bit identifiers in the first task information, and the second judgment result indicates that the first task and the second task meet a preset common local oscillation 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 quantum bit identifier in the second task information includes the quantum bit 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 local 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 also includes a third service submodule;
[0245] The service module is used to send an initialization instruction to the third service submodule, wherein the initialization instruction includes initialization parameters and address information of the task execution module;
[0246] The above-mentioned third service sub-module is used to receive the initialization instruction sent by the service module; based on the initialization parameters, the first service sub-module 1404 and the second service sub-module 1405 in the target service control module are initialized and configured, and based on the address information, a communication connection is established between the task execution module and the first service sub-module 1404 in the target service control module. The target service control module is the service control module where the third service sub-module is located.
[0247] Optionally, the third service submodule may 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 third service submodule may 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 receiving a stop instruction sent by the user through the service module.
[0250] Optionally, the kernel of the first service submodule 1404 caches thread status information of each thread in the task execution device 1402, and the thread status information includes thread occupancy status;
[0251] The above-mentioned 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 to obtain the detection result.
[0252] Optionally, the second service submodule 1405 may be specifically configured to obtain the first task information and the second task information when the detection result indicates that there is an idle thread in the task execution device 1402 .
[0253] Optionally, the above-mentioned second service sub-module 1405 can also be used to obtain the estimated end time of the execution of the quantum computing task 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; when the estimated end time is less than a preset time threshold, execute the steps of obtaining the first task information and the second task information.
[0254] Optionally, the task execution device 1402 is further configured to send a thread state update instruction to the first service submodule when the thread state of the thread is updated;
[0255] The first service submodule 1404 may also be configured to receive a thread status update instruction; and update thread status information based on the thread status update instruction.
[0256] Optionally, the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread; the second service submodule 1405 caches the second task information of the second task;
[0257] The above-mentioned second service sub-module 1405 can also be used to obtain the task identifier of the third task corresponding to the thread with updated status when it detects that the first service sub-module 1404 updates the thread status information based on the thread release instruction if the thread status update instruction is a thread release instruction; based on the task identifier of the third task, delete the task information of the third task from the second task information cached in itself.
[0258] Optionally, the second service submodule 1405 may also be configured to cache first task information of the first task as second task information after sending the task identifier of the first task to the first service submodule 1404 .
[0259] Optionally, the server 1401 further includes a service module; the kernel of the first service submodule 1404 caches thread state information of each thread in the task execution device 1402, and the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread;
[0260] The above-mentioned first service sub-module 1404 can also be used to receive a status query instruction sent by the user through the service module, where the status query instruction includes a 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] Through the system provided by the embodiment of the present application, multiple threads for executing quantum computing tasks in parallel can be deployed in the task execution device. The second service submodule in the service control module judges the parallel execution of the first task and the second task based on the parallel judgment data in the first task information corresponding to the first task to be executed, and the parallel judgment data in the second task information corresponding to the second task currently executed in parallel in the task execution device, 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 in the first task information is sent to the first service submodule in the service control module, and the first service submodule forwards the task identifier to the task execution module. The task execution module executes the first task while executing the above-mentioned second task based on the received task identifier, thereby realizing the parallel execution of the first task and the second task.
[0262] Compared with the method in which the task execution device of the related technology needs to execute each quantum computing task one by one, the task execution device provided in the embodiment of the present application deploys multiple threads that can execute quantum computing tasks in parallel, so that the task execution device can execute multiple quantum computing tasks at the same time, effectively shortening the time required to execute all quantum computing tasks, improving the execution efficiency of quantum computing tasks, and thus improving the efficiency of quantum computing.
[0263] In addition, the judgment process of parallel execution of tasks is deployed in a server that is communicatively connected to the task execution device. Compared with the method in which the task execution device directly judges the parallel execution of tasks, it saves the computing resources of the task execution device while ensuring the parallel execution of quantum computing tasks, and improves the task execution device's processing capabilities for quantum computing tasks.
[0264] Based on the same inventive concept, according to the task parallel execution method provided in the above-mentioned embodiment of the present application, the embodiment of the present application also provides a quantum control system to implement the task parallel execution method steps described in any of the above-mentioned items.
[0265] Based on the same inventive concept, according to the task parallel execution method provided in the above-mentioned embodiment of the present application, the embodiment of the present application also provides a quantum computer, including the quantum control system.
[0266] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0267] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0268] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for embodiments such as devices, systems, quantum control systems, and quantum computers, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0269] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A task parallel execution method, characterized in that: A service control module applied to a server, the service control module comprising 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 comprising a plurality of threads for executing quantum computing tasks in parallel, the method comprising: The second service submodule obtains first task information and second task information, wherein the first task information is task information of a first task in a to-be-executed quantum computing task, and the second task information is task information of a second task currently being executed in parallel in the thread, wherein the task information includes a task identifier and parallel judgment data; The second service submodule judges the parallel execution of the first task and the second task according to 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; When the first judgment result indicates that the first task can be executed in parallel with the second task, the second service submodule sends a 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 calls an idle thread to execute the first task based on the received task identifier.
2. The method according to claim 1, characterized in that The parallel judgment data includes one or more of a quantum bit identifier and quantum bit common local oscillation data corresponding to the quantum computing task.
3. The method according to claim 2, characterized in that If the parallel judgment data includes the quantum bit identifier and the quantum bit co-local oscillation data, the step of judging the parallel execution of the first task and the second task according to 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: Compare the quantum bit identifiers in each second task information with the quantum bit identifiers in the first task information to obtain a comparison result; According to the quantum bit co-local oscillation data in each second task information and the quantum bit co-local oscillation data in the first task information, determining whether the first task and the second task meet a preset co-local oscillation condition, and obtaining a second determination result; When the comparison result indicates that the quantum bit identifiers in each second task information do not include the quantum bit identifiers in the first task information, and the second judgment result indicates that the first task and the second task satisfy the preset co-local oscillation 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 quantum bit identifier in the second task information includes the quantum bit 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 co-local oscillation condition, a first judgment result indicating that the first task cannot be executed in parallel with the second task is obtained.
4. The method according to claim 1, characterized in that: The server includes a service module and a plurality of service control modules; each service control module also includes a third service submodule; The method further comprises: The third service submodule receives an initialization instruction sent by the service module, wherein the initialization instruction includes initialization parameters and address information of a task execution module; The third service submodule initializes and configures the first service submodule and the second service submodule 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.
5. The method according to claim 4, characterized in that The method further comprises: When the third service submodule detects a start command triggered by the user through the service module, the first service submodule and the second service submodule in the target service control module where the third service submodule is located are started; or, When receiving a stop instruction sent by the user through the service module, the third service submodule stops the first service submodule and the second service submodule in the target service control module where the third service submodule is located.
6. The method according to claim 1, characterized in that The kernel of the first service submodule caches thread state information of each thread in the task execution device, wherein the thread state information includes thread occupancy state; Before acquiring 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 detects whether there is an idle thread in the task execution device based on the thread occupancy status in the thread status information to obtain a detection result.
7. The method according to claim 6, characterized in that The step of obtaining the first task information and the second task information includes: When the detection result indicates that there is an idle thread in the task execution device, first task information and second task information are acquired.
8. The method according to claim 6, characterized in that The method further comprises: When the detection result indicates that there is no idle thread in the task execution device, the second service submodule obtains an estimated end time of execution of the quantum computing task 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 executes the step of acquiring the first task information and the second task information.
9. The method according to claim 6, characterized in that The method further comprises: The first service submodule receives a thread state update instruction, where the thread state update instruction is sent by the task execution device when the thread state of the thread is updated; The first service submodule updates the thread state information based on the thread state update instruction.
10. The method according to claim 9, characterized in that The thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread; the second task information of the second task is cached in the second service submodule; If the thread state update instruction is a thread release instruction, the method further includes: When the second service submodule detects that the first service submodule updates the thread state information based on the thread release instruction, the second service submodule obtains a task identifier of a third task corresponding to the thread with updated state; The second service submodule deletes the task information of the third task from the second task information cached by itself based on the task identifier of the third task.
11. 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.
12. The method according to claim 1, characterized in that The server also includes a service module; the kernel of the first service submodule caches thread state information of each thread in the task execution device, and the thread state information also includes a task identifier corresponding to the quantum computing task currently executed by each thread; The method further comprises: The first service submodule receives a status query instruction sent by a user through the service module, wherein the status query instruction includes a task identifier of a 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.
13. A task parallel execution device, characterized in that: The device is a server, the server 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 with a task execution device, and the task execution device includes a plurality of threads for executing quantum computing tasks in parallel; The second service submodule is used to obtain first task information and second task information, wherein the first task information is task information of the first task in the quantum computing task to be executed, and the second task information is task information of the second task executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data; according to 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 first service submodule is used to forward the received task identifier to the task execution device, so that the task execution device calls an idle thread to execute the first task based on the received task identifier.
14. 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, the service control module includes a first service submodule and a second service submodule, the first service submodule is communicatively connected with the task execution device, and the task execution device includes a plurality of threads for executing quantum computing tasks in parallel; The second service submodule is used to obtain first task information and second task information, wherein the first task information is task information of the first task in the quantum computing task to be executed, and the second task information is task information of the second task executed in parallel in the current thread, and the task information includes a task identifier and parallel judgment data; according to 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 first service submodule is used to forward the received task identifier to the task execution device; The task execution device is used to call an idle thread to execute the first task based on the received task identifier.
Citation Information
Patent Citations
Multi-task scheduling method and system under quantum-classical hybrid architecture and quantum computer system architecture
CN113010302A
Scheduling device and method of quantum control system and quantum computer
CN115469979A
Server system of quantum computer and implementation method thereof
CN115470915A
Hybrid computing power control method and device, equipment and storage medium
CN115640121A
Task scheduling method and system, electronic equipment, quantum cloud system and storage medium
CN116149831A
Cited By
Quantum computing task processing method
CN120338132A