Hybrid code compiling method and system, storage medium and electronic equipment
By identifying and compiling hybrid code, the problem of compiling code incompatibility with hybrid computing devices when electronic computers and quantum computers collaborate is solved, and efficient hybrid system operation is achieved.
Patent Information
- Application Number
- CN202411872689.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, when electronic computers and quantum computers collaborate, there is a lack of effective hybrid code compilation methods, which makes it difficult to adapt to the compiled code and the quantum electronic hybrid computing power equipment and the task execution efficiency is inefficient.
A hybrid code compilation method is proposed, including identifying whether the received code segment is a hybrid code of quantum electrons, reading the core function, determining the instruction set of quantum computers, selecting mixed codes that meet the compilation requirements, and compiling them into machine codes that can be recognized by the hybrid system of quantum electrons.
By identifying and compiling mixed code, the difficulty of code hybrid programming is reduced, quantum electrons are integrated, and the efficiency of hybrid system operation tasks is improved.
Smart Images

Figure CN119906442A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum electronic hybrid computing technology, and in particular to a hybrid code compilation method, system, storage medium and electronic device. Background Art
[0002] With the rapid development of computer and artificial intelligence technology, people often have the demand for large or special computing power in their daily work and life, such as numerical simulation, graphics rendering, model training, data processing, large model training, etc. These computing requirements exceed the processing capacity of existing computing equipment, and at the same time, the energy consumed is very huge, which creates another problem that the energy efficiency ratio is very low. Since quantum computers can not only provide powerful computing power, but also require low energy consumption in later maintenance, quantum computers came into being; at present, the development of quantum computers is still in the early stages of research and development, and cannot provide a large amount of computing power for the time being, so they need to work with electronic computers to provide computing power to the outside world.
[0003] There is currently no solution to the problem of collaboration between electronic computers and quantum computers. Task types are basically single-task, that is, either classical tasks, which only perform tasks performed by classical computing, or quantum computing tasks, which compile and schedule the execution of quantum computer tasks. Different compilation templates are used for different tasks. The two types of quantum electronic computing devices are not mixed as a whole. The hybrid code of quantum electronics must be separated and identified, and then compiled separately, which makes it difficult to adapt the compiled code to the quantum electronic hybrid computing device, which in turn leads to low task execution efficiency when users compile code to execute tasks. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a hybrid code compilation method, system, storage medium and electronic device.
[0005] In order to achieve the above object, the present invention adopts the following technical solution: a hybrid code compilation method, comprising:
[0006] S1: Identify the received code segment and determine whether the code segment is a hybrid code of quantum electronics. If yes, read the core function of the hybrid code.
[0007] S2: Determine the instruction set of the quantum computer, and select a hybrid code that meets the compilation requirements according to the core function and the instruction set;
[0008] S3: The hybrid code that meets the compilation requirements is represented as an intermediate representation and compiled into machine code that can be recognized by the quantum electronic hybrid system.
[0009] As a further description of the above technical solution: in step S1, the step of generating the core function includes:
[0010] The received code segment is identified by identification code, the operation logic of the identification code is identified, all the operation logics are packaged together to generate the core function.
[0011] As a further description of the above technical solution: in step S2, the method for selecting a mixed code that meets the compilation requirements includes detecting whether there is an execution device corresponding to the type of the code segment in the current system environment. If so, it is determined that the compilation requirements are met and subsequent compilation is performed. If not, it does not meet the compilation requirements, and returns to step S1, updates the received code segment, and identifies it.
[0012] As a further description of the above technical solution: in step S3, the step of performing intermediate representation of the hybrid code includes, when the quantum code is detected in the electronic code, fusing the quantum code and the electronic code, and performing at least one intermediate representation on the hybrid code as a whole.
[0013] As a further description of the above technical solution: after the mixed code passes through the intermediate representation, it is transformed into a high-level machine code that can be recognized by the high-level compiler;
[0014] Convert high-level machine code into low-level machine code that can be recognized by low-level compiler through intermediate representation;
[0015] In the low-level compiler, the low-level machine code is converted into machine code that can be recognized by the quantum electronic hybrid system through multiple intermediate representations.
[0016] As a further description of the above technical solution: in step S3, after compiling into machine codes recognizable by the quantum electronic hybrid system, the execution order of the machine codes is determined and sent to the execution device, and data is transmitted between different types of execution devices according to the type of machine codes.
[0017] As a further description of the above technical solution: before identifying the received code segment, the content of the code segment is detected to determine whether the code segment is correct; the detection method of the content of the code segment includes: code format detection, code standard detection, keyword detection, grammar detection, grammar prompts or keyword prompts.
[0018] Also included is a quantum electronic hybrid compilation system, which is applicable to the compilation method described in any one of the above technical solutions, including:
[0019] The acquisition module receives the code segments written by the user;
[0020] An identification module identifies the identification code in the code segment and determines whether the code segment is a mixed code;
[0021] Compilation module, which uses the compiler to perform intermediate representation of the mixed code and convert it into machine code;
[0022] The execution module receives the converted machine code and sends it to the execution device.
[0023] Also included is a computer-readable storage medium storing a computer program for running the compilation method, wherein the computer program enables a computer to execute the compilation method as described in any one of the above technical solutions.
[0024] Also included is an electronic device, comprising:
[0025] one or more processors; memory; and
[0026] One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a compilation method for executing any one of the above technical solutions.
[0027] The above technical solution has the following advantages or beneficial effects:
[0028] By identifying the hybrid code written by the user and the identification code in the hybrid code, the core function of controlling the quantum electronic hybrid system is obtained. The hybrid code of the corresponding core function is selected according to the instruction set corresponding to the computing task, and compiled into machine code that can be run on the hybrid system. Hybrid compilation not only reduces the difficulty of code hybrid programming, but also integrates quantum electronics from the bottom layer, which can improve the efficiency of the entire hybrid system's running tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The process of the compilation method proposed by the present invention Figure 1 ;
[0030] Figure 2 The process of the compilation method proposed by the present invention Figure 2 ;
[0031] Figure 3 This is a schematic diagram of the structure of the compilation system proposed by the present invention.
[0032] Legend:
[0033] 1. Acquisition module; 2. Recognition module; 3. Compilation module; 4. Execution module. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] Reference Figure 1 , an embodiment of the present invention provides: a mixed code compilation method, comprising:
[0036] S1: Identify the received code segment and determine whether the code segment is a hybrid code of quantum electronics. If yes, read the core function of the hybrid code;
[0037] S2: Determine the instruction set of the quantum computer and select the hybrid code that meets the compilation requirements based on the core functions and instruction set;
[0038] S3: The hybrid code that meets the compilation requirements is represented as an intermediate representation and compiled into machine code that can be recognized by the quantum electronic hybrid system.
[0039] Existing technical solutions usually regard quantum computers and electronic computers as subsystems, without combining the two in a unified way or being able to implement the solutions on real quantum computers. This inevitably leads to problems such as low task execution efficiency, inaccurate task scheduling, and the overall experience failing to achieve the expected results when executing quantum-electronic hybrid computing tasks.
[0040] In order to make up for the defects of the existing technical solutions, the hybrid code compilation method of the present application can couple the two types of computing power systems, quantum and electronic, together, which can not only quickly realize hybrid programming and hybrid compilation, but also realize accurate task scheduling and efficient operation of hybrid tasks, thereby improving the efficiency of the entire hybrid system in running tasks.
[0041] In this embodiment, the received high-level programming language is identified to obtain the code segment written by the user, and the electronic code part and the quantum code part in the hybrid code are identified by identifying the identification code in the code segment, and the corresponding core function is read. According to the computing power task of the quantum electronic hybrid system, the corresponding instruction set is determined, and the hybrid code that meets the requirements is selected according to the core function in the hybrid code, and the hybrid code is intermediately represented, and the high-level compiled language is compiled into machine code that can be recognized by the hybrid system. Task scheduling and execution are performed according to the computing power task, and data transmission and communication are performed between the electronic computer and the quantum computer. The machine code is openQASM, and other types of quantum computer machine code can also be used. As long as the machine code can be run on a quantum computer, it can be run.
[0042] The instruction set provides low-level operating commands for hardware devices such as electronic computers or quantum computers. The instruction set includes but is not limited to commands for performing basic arithmetic operations, data processing, and control flow.
[0043] In step S1, the steps of generating the core function include:
[0044] The received code segment is identified by identification code, the operation logic of the identification code is identified, all the operation logics are packaged together, and a core function is generated.
[0045] In this embodiment, when the user writes the hybrid code, the high-level programming language can be extended. The extension of the electronic computer language is aimed at the current C / C++ language to support quantum computers. This is mainly achieved through the following two aspects: on the one hand, various gate operations of quantum computers are supported, such as X gates, CNOT gates, etc.; on the other hand, the recognition of quantum codes is supported. The hybrid compiler compiles the quantum code into the machine code of the quantum computer by recognizing this code.
[0046] For quantum code recognition, the design method is that users add identification codes for identification when writing codes, such as adding "qdevice" before declaring the operation function in C / C++, and adding specific operation logic after it. The identification code and specific operation logic constitute the running operation content of quantum computing, which are used to perform specific operations on quantum computers. All operation contents are combined and encapsulated into a specific function, called the quantum computing core function. The identification information of the quantum computer core function is qdevice, and the representation method is not unique. Other names are also used by users to distinguish electronic codes, such as qglobal.
[0047] Regarding the form of the quantum computing core function, this embodiment also gives a specific form, such as in C language, the form is <<<qparam1,qparam2,…,qparamS> >>qCoreFunc(param1, param2, ..., paramN). For example, in Python, the code can be designed as run_kernel_func(quautum_kernel_func, qparam1, qparam2, ..., qparamS)(param1, param2, ..., paramN), or execFunc(qCoreFunc, qparam1, qparam2, ..., qparamS), (param1, param2, ..., paramN), etc. High-level languages are not limited to C / C++ and Python. Other languages, such as Java, can also be implemented in the same way.
[0048] Before users edit the code, they need to install the hybrid compiler. When editing the code, for traditional computer codes, the code should be written according to traditional computers, such as GPU, and the corresponding kernel functions, data transmission and code execution location should be written. For quantum computers, it is necessary to determine the functions implemented by the quantum computer, the writing of core functions, the identification of core functions, the location where the core functions are used or the data should be transmitted to the quantum computer. When users write code, the code segment does not necessarily need to contain the quantum code of the quantum computer, it can also be all electronic code of the electronic computer.
[0049] In step S2, the method for selecting a mixed code that meets the compilation requirements includes detecting whether there is an execution device corresponding to the type of the code segment in the current system environment. If so, it is determined that the compilation requirements are met and subsequent compilation is performed. If not, it does not meet the compilation requirements, and returns to step S1, updates the received code segment, and identifies it.
[0050] In this embodiment, the instruction set corresponding to the quantum computer needs to be determined. Determine which basic operations the current quantum computer and chip can perform. The basic operations of the quantum computer and chip are the basis for building advanced functions. Advanced functions are the basic operations used in core functions.
[0051] All built-in operation functions in the core function are the core content of the intermediate representation. The main process is to refer to various operations of current electronic computers, such as if, for statements and data transmission functions, and use the low-level language of quantum computers to encapsulate the same operation functions. When users write mixed operation codes, they can learn the operation logic of electronic computers to control quantum computers and realize the coupling of quantum electronic hybrid systems.
[0052] Based on the code snippet submitted by the user, the hybrid compiler starts to detect the identification code in the hybrid code to obtain the types of computing power involved in the hybrid code; checks whether the current environment can support the compilation of the code snippet, and based on the content of the code snippet, checks whether there are execution devices corresponding to the different types of computing power tasks involved in the code in the current environment, ensuring that the high-level language can be successfully compiled into machine code and the machine code can be successfully executed on different devices.
[0053] In step S3, the step of performing intermediate representation of the hybrid code includes, when the quantum code is detected in the electronic code, fusing the quantum code and the electronic code, and performing at least one intermediate representation of the hybrid code as a whole. Specifically, after the intermediate representation, the hybrid code is converted into a high-level machine code that can be recognized by a high-level compiler;
[0054] Convert high-level machine code into low-level machine code that can be recognized by low-level compiler through intermediate representation;
[0055] In the low-level compiler, the low-level machine code is converted into machine code that can be recognized by the quantum electronic hybrid system through multiple intermediate representations.
[0056] Reference Figure 2 In this embodiment, the specific steps include:
[0057] S31: the code compiled by the compiler on the host side is transformed into machine code recognizable by the advanced compiler through an intermediate representation;
[0058] S32: converting the high-level machine code into a low-level machine code recognizable by a low-level compiler by passing the high-level machine code through multiple intermediate representations;
[0059] S33: In the low-level compiler, the low-level machine code is converted into machine code that can be recognized by the quantum electronic hybrid system through multiple intermediate representations;
[0060] S34: After compiling the machine code that the quantum electronic hybrid system can recognize, it needs to be connected to various types of link libraries;
[0061] S35: Map the machine code to the quantum computer hardware device through the low-level quantum intermediate representation method, and perform machine code operations such as jump work and data transmission at the call location;
[0062] S36: Determine the order of executing the machine code based on the user code and settings, and execute it on different devices.
[0063] The intermediate representation (QIR) is a simplified operation interface between quantum computers and electronic computers. The intermediate representation encapsulates quantum operation gates to achieve consistent expression of quantum electronic hybrid computing system algorithms, thereby improving the feasibility and efficiency of cross-platform computing.
[0064] Based on the identification code, different types of code segments are identified, and different compilers are used according to different types of codes. For example, CPU devices directly call the gcc compiler; GPU devices directly call the nvcc compiler to compile traditional computer codes into assembly language; when quantum computer codes are detected, the host-side local compiler and domain-specific language (DSL) technology are used to integrate quantum electronic codes into one, making it convenient for the later hybrid compiler to compile quantum computing codes; link libraries are system-specific libraries related to the operating system, mathematical calculation libraries for scientific computing, etc., which assist in the correct operation of tasks; after the required libraries in the program are successfully linked, the machine code is mapped to the quantum computer hardware device through the low-level quantum intermediate representation method, and machine code operations such as jump work and data transmission are performed at the call location.
[0065] According to the high-level language written by the user, the hybrid compiler first identifies the electronic code and quantum code in the entire code, and then starts to compile different types of computing power; for electronic code, you can directly use compilers such as gcc or nvcc (compilers for electronic computing or peripherals) to compile it into assembly language; and when the hybrid compiler detects quantum code, its compilation process is designed as follows: after the quantum code is written through language expansion, the code is passed to the compiler on the host side. At this time, the code is still in the high-level code stage. After multiple rounds of intermediate representation and the high-level compiler of the hybrid compiler and the low-level compiler of the hybrid compiler, the host-side code can be compiled into code that can be recognized and run by the quantum computer. At this time, the hybrid compiler will link the library files required to run the program. At this time, the hybrid code for the core functions corresponding to the quantum computer has been compiled.
[0066] In step S3, after compiling into machine code recognizable by the quantum electronic hybrid system, the execution order of the machine code is determined and sent to the execution device. According to the type of machine code, data is transmitted between different types of execution devices.
[0067] In this embodiment, the order of machine code execution is determined based on user code and settings; then the machine code execution begins in the arranged order, and the compiled machine code is executed in sequence in the arranged order. According to the type of machine code, scheduling, execution and data exchange are performed on different types of devices to ensure that each one is accurately scheduled to the hardware device and executed accurately. After execution on different devices is completed, the final result is fed back to the user or the higher-level program.
[0068] The hybrid compiler mentioned in the present invention supports data transmission between quantum and electronic devices. When users write codes in high-level languages, they can explicitly transmit data between two types of computing devices or implicitly transmit data to quantum computers using unified memory. The hybrid compiler compiles the code into machine code and stores the transmission data information. When executing the machine code, the corresponding machine code is mapped to the corresponding device through the electronic intermediate representation (LLIR) module or the quantum intermediate representation (LLQIR) module. When scheduling a task to run on a quantum computer, data is obtained from the electronic computer. After the task operation is completed, the data is transmitted from the quantum computer to the electronic computer.
[0069] Data interaction between electronic computers and quantum computers; in actual application, the process of the quantum computer is only a part of it, and the calculated results must eventually be fed back to the electronic computer. The role of the quantum is similar to that of a coprocessor, which plays an accelerating role.
[0070] Before identifying the received code segment, the content of the code segment is detected to determine whether the code segment is correct; the code segment content detection method includes: code format detection, code standard detection, keyword detection, grammar detection, grammar prompt or keyword prompt.
[0071] In this embodiment, the writing standardization of the core function is involved in the implementation process. The hybrid compiler supports the front-end integrated development environment (IDE), performs code format detection, code standard detection, keyword detection, syntax detection, syntax prompts, keyword prompts and other functions on the code segment, and assists developers to write correct hybrid code. For example, when the developer writes the code, there is a for loop statement in it, and the hybrid compiler will detect whether the variables in the current loop body are defined; if there is an implicit conversion of the variable type, it will prompt that the data precision is reduced, etc.
[0072] Reference Figure 3 , and also includes an embodiment of a quantum electronic hybrid compilation system, the compilation system is applicable to any compilation method in the above technical solution, including:
[0073] Acquisition module 1, receiving the code segment written by the user;
[0074] Identification module 2, identifies the identification code in the code segment and determines whether the code segment is a mixed code;
[0075] Compilation module 3, which converts the mixed code into machine code through an intermediate representation of the mixed code by a compiler;
[0076] The execution module 4 receives the converted machine code and sends it to the execution device.
[0077] It is understandable that the compilation system provided in the embodiment of the present invention corresponds to the above-mentioned compilation method, and the explanation, examples, beneficial effects and other parts of its relevant contents can refer to the corresponding contents in the compilation method, which will not be repeated here.
[0078] Also included is a computer-readable storage medium storing a computer program for executing the selection method, wherein the computer program causes a computer to execute the following steps:
[0079] S1: Identify the received code segment and determine whether the code segment is a hybrid code of quantum electronics. If yes, read the core function of the hybrid code;
[0080] S2: Determine the instruction set of the quantum computer and select the hybrid code that meets the compilation requirements based on the core functions and instruction set;
[0081] S3: The hybrid code that meets the compilation requirements is represented as an intermediate representation and compiled into machine code that can be recognized by the quantum electronic hybrid system.
[0082] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the computer-readable storage medium can also exist in a communication device as discrete components.
[0083] Specifically, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0084] Also included is an electronic device, comprising:
[0085] one or more processors; memory; and
[0086] One or more programs, wherein the one or more programs are stored in a memory and configured to be executed by one or more processors, the programs comprising steps for performing the following steps:
[0087] S1: Identify the received code segment and determine whether the code segment is a hybrid code of quantum electronics. If yes, read the core function of the hybrid code;
[0088] S2: Determine the instruction set of the quantum computer and select the hybrid code that meets the compilation requirements based on the core functions and instruction set;
[0089] S3: The hybrid code that meets the compilation requirements is represented as an intermediate representation and compiled into machine code that can be recognized by the quantum electronic hybrid system.
[0090] Memory is used to store computer programs. The memory may include high-speed random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk.
[0091] A processor is used to execute a computer program stored in a memory. The processor may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0092] Optionally, the memory can be independent or integrated with the processor.
[0093] When the memory is a device independent of the processor, the electronic device may further include a bus. The bus is used to connect the memory and the processor. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, and the like.
[0094] It should be noted that, through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0095] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A hybrid code compilation method, characterized in that: include: S1: Identify the received code segment and determine whether the code segment is a hybrid code of quantum electronics. If yes, read the core function of the hybrid code. S2: Determine the instruction set of the quantum computer, and select a hybrid code that meets the compilation requirements according to the core function and the instruction set; S3: The hybrid code that meets the compilation requirements is represented as an intermediate representation and compiled into machine code that can be recognized by the quantum electronic hybrid system.
2. The compiling method according to claim 1, characterized in that: In step S1, the step of generating the core function includes: The received code segment is identified by identification code, the operation logic of the identification code is identified, all the operation logics are packaged together to generate the core function.
3. The compiling method according to claim 1, characterized in that: In step S2, the method for selecting a mixed code that meets the compilation requirements includes detecting whether there is an execution device corresponding to the type of the code segment in the current system environment. If so, it is determined that the compilation requirements are met and subsequent compilation is performed. If not, it does not meet the compilation requirements, and returns to step S1, updates the received code segment, and identifies it.
4. The compiling method according to claim 1, characterized in that: In step S3, the step of performing intermediate representation of the hybrid code includes, when the quantum code is detected in the electronic code, fusing the quantum code and the electronic code, and performing at least one intermediate representation of the hybrid code as a whole.
5. The compiling method according to claim 4, characterized in that: After the mixed code passes through the intermediate representation, it is transformed into high-level machine code that can be recognized by the high-level compiler; Convert high-level machine code into low-level machine code that can be recognized by low-level compiler through intermediate representation; In the low-level compiler, the low-level machine code is converted into machine code that can be recognized by the quantum electronic hybrid system through multiple intermediate representations.
6. The compiling method according to claim 1, characterized in that: In step S3, after compiling into machine codes recognizable by the quantum electronic hybrid system, the execution order of the machine codes is determined and sent to the execution device. According to the type of machine codes, data is transmitted between different types of execution devices.
7. The compiling method according to claim 1, characterized in that: Before identifying the received code segment, the content of the code segment is detected to determine whether the code segment is correct; the detection method of the content of the code segment includes: code format detection, code standard detection, keyword detection, grammar detection, grammar prompt or keyword prompt.
8. A quantum electronic hybrid compilation system, characterized in that: The compilation system is applicable to the compilation method according to any one of claims 1 to 7, including: The acquisition module receives the code segments written by the user; An identification module identifies the identification code in the code segment and determines whether the code segment is a mixed code; Compilation module, which uses the compiler to perform intermediate representation of the mixed code and convert it into machine code; The execution module receives the converted machine code and sends it to the execution device.
9. A computer-readable storage medium, characterized in that: It stores a computer program for running the compilation method, wherein the computer program enables a computer to execute the compilation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for executing the compiling method according to any one of claims 1 to 7.