Disclosure of Invention
One or more embodiments of the present specification provide a method for quantum service resource call optimization based on a quantum cloud platform. To solve the following problems: the resource utilization rate of the quantum computer is not high, and the quantum computer can not be fully utilized.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
one or more embodiments of the present specification provide a quantum service resource invocation optimization method based on a quantum cloud platform, including:
equally dividing according to quantum computer resources, installing an application container engine Docker with an open source, installing and starting quantum computing service in the Docker, and providing an address of the quantum computing service to the outside through the Docker;
setting a Docker service resource table and a Docker service queue table, and receiving a task instruction generated and submitted by user programming through an interface provided by the quantum computing service;
and acquiring addresses of all currently idle quantum computing services by inquiring and monitoring the Docker service resource table and the Docker service queue table, and selecting one quantum computing service from all currently idle quantum computing services to execute the task instruction.
Docker starts fast, the resource occupies smallly, and dispose convenient and safe, can save hardware resource and provide more computational resources for users, through quantum cloud platform and quantum computational resource scheduling service and quantum computer's cooperation, the quantum computer resource utilization ratio has effectively been improved for quantum computer obtains make full use of, has practiced thrift infrastructure construction cost.
Optionally, the method includes obtaining addresses of all currently idle quantum computing services by querying and monitoring the Docker service resource table and the Docker service queue table, and selecting one quantum computing service from all currently idle quantum computing services to execute the task instruction, and specifically includes:
and inquiring the Docker service queue list, if a task instruction is queued in the Docker service queue list, inserting the task instruction into the Docker service queue list for queuing, and waiting for the quantum computing service to be allocated to execute the task instruction.
Optionally, if the Docker service queue table is empty, querying whether the Docker service resource table has an idle quantum computing service, and if the Docker service queue table has an idle quantum computing service, allocating the quantum computing service to execute the task instruction, and identifying the quantum computing service state in the Docker service resource table as an active state.
Optionally, if there is no idle quantum computing service, inserting the task instruction into the Docker service queue list to queue up, and waiting for allocating the quantum computing service to execute the task instruction.
Optionally, monitoring the use condition of the quantum computing service in the Docker service resource table, and after the task instruction is executed, updating the resource state of the quantum computing service to be idle.
Optionally, the Docker service queue table is queried, the task instruction which is arranged at the head is found, the idle quantum computing service is allocated to the task instruction, and the task instruction allocated with the quantum computing service is deleted in the Docker service queue table.
Optionally, the setting the Docker service resource table and the Docker service queue table specifically includes:
the Docker service resource table exposes the quantum computing service, and the quantum computing service is in an idle state by default;
the Docker service queue list defines users and the task instructions.
Optionally, the receiving, through an interface provided by the quantum computing service, a task instruction generated and submitted by a user program specifically includes:
and receiving the task instruction generated and submitted by a user logging in a quantum cloud platform through a quantum cloud programming framework through an interface provided by the quantum computing service, wherein the task instruction can be recognized by a quantum computer.
Optionally, the quantum cloud programming framework is provided by a quantum cloud platform, and the quantum cloud platform cooperates with a quantum computing resource scheduling service and a quantum computing device to optimize and call quantum service resources; wherein the quantum computing resource scheduling service comprises: quantum computing services and measurement and control systems.
Optionally, the interface provided by the quantum computing service includes: the system comprises an inquiry interface, a quantum command verification interface, a quantum task submitting interface and a quantum task state interface;
the query interface queries the quantum computer details;
the quantum command verification interface verifies whether the task instruction generated and submitted by a user logging in a quantum cloud platform through programming of a quantum cloud programming framework is legal or not;
the quantum task submitting interface executes the task instruction;
the quantum task state interface views the state of the quantum computing service.
At least one technical scheme adopted by one or more embodiments of the specification can achieve the following beneficial effects: the resource utilization rate of the quantum computer is effectively improved, the quantum computer is fully utilized, and the construction cost of infrastructure is saved.
Detailed Description
The embodiment of the specification provides a quantum service resource calling optimization method based on a quantum cloud platform.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
One or more embodiments of the present disclosure provide a quantum cloud platform-based method for quantum service resource invocation optimization, which improves the resource utilization rate of a quantum computer through the synergistic effect of a quantum cloud platform, a quantum computer resource scheduling service, and the quantum computer, so that the quantum computer is fully utilized, and the infrastructure construction cost is saved.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a method for quantum service resource call optimization based on a quantum cloud platform according to one or more embodiments of the present disclosure;
s101: equally dividing the quantum computer resources, installing a Docker, installing and starting quantum computing service in the Docker, and providing the addresses of the quantum computing service to the outside through the Docker;
the method comprises the steps of carrying out average division according to actual quantum computer resources, dividing the actual quantum computer resources into a plurality of quantum service resources with the same resources, installing an open-source application container engine Docker on each quantum service resource, and installing quantum computing services in Docker. The quantum computing services can be installed in the Docker, the configuration of the same Docker can be used in different environments, and the coupling degree between hardware requirements and application environments is reduced. And starting each quantum computing service, and providing a service address to the outside through a Docker. Docker is a container, an operating system does not need to be started, the starting time is greatly shortened, the cost caused by restarting is not needed to be worried about, the utilization rate of resources can be improved by using Docker and carrying out effective resource allocation, and the construction cost of infrastructure is saved.
S102: setting a Docker service resource table and a Docker service queue table, and receiving a task instruction generated and submitted by user programming through an interface provided by the quantum computing service;
the Docker service resource table exposes the quantum computing service, and the default state of the quantum computing service is idle;
the Docker service queue table defines user and task instructions.
In one or more embodiments of the present specification, the set Docker service resource table and Docker service queue table record a current state of a quantum computing service address and a user and a task instruction to be executed, respectively. The Docker service resource table and the Docker service queue table are table names, and should not be taken as a specific limitation of the present application. In the Docker service resource table, the default state of the quantum computing service is idle, and the state of the quantum computing service becomes active when the quantum computing service executes a task instruction.
In one or more embodiments of the present description, the Docker service queue table defines users and task instructions that the users get through programming of quantum languages, quantum parameters, and the like. Wherein the task instructions include quantum gates, quantum operations, etc., and the quantum operations include various operations of the quantum gates. A quantum gate is a basic, quantum wire that operates on a small number of qubits. It is the basis of quantum wires, like the relationship between traditional logic gates and ordinary digital wires.
And receiving a task instruction which is generated and submitted by a user logging in a quantum cloud platform through programming of a quantum cloud programming framework through an interface provided by the quantum computing service, wherein the task instruction can be identified by a quantum computer.
In one or more embodiments of the present description, a quantum computing service provides an interface for receiving user-submitted task instructions. And a user logs in the quantum cloud platform to program through a quantum cloud programming framework or a quantum cloud visualization and language programming framework, so as to generate a task instruction which can be recognized by a quantum computer. The user can perform quantum programming and experimental programming on the quantum cloud platform to generate task instructions which can be recognized by the quantum computer.
The quantum cloud programming framework is provided by a quantum cloud platform, and the quantum cloud platform, the quantum computing resource scheduling service and the quantum computing equipment cooperate to optimize and call quantum service resources; wherein the quantum computing resource scheduling service comprises: quantum computing services and measurement and control systems.
The interface provided by the quantum computing service comprises: the system comprises an inquiry interface, a quantum command verification interface, a quantum task submitting interface and a quantum task state interface;
inquiring details of the quantum computer by the inquiry interface;
the quantum command verification interface verifies whether a task instruction generated and submitted by a user logging in a quantum cloud platform through programming of a quantum cloud programming framework is legal or not;
the quantum task submitting interface executes a task instruction;
the quantum task state interface looks at the state of the quantum computing service.
In one or more embodiments of the present description, the query interface provided by the quantum computing service may query the details of the quantum computer, including resource partitioning of the quantum computer, operating conditions of the quantum computer, and the like. The quantum command verification interface can verify whether a task instruction generated and submitted by a user logging in a quantum cloud platform through quantum programming or experimental programming through a quantum cloud programming framework is legal or not and can be identified by a quantum computer or not.
And the quantum task submitting interface is used for receiving a task instruction generated and submitted by a user logging in a quantum cloud platform through quantum programming or experimental programming through a quantum cloud programming framework and executing the task instruction verified through the quantum command verifying interface. The quantum computing service is exposed by the Docker service resource table, the quantum computing service has an idle state and an in-use state, the Docker service queue table has a user and a task instruction to be executed, the task instruction to be executed is generated by the user through quantum language and quantum parameter programming, the quantum task state interface can check whether the quantum computing service is in the idle state or in the in-use state, and can check the queuing state of the task instruction to be executed in the Docker service queue table.
S103: and acquiring addresses of all currently idle quantum computing services by inquiring and monitoring the Docker service resource table and the Docker service queue table, and selecting one quantum computing service from all currently idle quantum computing services to execute the task instruction.
In one or more embodiments of the present specification, the Docker service resource table and the Docker service queue table respectively indicate whether there is available quantum computing service and whether there is a task instruction currently queued, and the Docker service resource table and the Docker service queue table are queried and monitored to allocate available quantum computing service to a task instruction to be executed, so as to reasonably allocate service resources, improve resource utilization efficiency of a quantum computer, and enable a user to see usage of the quantum computing service.
And inquiring the Docker service queue list, if a task instruction is queued in the Docker service queue list, inserting the task instruction into the Docker service queue list for queuing, and waiting for the allocation of quantum computing service to execute the task instruction.
In one or more embodiments of the present description, after a user generates and submits a task instruction in a programming manner, whether the task instruction is legal is verified, a Docker service queue table is queried after verification is passed, if a task instruction is queued in the Docker service queue table, it is described that quantum computing services in the Docker service resource table are all in use and have no idle quantum computing service, the task instruction is inserted into the Docker service queue table and queued, at this time, the task instruction to be inserted is queued behind the existing queued task instruction, and quantum computing services are waited to be allocated to execute the task instruction in sequence.
And if the Docker service queue list is empty, inquiring whether idle quantum computing services exist in the Docker service resource list, if the idle quantum computing services exist, allocating quantum computing service execution task instructions, and identifying the quantum computing service state in the Docker service resource list as an active state.
In one or more embodiments of the present specification, after a user generates and submits a task instruction by programming, it is verified whether the task instruction is legal, after the verification is passed, a Docker service queue table is queried, if there is no task instruction to be executed in the Docker service queue table, it is queried whether there is a quantum computing service in the Docker service resource table in which a state is idle, if there are multiple idle quantum computing services, one of the quantum computing services is allocated to execute the task instruction, a state identifier of the quantum computing service allocated to execute the task instruction in the Docker service resource table is changed to an active state, if there is only one idle quantum computing service, the quantum computing service is allocated to execute the task instruction, and the state identifier of the quantum computing service is identified to be the active state.
And if no idle quantum computing service exists, inserting the task instruction into a Docker service queue list to queue, and waiting for the allocation of the quantum computing service to execute the task instruction.
In one or more embodiments of the present specification, when there is no task instruction to be executed in the Docker service queue table, and all quantum computing service identifier states in the Docker service resource table are in the active state, inserting a newly submitted task instruction as a first task instruction to be executed into the Docker service queue table, and waiting for allocation of a quantum computing service to execute the task instruction.
Monitoring the use condition of the quantum computing service in the Docker service resource table, and updating the resource state of the quantum computing service to be idle after the task instruction is executed.
In one or more embodiments of the present specification, monitoring usage of all quantum computing services in a Docker service resource table, determining status identifiers of all quantum computing services, monitoring the Docker service resource table if the status identifiers of all quantum computing services in the Docker service resource table in a certain time period are in an active status, releasing quantum computing service resources executing the task instruction if the task instruction is executed, and updating the status identifiers of the quantum computing services to be idle.
And inquiring the Docker service queue list, finding out the task instruction arranged at the top, allocating idle quantum computing service to the task instruction, and deleting the task instruction allocated with the quantum computing service in the Docker service queue list.
In one or more embodiments of the present specification, a Docker service queue list is queried, under no special condition, a task instruction to be executed that is arranged at the top in the Docker service queue list is found, an idle quantum computing service is allocated to the task instruction arranged at the top, and the task instruction that is allocated with the quantum computing service is deleted in the Docker service queue list. And if the state identifications of a plurality of quantum computing services in the Docker service resource table are updated to be idle from the use, and only one task instruction to be executed is in the Docker service queue table, allocating one idle quantum computing service to the task instruction to be executed. And if the state identifications of the quantum computing services in the Docker service resource table are updated to be idle from the use state, and a plurality of task instructions to be executed are in the Docker service queue table, and the quantum computing services are distributed to the task instructions to be executed in sequence.
In one or more embodiments of the present specification, an order of the to-be-executed task instructions queued in the Docker service queue table may be adjusted, for example, a task instruction to be executed that is queued second in the Docker service queue table may be adjusted to be first.
Fig. 2 is a framework diagram for quantum service resource invocation optimization based on a quantum cloud platform according to one or more embodiments of the present specification.
In one or more embodiments of the present description, a quantum service resource calling optimization framework based on a quantum cloud platform includes a quantum cloud platform, a quantum computer resource scheduling service, and a quantum computer, where the quantum computer is composed of a quantum upper computer and a measurement and control system. A user can program on the quantum cloud platform, including quantum programming and experiment programming, and task instructions capable of being recognized by a quantum computer can be generated through programming. The quantum computer resource scheduling service is a scheduling center (task scheduling framework) in fig. 2, the scheduling center connects a quantum cloud platform with a quantum computer, and can exchange data with a relational database management system Mysql, a plurality of quantum computing services can be installed in a Docker, the quantum computing services are also included in the scheduling center, an interface provided by the quantum computing services is connected with the quantum cloud platform and the quantum computer at the same time, and the quantum device can be a measurement and control computer. The scheduling center can receive the task instruction and allocate quantum computing service resources for the task instruction, and the Quartz of the scheduling center can be used for monitoring the Docker service resource table and the Docker service queue table. By receiving the task instruction, the quantum computing service resources are distributed, the task instruction is executed, and the quantum cloud platform, the quantum computer resource scheduling service and the quantum computer cooperate to improve the resource utilization rate of the quantum computer.
One or more embodiments of the specification provide a quantum cloud platform-based quantum service resource calling optimization method, which improves the resource utilization rate of a quantum computer through the synergistic effect of the quantum cloud platform, the quantum computer resource scheduling service and the quantum computer, so that the quantum computer is fully utilized, and the infrastructure construction cost is saved. The reasonable allocation and calling of the service are completed in the modes of resource division, service resource initialization and user queuing, state information, resource release conditions and the like of the quantum computing service are obtained, the scheduling task allocates resources reasonably in time, and the user can also see the using condition of the quantum computing service.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.