Task processing method, server and system based on quantum-classical hybrid architecture
By establishing a session connection for each client in a quantum-classical hybrid architecture and allocating dedicated computing resources, the problems of resource competition and task processing stability are solved, and the overall processing efficiency and security are improved.
Patent Information
- Application Number
- CN202411493130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The existing quantum-classical hybrid architecture leads to reduced processing efficiency in the case of resource competition, and when the client is disconnected from the server, computing resources are easily occupied by other clients, resulting in task processing errors.
By establishing a session connection between the server and the client, setting a session identity, and determining the session computing resource based on task processing requests, ensuring that the computing resource is only used to process the client's task requests, reducing resource competition and queuing time.
It improves the overall processing efficiency of the quantum-classic hybrid architecture, ensures the stability and security of task processing, and avoids resource competition and task processing errors.
Smart Images

Figure CN119629212A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] Quantum computers, which use the principles of quantum mechanics to process information, have significant advantages in solving specific problems such as factoring large numbers and searching for unstructured data. However, due to the limitations of existing hardware technology and interference from the external environment, quantum computers still face many challenges in practical applications. In order to improve their ability to process tasks, they usually combine classical computers with quantum computers to complete tasks together. However, this mixed use mode is prone to resource competition problems, which in turn affects overall processing efficiency. Summary of the invention
[0003] The present 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] The embodiment of the present 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 for the server, and the method includes:
[0005] Establishing a session connection with the client via a preset communication protocol;
[0006] When the session connection is successfully established, setting a session identifier;
[0007] Receiving a first task processing request sent by the client;
[0008] Determine session computing resources according to the first task processing request, where the session computing resources include session classical computing resources and session quantum computing resources;
[0009] Associating the session computing power resource 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 resource to obtain a first task processing result.
[0011] In this way, the server first establishes a session connection with the client through a preset communication protocol. When the session connection is successfully established, the server sets the session identifier and receives the first task processing request sent by the client. Then, the server determines the session computing power resources 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. Next, the server associates the session computing power resources with the session identifier. Finally, the server processes 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. In this way, the server establishes a session connection with the client and receives the first task request, and determines the session computing power resources that the client can use for this session according to the first task request. Then, by associating the session computing power resources with the set session identifier, it is ensured that before the end of the session connection, the session computing power resources will not be used by other clients, and are only used to process the task requests sent by the client, thereby reducing the queuing time caused by competing resources and improving the overall efficiency of the quantum-classical hybrid architecture.
[0012] In some implementations, determining session computing resources according to the first task processing request includes:
[0013] Evaluate the first task processing request to obtain a session computing power requirement, where the session computing power requirement is used to indicate a first classical computing power resource and a first quantum computing power resource required to process the first task processing request;
[0014] Determine the processing status of the first task processing request according to the session computing power demand and the remaining computing power resources of the server to determine the session computing power resources, wherein the remaining computing power resources of the server are used to indicate a second classical computing power resource and a second quantum computing power resource in the server that are in an idle state.
[0015] In this way, the server evaluates and processes the first task processing request to obtain the session computing power requirement, and the session computing power requirement 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. Next, the server determines 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 to determine the session computing power resources, wherein the remaining computing power resources of the server are used to indicate the second classical computing power resources and the second quantum computing power resources in the server that are idle. In this way, the server obtains the session computing power requirement by evaluating and processing the first task processing request, and determines whether to process the first task processing request by comparing the session computing power requirement with the remaining computing power resources of the server in the server, and determines the session computing power resources that need to be allocated to the session connection, so as to avoid 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 according to the session computing power requirement and the remaining computing power resources of the server to determine the session computing power resources includes:
[0017] When the session computing power requirement is less than or equal to the remaining computing power resources of the server, accepting and processing the first task processing request;
[0018] The session computing power resources are determined according to a preset resource scheduling algorithm and the session computing power requirements.
[0019] In this way, when the session computing power demand is less than or equal to the remaining computing power resources of the server, the server accepts the first task processing request for processing. Then, the server determines the session computing power resources according to the preset resource scheduling algorithm and the session computing power demand. In this way, when the server can meet the session computing power demand 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 demand, so that its resources can be efficiently utilized and the requirements of the task can be met at the same time, thereby improving the efficiency and overall performance of task processing.
[0020] In some embodiments, the session computing resources remain unchanged while the session connection is in an ongoing state.
[0021] In this way, when the session connection is in an ongoing state, the session computing resources allocated to the session connection are determined to remain unchanged. In this way, keeping the session computing resources unchanged helps to ensure the consistency and stability of the session connection, so that task processing during the session connection can be carried out in a relatively stable environment. In addition, it can prevent malicious computing resource competition between different clients, thereby improving the security and reliability of the system. In addition, the server can also ensure that the session computing resources will not be occupied by other devices during the time when the session connection is in an ongoing state. Even if the client disconnects the session connection from the server due to an emergency, it can directly use the session computing resources after reconnecting.
[0022] In some implementations, determining the processing status of the first task processing request according to the session computing power requirement and the remaining computing power resources of the server includes:
[0023] If the session computing power requirement is greater than the remaining computing power resources of the server, refusing to process the first task processing request;
[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] In this way, when the session computing power demand is greater than 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 the cloud queue until the session computing power demand 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 server computing power resources are insufficient to meet the first task processing request, the task processing request is refused to be processed, and the first task processing request is moved to the cloud queue to wait until the server's server remaining computing power resources increase to be sufficient to meet the task requirements, thereby being able to effectively manage its resources and ensure that ongoing tasks are not affected by insufficient resources.
[0026] In some implementations, the processing the first task processing request according to the association between the session identifier and the session computing power resource to obtain the first task processing result includes:
[0027] Preprocessing the first task processing request to obtain a classical processing subtask and a quantum processing subtask;
[0028] Calling the session classic computing resource to process the classic processing subtask to obtain a first classic processing result;
[0029] Calling the session quantum computing power resource to process the quantum processing subtask to obtain a first quantum processing result;
[0030] The first task processing result is obtained according to the first classical calculation result and the first quantum processing result.
[0031] In this way, the server preprocesses the first task processing request to obtain a classical processing subtask and a quantum processing subtask. Then, the server calls the session classical computing power resources to process the classical processing subtask to obtain the first classical processing result. Then, the server calls the session quantum computing power resources to process the quantum processing subtask to obtain the first quantum processing result. Finally, the server obtains the first task processing result based on the first classical computing result and the first quantum processing result. In this way, by decomposing the first task processing request into different subtasks and selecting appropriate computing resources according to the requirements of each subtask, the processing efficiency and accuracy of the first task processing request are improved.
[0032] In certain embodiments, the method further comprises:
[0033] Calling the session classical computing power resource to optimize the first quantum processing result to obtain a second classical processing result;
[0034] Calling the session quantum computing power resource to process the second classical processing result to obtain a second quantum processing result;
[0035] The first task processing result is obtained according to the second quantum processing result.
[0036] In this way, for the first task processing request that requires iterative processing, the server calls the session classical computing power resources to optimize the first quantum processing result to obtain the second classical processing result. Next, the server calls the session quantum computing power 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 that requires iterative processing, since the session classical computing power resources and the session quantum computing power resources are both located on the server, the first quantum processing result does not need to be returned to the client, and the session classical computing power resources can be directly called to optimize the first quantum processing result to obtain the second classical processing result, ensuring that the first task processing request can be processed stably and the low latency of the first task processing request is guaranteed.
[0037] In some embodiments, the preprocessing includes splitting processing and optimization processing, the splitting processing is used to indicate that the first task processing request is split to obtain the classical processing subtask and the temporary quantum processing subtask, and the optimization processing is used to indicate that the temporary quantum processing subtask is optimized to obtain the quantum processing subtask.
[0038] In this way, the preprocessing performed by the server on the first task processing request includes splitting processing and optimization processing. The splitting processing is used to indicate that the first task processing request is split to obtain classical processing subtasks and temporary quantum processing subtasks, and the optimization processing is used to indicate that the temporary quantum processing subtask is optimized to obtain quantum processing subtasks. In this way, the splitting processing can decompose the first task processing request into classical processing subtasks and temporary quantum processing subtasks, so as to allocate them to different computing power resources for processing, and can more efficiently utilize different computing power resources, thereby improving the processing efficiency and accuracy of the entire task. In addition, optimizing the temporary quantum processing subtask can enable the quantum computing power resources to more effectively process the quantum processing subtasks, thereby improving the processing efficiency of the first task processing request.
[0039] In certain embodiments, the method further comprises:
[0040] When the session connection is successfully established, setting a session waiting time;
[0041] When the idle time of the session computing power resource exceeds the session waiting time or a session end request sent by the client is received, the session identifier is deleted and the session computing power resource is released.
[0042] In this way, when the session connection is successfully established, the server sets the session waiting time. When the idle time of the session computing resources exceeds the session waiting time or receives a session end request sent by the client, the server will delete the session identifier and release the session computing resources. In this way, setting the session waiting time helps the server to effectively manage its computing resources, avoid computing resources being occupied for a long time and unable to be used for other tasks, and ensure the reasonable allocation and efficient use of computing resources.
[0043] In certain embodiments, the method further comprises:
[0044] In the case of receiving a second task processing request sent by the client, determining the usage of the session computing resources according to 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 power resource is idle, the second task processing request is processed according to the association relationship between the session identifier and the session computing power resource to obtain a second task processing result.
[0046] In this way, when receiving the second task processing request sent by the client, the server determines the usage of the session computing resources 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 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, the server determines whether the second task processing request can be processed immediately by determining the usage of the session computing resources allocated to the session connection. If the session computing resources are idle, the session computing resources are used to process the second task processing request, thereby being able to quickly respond to the client's needs while maintaining reasonable allocation and efficient use of computing resources.
[0047] In certain embodiments, the method further comprises:
[0048] When the session computing power resources are in operation, the second task processing request is moved to a pending task queue until the number of pending tasks in the pending task queue that is located before the second task processing request is 0 and the session computing power resources are in an idle state, wherein the pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing power resources are occupied.
[0049] In this way, when the session computing resources are in operation, the server moves the task processing request to the pending task queue until the number of pending tasks before the second task processing request in the pending task queue is 0 and the session computing resources are in an idle state, wherein the pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing resources are occupied. In this way, the server determines whether the second task processing request can be processed immediately by determining the usage of the session computing resources allocated to the session connection. If the session computing resources are in operation, the server refuses to process the second task processing request until the number of pending tasks before the second task processing request in the pending task queue is 0 and the session computing resources are in an idle state, thereby ensuring that all task processing requests are processed in the order of arrival and avoiding resource conflicts and waste.
[0050] The embodiment of the present application provides a server for a quantum-classical hybrid architecture, the server comprising a communication unit and a processor;
[0051] Wherein, the communication unit is configured to: establish a session connection with the client via a preset communication protocol;
[0052] When the session connection is successfully established, setting a session identifier;
[0053] Receiving a first task processing request sent by the client;
[0054] The processor is configured to: determine a session computing power resource according to the first task processing request, wherein the session computing power resource includes a session classical computing power resource and a session quantum computing power resource;
[0055] Associating the session computing power resource 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 resource to obtain a first task processing result.
[0057] Thus, a server for a quantum-classical hybrid architecture includes a communication unit and a processor. The communication unit is configured to establish a session connection with a client through a preset communication protocol. And when the session connection is successfully established, a session identifier is set. And a first task processing request sent by the client is received. The processor is configured to determine the session computing power resources 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. And the session computing power resources are associated with the session identifier. And the first task processing request is processed according to the association relationship 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 and sets the session identifier with the client through the communication unit, and receives the first task request. Then the session computing power resources are associated with the set session identifier through the processor, ensuring that the session computing power resources will not be used by other clients before the session connection ends, reducing the queuing time caused by competing resources, and improving the overall efficiency of the quantum-classical hybrid architecture.
[0058] An embodiment of the present application provides a task processing system based on a quantum-classical hybrid architecture, wherein the task processing system includes a client and the above-mentioned server.
[0059] In this way, the client establishes a session connection with the server. During the duration of the session connection, the client can continuously submit task processing requests until the session ends. In this way, the task processing system establishes a session connection with the client through the server and sets the session identifier, and receives the first task request. The session computing resources are associated with the set session identifier to ensure that the session computing resources will not be used by other clients before the session connection ends, reducing the queuing time for tasks to be processed and improving the overall efficiency of the task processing system. When the client disconnects the session connection with the server due to an emergency, 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 and ensure the efficiency of task processing.
[0060] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium memory stores a computer program, and when the computer program is executed by one or more processors, the above method is implemented.
[0061] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0063] Figure 1 It is one of the flow charts of the implementation method of the present application;
[0064] Figure 2 This is the second flow chart of the implementation method of the present application;
[0065] Figure 3 This is the third flow chart of the implementation method of this application;
[0066] Figure 4 This is the fourth flow chart of the implementation method of the present application;
[0067] Figure 5 This is the fifth flow chart of the implementation method of the present application;
[0068] Figure 6 This is the sixth flow chart of the implementation method of this application;
[0069] Figure 7 is a schematic diagram of calculation results of an example of an implementation method of the present application;
[0070] Figure 8 This is the seventh flow chart of the implementation method of the present application;
[0071] Fig. 9 This is the eighth flow chart of the implementation method of the present application;
[0072] Fig.10 This is the ninth flowchart of the implementation method of the present application;
[0073] Fig.11 is a schematic diagram of a session object in an example of an implementation manner of the present application;
[0074] Fig.12 It is a schematic diagram of the architecture of an implementation method of the present application. DETAILED DESCRIPTION
[0075] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0076] As the demand for computing power in fields such as big data, artificial intelligence, and cryptography continues to grow, traditional classical computers have encountered performance bottlenecks when dealing with specific problems such as large integer decomposition and search algorithms. In related fields, in order to break through the performance bottleneck of classical computers, a quantum computing technology that uses the principles of quantum mechanics to process information is used. Quantum computers based on quantum computing technology have significant advantages in solving specific problems such as large integer decomposition and search algorithms.
[0077] However, due to hardware limitations and interference from the external environment, quantum processors still have great deficiencies in the actual application of task processing. In related technologies, classical computers and quantum computers with mature hardware facilities and application ecosystems are combined to build a task processing system based on a quantum-classical hybrid architecture to work together and give full play to the advantages of both classical computing technology and quantum computing technology. However, the task processing system based on a quantum-classical hybrid architecture built in these related technologies does not take into account the situation of resource contention. When multiple clients send task requests synchronously, they will compete for the computing power resources of the task processing system, resulting in increased response time and slow or failed execution of certain tasks. In addition, when a client is disconnected from the server of the task processing system due to an emergency, the computing power resources will be occupied by other clients, which can easily lead to errors in task requests.
[0078] Based on the above questions, please refer to Figure 1 The embodiment of the present application provides a task processing method based on a quantum-classical hybrid architecture, the quantum-classical hybrid architecture includes a client and a server, the method is used for the server, and the method includes:
[0079] 011: Establish a session connection with the client through a preset communication protocol;
[0080] 012: When the session connection is successfully established, set the session identifier;
[0081] 013: receiving the first task processing request sent by the client;
[0082] 014: Determine session computing resources according to 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 a first task processing result.
[0085] The embodiment of the present application also provides a computer device, including a memory and a processor. The task processing method based on the quantum-classical hybrid architecture of the embodiment of the present application can be implemented by the computer device of the embodiment of the present application. Specifically, a computer program is stored in the memory, and the processor is used to establish a session connection with the client through a preset communication protocol. And when the session connection is successfully established, a session identifier is set. And a first task processing request sent by the client is received. The processor is also used to determine the session computing power resources according to the first task processing request. And the session computing power resources are associated with the session identifier. And the first task processing request is processed according to the association relationship between the session identifier and the session computing power resources to obtain a first task processing result.
[0086] The embodiment of the present application also provides a server for a quantum-classical hybrid architecture. The task processing method based on the quantum-classical hybrid architecture of the embodiment of the present application can be implemented by the server of the embodiment of the present 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, and 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 the session computing power resources 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 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 resource to obtain the first task processing result.
[0087] Specifically, the preset 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), etc., which are communication protocols used for Internet communication.
[0088] A session is a continuous process of interaction between a client and a server. These interactions logically constitute a complete operation cycle. In this operation cycle, a session represents a logical unit of the client's occupation and use of various server resources.
[0089] The session ID is used to identify the session connection between the client and the server.
[0090] The task processing request is used to indicate a series of computing tasks including quantum computing and classical computing.
[0091] Session classic computing resources refer to the classic computing hardware and software resources allocated by the server to each session to perform classic computing subtasks, including memory, processor, storage, and network resources.
[0092] The session quantum computing power resources refer to the quantum computing hardware and software resources allocated by the server to each session, which are used to perform quantum computing subtasks, including quantum processors and quantum control systems. In the implementation of the present application, quantum chips are used as quantum computing power resources.
[0093] The Variational Quantum Eigensolver task (VQE) is a quantum algorithm used to solve the eigenvalue problem of quantum systems such as many-body quantum systems on a quantum computer. The Variational Quantum Eigensolver task combines classical computing technology and quantum computing technology and is widely used in solving the Hamiltonian of 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] A quantum system is a microscopic particle system governed by the laws of quantum mechanics, with unique characteristics such as wave-particle duality, quantum superposition, and quantum entanglement. A quantum bit is the basic information unit of quantum computing, similar to a bit in classical computing.
[0096] Energy eigenvalue refers to the energy that a quantum system has in a specific state.
[0097] A quantum circuit is a sequence of quantum gates that simulates the quantum state of a system. In VQE, quantum circuits are usually parameterized, and 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.
[0098] Quantum gates are basic operations on quantum bits, similar to logic gates in classical computing. Each quantum logic gate is represented by a unitary matrix, which can perform specific linear transformations on quantum state vectors to achieve changes in the state of quantum bits. Quantum gates can also be called quantum logic gates.
[0099] The server first establishes a session connection with the client through a preset communication protocol. When the session connection is successfully established, the server sets the session identifier and receives the first task processing request sent by the client. Then, the server determines the session computing power resources 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. Next, the server associates the session computing power resources with the session identifier. Finally, the server processes 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. In this way, the server establishes a session connection with the client and receives the first task request, and determines the session computing power resources that the client can use for this session according to the first task request. Then, by associating the session computing power resources with the set session identifier, it is ensured that before the end of the session connection, the session computing power resources will not be used by other clients, and are only used to process the task requests sent by the client, thereby reducing the queuing time of tasks to be processed and improving the overall efficiency of the quantum-classical hybrid architecture.
[0100] The following is an example of the task processing method based on the quantum-classical hybrid architecture of the embodiment of the present application. In the embodiment of the present application, the task processing method based on the quantum-classical hybrid architecture of the embodiment of the present application is used to execute the variational quantum eigensolver task (VQE), and the preset communication protocol is the IPsec protocol.
[0101] The Hamiltonian description of a quantum system refers to the mathematical model of the multi-body quantum system to be solved by the VQE algorithm. In the VQE algorithm, the Hamiltonian is used to represent the energy eigenvalue problem of the quantum system to be solved.
[0102] Parameter setting of quantum circuits refers to the fact that in VQE, quantum circuits are usually parameterized and 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] Optimization algorithm parameters in classical computing refer to the parameters in the classical optimization algorithm used to adjust the parameters of quantum circuits. These optimization algorithm parameters determine the search strategy and efficiency of the optimization algorithm. For example, the "learning rate" of the gradient descent method, the "conjugate condition" and "convergence threshold" of the conjugate gradient method, the "annealing temperature" and "annealing rate" of the simulated annealing method, etc.
[0104] The demand for quantum computing resources refers to the quantum resources required for the VQE algorithm to run, including the number of quantum bits, the number of quantum gate operations, the depth of quantum circuits, etc. The demand for quantum computing resources directly affects the feasibility and efficiency of the algorithm on an actual quantum computer.
[0105] The client sends a session request to the server using the IPsec protocol.
[0106] After receiving the session request, the server establishes a session connection with the client through the IPsec protocol. When the session connection is successfully established, the server creates a session object A and sets the session identifier VQE-1. It also receives the first task processing request Q1 sent by the client, and the session identifier VQE-1 is stored in the 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 setting of the quantum circuit, the optimization algorithm parameters in the classical calculation, and the requirements for quantum computing resources. The specific settings of the initial parameters are as follows:
[0107] The number of quantum bits n is set to 4, the number of circuit layers L is set to 2, the number of iterations iteration_num is set to 20, the learning rate learning_rate is set to 0.3, the delta value of the Hamiltonian differential calculation is set to, and the number of local Hamiltonians K is set to 3.
[0108] The number of qubits n is set to 4, indicating that in the VQE algorithm, 4 qubits will be used to simulate the quantum system.
[0109] The circuit layer number L is set to 2, which indicates that in the VQE algorithm, the quantum circuit used to process the quantum computing task of the VQE algorithm will contain 2 layers of quantum gates. The choice of the circuit layer number will affect the complexity and resource requirements of the algorithm.
[0110] The number of iterations, iteration_num, is set to 20, which means that the VQE algorithm will perform 20 iterations. In each iteration, the VQE algorithm will update the parameters of the quantum circuit to optimize the energy estimate. The choice of the number of iterations will affect the convergence speed and accuracy of the algorithm. Gradient Descent Method
[0111] The learning rate learning_rate is set to 0.3, indicating that the optimization algorithm used is the gradient descent method. The learning rate is set to 0.3, which determines that the step size of the algorithm to update the parameters in each iteration is 0.3.
[0112] The delta value calculated by differentiating the Hamiltonian is often used to determine the gradient of each term in the Hamiltonian.
[0113] The number of local Hamiltonians K is set to 3, which means that in the VQE algorithm, three local Hamiltonians will be used to approximate the Hamiltonian of the entire system.
[0114] Then, the server determines the session computing power resource Z1 according to the first task processing request Q1, and the session computing power resource Z1 includes the session classical computing power resource and the session quantum computing power resource. Next, the server associates the session computing power resource Z1 with the session identifier VQE-1. Finally, the server processes the first task processing request Q1 according to the association between the session identifier VQE-1 and the 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 the session computing power resource Z1. That is to say, for example, due to the sudden disconnection of the session connection, the client has not submitted a new task or submitted a session end request. After the task submitted by the client is processed in the server, the session computing power resource Z1 will be retained for a period of time. During this time, the client can directly use the session computing power resource Z1 by resubmitting the task.
[0115] In summary, in the task processing method based on the quantum-classical hybrid architecture and the server for the quantum-classical hybrid architecture of the embodiment of the present application, the server first establishes a session connection with the client through a preset communication protocol. When the session connection is successfully established, the server sets the session identifier and receives the first task processing request sent by the client. Then, the server determines the session computing power resources 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. Then, the server associates the session computing power resources with the session identifier. Finally, the server processes the first task processing request according to the association relationship 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 and receives the first task request, and determines the session computing power resources that the client can use for this session according to the first task request. Then, by associating the session computing power resources with the set session identifier, it is ensured that before the end of the session connection, the session computing power resources will not be used by other clients, and are only used to process the task requests sent by the client, thereby reducing the queuing time of the tasks to be processed and improving the overall efficiency of the quantum-classical hybrid architecture.
[0116] See also Figure 2 Step 014 (determining session computing resources according to 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 according to the session computing power demand and the remaining computing power resources of the server 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 according to the session computing power requirement and the remaining computing power resources of the server to determine the session computing power resources.
[0120] In some embodiments, the processor is further configured to evaluate the first task processing request to obtain the session computing power requirement, and determine the processing state of the first task processing request according to the session computing power requirement and the remaining computing power resources of the server to determine the session computing power resources.
[0121] Specifically, the server evaluates the first task processing request to obtain a session computing power requirement, and the session computing power requirement is used to indicate the first classical computing power resource and the first quantum computing power resource required to process the first task processing request. The number of the first classical computing power resource can be 0 or other numbers, which are determined according to actual needs. The number of the first quantum computing power resource is the same as above.
[0122] Next, the server determines the processing status of the first task processing request based on the session computing power demand and the server's remaining computing power resources to determine the session computing power resources, wherein 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 above example, the server evaluates the initial parameters of the VQE task in the first task processing request Q1. The server estimates the demand for quantum computing resources, i.e., the first quantum computing resources, by the number of quantum bits and the number of circuit layers. And based on the number of iterations and the delta value calculated by the Hamiltonian differential, the server estimates the required computing time and storage space, as well as the first classical computing resources.
[0124] Next, the server determines the processing status of the first task processing request Q1 according to the session computing power demand and the remaining computing power resources of the server to determine the session computing power resources. That is, according to the remaining computing power resources in the server, both the second classical computing power resources and the second quantum computing power resources must meet the session computing power demand of this session.
[0125] In this way, the server obtains the session computing power requirement by evaluating the first task processing request Q1, and determines whether to process the first task processing request Q1 by comparing the session computing power requirement with the remaining computing power resources in the server, and determines the session computing power resources that need to be allocated to the session connection, avoiding task processing errors due to insufficient resources, thereby improving the efficiency and effectiveness of task processing.
[0126] See also Figure 3In some embodiments, step 0142 (determining the processing status of the first task processing request according to the session computing power demand and the remaining computing power resources of the server to determine the session computing power resources) includes:
[0127] 01421: When the session computing power requirement is less than or equal to the remaining computing power resources of the server, the first task processing request is accepted for processing;
[0128] 01422: Determine session computing resources based on the preset resource scheduling algorithm and session computing requirements.
[0129] In some embodiments, the accepting module is used to accept the first task processing request for processing when the session computing power requirement is less than or equal to the remaining computing power resources of the server. The determining module is used to determine the session computing power resources according to a preset resource scheduling algorithm and the session computing power requirement.
[0130] In some embodiments, the processor is further configured to accept and process the first task processing request when the session computing power requirement is less than or equal to the remaining computing power resources of the server, and determine the session computing power resources according to 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 Round Robin, Weighted Round Robin, and Response Time Based Load Balancing. Appropriate resource scheduling algorithms can be selected according to actual needs to schedule computing resources.
[0132] When the session computing power requirement is less than or equal to the remaining computing power resources of the server, the server accepts and processes the first task processing request. Then, the server determines the session computing power resources according to the preset resource scheduling algorithm and the session computing power requirement.
[0133] Continuing with the above example, the preset resource scheduling algorithm is a round robin algorithm. After confirming that the remaining computing power resources in the server can meet the computing power resources required for this session, that is, the second classical computing power resources are greater than or equal to the first classical computing power resources, and the second quantum computing power resources are greater than or equal to the first quantum computing power resources, the server accepts the first task processing request Q1 for processing. The server allocates session computing power resources for the session connection between the client and the server according to the polling 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. In addition, the server also stores the indexes corresponding to the allocated session classical computing power resources and session quantum computing power resources in the session object A, and the corresponding computing power resources can be called through these indexes.
[0134] In this way, when the server is able to 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, so that its resources can be efficiently utilized and the task requirements can be met at the same time, thereby improving the efficiency and overall performance of task processing.
[0135] In some embodiments, the session computing resources remain unchanged while the session connection is in an ongoing state.
[0136] Specifically, when the session connection is in the ongoing state, it is determined that the session computing resources allocated to the session connection remain unchanged. That is, when these computing resources have been allocated to the client's session connection, as long as the session connection is in the ongoing state, no matter whether the session computing resources are used or not, they will not be used by other clients.
[0137] In this way, keeping the session computing resources unchanged helps ensure the consistency and stability of the session connection, so that task processing during the session connection can be carried out in a relatively stable environment. In addition, it can prevent malicious computing resource competition between different clients, thereby improving the security and reliability of the system. In addition, the server can also ensure that the session computing resources will not be occupied by other devices during the time the session connection is in a continuous state. Even if the client disconnects the session connection from the server due to an emergency, it can directly use the session computing resources after reconnecting.
[0138] See also Figure 4 In some implementations, step 0142 (determining the processing status of the first task processing request according to the session computing power requirement and the remaining computing power resources of the server) includes:
[0139] 01423: If the session computing power requirement is greater than the remaining computing power resources of the server, the first task processing request is rejected;
[0140] 01424: Move the first task processing request to the cloud queue until the session computing power demand is less than or equal to the remaining computing power resources of the server.
[0141] In some embodiments, the processing module is used to refuse to process the first task processing request when the session computing power demand is greater than the remaining computing power resources of the server. The processing module is used to move the first task processing request to the cloud queue until the session computing power demand is less than or equal to the remaining computing power resources of the server.
[0142] In some embodiments, the processor is further configured to refuse to process the first task processing request when the session computing power requirement is greater than the remaining computing power resources of the server, and move the first task processing request to the cloud queue until the session computing power requirement is less than or equal to the remaining computing power resources of the server.
[0143] Specifically, when the session computing power requirement is greater than the remaining computing power resources of the server, the server refuses to process the first task processing request. Then, the server moves the first task processing request to the cloud queue until the session computing power requirement is less than or equal to the remaining computing power resources of the server.
[0144] Continuing with the above example, when it is confirmed that the remaining computing power resources in the server cannot meet the computing power resources required for this session, that is, 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 the first task processing request to the cloud queue until the session computing power demand is less than or equal to the remaining computing power resources on the server. In other words, the first task processing request is moved to the cloud queue used to store pending task processing requests from different clients until the remaining computing power resources in the server can meet the session computing power demand required by the first task processing request, and then the first task processing request is allocated resources according to the preset resource scheduling algorithm.
[0145] In this way, when it is found that the server's current remaining server computing power resources are insufficient to meet the first task processing request Q1, the task is refused to be processed, and the first task processing request Q1 is moved to the cloud queue to wait until the server's remaining server computing power resources increase to be sufficient to meet the task requirements, thereby being able to effectively manage its resources and ensure that ongoing tasks will not be affected by insufficient resources.
[0146] See also Figure 5In some implementations, step 016 (processing the first task processing request to obtain the first task processing result according to the association between the session identifier and the session computing power resource) includes:
[0147] 0161: pre-process the first task processing request to obtain a classical processing subtask and a quantum processing subtask;
[0148] 0162: Call the session classic computing resources to process the classic processing subtask to obtain the first classic processing result;
[0149] 0163: Call the session quantum computing power resource to process the quantum processing subtask to obtain the first quantum processing result;
[0150] 0164: Obtain a first task processing result according to the first classical calculation result and the first quantum processing result.
[0151] In some embodiments, the processing module is used to pre-process the first task processing request to obtain a classical processing subtask and a quantum processing subtask. The computing module is used to call the session classical computing power resources to process the classical processing subtask to obtain a first classical processing result. The computing module is also used to call the session quantum computing power resources to process the quantum processing subtask to obtain a first quantum processing result. The processing module is also used to obtain a first task processing result based on the first classical computing result and the first quantum processing result.
[0152] In some embodiments, the processor is further configured to pre-process the first task processing request to obtain a classical processing subtask and a quantum processing subtask. And call the session classical computing power resource to process the classical processing subtask to obtain a first classical processing result. The processor is further configured to call the session quantum computing power resource to process the quantum processing subtask to obtain a first quantum processing result. And obtain the first task processing result according to the first classical computing result and the first quantum processing result.
[0153] Specifically, when the first task processing request is relatively simple or the first task processing request is processed for the first time, the server pre-processes the first task processing request to obtain a classical processing subtask and a quantum processing subtask.
[0154] Next, the server calls the session classical computing power resources to process the classical processing subtask to obtain the first classical processing result. Then, the server calls the session quantum computing power resources to process the quantum processing subtask to obtain the first quantum processing result. Finally, the server obtains the first task processing result based on the first classical computing result and the first quantum processing result. It should be noted that the way the server calls the session quantum computing power resources is to submit the processed quantum circuit to the quantum chip.
[0155] Continuing with the above example, a Pauli Measurement Circuit is used to detect the state of a quantum bit and obtain information about the quantum bit.
[0156] The server preprocesses the first task processing request Q1 and divides the VQE task into two parts: classical processing subtasks and quantum processing subtasks. The session classical computing power resources can perform iterative optimization processing, such as Hamiltonian rotation, Pauli measurement circuit construction, parameter update and gradient calculation, etc. The server calls the session classical computing power resources to process the classical processing subtasks to obtain classical processing results. The session quantum computing power resources can execute and measure quantum circuits, and will process the quantum processing subtasks in the iterative process to obtain quantum processing results.
[0157] In this way, by dividing the VQE task into different subtasks and selecting appropriate computing resources according to the requirements of each subtask, the processing efficiency and accuracy of the first task processing request Q1 are improved.
[0158] See also Figure 6 In some embodiments, the method further comprises:
[0159] 0165: Call the session classical computing power resources to optimize the first quantum processing result to obtain the second classical processing result;
[0160] 0166: Call the session quantum computing power resource to process the second classical processing result to obtain the second quantum processing result;
[0161] 0167: Obtain the first task processing result according to the second quantum processing result.
[0162] In some embodiments, the calling module is further used to call the session classical computing power resources to optimize the first quantum processing result to obtain the second classical processing result. The calling module is also used to use the session quantum computing power resources to process the second classical processing result to obtain the second quantum processing result. The processing module is also used to obtain the first task processing result according to the second quantum processing result.
[0163] In some embodiments, the processor is further configured to call the session classical computing power resource to optimize the first quantum processing result to obtain a second classical processing result, and call the session quantum computing power resource to process the second classical processing result to obtain a second quantum processing result, and obtain the first task processing result according to the second quantum processing result.
[0164] Specifically, the first quantum processing result can be regarded as the processing result obtained by calling the session quantum computing power resources to process the quantum processing subtask, or the processing result obtained by arbitrarily calling the session quantum computing power resources to process the second classical processing result.
[0165] The second classical processing result can be regarded as the processing result obtained by optimizing the above-mentioned first quantum processing result by arbitrarily calling the session classical computing power resources.
[0166] When the first task processing request is more complex, the first task processing request needs to be divided into multiple calculation steps for iterative processing. The session classical computing power resources in the session computing power resources can optimize the parameters of the quantum circuit in the first quantum processing result to obtain the second classical processing result, that is, the new quantum computing task. Then the server calls the session quantum computing power resources to process this new quantum computing task and obtains the second quantum processing result. Then, according to actual needs, it is determined whether it is necessary to call the session classical computing power resources again to optimize the obtained second quantum processing result. This is repeated many times until the first task processing result that meets the needs is obtained. That is, the server obtains the processing result of this step based on the classical processing result or quantum processing result of the previous step.
[0167] Continuing with the above example, since the VQE task is relatively complex, the service needs to iterate the VQE task, and the number of iterations is 20. That is, the server optimizes the processing result obtained in the previous step and uses it to process the calculation in this step.
[0168] The server analyzes the quantum processing results based on the session classical computing resources, calculates the minimum eigenvalue of the Hamiltonian and the loss value during the iteration, and uses the session quantum computing resources to process the quantum circuit after the updated parameters. This iteration is repeated 20 times to finally obtain the first task processing result. The server feeds back the first task processing result to the client. Figure 7 ,The result of the client randomly submitting two VQE hybrid computing jobs is shown in the figure. The curve in the figure shows the changing trend of the loss value as the number of iterations increases during each processing of the VQE hybrid computing job.
[0169] In this way, for the first task processing request that needs to be iteratively processed, since the session classical computing power resources and the session quantum computing power resources are both located on the server, the first quantum processing result does not need to be returned to the client. The session classical computing power resources can be directly called to optimize the first quantum processing result to obtain the second classical processing result, ensuring that the first task processing request can be processed stably and the low latency of the first task processing request is guaranteed.
[0170] In some embodiments, the preprocessing includes splitting processing and optimization processing, the splitting processing is used to indicate that the first task processing request is split to obtain a classical processing subtask and a temporary quantum processing subtask, and the optimization processing is used to indicate that the temporary quantum processing subtask is optimized to obtain a quantum processing subtask.
[0171] Specifically, the preprocessing performed by the server on the VQE task in the first task processing request Q1 includes splitting processing and optimization processing. The splitting processing is used to indicate that the VQE task is split to obtain classical processing subtasks and temporary quantum processing subtasks. The optimization processing is used to indicate that the temporary quantum processing subtask is optimized to obtain quantum processing subtasks. This optimization processing refers to the server using quantum circuit optimization algorithms such as gradient descent and genetic algorithm to optimize the quantum circuit that needs to be executed and measured. Specifically, it means using the session classical computing power resources to optimize the parameters in the quantum circuit, such as optimizing the quantum gate parameters in the quantum circuit according to the gradient descent method.
[0172] See also Figure 8 In some embodiments, the method further comprises:
[0173] 017: Set the session waiting time when the session connection is successfully established;
[0174] 018: When the idle time of the session computing resources exceeds the session waiting time or a session end request is received from the client, the session identifier is deleted and the session computing resources are released.
[0175] In some embodiments, the processing module is further configured to set a session waiting time when the session connection is successfully established. The processing module is configured to delete the session identifier and release the session computing resources when the idle time of the session computing resources exceeds the session waiting time or a session end request sent by the client is received.
[0176] In some embodiments, the processor is further configured to set a session waiting 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 waiting time or a session end request sent by the client is received.
[0177] Specifically, when the session connection is successfully established, the server sets a session waiting time. When the idle time of the session computing resources exceeds the session waiting time or a session end request is received from the client, the server deletes the session identifier and releases the session computing resources.
[0178] Continuing with the above example, when the session connection is successfully established, the server sets the session waiting time T. When the idle time of the session computing resource Z1 exceeds the session waiting time T or receives a session end request sent by the client, the server will delete the session identifier VQE-1 and release the session computing resource Z1. That is, there are two situations for ending this session. One situation is that the session computing resource Z1 has not been used within the session waiting time T, the session identifier VQE-1 will be deleted, and the session computing resource Z1 will be released. The other situation is that the server receives a session end request sent by the client, and the client confirms that all computing tasks for this session have been completed. The server will delete the session identifier VQE-1 and release the session computing resource Z1.
[0179] In this way, setting the session waiting time T helps the server to effectively manage its computing resources, avoid computing resources being occupied for a long time and unable to be used for other tasks, and ensure the reasonable allocation and efficient use of computing resources.
[0180] See also Fig. 9 In some embodiments, the method further comprises:
[0181] 019: when receiving the second task processing request sent by the client, determining the usage of the session computing resources according to the session identifier;
[0182] 020: When the session computing power resources are idle, the second task processing request is processed according to the association relationship between the session identifier and the session computing power resources to obtain a second task processing result.
[0183] In some embodiments, the determination module is further configured to determine the usage of the session computing resources according to the session identifier when receiving the second task processing request sent by the client. The processing module is configured to process 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 when the session computing resources are idle.
[0184] In some embodiments, the processor is further configured to determine the usage of the session computing resources according to the session identifier when receiving the second task processing request sent by the client, and to process 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 when the session computing resources are idle.
[0185] Specifically, when receiving the second task processing request sent by the client, the server determines the usage of the session computing resources according to 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 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 with the above example, when the session identifier VQE-1 exists, that is, the client has always had the right to use the session computing resource Z1, the client submits a second task processing request Q2, and the server determines the usage of the session computing resource Z1 according to the session identifier VQE-1. When the session computing resource Z1 is idle, the server processes the second task processing request according to the session computing resource Z1 determined by the session identifier VQE-1 to obtain the second task processing result.
[0187] In this way, the server determines whether the second task processing request can be processed immediately by determining the usage of the session computing power resource Z1 allocated to the session connection. If the session computing power resource Z1 is in an idle state, the session computing power resource Z1 is used to process the second task processing request, thereby being able to quickly respond to the client's needs while maintaining reasonable allocation and efficient utilization of computing power resources.
[0188] See also Fig.10 In some embodiments, the method further comprises:
[0189] 021: 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 before the second task processing request in the pending task queue is 0 and the session computing power resources are in an idle state.
[0190] In some embodiments, the moving module is also used to move the second task processing request to the pending task queue when the session computing power resources are in operation 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.
[0191] In some embodiments, the processor is further used to move the second task processing request to the pending task queue when the session computing power resources are in operation 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.
[0192] Specifically, when the session computing resources are in operation, 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 in an idle state, wherein the pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing resources are occupied.
[0193] Continuing with the above example, when the session computing resource Z1 is working, the server moves the second task processing request to the pending task queue until the number of pending tasks before the second task processing request in the pending task queue is 0 and the session computing resource Z1 is in an idle state, wherein the pending task is used to indicate a task that cannot be processed temporarily because the session computing resource Z1 is occupied. Fig.11 In some implementations, the session identifier VQE-1 binds the session computing resource Z1, the pending task queue, and the session waiting time occupied by the client in this session and stores them in the server. The classical computing resources and quantum computing resources store the corresponding indexes in 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 determining the usage of the session computing resources allocated to the 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 before the second task processing request in the pending task queue is 0 and the session computing resources are in an idle state, ensuring that all task processing requests are processed in the order of arrival while avoiding resource conflicts and waste.
[0195] See also Fig.12 An embodiment of the present application provides a task processing system 100 based on a quantum-classical hybrid architecture, and the task processing system includes a client 10 and the above-mentioned server 20.
[0196] Specifically, the client 10 establishes a session connection with the server 20. During the session connection, the client 10 can continuously submit task processing requests until the session ends.
[0197] When the first task request submitted by the client 10 is an iterative task request, the session classical computing power resources in the session computing power resources can optimize the parameters of the quantum circuit and obtain the second classical processing result, that is, the new quantum computing task. Then the server 20 calls the session quantum computing power resources to process this new quantum computing task and obtains the second quantum processing result. Then, according to actual needs, it is determined whether it is necessary to call the session classical computing power resources again to optimize the obtained second quantum processing result, and iterates multiple times until the first task processing result that meets the needs is obtained. The first task processing result is then sent to the 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. The session computing resources are associated 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 queue time of tasks to be processed and improving the overall efficiency of the task processing system 100. When the client 10 disconnects the session connection with the server 20 due to an emergency, 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 and ensure the efficiency of task processing.
[0199] The present application also provides a computer-readable storage medium containing a computer program. When the computer program is executed by one or more processors, the one or more processors execute the method of the present application.
[0200] It is understood that a computer program includes computer program code. The computer program code may be in source code form, object code form, executable file or some intermediate form. Computer readable storage media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution medium.
[0201] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0202] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0203] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present 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, and the method is used for the server, and the method includes: Establishing a session connection with the client via a preset communication protocol; When the session connection is successfully established, setting a session identifier; Receiving a first task processing request sent by the client; Determine session computing resources according to the first task processing request, where the session computing resources include session classical computing resources and session quantum computing resources; Associating the session computing power resource with the session identifier; The first task processing request is processed according to the association between the session identifier and the session computing power resource to obtain a first task processing result.
2. The method according to claim 1, characterized in that The determining of session computing resources according to the first task processing request includes: Evaluate the first task processing request to obtain a session computing power requirement, where the session computing power requirement is used to indicate a first classical computing power resource and a first quantum computing power resource required to process the first task processing request; Determine the processing status of the first task processing request according to the session computing power demand and the remaining computing power resources of the server to determine the session computing power resources, wherein the remaining computing power resources of the server are used to indicate a second classical computing power resource and a second quantum computing power resource in the server that are in an idle state.
3. The method according to claim 2, characterized in that The determining the processing status of the first task processing request according to the session computing power requirement and the remaining computing power resources of the server to determine the session computing power resources includes: When the session computing power requirement is less than or equal to the remaining computing power resources of the server, accepting and processing the first task processing request; The session computing power resources are determined according to a preset resource scheduling algorithm and the session computing power requirements.
4. The method according to claim 3, characterized in that The session computing resources remain unchanged while the session connection is in an ongoing state.
5. The method according to claim 2, characterized in that: The determining the processing status of the first task processing request according to the session computing power requirement and the remaining computing power resources of the server includes: If the session computing power requirement is greater than the remaining computing power resources of the server, refusing to process the first task processing request; 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.
6. The method according to claim 1, characterized in that The processing of the first task processing request according to the association relationship between the session identifier and the session computing power resource to obtain a first task processing result includes: Preprocessing the first task processing request to obtain a classical processing subtask and a quantum processing subtask; Calling the session classic computing resource to process the classic processing subtask to obtain a first classic processing result; Calling the session quantum computing power resource to process the quantum processing subtask to obtain a first quantum processing result; The first task processing result is obtained according to the first classical calculation result and the first quantum processing result.
7. The method according to claim 6, characterized in that The method further comprises: Calling the session classical computing power resource to optimize the first quantum processing result to obtain a second classical processing result; Calling the session quantum computing power resource to process the second classical processing result to obtain a second quantum processing result; The first task processing result is obtained according to the second quantum processing result.
8. The method according to claim 6, characterized in that The preprocessing includes splitting processing and optimization processing, wherein the splitting processing is used to indicate that the first task processing request is split to obtain the classical processing subtask and the temporary quantum processing subtask, and the optimization processing is used to indicate that the temporary quantum processing subtask is optimized to obtain the quantum processing subtask.
9. The method according to claim 1, characterized in that: The method further comprises: When the session connection is successfully established, setting a session waiting time; When the idle time of the session computing power resource exceeds the session waiting time or a session end request sent by the client is received, the session identifier is deleted and the session computing power resource is released.
10. The method according to claim 1, characterized in that The method further comprises: In the case of receiving a second task processing request sent by the client, determining the usage of the session computing resources according to 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 power resource is idle, the second task processing request is processed according to the association relationship between the session identifier and the session computing power resource to obtain a second task processing result.
11. The method according to claim 10, characterized in that The method further comprises: When the session computing power resources are in operation, the second task processing request is moved to a pending task queue until the number of pending tasks in the pending task queue that is located before the second task processing request is 0 and the session computing power resources are in an idle state, wherein the pending tasks are used to indicate tasks that cannot be processed temporarily because the session computing power resources are occupied.
12. A server for a quantum-classical hybrid architecture, characterized in that: The server includes a communication unit and a processor; Wherein, the communication unit is configured to: establish a session connection with the client via a preset communication protocol; When the session connection is successfully established, setting a session identifier; Receiving a first task processing request sent by the client; The processor is configured to: determine a session computing power resource according to the first task processing request, wherein the session computing power resource includes a session classical computing power resource and a session quantum computing power resource; Associating the session computing power resource with the session identifier; The first task processing request is processed according to the association between the session identifier and the session computing power resource to obtain a first task processing result.
13. A task processing system based on a quantum-classical hybrid architecture, characterized in that: The task processing system comprises a client and the server as claimed in claim 12.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium memory stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Session connection request processing method and device and server
CN113282389A
Method and system for dynamically and adaptively dividing and scheduling hybrid computing tasks of heterogeneous cloud computing platform
CN113902120A
Distributed quantum computing system
CN115511093A
Task processing method and device, electronic equipment and readable storage medium
CN116841738A
Automatic dialogue resource clearing method and system for distributed client computor-server
CN1371063A