Task processing method, server and system based on quantum-classical hybrid architecture
By establishing session connections and associating session computing resources in a quantum-classical hybrid architecture, the resource contention problem is solved, processing efficiency is improved, resource availability is ensured, and stable task processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中电信量子信息科技集团有限公司
- Filing Date
- 2024-10-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing quantum-classical hybrid architectures suffer from low processing efficiency due to resource contention issues, and when clients disconnect from servers, computing resources are easily occupied by other clients, leading to slow task execution or failure.
By establishing a session connection between the client and the server, setting a session identifier, and associating session computing resources with the session identifier, it is ensured that resources are only used for the current client's task requests, thus avoiding resource contention.
It reduces the queuing time of pending tasks, improves the overall efficiency of the quantum-classical hybrid architecture, and ensures resource availability and system stability even after the client disconnects.
Smart Images

Figure CN119629212B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing, and more specifically, to a task processing method based on a quantum-classical hybrid architecture, a server for a quantum-classical hybrid architecture, a task processing system based on a quantum-classical hybrid architecture, and a computer-readable storage medium. Background Technology
[0002] Quantum computers, which utilize the principles of quantum mechanics for information processing, have significant advantages in solving specific problems such as large number factorization and unstructured data search. However, limited by current hardware technology and external environmental interference, quantum computers still face many challenges in practical applications. To improve their processing capabilities, a combination of classical and quantum computers is often used to complete tasks. However, this hybrid approach can easily lead to resource contention, thus affecting overall processing efficiency. Summary of the Invention
[0003] This application provides a task processing method based on a quantum-classical hybrid architecture, a server for a quantum-classical hybrid architecture, a task processing system based on a quantum-classical hybrid architecture, and a computer-readable storage medium.
[0004] This application provides a task processing method based on a quantum-classical hybrid architecture, wherein the quantum-classical hybrid architecture includes a client and a server, and the method is used on the server, the method comprising:
[0005] Establish a session connection with the client using a preset communication protocol;
[0006] If the session connection is successfully established, set the session identifier;
[0007] Receive the first task processing request sent by the client;
[0008] The session computing power resources are determined according to the first task processing request, and the session computing power resources include session classical computing power resources and session quantum computing power resources.
[0009] The session computing resources are associated with the session identifier.
[0010] The first task processing request is processed according to the association between the session identifier and the session computing power resources to obtain the first task processing result.
[0011] In this way, the server first establishes a session connection with the client using a preset communication protocol. Once the session connection is successfully established, the server sets a session identifier and receives the first task processing request from the client. Then, the server determines the session computing resources based on the first task processing request; these resources include both classical and quantum computing resources. Next, the server associates the session computing resources with the session identifier. Finally, the server processes the first task processing request based on the association between the session identifier and the session computing resources to obtain the first task processing result. In this way, the server establishes a session connection with the client, receives the first task request, and determines the session computing resources available to the client for this session. Furthermore, by associating the session computing resources with the set session identifier, it ensures that the session computing resources will not be used by other clients before the session connection ends, and are only used to process the task requests sent by that client. This reduces queuing time caused by resource contention and improves the overall efficiency of the quantum-classical hybrid architecture.
[0012] In some implementations, determining session computing resources based on the first task processing request includes:
[0013] The first task processing request is evaluated to obtain the session computing power requirement, which is used to indicate the first classical computing power resources and the first quantum computing power resources required to process the first task processing request.
[0014] The processing status of the first task processing request is determined based on the session computing power requirement and the server's remaining computing power resources, thereby determining the session computing power resources. The server's remaining computing power resources are used to indicate the second classical computing power resources and the second quantum computing power resources that are idle in the server.
[0015] Thus, the server evaluates and processes the first task processing request to obtain the session computing power requirement. This requirement indicates the first classical computing power resources and the first quantum computing power resources needed to process the first task processing request. Next, the server determines the processing status of the first task processing request based on the session computing power requirement and the server's remaining computing power resources, thereby determining the session computing power resources. The remaining server computing power resources indicate the second classical computing power resources and the second quantum computing power resources that are idle on the server. In this way, the server obtains the session computing power requirement by evaluating and processing the first task processing request, and compares this requirement with the server's remaining computing power resources to determine whether to process the first task processing request. This determines the session computing power resources that need to be allocated to this session connection, avoiding task processing errors due to insufficient resources, thereby improving the efficiency and effectiveness of task processing.
[0016] In some implementations, determining the processing status of the first task processing request based on the session computing power requirement and the remaining server computing power resources, in order to determine the session computing power resources, includes:
[0017] If the session computing power requirement is less than or equal to the remaining computing power resources of the server, the request to process the first task will be accepted.
[0018] The session computing power resources are determined based on the preset resource scheduling algorithm and the session computing power requirements.
[0019] Thus, when the session computing power requirement is less than or equal to the server's remaining computing power resources, the server accepts and processes the first task processing request. Next, the server determines the session computing power resources based on a preset resource scheduling algorithm and the session computing power requirement. In this way, when the server can meet the session computing power requirement of the first task processing request, it determines the session computing power resources used to process the first task processing request based on the preset resource scheduling algorithm and the session computing power requirement, thereby efficiently utilizing its resources while simultaneously meeting the task's needs, improving task processing efficiency and overall performance.
[0020] In some implementations, the session computing resources remain unchanged while the session connection is active.
[0021] Thus, while the session connection is active, the session computing resources allocated to that session connection remain unchanged. Maintaining consistent session computing resources helps ensure the consistency and stability of the session connection, allowing task processing to proceed in a relatively stable environment during the session's duration. Furthermore, it prevents malicious competition for computing resources between different clients, thereby improving system security and reliability. In addition, the server can guarantee that the session computing resources will not be occupied by other devices while the session connection is active, ensuring that even if a client disconnects from the server due to unforeseen circumstances, it can directly use the session computing resources upon reconnection.
[0022] In some implementations, determining the processing status of the first task processing request based on the session computing power requirement and the remaining server computing power resources includes:
[0023] If the session's computing power requirement exceeds the server's remaining computing power resources, the first task processing request will be rejected.
[0024] The first task processing request is moved to the cloud queue until the session computing power requirement is less than or equal to the remaining computing power resources of the server.
[0025] Thus, if the session's computing power requirement exceeds the server's remaining computing power resources, the server refuses to process the first task processing request. Next, the server moves the first task processing request to a cloud queue until the session's computing power requirement is less than or equal to the server's remaining computing power resources. In this way, when it is found that the server's current remaining computing power resources are insufficient to meet the first task processing request, the server refuses to process the request and moves it to a cloud queue to wait until the server's remaining computing power resources increase sufficiently to meet the task's requirements. This effectively manages resources and ensures that ongoing tasks are not affected by insufficient resources.
[0026] In some implementations, processing the first task processing request based on the association between the session identifier and the session computing resources to obtain the first task processing result includes:
[0027] The first task processing request is preprocessed to obtain classical processing subtasks and quantum processing subtasks;
[0028] The session's classic computing resources are invoked to process the classic processing subtask to obtain the first classic processing result;
[0029] The session quantum computing resources are invoked to process the quantum processing subtask to obtain the first quantum processing result;
[0030] The first task processing result is obtained based on the first classical calculation result and the first quantum processing result.
[0031] In this way, the server preprocesses the first task processing request, obtaining classical processing subtasks and quantum processing subtasks. Next, the server utilizes session classical computing resources to process the classical processing subtasks, obtaining the first classical processing result. Then, the server utilizes session quantum computing resources to process the quantum processing subtasks, obtaining the first quantum processing result. Finally, the server obtains the first task processing result based on the first classical computation result and the first quantum processing result. Thus, by decomposing the first task processing request into different subtasks and selecting appropriate computing resources according to the needs of each subtask, the processing efficiency and accuracy of the first task processing request are improved.
[0032] In some embodiments, the method further includes:
[0033] The classical computing resources of the session are used to optimize the first quantum processing result to obtain the second classical processing result;
[0034] The second classical processing result is processed by calling upon the session quantum computing resources to obtain the second quantum processing result;
[0035] The first task processing result is obtained based on the second quantum processing result.
[0036] Thus, for the first task processing request requiring iterative processing, the server utilizes session classical computing resources to optimize the first quantum processing result to obtain the second classical processing result. Next, the server utilizes session quantum computing resources to process the second classical processing result to obtain the second quantum processing result. Finally, the server obtains the first task processing result based on the second quantum processing result. In this way, for the first task processing request requiring iterative processing, since both session classical and quantum computing resources reside on the server, the first quantum processing result does not need to be returned to the client. The server can directly utilize session classical computing resources to optimize the obtained first quantum processing result to obtain the second classical processing result, ensuring stable processing of the first task processing request and guaranteeing low latency.
[0037] In some implementations, the preprocessing includes splitting and optimization processes. The splitting process is used to instruct the first task processing request to be split into the classical processing subtask and the temporary quantum processing subtask, and the optimization process is used to instruct the temporary quantum processing subtask to be optimized to obtain the quantum processing subtask.
[0038] Thus, the server's preprocessing of the first task processing request includes splitting and optimization. Splitting indicates that the first task processing request should be split into classical processing subtasks and temporary quantum processing subtasks, while optimization indicates that the temporary quantum processing subtasks should be optimized to obtain quantum processing subtasks. In this way, splitting decomposes the first task processing request into classical and temporary quantum processing subtasks, allowing for allocation to different computing resources and more efficient utilization of these resources, thereby improving the overall processing efficiency and accuracy of the task. Furthermore, optimizing the temporary quantum processing subtasks enables quantum computing resources to process them more effectively, further improving the processing efficiency of the first task processing request.
[0039] In some embodiments, the method further includes:
[0040] If the session connection is successfully established, set the session wait time;
[0041] If the idle time of the session computing power resource exceeds the session waiting time or if a session termination request is received from the client, the session identifier is deleted and the session computing power resource is released.
[0042] Thus, once a session connection is successfully established, the server sets a session wait time. If the idle time of the session computing resources exceeds the session wait time or a session termination request is received from the client, the server will delete the session identifier and release the session computing resources. In this way, setting a session wait time helps the server effectively manage its computing resources, preventing them from being occupied for extended periods and unavailable for other tasks, ensuring the rational allocation and efficient utilization of computing resources.
[0043] In some embodiments, the method further includes:
[0044] Upon receiving a second task processing request sent by the client, the usage of session computing resources is determined based on the session identifier, wherein the second task processing request is a subsequent task processing request of the first task processing request.
[0045] When the session computing resources are idle, the second task processing request is processed according to the association between the session identifier and the session computing resources to obtain the second task processing result.
[0046] Thus, upon receiving a second task processing request from a client, the server determines the usage of session computing resources based on the session identifier, where the second task processing request is a subsequent task processing request to the first task processing request. If the session computing resources are idle, the server processes the task processing request according to the association between the session identifier and the session computing resources to obtain the second task processing result. In this way, by determining the usage of the session computing resources allocated to this session connection, the server determines whether the second task processing request can be processed immediately. If the session computing resources are idle, the server uses the session computing resources to process the second task processing request, thereby enabling a rapid response to client needs while maintaining the reasonable allocation and efficient utilization of computing resources.
[0047] In some embodiments, the method further includes:
[0048] When the session computing power resource is active, the second task processing request is moved to the pending task queue until the number of pending tasks in the pending task queue before the second task processing request is 0 and the session computing power resource is idle. The pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing power resource is occupied.
[0049] Thus, when session computing resources are available, the server moves task processing requests to the pending task queue until the number of pending tasks preceding the second task processing request in the queue is zero and the session computing resources are idle. Pending tasks indicate tasks that cannot be processed temporarily due to the availability of session computing resources. In this way, the server determines whether the second task processing request can be processed immediately by checking the usage of session computing resources allocated to the current session connection. If the session computing resources are available, the server refuses to process the second task processing request until the number of pending tasks preceding the second task processing request in the queue is zero and the session computing resources are idle. This ensures that all task processing requests are processed in the order of arrival, while avoiding resource conflicts and waste.
[0050] This application provides a server for a quantum-classical hybrid architecture, the server including a communication unit and a processor;
[0051] The communication unit is configured to establish a session connection with the client via a preset communication protocol.
[0052] If the session connection is successfully established, set the session identifier;
[0053] Receive the first task processing request sent by the client;
[0054] The processor is configured to: determine session computing power resources based on the first task processing request, wherein the session computing power resources include session classical computing power resources and session quantum computing power resources;
[0055] The session computing resources are associated with the session identifier.
[0056] The first task processing request is processed according to the association between the session identifier and the session computing power resources to obtain the first task processing result.
[0057] Thus, a server for a quantum-classical hybrid architecture is provided, comprising a communication unit and a processor. The communication unit is configured to establish a session connection with a client via a preset communication protocol, and, upon successful establishment of the session connection, set a session identifier. It also receives a first task processing request from the client. The processor is configured to determine session computing resources based on the first task processing request, including both classical and quantum computing resources. It then associates the session computing resources with the session identifier. Finally, it processes the first task processing request based on the association between the session identifier and the session computing resources to obtain a first task processing result. In this way, the server establishes a session connection and sets a session identifier with the client through the communication unit and receives the first task request. The processor then associates the session computing resources with the set session identifier, ensuring that the session computing resources are not used by other clients before the session connection ends, reducing queuing time caused by resource contention and improving the overall efficiency of the quantum-classical hybrid architecture.
[0058] This application provides a task processing system based on a quantum-classical hybrid architecture, the task processing system including a client and the aforementioned server.
[0059] In this way, the client establishes a session connection with the server. During the session, the client can continuously submit task processing requests until the session ends. The task processing system establishes a session connection and sets a session identifier with the client through the server, and receives the first task request. It associates the session's computing resources with the set session identifier, ensuring that these resources will not be used by other clients before the session connection ends, reducing queuing time for pending tasks and improving the overall efficiency of the task processing system. If the client disconnects from the server due to unforeseen circumstances, the server in the task processing system modifies the parameters of the first task request and resubmits it to maintain the continuous execution of the first task request, ensuring efficient task processing.
[0060] This application provides a computer-readable storage medium that stores a computer program that, when executed by one or more processors, implements the above-described method.
[0061] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0062] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0063] Figure 1 This is one of the flowcharts illustrating the implementation of this application;
[0064] Figure 2 This is a second flowchart illustrating the implementation method of this application;
[0065] Figure 3 This is the third flowchart illustrating the implementation method of this application;
[0066] Figure 4 This is the fourth flowchart illustrating the implementation method of this application;
[0067] Figure 5 This is the fifth flowchart illustrating the implementation method of this application;
[0068] Figure 6 This is the sixth flowchart illustrating the implementation method of this application;
[0069] Figure 7 This is a schematic diagram of the calculation results of an embodiment of the present application;
[0070] Figure 8 This is the seventh flowchart illustrating the implementation method of this application;
[0071] Figure 9 This is the eighth flowchart illustrating the implementation method of this application;
[0072] Figure 10 This is the ninth flowchart illustrating the implementation method of this application;
[0073] Figure 11 This is a schematic diagram of a session object according to an embodiment of the present application.
[0074] Figure 12 This is a schematic diagram of the architecture of an embodiment of this application. Detailed Implementation
[0075] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0076] With the ever-increasing demand for computing power in fields such as big data, artificial intelligence, and cryptography, traditional classical computers have encountered performance bottlenecks when handling specific problems such as large integer factorization and search algorithms. To overcome these performance limitations, quantum computing technology, which utilizes the principles of quantum mechanics for information processing, has been adopted in these fields. Quantum computers based on quantum computing technology have significant advantages in solving specific problems such as large integer factorization and search algorithms.
[0077] However, due to hardware limitations and external environmental interference, quantum processors still have significant shortcomings in practical applications for task processing. Related technologies utilize a hybrid quantum-classical architecture to build task processing systems that combine classical and quantum computers, which possess mature hardware and application ecosystems, to leverage the advantages of both technologies. However, these hybrid quantum-classical architecture task processing systems do not consider resource contention. When multiple clients simultaneously send task requests, they compete for the system's computing resources, leading to increased response times and slow or failed task execution. Furthermore, if a client loses connection to the server due to unforeseen circumstances, computing resources can be occupied by other clients, potentially causing task requests to fail.
[0078] Based on the above issues, please refer to Figure 1 This application provides a task processing method based on a quantum-classical hybrid architecture, which includes a client and a server. The method is used on the server and includes:
[0079] 011: Establish a session connection with the client using a preset communication protocol;
[0080] 012: Set the session identifier if the session connection is successfully established;
[0081] 013: Receive the first task processing request sent by the client;
[0082] 014: Determine session computing resources based on the first task processing request;
[0083] 015: Associate session computing resources with session identifiers;
[0084] 016: Process the first task processing request according to the association between the session identifier and the session computing power resources to obtain the first task processing result.
[0085] This application also provides a computer device, including a memory and a processor. The task processing method based on a quantum-classical hybrid architecture according to this application can be implemented by the computer device of this application. Specifically, the memory stores a computer program, and the processor is used to establish a session connection with a client through a preset communication protocol. Upon successful establishment of the session connection, it sets a session identifier and receives a first task processing request sent by the client. The processor is also used to determine session computing resources based on the first task processing request, associate the session computing resources with the session identifier, and process the first task processing request according to the association between the session identifier and the session computing resources to obtain a first task processing result.
[0086] This application also provides a server for a quantum-classical hybrid architecture. The task processing method based on this quantum-classical hybrid architecture can be implemented by the server described in this application. Specifically, the server includes a communication unit and a processor. The communication unit includes a connection module, a setting module, and a receiving module. The processor includes a determination module, an association module, and a processing module. The connection module is used to establish a session connection with the client through a preset communication protocol. The setting module is used to set a session identifier when the session connection is successfully established. The receiving module is used to receive a first task processing request sent by the client. The determination module is used to determine session computing power resources based on the first task processing request. The session computing power resources include session classical computing power resources and session quantum computing power resources. The association module is used to associate the session computing power resources with the session identifier. The processing module is used to process the first task processing request according to the association relationship between the session identifier and the session computing power resources to obtain a first task processing result.
[0087] Specifically, the default communication protocol is a secure communication protocol, such as Secure Sockets Layer / Transport Layer Security (SSL / TLS), Hypertext Transfer Protocol Secure (HTTPS), and Internet Protocol Security (IPsec), which are communication protocols used for Internet communication.
[0088] A session refers to a continuous process of interaction between a client and a server, which logically constitutes a complete operational cycle. Within this operational cycle, a session represents a logical unit for the client to occupy and use various resources of the server.
[0089] The session identifier is used to identify the current session connection between the client and the server.
[0090] A task processing request is used to indicate a series of computational tasks that include both quantum computing and classical computing.
[0091] Classical computing resources for a session refer to the classical computing hardware and software resources allocated by the server for each session, used to execute classical computing subtasks, including memory, processor, storage, and network resources.
[0092] Session-level quantum computing resources refer to the quantum computing hardware and software resources allocated by the server for each session, used to execute quantum computing subtasks, including quantum processors and quantum control systems. In this application's implementation, quantum chips are used as quantum computing resources.
[0093] The Variational Quantum Eigensolver (VQE) is a quantum algorithm used to solve eigenvalue problems of quantum systems, such as many-body quantum systems, on quantum computers. This VQE combines classical computing techniques with quantum computing techniques and is widely used in solving for Hamiltonians in quantum systems.
[0094] The Hamiltonian describes the total energy of a quantum system and how the quantum system evolves over time. It can be used to predict the state and behavior of the system, including the energy eigenvalues and eigenstates of the quantum system. The form of the Hamiltonian depends on the properties and constraints of the system.
[0095] Quantum systems are microscopic particle systems governed by the laws of quantum mechanics, possessing unique properties such as wave-particle duality, quantum superposition, and quantum entanglement. A quantum bit (qubit) is the basic unit of information in quantum computing, similar to a bit in classical computing.
[0096] Energy eigenvalues refer to the energy possessed by a quantum system in a specific state.
[0097] Quantum circuits are sequences of quantum gates used to simulate the quantum states of a system. In VQE, quantum circuits are typically parameterized, and these parameters need to be tuned through classical optimization processes to minimize the difference between the energy estimate and the energy of the target quantum state.
[0098] A quantum gate is a fundamental operation performed on a qubit, similar to a logic gate in classical computing. Each quantum logic gate is represented by a unitary matrix and can perform specific linear transformations on the quantum state vector, thereby changing the state of the qubit. Quantum gates are also called quantum logic gates.
[0099] The server first establishes a session connection with the client using a preset communication protocol. Once the session connection is successfully established, the server sets a session identifier and receives the first task processing request from the client. Then, the server determines the session computing resources based on the first task processing request; these resources include both classical and quantum computing resources. Next, the server associates the session computing resources with the session identifier. Finally, the server processes the first task processing request based on the association between the session identifier and the session computing resources to obtain the first task processing result. In this way, the server establishes a session connection with the client, receives the first task request, and determines the session computing resources available to the client for this session. By associating the session computing resources with the set session identifier, the server ensures that the session computing resources will not be used by other clients before the session connection ends, and are only used to process task requests sent by this client. This reduces the queuing time for pending tasks and improves the overall efficiency of the quantum-classical hybrid architecture.
[0100] The following example illustrates the task processing method based on a quantum-classical hybrid architecture according to embodiments of this application. In the embodiments described in this application, the variable quantum eigensolver (VQE) task is executed using the task processing method based on a quantum-classical hybrid architecture according to embodiments of this application, with the IPsec protocol as the default communication protocol.
[0101] The Hamiltonian description of a quantum system refers to the mathematical model of a many-body quantum system that the VQE algorithm aims to solve. In the VQE algorithm, the Hamiltonian is used to represent the energy eigenvalue problem of the quantum system to be solved.
[0102] The parameter setting of a quantum circuit refers to the parameterization of the quantum circuit in VQE. These parameters need to be adjusted through a classical optimization process to minimize the gap between the energy estimate and the energy of the target quantum state.
[0103] In classical computing, optimization algorithm parameters refer to the parameters used in classical optimization algorithms to adjust the parameters of quantum circuits. These optimization algorithm parameters determine the search strategy and efficiency of the optimization algorithm. Examples include the "learning rate" of gradient descent, the "conjugate condition" and "convergence threshold" of conjugate gradient, and the "annealing temperature" and "annealing rate" of simulated annealing.
[0104] The quantum computing resource requirements refer to the quantum resources needed for the VQE algorithm to run, including the number of qubits, the number of quantum gate operations, and the depth of the quantum circuit. These resource requirements directly impact the algorithm's feasibility and efficiency on a practical quantum computer.
[0105] The client sends a session request to the server via the IPsec protocol.
[0106] After receiving the session request, the server establishes a session connection with the client via the IPsec protocol. If the session connection is successfully established, the server creates session object A and sets the session identifier VQE-1. It also receives the first task processing request Q1 from the client. The session identifier VQE-1 is stored in session object A. The first task processing request Q1 includes the initial parameters of the VQE task, such as the Hamiltonian description of the quantum system, the parameter settings of the quantum circuit, the optimization algorithm parameters in classical computing, and the resource requirements for quantum computing. The specific settings of the initial parameters are as follows:
[0107] The number of qubits n is set to 4, the number of circuit layers L is set to 2, the number of iterations_num is set to 20, the learning rate_rate is set to 0.3, the delta value for Hamiltonian differential calculation is set to , and the number of local Hamiltonians K is set to 3.
[0108] Setting the number of qubits n to 4 indicates that 4 qubits will be used to simulate the quantum system in the VQE algorithm.
[0109] Setting the number of circuit layers L to 2 indicates that the quantum circuit used to process the quantum computing task of the VQE algorithm will contain 2 layers of quantum gates. The choice of this number of circuit layers will affect the complexity and resource requirements of the algorithm.
[0110] Setting the iteration number `iteration_num` to 20 means the VQE algorithm will perform 20 iterations. In each iteration, the VQE algorithm updates the parameters of the quantum circuit to optimize the energy estimate. The choice of the number of iterations affects the algorithm's convergence speed and accuracy. Gradient descent method
[0111] Setting the learning rate to 0.3 indicates that the optimization algorithm used is gradient descent, and setting the learning rate to 0.3 determines that the step size for updating parameters in each iteration is 0.3.
[0112] The delta value calculated from the differential of the Hamiltonian is often used to determine the gradient of each term in the Hamiltonian.
[0113] Setting the number of local Hamiltonians K to 3 indicates that in the VQE algorithm, 3 local Hamiltonians will be used to approximate the Hamiltonian of the entire system.
[0114] Then, the server determines the session computing power resource Z1 based on the first task processing request Q1. Session computing power resource Z1 includes both classical and quantum computing power resources. Next, the server associates session computing power resource Z1 with the session identifier VQE-1. Finally, the server processes the first task processing request Q1 based on the association between session identifier VQE-1 and session computing power resource Z1 to obtain the first task processing result. The session identifier VQE-1 can be used to determine the right to use session computing power resource Z1. That is, for example, if the session connection is suddenly broken, causing the client not to submit a new task or a session termination request, after the client's submitted task is processed on the server, the session computing power resource Z1 will be retained for a period of time. During this period, the client can directly use the session computing power resource Z1 by resubmitting a task.
[0115] In summary, in the task processing method and server based on the quantum-classical hybrid architecture of this application, the server first establishes a session connection with the client through a preset communication protocol. Upon successful establishment of the session connection, the server sets a session identifier and receives a first task processing request from the client. Then, the server determines the session computing power resources based on the first task processing request, which include both classical and quantum computing power resources. Next, the server associates the session computing power resources with the session identifier. Finally, the server processes the first task processing request based on the association between the session identifier and the session computing power resources to obtain the first task processing result. In this way, the server establishes a session connection with the client, receives the first task request, and determines the session computing power resources available to the client for this session. Furthermore, by associating the session computing power resources with the set session identifier, it ensures that the session computing power resources will not be used by other clients before the session connection ends, and are only used to process task requests sent by the client, thereby reducing the queuing time for pending tasks and improving the overall efficiency of the quantum-classical hybrid architecture.
[0116] Please see Figure 2 Step 014 (determining session computing resources based on the first task processing request) includes:
[0117] 0141: Evaluate and process the first task processing request to obtain the session computing power requirement;
[0118] 0142: Determine the processing status of the first task processing request based on the session computing power requirements and the remaining server computing power resources, so as to determine the session computing power resources.
[0119] In some implementations, the evaluation module is used to evaluate the first task processing request to obtain the session computing power requirement. The determination module is used to determine the processing status of the first task processing request based on the session computing power requirement and the remaining computing power resources of the server, thereby determining the session computing power resources.
[0120] In some implementations, the processor is further configured to evaluate the first task processing request to obtain the session computing power requirement, and determine the processing status of the first task processing request based on the session computing power requirement and the remaining computing power resources of the server, thereby determining the session computing power resources.
[0121] Specifically, the server evaluates and processes the first task processing request to obtain the session computing power requirement. This requirement indicates the first classical computing power resources and the first quantum computing power resources needed to process the first task processing request. The quantity of the first classical computing power resources can be 0 or any other quantity, determined according to actual needs. The quantity of the first quantum computing power resources is the same.
[0122] Next, the server determines the processing status of the first task processing request based on the session computing power requirements and the server's remaining computing power resources, thereby determining the session computing power resources. The server's remaining computing power resources are used to indicate the second classical computing power resources and the second quantum computing power resources that are idle in the server.
[0123] Continuing with the example above, the server evaluates the initial parameters of the VQE task in the first task processing request Q1. The server estimates the required quantum computing resources, i.e., the first quantum computing resources, based on the number of qubits and the number of circuit layers. It also estimates the required computation time and storage space, i.e., the first classical computing resources, based on the number of iterations and the delta value calculated from the Hamiltonian differential.
[0124] Next, the server determines the processing status of the first task processing request Q1 based on the session computing power requirements and the server's remaining computing power resources, thereby determining the session computing power resources. In other words, based on the server's remaining computing power resources, both the second classical computing power resources and the second quantum computing power resources must meet the session computing power requirements for this session.
[0125] In this way, the server evaluates and processes the first task processing request Q1 to obtain the session computing power requirement, and compares the session computing power requirement with the server's remaining computing power resources to determine whether to process the first task processing request Q1, and determines the session computing power resources that need to be allocated to this session connection, so as to avoid the situation where task processing errors occur due to insufficient resources, thereby improving the efficiency and effectiveness of task processing.
[0126] Please see Figure 3In some implementations, step 0142 (determining the processing status of the first task processing request based on the session computing power requirement and the remaining server computing power resources, thereby determining the session computing power resources) includes:
[0127] 01421: If the session computing power requirement is less than or equal to the server's remaining computing power resources, accept and process the request for the first task.
[0128] 01422: Determine session computing resources based on the preset resource scheduling algorithm and session computing power requirements.
[0129] In some implementations, the receiving module is used to accept and process the first task processing request when the session computing power requirement is less than or equal to the server's remaining computing power resources. The determining module is used to determine the session computing power resources based on a preset resource scheduling algorithm and the session computing power requirement.
[0130] In some implementations, the processor is further configured to accept and process a first task processing request when the session computing power requirement is less than or equal to the server's remaining computing power resources, and to determine the session computing power resources based on a preset resource scheduling algorithm and the session computing power requirement.
[0131] Specifically, the preset resource scheduling algorithm is a load balancing resource scheduling algorithm, such as the Round Robin algorithm, the Weighted Round Robin algorithm, and the Response Time Based Load Balancing algorithm. The appropriate resource scheduling algorithm can be selected to schedule computing resources according to actual needs.
[0132] If the session's computing power requirement is less than or equal to the server's remaining computing power resources, the server accepts and processes the request for the first task. Then, the server determines the session's computing power resources based on the preset resource scheduling algorithm and the session's computing power requirement.
[0133] Continuing the example above, the default resource scheduling algorithm is Round Robin. If the server confirms that its remaining computing power resources are sufficient to meet the needs of this session (i.e., the second classical computing power resource is greater than or equal to the first classical computing power resource, and the second quantum computing power resource is greater than or equal to the first quantum computing power resource), the server accepts and processes the first task processing request Q1. The server allocates session computing power resources to the client and server for this session connection based on the Round Robin algorithm and the session computing power requirements; that is, the allocated session classical computing power resources are equal to the first classical computing power resources, and the allocated session quantum computing power resources are equal to the first quantum computing power resources. Furthermore, the server stores the indexes corresponding to the allocated session classical and quantum computing power resources in session object A, through which the corresponding computing power resources can be accessed.
[0134] Thus, if the server can meet the session computing power requirements of the first task processing request, the session computing power resources used to process the first task processing request are determined according to the preset resource scheduling algorithm and the session computing power requirements. This allows for efficient use of its resources while simultaneously meeting the needs of the task, thereby improving the efficiency of task processing and overall performance.
[0135] In some implementations, the session computing resources remain unchanged while the session connection is active.
[0136] Specifically, while the session connection is active, the session computing resources allocated to that session connection remain unchanged. In other words, once these computing resources have been allocated to the client for this session connection, as long as the session connection is active, the session computing resources will not be used by other clients, regardless of whether they have been used or not.
[0137] Thus, maintaining unchanged session computing resources helps ensure the consistency and stability of session connections, allowing task processing to take place in a relatively stable environment during the session's duration. Furthermore, it prevents malicious competition for computing resources between different clients, thereby improving system security and reliability. In addition, the server can guarantee that session computing resources will not be occupied by other devices while the session connection is active, and even if a client disconnects from the server due to unforeseen circumstances, it can directly use the session computing resources upon reconnection.
[0138] Please see Figure 4 In some implementations, step 0142 (determining the processing status of the first task processing request based on the session computing power requirement and the remaining computing power resources of the server) includes:
[0139] 01423: If the session's computing power requirement exceeds the server's remaining computing power resources, refuse to process the first task processing request;
[0140] 01424: Move the first task processing request to the cloud queue until the session's computing power requirement is less than or equal to the server's remaining computing power resources.
[0141] In some implementations, the processing module is configured to reject the processing of the first task processing request if the session's computing power demand exceeds the server's remaining computing power resources. The processing module is configured to move the first task processing request to a cloud queue until the session's computing power demand is less than or equal to the server's remaining computing power resources.
[0142] In some implementations, the processor is further configured to refuse to process the first task processing request if the session's computing power demand exceeds the server's remaining computing power resources, and to move the first task processing request to a cloud queue until the session's computing power demand is less than or equal to the server's remaining computing power resources.
[0143] Specifically, if the session's computing power demand exceeds the server's remaining computing power resources, the server refuses to process the first task processing request. Then, the server moves the first task processing request to a cloud queue until the session's computing power demand is less than or equal to the server's remaining computing power resources.
[0144] Continuing the example above, if it is confirmed that the remaining computing power resources on the server are insufficient to meet the computing power requirements of this session (i.e., the second classical computing power resources are less than the first classical computing power resources, or the second quantum computing power resources are less than the first quantum computing power resources), the server refuses to process the first task processing request Q1 and moves it to a cloud queue until the session's computing power requirement is less than or equal to the server's remaining computing power resources. In other words, the first task processing request is moved to a queue used to store pending task processing requests from different clients until the server's remaining computing power resources can meet the session's computing power requirements for the first task processing request. Only then, the server allocates resources to the first task processing request according to a preset resource scheduling algorithm.
[0145] Thus, when it is found that the server's remaining computing power is insufficient to meet the first task processing request Q1, the task is rejected and the first task processing request Q1 is moved to the cloud queue to wait until the server's remaining computing power increases to meet the task's requirements. This effectively manages its resources and ensures that the ongoing task is not affected by insufficient resources.
[0146] Please see Figure 5In some implementations, step 016 (processing the first task processing request according to the association between the session identifier and the session computing resources to obtain the first task processing result) includes:
[0147] 0161: Preprocess the first task processing request to obtain classical processing subtasks and quantum processing subtasks;
[0148] 0162: Call upon the session's classic computing resources to process the classic processing subtask and obtain the first classic processing result;
[0149] 0163: Call upon session quantum computing resources to process the quantum processing subtask and obtain the first quantum processing result;
[0150] 0164: The first task processing result is obtained based on the first classical calculation result and the first quantum processing result.
[0151] In some implementations, the processing module preprocesses the first task processing request to obtain a classical processing subtask and a quantum processing subtask. The computation module invokes session classical computing resources to process the classical processing subtask to obtain a first classical processing result. The computation module also invokes session quantum computing resources to process the quantum processing subtask to obtain a first quantum processing result. The processing module further obtains a first task processing result based on the first classical computation result and the first quantum processing result.
[0152] In some implementations, the processor is further configured to preprocess the first task processing request to obtain a classical processing subtask and a quantum processing subtask, and to invoke session classical computing resources to process the classical processing subtask to obtain a first classical processing result. The processor is also configured to invoke session quantum computing resources to process the quantum processing subtask to obtain a first quantum processing result, and to obtain a first task processing result based on the first classical calculation result and the first quantum processing result.
[0153] Specifically, when the first task processing request is relatively simple or is being processed for the first time, the server preprocesses the first task processing request to obtain classical processing subtasks and quantum processing subtasks.
[0154] Next, the server utilizes session classical computing resources to process the classical processing subtask and obtains the first classical processing result. Then, the server utilizes session quantum computing resources to process the quantum processing subtask and obtains the first quantum processing result. Finally, the server obtains the first task processing result based on the first classical calculation result and the first quantum processing result. It should be noted that the server utilizes session quantum computing resources by submitting the processed quantum circuit to the quantum chip.
[0155] Continuing with the example above, the Pauli Measurement Circuit is used to detect the state of a qubit and to acquire information about the qubit.
[0156] The server preprocesses the first task processing request Q1, dividing the VQE task into two parts: classical processing subtasks and quantum processing subtasks. Session classical computing resources can perform iterative optimization processing, such as Hamiltonian rotation, Pauli measurement circuit construction, parameter updates, and gradient calculations. The server calls upon these resources to process the classical processing subtasks and obtain the classical processing results. Session quantum computing resources can execute and measure quantum circuits and process the quantum processing subtasks during the iterative process to obtain the quantum processing results.
[0157] In this way, by dividing the VQE task into different subtasks and selecting appropriate computing resources according to the needs of each subtask, the processing efficiency and accuracy of the first task, which processes request Q1, can be improved.
[0158] Please see Figure 6 In some implementations, the method further includes:
[0159] 0165: Utilize classical computing resources to optimize the first quantum processing result and obtain the second classical processing result;
[0160] 0166: Call upon the session quantum computing power resources to process the second classical processing result to obtain the second quantum processing result;
[0161] 0167: The result of the first task processing is obtained based on the result of the second quantum processing.
[0162] In some implementations, the calling module is further configured to invoke session classical computing resources to optimize the first quantum processing result to obtain a second classical processing result. The calling module is also configured to use session quantum computing resources to process the second classical processing result to obtain a second quantum processing result. The processing module is further configured to obtain a first task processing result based on the second quantum processing result.
[0163] In some implementations, the processor is further configured to invoke session classical computing resources to optimize the first quantum processing result to obtain a second classical processing result, and to invoke session quantum computing resources to process the second classical processing result to obtain a second quantum processing result. Finally, the processor obtains the first task processing result based on the second quantum processing result.
[0164] Specifically, the first quantum processing result can be seen as the processing result obtained by calling session quantum computing resources to process the quantum processing subtask, or the processing result obtained by arbitrarily calling session quantum computing resources to process the second classical processing result.
[0165] The second classical processing result can be seen as the result obtained by arbitrarily calling the classical computing power resources of the session to optimize the first quantum processing result.
[0166] When the first task processing request is complex, it needs to be divided into multiple computational steps and processed iteratively. The session classical computing resources within the session computing power resources can optimize the parameters of the quantum circuit in the first quantum processing result, obtaining a second classical processing result, i.e., a new quantum computing task. Then, the server calls the session quantum computing resources to process this new quantum computing task, obtaining the second quantum processing result. Next, based on actual needs, it determines whether it is necessary to call the session classical computing resources again to optimize this obtained second quantum processing result. This process is iterated multiple times until a satisfactory first task processing result is obtained. In other words, the server obtains the processing result of this step based on the classical or quantum processing result of the previous step.
[0167] Continuing with the example above, because the VQE task is relatively complex, the service needs to iterate through the VQE task, with 20 iterations. That is, the server optimizes the processing result obtained in the previous step before using it to process the calculation in this step.
[0168] The server analyzes the quantum processing results using the session's classical computing resources, calculates the minimum eigenvalue of the Hamiltonian and the loss value during the iteration process, and then uses the session's quantum computing resources to process the quantum circuit with updated parameters. This process is repeated 20 times to obtain the first task processing result. The server then sends the first task processing result back to the client. Please refer to [link to relevant documentation]. Figure 7 The results of the client randomly submitting two VQE hybrid computing jobs are shown in the figure. The curve in the figure shows the trend of the loss value as the number of iterations increases during each processing of the VQE hybrid computing job.
[0169] Thus, for the first task processing request that requires iterative processing, since both the session classical computing resources and the session quantum computing resources are located on the server, the first quantum processing result does not need to be returned to the client. The session classical computing resources can be directly called to optimize the obtained first quantum processing result to obtain the second classical processing result, ensuring that the first task processing request can be processed stably and guaranteeing the low latency of the first task processing request.
[0170] In some implementations, the preprocessing includes splitting and optimization. Splitting is used to instruct the first task processing request to be split into classical processing subtasks and temporary quantum processing subtasks, and optimization is used to instruct the temporary quantum processing subtasks to be optimized to obtain quantum processing subtasks.
[0171] Specifically, the preprocessing performed by the server on the VQE task in the first task processing request Q1 includes splitting and optimization. Splitting indicates that the VQE task should be split into classical processing subtasks and temporary quantum processing subtasks. Optimization indicates that the temporary quantum processing subtasks should be optimized to obtain quantum processing subtasks. This optimization refers to the server using quantum circuit optimization algorithms such as gradient descent and genetic algorithms to optimize the quantum circuits to be executed and measured. Specifically, this means using the session's classical computing resources to optimize the parameters in the quantum circuits, such as optimizing the quantum gate parameters using gradient descent.
[0172] Please see Figure 8 In some implementations, the method further includes:
[0173] 017: Set the session wait time after a successful session connection establishment;
[0174] 018: If the idle time of the session computing power resources exceeds the session waiting time or a session termination request is received from the client, delete the session identifier and release the session computing power resources.
[0175] In some implementations, the processing module is further configured to set a session wait time upon successful establishment of the session connection. The processing module is also configured to delete the session identifier and release the session computing resources if the idle time of the session computing resources exceeds the session wait time or if a session termination request is received from the client.
[0176] In some implementations, the processor is also configured to set a session wait time when the session connection is successfully established, and to delete the session identifier and release the session computing resources when the idle time of the session computing resources exceeds the session wait time or when a session termination request is received from the client.
[0177] Specifically, once a session connection is successfully established, the server sets a session wait time. If the idle time of the session computing resources exceeds the session wait time or a session termination request is received from the client, the server will delete the session identifier and release the session computing resources.
[0178] Continuing the example above, once a session connection is successfully established, the server sets a session wait time T. If the idle time of session computing resource Z1 exceeds the session wait time T, or if the server receives a session termination request from the client, it will delete the session identifier VQE-1 and release the session computing resource Z1. In other words, there are two scenarios for ending the session: one is that session computing resource Z1 has not been used within the session wait time T, in which case session identifier VQE-1 will be deleted and session computing resource Z1 will be released. The other is that the server receives a session termination request from the client, and the client confirms that all computational tasks for the current session have been completed; in this case, the server will delete session identifier VQE-1 and release session computing resource Z1.
[0179] Thus, setting a session wait time T helps the server effectively manage its computing resources, preventing them from being occupied for extended periods and thus unusable for other tasks, ensuring the rational allocation and efficient utilization of computing resources.
[0180] Please see Figure 9 In some implementations, the method further includes:
[0181] 019: Upon receiving a second task processing request from the client, determine the usage of session computing resources based on the session identifier;
[0182] 020: When the session computing resources are idle, the second task processing request is processed according to the association between the session identifier and the session computing resources to obtain the second task processing result.
[0183] In some implementations, the determining module is further configured to determine the usage status of session computing resources based on the session identifier when receiving a second task processing request from the client. The processing module is configured to process the second task processing request to obtain a second task processing result based on the association between the session identifier and the session computing resources when the session computing resources are idle.
[0184] In some implementations, the processor is further configured to, upon receiving a second task processing request from a client, determine the usage status of session computing resources based on a session identifier; and, if the session computing resources are idle, process the second task processing request according to the association between the session identifier and the session computing resources to obtain a second task processing result.
[0185] Specifically, upon receiving a second task processing request from the client, the server determines the usage status of session computing resources based on the session identifier, where the second task processing request is a subsequent task processing request to the first task processing request. If the session computing resources are idle, the server processes the second task processing request according to the association between the session identifier and the session computing resources to obtain the second task processing result.
[0186] Continuing the example above, if session identifier VQE-1 exists, meaning the client retains the right to use session computing resource Z1, the client submits a second task processing request Q2. The server determines the usage status of session computing resource Z1 based on session identifier VQE-1. If session computing resource Z1 is idle, the server processes the second task processing request based on the session computing resource Z1 determined by session identifier VQE-1 to obtain the second task processing result.
[0187] In this way, by determining the usage status of the session computing power resource Z1 allocated to this session connection, the server determines whether the second task processing request can be processed immediately. If the session computing power resource Z1 is idle, it uses the session computing power resource Z1 to process the second task processing request, thereby quickly responding to the client's needs while maintaining the reasonable allocation and efficient utilization of computing power resources.
[0188] Please see Figure 10 In some implementations, the method further includes:
[0189] 021: When the session computing power resources are active, move the second task processing request to the pending task queue until the number of pending tasks in the pending task queue before the second task processing request is 0 and the session computing power resources are idle.
[0190] In some implementations, the moving module is further configured to move the second task processing request to the task queue when the session computing resources are active, until the number of tasks in the task queue preceding the second task processing request is 0 and the session computing resources are idle.
[0191] In some implementations, the processor is further configured to move the second task processing request to the task queue while the session computing resources are active, until the number of tasks in the task queue preceding the second task processing request is 0 and the session computing resources are idle.
[0192] Specifically, when the session computing resources are active, the server moves the second task processing request to the pending task queue until the number of pending tasks in the pending task queue before the second task processing request is 0 and the session computing resources are idle. The pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing resources are occupied.
[0193] Continuing with the previous example, when session computing power resource Z1 is active, the server moves the second task processing request to the pending task queue until the number of pending tasks preceding the second task processing request in the queue is 0 and session computing power resource Z1 is idle. The pending tasks indicate tasks that cannot be processed temporarily because session computing power resource Z1 is occupied. Please refer to... Figure 11 In some implementations, the session identifier VQE-1 binds and stores the session computing power resource Z1, the pending task queue, and the session waiting time used by the client in this session on the server. The classical computing resources and quantum computing resources store the corresponding indices of the session classical computing resources and session quantum computing resources, respectively.
[0194] In this way, the server determines whether the second task processing request can be processed immediately by checking the usage of the session computing resources allocated to the current session connection. If the session computing resources are in a working state, the server refuses to process the second task processing request until the number of pending tasks in the pending task queue that are ahead of the second task processing request is 0 and the session computing resources are idle. This ensures that all task processing requests are processed in the order of arrival, while avoiding resource conflicts and waste.
[0195] Please see Figure 12 This application provides a task processing system 100 based on a quantum-classical hybrid architecture, which includes a client 10 and the aforementioned server 20.
[0196] Specifically, client 10 establishes a session connection with server 20. During the session connection, client 10 can continuously submit task processing requests until the session ends.
[0197] When client 10 submits an iterative task request, the session classical computing resources within the session computing power resources can optimize the parameters of the quantum circuit to obtain a second classical processing result, i.e., a new quantum computing task. Then, server 20 calls the session quantum computing resources to process this new quantum computing task, obtaining a second quantum processing result. Next, based on actual needs, it determines whether it is necessary to further call the session classical computing resources to optimize this obtained second quantum processing result. This process is iterated multiple times until a first task processing result that meets the requirements is obtained. Finally, this first task processing result is sent to client 10.
[0198] In this way, the task processing system 100 establishes a session connection and sets a session identifier with the client 10 through the server 20, and receives the first task request. It also associates the session computing resources with the set session identifier, ensuring that the session computing resources will not be used by other clients before the session connection ends, reducing the queuing time of pending tasks and improving the overall efficiency of the task processing system 100. If the client 10 disconnects from the server 20 due to unforeseen circumstances, the server 20 in the task processing system modifies the parameters of the first task request and resubmits it to maintain the continuous execution of the first task request, ensuring the efficiency of task processing.
[0199] This application also provides a computer-readable storage medium containing a computer program. When the computer program is executed by one or more processors, it causes the one or more processors to perform the method of this application.
[0200] It is understood that a computer program includes computer program code. Computer program code can be in the form of source code, object code, executable files, or some intermediate form. Computer-readable storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, external hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.
[0201] In this specification, the terms "specifically," "furthermore," "particularly," "understandably," etc., refer to specific features, structures, materials, or characteristics described in connection with embodiments or examples that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0202] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0203] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A task processing method based on a quantum-classical hybrid architecture, characterized in that, The quantum-classical hybrid architecture includes a client and a server, the method is used on the server, and the method includes: Establish a session connection with the client using a preset communication protocol; If the session connection is successfully established, set the session identifier; Receive the first task processing request sent by the client; The session computing power resources are determined according to the first task processing request, and the session computing power resources include session classical computing power resources and session quantum computing power resources. The session computing resources are associated with the session identifier, and the session computing resources remain unchanged while the session connection is active. The first task processing request is preprocessed to obtain classical processing subtasks and quantum processing subtasks; The session's classic computing resources are invoked to process the classic processing subtask to obtain the first classic processing result; The session quantum computing resources are invoked to process the quantum processing subtask to obtain the first quantum processing result; The classical computing resources of the session are invoked to optimize the parameters of the quantum circuit in the first quantum processing result, thereby obtaining the second classical processing result; The second classical processing result is processed by calling upon the session quantum computing resources to obtain the second quantum processing result; Based on actual needs, determine whether it is necessary to call upon classical computing resources of the session to optimize the second quantum processing result. Repeat this process multiple times until the first task processing result that meets the requirements is obtained.
2. The method according to claim 1, characterized in that, The step of determining session computing resources based on the first task processing request includes: The first task processing request is evaluated to obtain the session computing power requirement, which is used to indicate the first classical computing power resources and the first quantum computing power resources required to process the first task processing request. The processing status of the first task processing request is determined based on the session computing power requirement and the server's remaining computing power resources, thereby determining the session computing power resources. The server's remaining computing power resources are used to indicate the second classical computing power resources and the second quantum computing power resources that are idle in the server.
3. The method according to claim 2, characterized in that, Determining the processing status of the first task processing request based on the session computing power requirement and the remaining server computing power resources, in order to determine the session computing power resources, includes: If the session computing power requirement is less than or equal to the remaining computing power resources of the server, the request to process the first task will be accepted. The session computing power resources are determined based on the preset resource scheduling algorithm and the session computing power requirements.
4. The method according to claim 2, characterized in that, Determining the processing status of the first task processing request based on the session computing power requirement and the remaining computing power resources of the server includes: If the session's computing power requirement exceeds the server's remaining computing power resources, the first task processing request will be rejected. The first task processing request is moved to the cloud queue until the session computing power requirement is less than or equal to the remaining computing power resources of the server.
5. The method according to claim 1, characterized in that, The preprocessing includes splitting and optimization. The splitting process is used to instruct the first task processing request to be split into classical processing subtasks and temporary quantum processing subtasks. The optimization process is used to instruct the temporary quantum processing subtasks to be optimized to obtain quantum processing subtasks.
6. The method according to claim 1, characterized in that, The method further includes: If the session connection is successfully established, set the session wait time; If the idle time of the session computing power resource exceeds the session waiting time or if a session termination request is received from the client, the session identifier is deleted and the session computing power resource is released.
7. The method according to claim 1, characterized in that, The method further includes: Upon receiving a second task processing request sent by the client, the usage of session computing resources is determined based on the session identifier, wherein the second task processing request is a subsequent task processing request of the first task processing request. When the session computing resources are idle, the second task processing request is processed according to the association between the session identifier and the session computing resources to obtain the second task processing result.
8. The method according to claim 7, characterized in that, The method further includes: When the session computing power resources are in operation, the second task processing request is moved to the pending task queue until the number of pending tasks in the pending task queue before the second task processing request is 0 and the session computing power resources are in an idle state. The pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing power resources are occupied.
9. A server for a quantum-classical hybrid architecture, characterized in that, The server includes a communication unit and a processor; The communication unit is configured to establish a session connection with the client via a preset communication protocol. If the session connection is successfully established, set the session identifier; Receive the first task processing request sent by the client; The processor is configured to: determine session computing power resources based on the first task processing request, wherein the session computing power resources include session classical computing power resources and session quantum computing power resources; The session computing resources are associated with the session identifier, and the session computing resources remain unchanged while the session connection is active. The first task processing request is preprocessed to obtain classical processing subtasks and quantum processing subtasks; The session's classic computing resources are invoked to process the classic processing subtask to obtain the first classic processing result; The session quantum computing resources are invoked to process the quantum processing subtask to obtain the first quantum processing result; The classical computing resources of the session are invoked to optimize the parameters of the quantum circuit in the first quantum processing result, thereby obtaining the second classical processing result; The second classical processing result is processed by calling upon the session quantum computing resources to obtain the second quantum processing result; Based on actual needs, determine whether it is necessary to call upon classical computing resources of the session to optimize the second quantum processing result. Repeat this process multiple times until the first task processing result that meets the requirements is obtained.
10. A task processing system based on a quantum-classical hybrid architecture, characterized in that, The task processing system includes a client and a server as described in claim 9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by one or more processors, implements the method as described in any one of claims 1-8.