A method, system and electronic device for planning execution of a computing task
By performing structured parsing and multiple verifications on the task description to generate an intermediate representation of the task, the problem that existing systems cannot automatically parse natural language tasks is solved, and the flexible adaptation and efficient execution of computing tasks on heterogeneous computing resources are realized.
Patent Information
- Application Number
- CN202611695584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
Existing task orchestration systems cannot automatically parse complex computational tasks described in natural language, resulting in a strong coupling between the generated intermediate task representation and the computing device. This leads to a lack of flexibility and automation, making it difficult to adapt to dynamically changing computational task logic and constraints.
By obtaining the task description and performing structured parsing, an intermediate task representation is generated and multiple checks are performed to ensure its integrity and accuracy. Then, the task is assigned to the corresponding computing device for execution based on a preset device allocation strategy, supporting heterogeneous computing resources such as CPU, GPU and quantum processor.
It enables flexible adaptation and efficient execution of computing tasks, reduces dependence on specific algorithms and devices, avoids resource waste and erroneous task execution, and improves the automation and execution efficiency of computing tasks.
Smart Images

Figure CN123178035A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and heterogeneous computing technology, and in particular to a method, system and electronic device for planning and executing computing tasks. Background Technology
[0002] With the rapid development of artificial intelligence technology, the demand for intelligent agents to handle complex computational tasks is increasing. To achieve efficient processing of computational tasks, intelligent agents typically need to parse the computational tasks described in natural language and convert them into an intermediate representation that can be recognized by computing devices. Computational tasks usually contain logical elements such as task objectives, variables, and constraints. The intermediate representation is a data structure that bridges the gap between the natural language description and the execution logic of the computing device, aiming to transform unstructured or semi-structured task descriptions into structured execution semantic representations.
[0003] Existing task orchestration systems, such as Google Vertex AI Pipelines, AWS Step Functions, and Azure ML Pipelines, primarily target pre-defined, structured task flows. They rely on users manually writing flow definition files, support only the orchestration and execution of fixed operators, and lack native parsing capabilities for complex computational tasks described in natural language. These systems cannot automatically extract task objectives, variables, and constraints from natural language text, making it difficult to generate intermediate task representations adapted to computing devices. When task logic and constraints change dynamically, manual modification of the flow definition is required, resulting in low automation. Furthermore, their intermediate representations are biased towards flow topology descriptions, lacking complete computational semantics, and cannot complete the end-to-end structured conversion from natural language tasks to underlying computational execution logic. This makes them unsuitable for scenarios where intelligent agents autonomously parse and execute dynamic and complex computational tasks.
[0004] To avoid strong coupling between the generated intermediate task representation and the computing device, and to ensure that the generated intermediate task representation has executable semantics and accuracy, so that the intelligent agent for planning and executing computing tasks can be independent of the backend computing device and avoid the need to redeploy the intelligent agent after system updates, a method for planning and executing computing tasks for intelligent agents is needed to flexibly respond to the parsing requirements of computing tasks, achieve flexible adaptation, and reduce workload. Summary of the Invention
[0005] This application provides a method for planning and executing computational tasks to solve the technical problem of excessive correlation between the preset algorithm of the parsed computational task and the computing device.
[0006] The first aspect of this application provides a method for planning and executing a computational task, comprising: obtaining a task description; performing structured parsing on the task description to obtain task fields of the computational task, the task fields including task objectives, task data, and task constraints; analyzing the task objectives, task data, and task constraints to generate an intermediate representation of the computational task, wherein the intermediate representation describes the task content, task data scale, and task output results of the computational task; performing multiple verifications on the intermediate representation; and, after the multiple verifications pass, allocating the computational task corresponding to the intermediate representation to the corresponding computational device for execution based on a preset device allocation strategy, according to the task content, task data scale, and task output results.
[0007] In one embodiment of this application, a task description is obtained, and the task description is structured and parsed to obtain the task fields of the computation task. This includes: performing target identification, data identification, and constraint identification on the task description to identify candidate task fields describing the computation task. The candidate task fields include target content, variable content, data content, constraint content, and restriction content. According to preset field categories, the target content is classified as task target, the variable content and data content are classified as task data, and the constraint content and restriction content are classified as task constraint.
[0008] In one embodiment of this application, analysis is performed based on the task objective, task data, and task constraints to generate an intermediate representation of the computational task. This includes: analyzing the task objective, task data, and task constraints to determine the data, data type, data domain, target execution process, target expression, constraints, precision requirements, computation time limit, and result quality requirements corresponding to the computational task; forming the task data scale based on the data, data type, and data domain; forming the task content based on the target execution process and target expression, wherein the target execution process describes the data processing process, and the target expression describes the basis for data computation; and forming the task output result based on the constraints, precision requirements, computation time limit, and result quality requirements, wherein the constraints describe the value relationship between the data and the data domain, the precision requirements describe the data error, the computation time limit describes the completion time limit of the target execution process, and the result quality requirements describe the expected quality of the target execution process.
[0009] In one embodiment of this application, performing multiple checks on the intermediate representation of a task includes performing at least one of integrity checks, range checks, and conflict checks on the intermediate representation of the task, wherein the integrity checks, range checks, and conflict checks are performed sequentially or in parallel according to a preset order.
[0010] In one embodiment of this application, the intermediate representation of the task is subjected to at least one of integrity verification, range verification, and conflict verification, including: according to integrity verification, verifying whether the data, data types, and data fields included in the task data scale correspond; verifying whether the data, target execution process, or output results referenced by the target expression, constraints, precision requirements, calculation time limits, and result quality requirements included in the task content and task output results are defined in the intermediate representation of the task; according to range verification, verifying whether the data included in the task data scale is compatible with the upper and lower limits of the data fields, verifying whether the upper limit of the data fields is greater than or equal to the lower limit, verifying whether the values of the constraints included in the task output results fall within the data fields, and verifying whether the precision requirements are within a preset error range; and according to conflict verification, verifying whether there is a conflict between the constraints and the precision requirements, calculation time limits, and result quality requirements.
[0011] In one embodiment of this application, the computational task corresponding to the intermediate representation of the task is assigned to the corresponding computing device for execution based on the task content, task data size, and task output result. This includes: determining the estimated running time, estimated cost, and allowed computing resources of the computational task based on the task content, task data size, and task output result; matching each computing device in the preset computing device list to determine the computing device corresponding to the computational task; and assigning the computational task to the corresponding computing device for execution.
[0012] In one embodiment of this application, the method further includes: generating a normalized identifier for the intermediate representation of the task; performing a hash calculation on the intermediate representation of the task to obtain a hash digest of the intermediate representation of the task; and saving the intermediate representation of the task based on the normalized identifier and the hash digest.
[0013] In one embodiment of this application, the computing device includes heterogeneous computing resources, which include at least two of a central processing unit, a graphics processing unit, and a quantum processor.
[0014] A second aspect of this application provides a system for planning and executing computational tasks, comprising: a task parsing module for obtaining a task description, performing structured parsing on the task description to obtain task fields for the computational task, the task fields including task objectives, task data, and task constraints; a task intermediate representation generation module for analyzing the task objectives, task data, and task constraints to generate a task intermediate representation corresponding to the computational task, wherein the task intermediate representation describes the task content, task data scale, and task output results of the computational task; a multi-validation module for performing multi-validation on the task intermediate representation; and an allocation and execution module for allocating the computational task corresponding to the task intermediate representation to the corresponding computational device for execution based on a preset device allocation strategy, according to the task content, task data scale, and task output results, after the multi-validation passes.
[0015] A third aspect of this application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executed by the processor; when the processor executes the computer program, it implements a planning and execution method for the computational tasks described in the first aspect.
[0016] The beneficial effects of this application are as follows: By obtaining the task description and performing structured parsing, fields such as task objectives, task data, and task constraints are uniformly extracted and classified, reducing ambiguity caused by natural language or unstructured descriptions and providing a standardized foundation for subsequent automatic planning and execution. By generating intermediate task representations, the task content, task data scale, and task output results are independently described, making computational tasks no longer dependent on specific algorithms or specific devices, facilitating matching, migration, and scheduling between different computing devices. By performing multiple checks on the intermediate task representations, including integrity checks, range checks, and conflict checks, problems such as missing fields, undefined references, incompatible data fields, and precision or time limit conflicts are detected before task allocation, preventing erroneous tasks from entering the execution stage and reducing the waste of computing resources. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0018] In the attached diagram: Figure 1 A schematic diagram of a scenario for a computational task planning and execution system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for planning and executing a computational task provided in one embodiment of this application. Figure 3 This is a flowchart illustrating the process of performing multiple verifications on the intermediate representation of a computational task provided in one embodiment of this application. Figure 4 This is a schematic diagram of the module structure of a computational task planning and execution system provided in one embodiment of this application; Figure 5 This is a schematic diagram of an electronic device for performing a planning execution method for executing computational tasks, as provided in one embodiment of this application. Detailed Implementation
[0019] To facilitate understanding of the technical solution, processing flow, and technical effects of this application, the following description, in conjunction with the accompanying drawings and embodiments, illustrates how a computational task is transformed from the task input submitted by the agent into an intermediate task representation that can be used by different candidate algorithms or heterogeneous computing backends. The various embodiments can be combined without technical conflict and are not limited by specific data organization formats, programming languages, or deployment methods.
[0020] In this application, a computing device refers to a computing resource or computing service capable of receiving executable tasks and returning execution results. Heterogeneous computing resources include at least two of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Neural Processing Unit (NPU), Field Programmable Gate Array (FPGA), Quantum Processing Unit (QPU), quantum simulator, and cloud solver.
[0021] The Problem Intermediate Representation (PIR) in this application, also known as the Task Intermediate Representation, is a data representation located between the task access side and the algorithm execution side. It stores the executable semantics of the computational task, including the task execution objective, task execution data, and task execution constraints, and describes the task content, task data scale, and task output results. However, it does not store the calling instructions used to directly invoke a specific algorithm or a specific computational backend. The Task Intermediate Representation can be represented as a memory object, a streaming data object, a task graph, a domain object, or serialized data, and does not need to exist with a specific name or syntax.
[0022] refer to Figure 1 , Figure 1 This is a schematic diagram of a scenario for a computing task planning and execution system provided in an embodiment of this application. The hybrid computing system 10 is configured with at least one CPU resource pool, at least one GPU resource pool, and at least one quantum computing resource pool, as well as an agent 11 (which can be called a computing power scheduling agent). The agent 11 receives user input 12, parses the computing tasks from the user input, and allocates a computing device 13 to each computing task. During the allocation process, the agent 11 can also extract intermediate task representations from the computing tasks, match computing devices supporting algorithm capabilities from the algorithm registration library / backend registration library based on the intermediate task representations, and determine the link diagram of multiple computing devices, thereby improving the flexibility of the computing tasks parsed by the agent 11 and increasing the execution efficiency of the computing tasks.
[0023] refer to Figure 2 , Figure 2 A flowchart illustrating a computational task planning and execution method provided in an embodiment of this application includes the following steps.
[0024] Step S201a: Obtain the task description, perform structured parsing on the task description to obtain the task fields of the calculation task. The task fields include the task objective, task data, and task constraints.
[0025] Step S202a: Analyze the task objectives, task data, and task constraints to generate an intermediate representation of the computation task. The intermediate representation describes the task content, task data scale, and task output results of the computation task.
[0026] Step S203a: Perform multiple verifications on the intermediate representation of the task. After the multiple verifications pass, based on the preset device allocation strategy, allocate the computing task corresponding to the intermediate representation of the task to the corresponding computing device for execution according to the task content, task data size and task output results.
[0027] Specifically, the computational task here can be defined by a task description, which can be text input received by the agent. For example, the task description could be: "Arrange computational tasks with the goal of maximizing benefits and minimizing risks; total power consumption must not exceed 2MW; solution time limit of 300 seconds, accuracy of one-thousandth, and budget of 1XX yuan."
[0028] In some embodiments, the task description is subjected to target identification, data identification, and constraint identification to identify candidate task fields describing the computation task. The candidate task fields include target content, variable content, data content, constraint content, and restriction content. According to preset field categories, the target content is classified as task target, the variable content and data content are classified as task data, and the constraint content and restriction content are classified as task constraint.
[0029] The candidate task fields here can also be represented by the following features: target, variable, data, constraint, and limitation. In other embodiments, the variables, target, data, constraint, and limitation can also be described in the form of input variables, decision variables, constraints, data scale, accuracy requirements, time limits, cost limits, allowed computing resources (whether quantum computing or cloud computing is allowed), data security requirements, etc.
[0030] For example, referring to the task description above, examples are given for variables, objectives, data, constraints, and limitations. Regarding variables (variable content), these include: data name, which can be described as: (PGPU, i, t) represents the power of the i-th computing device executing the computation task at time t; (xi, t) represents the start / stop status of the i-th computing device executing the computation task at time t; Si represents the start time of the i-th computing device executing the computation task. Data type, which can be described as: continuous variable or discrete variable (values 0 or 1), etc. Data dimension, which can be described as: if the time granularity is hours, then the time dimension is 24; if the number of computing devices executing computation tasks is N, the dimension of (PGPU, i, t) is N×24, and the data domain is: (Pgrid, t) ∈ [0, 2MW]. Regarding objectives (objective content), these include: objective direction, which can be described as: maximizing revenue and minimizing risk. Objective function type, which can be described as: linear or piecewise linear optimization objective (total electricity cost is the sum of the product of electricity purchased and electricity price in each time period). The objective expression can be described as: min∑(Pgrid,t)×Δt×price_t, where Δt = 1 hour. For the data (data content), for example: the time-of-use electricity price table for the region where the computing equipment is deployed, let the electricity price at time t be price_t. For the constraints (constraint content), including: Algorithm applicability conditions: If mixed-integer linear programming is chosen, both the objective function and constraints must be linear; if a nonlinear temperature model exists, nonlinear programming or a heuristic algorithm must be used. Accuracy limitations: For example, the relative error of the objective function should not exceed 0.001. Iteration limit: For example, the maximum number of iterations for a heuristic algorithm is set to 1000. Qubit limit: If attempting to map some subproblems to a quantum processor, the estimated number of qubits required should not exceed the number of available qubits on the current quantum processor. Backend limitations: The algorithm must run on a central processing unit, or must be accelerated on a graphics processing unit, or allow the use of a quantum simulator. Relative error: The relative error of the objective function value should not exceed one-thousandth (0.001). Absolute error: The absolute error of the total electricity cost should not exceed 0.1 yuan. Feasibility tolerance: The number of constraint violations does not exceed 10. -6 Confidence threshold: The confidence level of the solution result is not lower than 0.95. Baseline deviation threshold: Compared with the baseline scheduling scheme, the total electricity cost is reduced by at least 5%. Calculation time limit: The calculation task must be completed within 300 seconds. This can be further broken down into: task parsing ≤ 10 seconds, candidate computing device matching ≤ 30 seconds, combined evaluation ≤ 60 seconds, and execution scheduling ≤ 200 seconds.
[0031] In some embodiments, after determining the task objective, task data, and task constraints, the agent analyzes the task objective, task data, and task constraints to generate an intermediate representation of the computational task. This includes: analyzing the task objective, task data, and task constraints to determine the data, data type, data domain, target execution process, target expression, constraints, accuracy requirements, computation time limits, and result quality requirements corresponding to the computational task; forming the task data scale based on the data, data type, and data domain; forming the task content based on the target execution process and target expression, wherein the target execution process describes the data processing process, and the target expression describes the basis for data computation; and forming the task output result based on the constraints, accuracy requirements, computation time limits, and result quality requirements, wherein the constraints describe the value relationship between the data and the data domain, the accuracy requirements describe the data error, the computation time limits describe the completion time of the target execution process, and the result quality requirements describe the expected quality of the target execution process.
[0032] In some embodiments, the intermediate representation of the task can employ a first representation method and a second representation method. The first representation method describes the problem structure of the computational task, including the task content, task data scale, and task output results. The second representation method is used to structurally expand the information in the first representation method, including problem category, objective function, variables, data type, constraints, input data, problem size, mathematical structure, accuracy requirements, computation time limit, computation budget, security requirements, data location, allowed computational resources, and result quality requirements. The second representation method can be considered as an expanded representation of the first representation method at the planning and execution level; both describe the same computational task, differing only in field division and purpose.
[0033] In some embodiments, the mapping relationship between the first representation and the second representation can be established as follows: a one-to-many mapping is performed between the task content, task data size, and task output results, such as mapping the task content to problem category, objective function, and variables; mapping the task data size to data type, input data, problem size, mathematical structure, data location, and security requirements; and mapping the task output results to constraints, accuracy requirements, computation time limits, computation budget, security requirements, allowed computational resources, and result quality requirements. This mapping relationship can be used bidirectionally, meaning the second representation can be generated from the first representation, and the first representation can be backfilled or validated by the second representation. In some embodiments, this mapping relationship can be saved through an algorithm registry.
[0034] Taking the user input above as an example, the first computational task is to maximize the profit, and the second computational task is to minimize the risk. The intermediate representation of the second task of the first computational task is denoted as PIR-T1, and the intermediate representation of the second task of the second computational task is denoted as PIR-T2.
[0035] Specifically, PIR-T1 includes: Task content, such as: Problem type: scheduling optimization; Objective function: maximizing profit; Task data scale, such as: Variables: including PGPU, i, t, Pgrid, t, etc.; Data type: continuous or discrete variables; Constraints: including (Pgrid, t) ∈ [0, 2MW], etc.; Input data: including time-of-use electricity price data, computing device power, ambient temperature, etc.; Problem scale: time dimension is 24, and the number of computing tasks executed by the computing device is N; Accuracy requirements: the relative error of the objective function does not exceed 0.001, etc.; Computation time limit: the planning and solving process does not exceed 300 seconds; Computation budget: 1XX yuan; Security requirements: data does not leave the local storage, etc.; Data location: local storage node of the computing device; Allowed computing resources: at least two of the following: central processing unit, graphics processing unit, quantum processor, and quantum simulator, for example, the allowed computing resource set is {central processing unit, graphics processing unit, quantum processor, etc.}. Results quality requirements: error not exceeding 0.001, absolute error not exceeding 0.1 yuan, and result confidence level not lower than 0.95, etc.
[0036] PIR-T2 includes: Problem category: Model predictive control. Objective function: Minimize risk. Variables: Including PGPU, i, t, Pgrid, t, etc. Data type: Primarily continuous variables, but may include discrete variables related to the start and stop of cooling equipment; if both continuous and discrete variables are included, they are mixed variables. Constraints: Including (Pgrid, t) ∈ [0, 2MW], etc.; may also include task constraints with the first computational task. Input data: Including ambient temperature, computational equipment heat load, time-of-use electricity price, etc. Problem size: Time dimension is 24, etc. Accuracy requirement: The relative error of the objective function does not exceed 0.001. Computation time limit: The planning and solving process does not exceed 300 seconds. Computation budget: 1XX yuan. Security requirements: Same as the first computational task. Allowed computational resources: At least two of the following: CPU, GPU, quantum processor, and quantum simulator, for example, the allowed set of computational resources is {CPU, GPU, quantum processor, etc.}. Result quality requirements: The relative error of the total electricity cost does not exceed 0.001, and the absolute error does not exceed 0.1 yuan, etc.
[0037] Through the above mapping relationship, the task content, task data scale, and task output results in the first representation can be converted into the problem category, objective function, variables, data type, constraints, input data, problem size, mathematical structure, accuracy requirements, computation time limit, computation budget, security requirements, data location, allowed computing resources, and result quality requirements in the second representation. The fields in the second representation can further serve as the basis for extracting task features, matching them with computing devices in a preset list of computing devices to determine multiple candidate computing devices corresponding to each computing task, and predicting result quality, computation cost, execution latency, execution risk, and confidence level.
[0038] refer to Figure 3 , Figure 3 The flowchart illustrating the process of performing multiple verifications on the intermediate representation of a computational task provided in an embodiment of this application includes the following steps.
[0039] Step S201b: Perform multiple checks on the intermediate representation of the task, including: integrity check, range check and conflict check.
[0040] Step S202b: Output the verification results of the multiple verification.
[0041] Step S203b: After the verification result passes, determine that the intermediate representation of the task has executable semantics and accuracy.
[0042] In some embodiments, the agent can also perform multiple checks on the intermediate task representation, specifically including performing at least one of integrity checks, range checks, and conflict checks on the intermediate task representation. Multiple checks can be performed after the intermediate task representation is generated but before computing devices are allocated based on it. Integrity checks, range checks, and conflict checks can be performed sequentially in a preset order or in parallel. Only after all performed checks pass is the multiple check considered successful, and the process proceeds to the step of allocating the computing task to the corresponding computing device based on the intermediate task representation. If any check fails, the error location, error type, and / or correction suggestions can be output, and the process returns to the structured parsing step to regenerate or correct the intermediate task representation.
[0043] The integrity check is used to verify whether the data, data types, and data fields within the task data scale correspond to each other; and to verify whether the data, target execution process, or output results referenced in the task content and output results, including the target expression, constraints, accuracy requirements, calculation time limits, and result quality requirements, are defined in the task's intermediate representation. Taking PIR-T1 as an example, the integrity check can check whether variables such as PGPU,i,t and Pgrid,t all have data names, data types, and data fields. If there are missing data names, missing data types, missing data fields, or undefined referenced objects, the integrity check is deemed to have failed.
[0044] In some embodiments, range validation is used to verify whether the data included in the task data scale is compatible with the upper and lower limits of the data domain, whether the upper limit of the data domain is greater than or equal to the lower limit, whether the values of the constraints included in the task output fall within the data domain, and whether the accuracy requirements are within a preset error range. For example, for continuous variables, their data domain should generally be a continuous interval, and the upper limit of the interval should be greater than or equal to the lower limit of the interval; for integer variables, their data domain should be a set of integers or a range of integers; for Boolean variables or discrete variables, their data domain should be {0, 1} or a preset enumeration set. If the data type is a continuous variable but the data domain is set to {0, 1}, or the upper limit of the data domain is less than the lower limit, or the data domain exceeds the allowed value range of the data type, then the range validation can be determined to have failed. Range validation can also verify whether the data falls within the data domain and whether the problem size and data dimension are consistent. For example, if the time granularity is hours and the time dimension is 24, then the time dimensions of variables PGPU, i, and t should be consistent; if they are inconsistent, then the range validation can be determined to have failed.
[0045] In some embodiments, conflict checking is used to verify whether there are conflicts between constraints and accuracy requirements, computation time limits, and result quality requirements. Specifically, multiple constraints can be converted into mathematical expressions, interval constraints, equality constraints, and / or inequality constraints, and boundary analysis, linear or nonlinear feasibility checks, rule matching, etc., are used to determine whether there is a feasible solution to the constraints. If the same variable is required to satisfy contradictory conditions simultaneously, such as Pgrid,t≤500kW and Pgrid,t≥1MW, then the conflict checking is considered to have failed. If there are no conflicts between multiple constraints, then the conflict checking is considered to have passed.
[0046] The integrity check, range check, and conflict check described above can each output their results. After multiple checks pass, the intermediate representation of the task can be considered to have executable semantics and accuracy, thereby reducing errors in subsequent computing device matching and execution processes.
[0047] Specifically, after multiple verifications pass, the computational task corresponding to the intermediate representation of the task can be assigned to the corresponding computing device for execution based on the preset device allocation strategy, according to the task content, task data scale, and task output results.
[0048] In some embodiments, step S203, which assigns the computing task to the corresponding computing device for execution based on the intermediate task representation, specifically includes: determining at least one of the estimated runtime, estimated cost, and allowed computing resources of the computing task based on the intermediate task representation; matching each computing device in a preset computing device list to determine the computing device corresponding to the computing task; and assigning the computing task to the corresponding computing device for execution. This preset computing device list can be referred to as a backend registry.
[0049] Specifically, based on the problem category and objective function type, and considering at least one of the following factors: data type, data dimension, and data domain; problem size, mathematical structure, data location, and security requirements; number and type of constraints; accuracy requirements; computation time limit; computation budget; allowed computational resources; and result quality requirements, the estimated runtime, estimated cost, and allowed computational resources for a computational task can be determined or predicted. For example, based on the problem size, data dimension, number of constraints, and objective function type, the computation time and computational resources required by a classical solver can be estimated; based on the computation budget and cost rate, the estimated cost can be estimated. Alternatively, based on the set of allowed computational resources, it can be determined that the computational task allows the use of at least two of the following: central processing unit (CPU), graphics processing unit (GPU), neural network processor, field-programmable gate array (FPGA), quantum processor, quantum simulator, and cloud solver.
[0050] The preset computing device list can include multiple computing devices and their capabilities. Capability information includes, for example, device type, available computing power, supported algorithms or solvers, historical execution time, cost rate, accuracy level, security level, current load, data location, and network latency. When matching the task characteristics of a computing task with the computing devices in the preset computing device list, a hard filtering process can be performed first, eliminating computing devices that do not meet conditions such as allowed computing resources, data security requirements, accuracy requirements, computing budget, and computing time limits. A soft scoring process is then performed, weighting the computing devices that meet the hard conditions based on at least one of the following: estimated runtime, estimated cost, execution risk, result confidence level, and current load. Based on the scoring results, one or more computing devices corresponding to computing tasks can be identified.
[0051] As can be seen, based on the task content, task data scale, and task output results, combined with the expected execution time, expected cost, and allowed computing resources, a pre-defined list of computing devices is matched to allocate tasks to more suitable computing devices, thereby improving execution efficiency and resource utilization. For quantum processor candidates, quantum suitability is evaluated by combining available quantum algorithms, quantum hardware capabilities, historical execution data, and task constraints. A quantum processor is only invoked when its suitability conditions are met; otherwise, it is allocated to other computing devices for execution. This alleviates problems such as high quantum processor invocation costs, long queuing times, and high noise levels, thus protecting the benefits of quantum computing.
[0052] If multiple computing tasks exist, the computing devices corresponding to each task can be determined separately, or joint matching can be performed based on constraints between tasks. After determining the computing devices, the computing tasks can be assigned to the corresponding devices for execution. This includes generating execution requests or scheduling instructions, sending the task intermediate representation or execution parameters derived from the task intermediate representation to the computing device, and receiving the execution results returned by the computing device. If the assignment fails or the execution does not meet the requirements, matching and assignment can be re-performed.
[0053] In some embodiments, the method further includes: generating a normalized identifier for the intermediate representation of the task; performing a hash calculation on the intermediate representation of the task to obtain a hash digest of the intermediate representation of the task; and saving the intermediate representation of the task based on the normalized identifier and the hash digest.
[0054] When performing hash calculations on the intermediate representation of a task, a hash algorithm can be executed on the serialized data of the intermediate representation to obtain a hash digest. Serialized data can be, for example, JSON data, XML data, binary data, or data sorted according to a preset standard. Hash algorithms can be, for example, SHA-256, SM3, etc. The hash digest can be used to verify whether the intermediate representation of a task has been tampered with, and also to determine whether different intermediate representations of tasks are the same or duplicated. By generating a normalized identifier and hash digest for the intermediate representation of a task, it is convenient for task deduplication, cache reuse, version management, audit traceability, and result consistency verification.
[0055] When saving the intermediate representation of a task, the normalized identifier and hash digest can be associated with it as indexes and / or metadata. For example, a mapping relationship of "normalized identifier - hash digest - intermediate representation of task" can be established and saved to local storage, distributed storage, a database, content-addressed storage, or a cache. During subsequent retrievals, the corresponding intermediate representation can be retrieved based on the normalized identifier, and the completeness and consistency with the saved representation can be verified based on the hash digest. If the intermediate representation is updated, the normalized identifier and / or hash digest can be regenerated, forming a version record, which facilitates integrity verification, deduplication, caching, and version management of the intermediate representation.
[0056] The following section further illustrates the planning and execution method of this application embodiment through the generation of intermediate task identifiers corresponding to chemical molecular energy calculations. For example, the user input here could be: "Calculate the ground state energy of H2O, using VQE, chemical precision ≤ 0.0016 Hartree, time limit 600 seconds, CPU, GPU, and QPU are allowed." The agent can parse the following: the task objective is to minimize the molecular ground state energy; the task data includes molecular geometry, basis set, Hamiltonian, and fermion-qubit mapping; and the task constraints include VQE, UCCSD formulation, chemical precision, time limit, allowed resources, and security requirements.
[0057] The intermediate representation of the first task may include: the problem category as quantum chemical ground state energy / VQE; the task data scale: number of qubits Nq, number of variational parameters D, number of Pauli terms M, number of measurements S; and the task output results.
[0058] The intermediate representation for the second task may include: Problem type: VQE; Constraints: Chemical precision ≤ 0.0016 Hartree; Input data: Molecular geometry, etc.; Problem size: Nq × D × M; Mathematical structure: Quantum expectation estimation + nonlinear optimization; Computation time limit: 600 seconds; Computation budget: 1XX yuan; Allowed computational resources: {CPU, GPU, QPU, quantum simulator}; Result quality requirement: Confidence ≥ 0.95. Multiple validations are performed on the intermediate representations for both the first and second tasks.
[0059] In one implementation, Figure 4 The present application provides a computational task planning and execution system 30, comprising: a task parsing module 31, used to obtain a task description, perform structured parsing on the task description to obtain task fields of the computational task, the task fields including task objectives, task data, and task constraints; a task intermediate representation generation module 32, used to analyze the task objectives, task data, and task constraints to generate a task intermediate representation corresponding to the computational task, wherein the task intermediate representation describes the task content, task data scale, and task output results of the computational task; a multi-validation module 33, used to perform multi-validation on the task intermediate representation; and an allocation and execution module 34, used to, after the multi-validation passes, allocate the computational task corresponding to the task intermediate representation to the corresponding computing device for execution based on a preset device allocation strategy, according to the task content, task data scale, and task output results.
[0060] In one implementation, Figure 5 An electronic device 40 provided in this application includes a processor 42 and a memory 41. The memory stores a computer program, and the processor executes the computer program to implement the planned execution method of the above-mentioned computational task.
[0061] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, any equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for planning and executing a computational task, characterized in that, include: Obtain the task description, perform structured parsing on the task description to obtain the task fields of the computation task, the task fields including task objectives, task data and task constraints; Based on the analysis of the task objectives, task data, and task constraints, an intermediate representation of the task corresponding to the computation task is generated, wherein the intermediate representation of the task describes the task content, task data scale, and task output results of the computation task. Multiple verifications are performed on the intermediate representation of the task. After the multiple verifications pass, based on a preset device allocation strategy, the computing task corresponding to the intermediate representation of the task is allocated to the corresponding computing device for execution according to the task content, task data size and task output results.
2. The method according to claim 1, characterized in that, The step of obtaining the task description involves performing structured parsing on the task description to obtain the task fields for the computation task, including: The task description is subjected to target identification, data identification, and constraint identification to identify candidate task fields describing the computation task. The candidate task fields include target content, variable content, data content, constraint content, and restriction content. According to preset field categories, the target content is classified as task target, the variable content and the data content are classified as task data, and the constraint content and restriction content are classified as task constraint.
3. The method according to claim 2, characterized in that, The step of analyzing the task objective, task data, and task constraints to generate an intermediate representation of the computational task includes: The task objectives, task data, and task constraints are analyzed to determine the data, data types, data domains, target execution process, target expression, constraints, accuracy requirements, computation time limits, and result quality requirements corresponding to the computation task. Based on the data, data type, and data domain, the task data scale is formed; The task content is formed based on the target execution process and the target expression, wherein the target execution process describes the data processing process and the target expression describes the basis for the data calculation; Based on the constraints, accuracy requirements, computation time limits, and result quality requirements, the task output results are formed, wherein the constraints describe the value relationship between the data and the data domain, the accuracy requirements describe the error of the data, the computation time limits describe the completion time limit of the target execution process, and the result quality requirements describe the expected quality of the target execution process.
4. The method according to claim 3, characterized in that, The process of performing multiple checks on the intermediate representation of the task includes: The intermediate representation of the task is to perform at least one of integrity verification, range verification, and conflict verification, wherein the integrity verification, range verification, and conflict verification are performed sequentially or in parallel according to a preset order.
5. The method according to claim 4, characterized in that, The execution of the intermediate representation of the task includes at least one of integrity verification, range verification, and conflict verification, including: Based on the integrity check, verify whether the data, data types, and data fields included in the task data scale correspond to each other; verify whether the data, target execution process, or output results referenced by the target expression, constraints, accuracy requirements, calculation time limits, and result quality requirements included in the task content and the task output results have been defined in the task intermediate representation; According to the range verification, the data included in the task data scale is verified to be compatible with the upper and lower limits of the data domain, the upper limit of the data domain is verified to be greater than or equal to the lower limit, the value of the constraint conditions included in the task output result is verified to fall within the data domain, and the accuracy requirement is verified to be within the preset error range. In addition, based on the conflict check, it is verified whether there is a conflict between the constraints and the accuracy requirements, calculation time limits, and result quality requirements.
6. The method according to claim 1, characterized in that, The step of allocating the computational task corresponding to the intermediate representation of the task to the corresponding computing device for execution based on the task content, task data size, and task output results includes: Based on the task content, task data scale, and task output results, determine the estimated running time, estimated cost, and allowed computing resources for the computing task; Match each computing device in the preset computing device list to determine the computing device corresponding to the computing task; The computing task is assigned to the corresponding computing device for execution.
7. The method according to claim 1, characterized in that, Also includes: Generate a normalized identifier for the intermediate representation of the task; Perform a hash calculation on the intermediate representation of the task to obtain a hash digest of the intermediate representation of the task; The intermediate representation of the task is saved based on the normalized identifier and the hash digest.
8. The method according to claim 1, characterized in that, The computing device includes heterogeneous computing resources, which include at least two of the following: a central processing unit, a graphics processing unit, and a quantum processor.
9. A planning and execution system for a computational task, characterized in that, include: The task parsing module is used to obtain the task description, perform structured parsing on the task description, and obtain the task fields of the calculation task. The task fields include the task objective, task data, and task constraints. The task intermediate representation generation module is used to analyze the task objective, task data and task constraints to generate a task intermediate representation corresponding to the computing task, wherein the task intermediate representation describes the task content, task data scale and task output results of the computing task; The multi-validation module is used to perform multiple validations on the intermediate representation of the task; The allocation and execution module is used to allocate the computing task corresponding to the intermediate representation of the task to the corresponding computing device for execution based on the task content, task data size and task output result, according to the preset device allocation strategy after the multiple verifications pass.
10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executed by the processor; when the processor executes the computer program, it implements the planning and execution method of the computing task according to any one of claims 1 to 8.
