Task processing method, electronic equipment, storage medium and program product
By converting the combination optimization problem into a particle model and introducing a speed function, the problem of inefficiency of the simulation bifurcator when dealing with the combination optimization problem is solved, and more efficient task processing is achieved.
Patent Information
- Application Number
- CN202510222685.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-27
AI Technical Summary
In the prior art, when the simulation bifurcator handles the combination optimization problem, the task processing efficiency is low because it needs to process a large amount of data in a linear time.
By converting the target task into the corresponding task model, each particle in the task model corresponds to the processing results of multiple objects of the target task, the speed function and loss function are determined according to the target task, and the task model is subjected to multiple time evolution processing until the particle value of each particle is determined as the target particle value, thereby determining the task processing results.
By introducing a speed function, the evolution speed is fast first and then slow, and the characteristics of the simulated bifurcator at the bifurcated point are fully utilized to obtain the task processing results in a shorter time, improving the efficiency of task processing.
Smart Images

Figure CN119720715A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task processing method, electronic equipment, storage medium and program product. Background Art
[0002] In some scenarios, it is necessary to determine the optimal solution to a combinatorial optimization problem. For example, the problem of installing cameras on the road can be solved to find the optimal way to install the cameras.
[0003] In the related art, the combinatorial optimization problem is converted into a mathematical model, which is input into a simulated bifurcation machine, and the mathematical model is simulated and processed by the simulated bifurcation machine to obtain the optimal solution to the problem. However, in the above method, since the simulation process of the simulated bifurcation machine needs to process a large amount of data in linear time, the efficiency of task processing is low. Summary of the invention
[0004] The present application provides a task processing method, electronic device, storage medium and program product to at least solve the problem of low efficiency of task processing in related technologies.
[0005] The present application provides a task processing method, comprising:
[0006] Obtain a target task, where the target task is used to determine object processing results of multiple objects;
[0007] Generate a task model corresponding to the target task, where the task model includes particles corresponding to each object;
[0008] Determine a speed function and a loss function corresponding to the target task, wherein the speed function is used to slow down the speed at which the target task evolves over time;
[0009] According to the speed function and the loss function, the task model is subjected to multiple time evolution processes until the particle value of each particle is determined as a target particle value, the target particle value is a first preset value or a second preset value, and the second preset value is greater than the first preset value;
[0010] According to the target particle value of each particle, a task processing result of the target task is determined, and the task processing result includes an object processing result of each object.
[0011] The present application also provides a task processing device, comprising: an acquisition module, a generation module, a first determination module, a time evolution processing module, and a second determination module, wherein:
[0012] The acquisition module is used to acquire a target task, and the target task is used to determine object processing results of multiple objects;
[0013] The generation module is used to generate a task model corresponding to the target task, and the task model includes particles corresponding to each object;
[0014] The first determination module is used to determine the speed function and loss function corresponding to the target task, and the speed function is used to indicate that the evolution speed of the evolutionary solution of the target task becomes slower in sequence;
[0015] The time evolution processing module is used to perform multiple time evolution processing on the task model according to the speed function and the loss function until the particle value of each particle is determined as the target particle value, the target particle value is a first preset value or a second preset value, and the second preset value is greater than the first preset value;
[0016] The second determination module is used to determine the task processing result of the target task according to the target particle value of each particle, and the task processing result includes the object processing result of each object.
[0017] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned task processing methods when executing the computer program.
[0018] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned task processing methods are implemented.
[0019] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned task processing methods when executed by a processor.
[0020] Through this application, since the target task is converted into a corresponding task model, each particle in the task model corresponds to the processing results of multiple objects of the target task, and then the corresponding speed function (used to slow down the evolution speed of the target task) and loss function are determined according to the target task, so that the task model is processed multiple times in time evolution until the particle value of each particle is determined as the target particle value, and the target particle value of each particle is determined as the task processing result of the target task. In this way, by introducing the speed function to make the evolution speed fast first and then slow, the characteristics of the simulated bifurcation machine at the bifurcation point are fully utilized to obtain the result of task processing in a shorter time, thereby improving the efficiency of task processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;
[0023] Figure 2 A flowchart of a task processing method provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a process for determining a target particle value provided in an embodiment of the present application;
[0025] Figure 4 A process diagram of the task processing result of the target task provided in the embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of a task processing device provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of the structure of another task processing device provided in an embodiment of the present application;
[0028] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] It should be noted that, in the description of this application, 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 includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0031] First, the terms involved in this application are explained:
[0032] Simulated bifurcation machine: A device or experimental device used to simulate and study bifurcation phenomena in dynamic systems. Bifurcation refers to a sudden change or transformation in the stability or behavior pattern of a system in a nonlinear system when a certain control parameter changes. For example, the system may change from a stable equilibrium state to a periodic or chaotic state. The simulated bifurcation machine reproduces this behavior change in an experimental environment by changing control parameters (such as current, voltage, physical force, etc.), helping researchers observe and analyze the performance of the system under different conditions. This device usually contains electronic circuits, mechanical devices or computer simulation systems, and simulates the occurrence of bifurcation phenomena by adjusting certain key parameters of the system. For example, by adjusting the resistance and capacitance in the circuit, or by controlling the force and speed in the mechanical system, the simulated bifurcation machine can observe the transition process of the system from a stable state to an unstable state. This simulation method allows researchers to intuitively understand the bifurcation phenomenon and conduct in-depth analysis of it. It is applied to many fields such as physics, biology, and engineering to study the behavior of nonlinear dynamic systems, design more stable control systems, and optimize the performance of natural or artificial systems.
[0033] Combinatorial optimization problem: the problem of finding the optimal solution in a discrete, finite solution space. The core is to meet specific constraints and make the objective function reach the optimal value by selecting and combining different elements or decision variables. Combinatorial optimization problems involve finding a solution that can minimize or maximize a certain goal among multiple possible combinations.
[0034] Ising model: Ising model is a type of random process model that describes the phase change of matter. When a substance undergoes a phase change, new structures and physical properties will appear. The system in which the phase change occurs is generally a system with strong interactions between molecules. The system studied by the Ising model consists of a multidimensional periodic lattice. The geometric structure of the lattice can be cubic or hexagonal, and each lattice point is assigned a value representing the spin variable, that is, spin up or spin down. The Ising model assumes that only the spins of the nearest neighbors interact with each other, and the configuration of the lattice is determined by a set of spin variables. The common two-dimensional Ising model schematic uses the direction of the arrow to indicate the spin direction.
[0035] In the related art, the combinatorial optimization problem is converted into a mathematical model, which is input into a simulated bifurcation machine, and the mathematical model is simulated and processed by the simulated bifurcation machine to obtain the optimal solution to the problem. However, in the above method, since the simulation process of the simulated bifurcation machine needs to process a large amount of data in linear time, the efficiency of task processing is low.
[0036] In view of the above problems, in the embodiment of the present application, when it is necessary to process the target task, the target task can be first converted into a corresponding task model, and each particle in the task model corresponds to the processing results of multiple objects of the target task, and then the corresponding speed function (used to slow down the evolution speed of the target task) and the loss function are determined according to the target task, so as to perform multiple time evolution processing on the task model until the particle value of each particle is determined as the target particle value, and the target particle value of each particle is determined as the task processing result of the target task. In this way, by introducing the speed function to slow down the evolution speed of the target task, the evolution speed is first fast and then slow, so as to make full use of the characteristics of the simulated bifurcation machine at the bifurcation point, obtain the result of task processing in a shorter time, and improve the efficiency of task processing.
[0037] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0038] In conjunction with the specific application environment architecture or the specific hardware architecture on which the execution of the task processing method depends, the specific application environment architecture or the specific hardware architecture is described herein. Figure 1 , Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of this application. Figure 1 , including a classical computer 101 and a simulated bifurcation machine 102. The classical computer 101 may refer to a user's computer device. The classical computer 101 uses a binary calculation method to process data. The simulated bifurcation machine 102 may refer to a device or system specifically used to simulate and study bifurcation phenomena in dynamic systems. The simulated bifurcation machine 102 may simulate the bifurcation phenomenon of particles. The classical computer 101 may convert the target task to be processed into a task model and send it to the simulated bifurcation machine 102. The simulated bifurcation machine 102 may perform time evolution processing on the task model to obtain the particle value of the particle, and send the particle value to the classical computer 101, thereby obtaining the task processing result.
[0039] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0040] Figure 2 A flowchart of a task processing method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, an embodiment of the present application provides a task processing method, and the method is described in detail as follows:
[0041] S201, obtaining target tasks.
[0042] The execution subject of the embodiment of the present application may be a terminal device, such as a classical computer, or a task processing device arranged in the terminal device. The task processing device may be implemented by software, or by a combination of software and hardware.
[0043] The target task may refer to a combinatorial optimization problem used to determine the object processing results of multiple objects. The target task may refer to a task input by a user into a terminal device.
[0044] For example, the target tasks may include the traveling salesman problem, the knapsack problem, the minimum spanning tree problem, the graph coloring problem, etc. Specifically, suppose that in the traveling salesman problem, the goal is to find a path so that the traveling salesman visits each of multiple cities once and the total distance back to the starting point is the shortest; suppose that in the knapsack problem, the goal is to select items so that the total value of the knapsack is maximized and the total weight of the items does not exceed the load limit of the knapsack.
[0045] S202: Generate a task model corresponding to the target task.
[0046] The task model may refer to a model system composed of multiple particles, and the task model includes particles corresponding to each object.
[0047] The task model can describe multiple objects of the target task in the form of particles.
[0048] For example, suppose the target task is to install street lights on the roads in a certain area. Each road can be regarded as an object. In the task model generated according to the target task, each particle will correspond to an object, that is, each particle corresponds to a road.
[0049] Optionally, the task model may refer to an Ising model, that is, the target task may be mapped to the form of a spin system of the Ising model.
[0050] The task model corresponding to the target task can be generated in the following way: determine multiple variables of the target task, map the multiple variables to particle spins in the Ising model, each spin value can be 1 or -1, representing two states of the decision (for example, 1 represents selection, -1 represents non-selection); define the interaction between particles to represent the relationship between different decisions in the target task; set an external field to guide particles to lean towards a specific decision state to simulate constraints or preferences in the task; and build a task model.
[0051] S203: Determine the speed function and loss function corresponding to the target task.
[0052] The loss function can refer to a function that measures the quality of the current solution. When solving the target task, the loss function can represent the objective function expression of the target task. The loss function can be used to measure the quality of the solution and guide the optimization process to evolve towards the optimal solution.
[0053] Assume that x i is the coordinate of the ith particle, x j is the coordinate of the jth particle, J is the preset matrix, J ij is the value of the preset matrix J in the i-th row and j-th column, E is the position of the non-zero elements in the preset matrix J, then the loss function C can be expressed as:
[0054]
[0055] The speed function may refer to an external control function that satisfies the property of variable speed time evolution. The speed function is used to slow down the speed at which the target task evolves over time, that is, the main function of the speed function is to gradually slow down the evolution speed of the particles.
[0056] Assume that t is the time, is the first preset constant, then the speed function a(t) can be expressed as:
[0057]
[0058] Specifically, during the time evolution process, the particles in the task model are in the exploration stage at the beginning and have not reached the optimal solution of the target task. By introducing the speed function, the solution space can be quickly searched at a higher speed; in the later stage of time evolution, the particles gradually approach the optimal solution, and the evolution speed needs to be slowed down to obtain an accurate optimal solution, thereby improving the efficiency of task processing.
[0059] S204: Perform multiple time evolution processes on the task model according to the speed function and the loss function until the particle value of each particle is determined as the target particle value.
[0060] Time evolution processing can refer to controlling the evolution of particles in the task model through a velocity function, that is, through multiple iterations, making the particles gradually approach the optimal solution.
[0061] The particle value of a particle may refer to the coordinate of the particle in the task model. For example, assuming that the coordinate of the particle is 0.8, the particle value of the particle may be determined to be 0.8.
[0062] The target particle value is a first preset value or a second preset value, and the second preset value is greater than the first preset value. For example, the first preset value may be -1, and the second preset value may be 1.
[0063] The target particle value can be determined in the following manner: initializing the task model, the initialization processing is used to set the initial particle value and initial momentum value for each particle in the task model; starting the time evolution processing of each particle in the task model according to the velocity function and the loss function, the time evolution processing is used to update the particle value of each particle; in the process of time evolution, obtaining the particle values of multiple particles multiple times, and judging whether to set the particle value of the particle as the target particle value according to the particle value of the particle, until the particle value of each particle is determined to be the target particle value, then stopping the time evolution processing of the target task.
[0064] The first preset value and the second preset value can be determined in the following manner: obtaining the initial particle value set for each particle, sorting the initial particle values in ascending order, and determining the maximum initial particle value and the minimum initial particle value among the initial particle values; obtaining a preset threshold value, which may be a value set in advance by the user in the terminal device; determining the first preset value, which is the value obtained by subtracting the preset threshold value from the minimum initial particle value; and determining the second preset value, which is the value obtained by adding the preset threshold value to the maximum initial particle value.
[0065] S205. Determine the task processing result of the target task according to the target particle value of each particle.
[0066] The task processing result includes the object processing result of each object.
[0067] The task processing result can be determined in the following ways: determine the semantic information of the target task; for any particle, determine the object processing result of the object corresponding to the particle according to the target particle value and semantic information of the particle; determine the task processing result according to the object processing result of each object.
[0068] For example, suppose the semantic information of the target task is to install cameras on the roads in the target area, so as to ensure that every road in the target area can be monitored by cameras and the number of cameras installed is the minimum. Suppose that according to the target particle value and semantic information of the particle, it can be determined that if the target particle value is 1, it means that a camera is installed on the road corresponding to the particle, and if the target particle value is -1, it means that a camera is not installed on the road corresponding to the particle. According to the above method, the task processing result can be determined, that is, it can be determined which roads in the target area need to install cameras and which roads do not need to install cameras.
[0069] In an embodiment of the present application, when it is necessary to process a task, the target task can be obtained first, and the target task can refer to a combinatorial optimization problem, which is used to determine the object processing results of multiple objects; according to the target task, a corresponding task model is generated, and the task model includes particles corresponding to each object; the speed function and loss function corresponding to the target task are determined, and the speed function is used to indicate that the evolution speed of the evolutionary solution of the target task is successively slowed down, and the loss function can refer to a function that measures the pros and cons of the current solution; according to the speed function and the loss function, the task model is subjected to multiple time evolution processing until the particle value of each particle is determined as the target particle value; according to the target particle value of each particle, the task processing result of the target task is determined. Through the above method, the objects in the target task are converted into particles, and the object processing results of multiple objects are converted into particle values of particles, so as to obtain the task processing result of the target task by means of time evolution. In addition, by determining the first preset value and the second preset value based on the initial particle value, the time used to determine each particle value as the target particle value can be reduced (i.e., the number of iterations of time evolution is reduced), and the efficiency of time evolution is improved. At the same time, by introducing the speed function, the evolution speed is accelerated when the optimal solution of the target task is not reached, and the evolution speed is slowed down when it is close to the optimal solution, thereby improving the efficiency of task processing and the accuracy of the optimal solution.
[0070] Based on any of the above embodiments, Figure 3 , the process of determining the target particle value ( Figure 2 S204) in the embodiment is described in detail.
[0071] Figure 3 Schematic diagram of the process of determining the target particle value provided in the embodiment of the present application. Figure 3 , the method may include:
[0072] S301: Initialize the task model.
[0073] Initialization processing may refer to setting an initial particle value and an initial momentum value for each particle in the task model. The initial momentum value of a particle may be used to describe the motion state of the particle.
[0074] S302: Send a time evolution task to the simulated bifurcation machine according to the speed function and the loss function.
[0075] The time evolution task can instruct the simulation bifurcation machine to evolve particles according to the speed function and the loss function. The time evolution task includes the speed function and the loss function.
[0076] S303, sending a start instruction to the simulated branching machine.
[0077] The start instruction is used to instruct the simulation fork machine to start the time evolution processing of each particle in the task model. The time evolution processing is used to update the particle value of each particle.
[0078] Each particle can be processed for time evolution as follows: For any i-th particle, the potential energy V of the particle can be determined first. SB , and then according to V SB Determine the particle energy H SB , and then according to H SB Determine the rate of change of the coordinates of the ith particle over time and the rate of change of kinetic energy of the i-th particle over time .
[0079] Assume that a(t) is the speed function, a0 is the second preset constant, c0 is the third preset constant, and x i is the coordinate of the ith particle, x j is the coordinate of the jth particle, J is the preset matrix, J ij is the value of the preset matrix J in the i-th row and j-th column, N is the number of variables in the loss function, then the potential energy V of the particle SB It can be expressed as:
[0080]
[0081] Assume that a0 is the second preset constant, N is the number of variables in the loss function, and y i is the momentum of the ith particle, V SB is the potential energy of the particle, then the energy H of the system composed of each particle SB It can be expressed as:
[0082]
[0083] Assume that H SB is the energy of the system composed of each particle, x i is the coordinate of the ith particle, x j is the coordinate of the jth particle, a0 is the second preset constant, c0 is the third preset constant, a(t) is the velocity function, J is the preset matrix, J ij The value of the i-th row and j-th column in the preset matrix, N is the number of variables in the loss function, then the rate of change of the kinetic energy of the i-th particle over time is It can be expressed as:
[0084]
[0085] Assume that H SB is the energy of the system composed of each particle, y iis the momentum of the ith particle, a0 is the second preset constant, then the rate of change of the coordinates of the ith particle over time is It can be expressed as:
[0086]
[0087] S304, obtaining the kth particle value of each particle.
[0088] Among them, k is 1, 2, 3, etc. in sequence.
[0089] The k-th particle value of a particle may refer to the particle value of the particle obtained by the simulated fork machine at the k-th moment.
[0090] The k-th particle value of each particle can be obtained in the following way: send a measurement instruction to the simulated fork machine, the measurement instruction is used to request the particle value of the particle; the particle value of each particle obtained by the simulated fork machine at the k-th moment; receive the particle value of each particle at the current moment sent by the simulated fork machine, for any particle, the particle value of the particle at the current moment is the k-th particle value.
[0091] S305 . Determine a first particle among multiple particles according to the k-th particle value of each particle.
[0092] The first particle can be determined in the following manner: obtaining the kth particle value of each particle in turn; for any particle, determining whether the kth particle value of the particle is greater than a second preset value, or whether the kth particle value of the particle is less than a first preset value; if so, determining the particle as the first particle; and determining multiple first particles from multiple particles.
[0093] The first preset value may be -1, and the second preset value may be 1.
[0094] S306 . According to the kth particle value of the first particle, the particle value of the first particle is set to the corresponding target particle value.
[0095] The particle value of the first particle can be set to the corresponding target particle value in the following manner: obtain the kth particle value of the first particle; if the kth particle value of the first particle is greater than a second preset value, set the target particle value of the first particle to the second preset value; if the kth particle value of the first particle is less than the first preset value, set the target particle value of the first particle to the first preset value.
[0096] S307, add k+1.
[0097] S308: Determine whether the particle value of each particle is the target particle value.
[0098] If yes, execute S309.
[0099] If not, execute S304.
[0100] S309, sending a stop evolution instruction corresponding to the first particle to the simulated fork machine.
[0101] The stop evolution instruction may be used to instruct to stop the evolution of the first particle.
[0102] In an embodiment of the present application, when it is necessary to process a task, the target particle value can be determined first, and the initial particle value can be set for each particle in the task model by initializing the task model; according to the speed function and the loss function, the time evolution task is sent to the simulation bifurcation machine, and a start instruction is sent to the simulation bifurcation machine, instructing the simulation bifurcation machine to start the time evolution processing of each particle in the task model; a measurement acquisition instruction is sent to the simulation bifurcation machine, and the kth particle value of each particle at the current moment sent by the simulation bifurcation machine is received; according to the kth particle value of each particle, a first particle is determined among multiple particles; according to the kth particle value of the first particle, the particle value of the first particle is set to the corresponding target particle value; k+1 is set, and it is determined whether the particle values of each particle are the target particle values. If so, a stop evolution instruction corresponding to the first particle is sent to the simulation bifurcation machine. If not, the k+1th particle value of each particle continues to be acquired. In the above method, the target particle value of each particle is the optimal solution of the current target task, thereby improving the accuracy of the optimal solution; at the same time, by introducing a speed function, the evolution speed is accelerated when the optimal solution of the target task is not reached, and the evolution speed is slowed down when it is close to the optimal solution, thereby improving the efficiency of task processing and the accuracy of the optimal solution.
[0103] Based on any of the above embodiments, Figure 4 , the process of determining the task processing results of the target task ( Figure 2 S205) is described in detail in the embodiment.
[0104] Figure 4 This is a schematic diagram of the process of processing the target task provided in the embodiment of the present application. Figure 4 , the method may include:
[0105] S401: Determine semantic information of the target task.
[0106] The semantic information of the target task may refer to the problem that the target task actually wants to solve.
[0107] For example, semantic information may refer to whether street lights are installed on the road.
[0108] Optionally, semantic information can be determined in the following ways: performing natural language processing on the text information of the target task, extracting key information in the target task through steps such as word segmentation, named entity recognition, syntactic analysis, and sentiment analysis; determining key variables and relationships involved in the target task through data mining processing, thereby determining the semantic information of the target task.
[0109] S402: Determine two preset processing results according to the semantic information.
[0110] The two preset processing results include a first preset processing result and a second preset processing result.
[0111] For example, assuming that the semantic information is: whether to install a street light on the road, it can be determined that the first preset processing result is not to install the street light, and the second preset processing result is to install the street light.
[0112] S403: Determine the corresponding relationship between two preset processing results and two preset values.
[0113] The two preset values include a first preset value and a second preset value, and the second preset value is greater than the first preset value. For example, the first preset value may be -1, and the second preset value may be 1.
[0114] The corresponding relationship between the two preset processing results and the two preset values may be: the first preset value corresponds to the first preset processing result, and the second preset value corresponds to the second preset processing result.
[0115] For example, assuming that the first preset processing result is not to install street lights, and the second preset processing result is to install street lights, the first preset value can be -1, the second preset value can be 1, and the corresponding relationship is that the first preset value corresponds to the first preset processing result, and the second preset value corresponds to the second preset processing result. It can be determined that not installing street lights corresponds to -1, and installing street lights corresponds to 1.
[0116] S404: Determine the object processing result of the object corresponding to the particle according to the target particle value and the corresponding relationship of the particle.
[0117] The object processing result is the first preset processing result or the second preset processing result.
[0118] For example, assuming that the objects corresponding to the particles include the first road, the second road and the third road, the target particle value corresponding to the first road is 1, the target particle value corresponding to the second road is -1, and the target particle value corresponding to the third road is -1, then it can be determined that the object processing result corresponding to the first road is to install a street lamp, the object processing result corresponding to the second road is not to install a street lamp, and the object processing result corresponding to the third road is not to install a street lamp.
[0119] S405: Determine the task processing result according to the object processing result of each object.
[0120] For example, assuming that the object processing result corresponding to the first road is to install street lights, the object processing result corresponding to the second road is not to install street lights, and the object processing result corresponding to the third road is not to install street lights, then the task processing results are: the first road installs street lights, the second road does not install street lights, and the third road does not install street lights.
[0121] In an embodiment of the present application, when it is necessary to process a task, the task processing result of the target task can be determined according to the target particle value of each particle. According to the semantic information of the target task, the problem that the target task actually wants to solve is determined; according to the semantic information, two preset processing results are determined, including a first preset processing result and a second preset processing result; the correspondence between the two preset processing results and two preset values is determined, and the two preset values include a first preset value and a second preset value; according to the target particle value and the correspondence of the particle, the object processing result of the object corresponding to the particle is determined; according to the object processing result of each object, the task processing result is determined. In this way, according to the target particle value obtained by the particle evolution processing, and combined with the semantic information of the target task, the task processing result is determined by determining the object processing result of each object, thereby improving the efficiency and accuracy of task processing.
[0122] Next, based on the above embodiment, the task processing method is described in detail through specific examples.
[0123] For example, there is a target task: cameras need to be installed on the streets of a city, and the monitoring range of the cameras needs to cover all streets under the condition of using as few cameras as possible. If a camera can monitor all information of a street, it can be determined that it is most reasonable to install the camera at the intersection of the street. Then, for any street, there are only two results: install a camera or not install a camera.
[0124] According to the target task, a task model corresponding to the target task can be generated, and each intersection in the city represents multiple objects of the target task, that is, in the task model, each intersection represents a particle.
[0125] Assume that x i represents the i-th intersection of the city, x j represents the jth intersection of the city, J represents the preset matrix, J ij represents the value of the preset matrix in the i-th row and j-th column, and E represents the set of streets connected by the two intersections. Then, the loss function corresponding to the target task can be determined as:
[0126]
[0127] Assume that t represents time, represents the first preset constant, then the speed function a(t) can be determined as:
[0128]
[0129] According to the above speed function and loss function, the task model is subjected to multiple time evolution processes.
[0130] Assume that the first preset value is -1 and the second preset value is 1, obtain the kth particle value of each particle, and for any particle, if the kth particle value is greater than the second preset value, or the kth particle value of the first particle is less than the first preset value, then the particle is determined as the first particle; according to the kth particle value of the first particle, the particle value of the first particle is set to the corresponding target particle value; wherein k is 1, 2, 3, etc. in sequence, until the particle value of each particle is determined as the target particle value, stop performing time evolution processing on the task model.
[0131] Through the above steps, the target particle value corresponding to each particle can be determined, that is, the target particle value corresponding to each intersection in the city can be determined.
[0132] According to the target task, it can be determined that the first preset processing result is not to install the camera, and the second preset processing result is to install the camera.
[0133] Assume that the corresponding relationship is that the first preset value corresponds to the first preset processing result, and the second preset value corresponds to the second preset processing result, that is, not installing a camera corresponds to -1, and installing a camera corresponds to 1.
[0134] Assuming that the particle corresponding objects include the first intersection, the second intersection, the third intersection and the fourth intersection, the target particle value corresponding to the first intersection is 1, the target particle value corresponding to the second intersection is -1, the target particle value corresponding to the third intersection is -1, and the target particle value corresponding to the fourth intersection is 1, then the task processing result can be determined as: a camera is installed at the first intersection, a camera is not installed at the second intersection, a camera is not installed at the third intersection, and a camera is installed at the fourth intersection.
[0135] A task processing method provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0137] Figure 5This is a schematic diagram of the structure of the task processing device provided in the embodiment of the present application. Figure 5 As shown, the embodiment of the present application further provides a task processing device 10, comprising: an acquisition module 11, a generation module 12, a first determination module 13, a time evolution processing module 14 and a second determination module 15, wherein:
[0138] The acquisition module 11 is used to acquire a target task, where the target task is used to determine object processing results of multiple objects;
[0139] The generation module 12 is used to generate a task model corresponding to the target task, wherein the task model includes particles corresponding to each object;
[0140] The first determination module 13 is used to determine a speed function and a loss function corresponding to the target task, wherein the speed function is used to slow down the speed at which the target task evolves over time;
[0141] The time evolution processing module 14 is used to perform multiple time evolution processing on the task model according to the speed function and the loss function until the particle value of each particle is determined as the target particle value, and the target particle value is a first preset value or a second preset value, and the second preset value is greater than the first preset value;
[0142] The second determination module 15 is used to determine the task processing result of the target task according to the target particle value of each particle, and the task processing result includes the object processing result of each object.
[0143] A task processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0144] In a possible design, the time evolution processing module 14 is specifically used for:
[0145] Initializing the task model, where the initialization is used to set initial particle values for each particle in the task model;
[0146] According to the speed function and the loss function, start the time evolution processing of each particle in the task model, and the time evolution processing is used to update the particle value of each particle;
[0147] During the time evolution process, the particle values of multiple particles are obtained multiple times, and whether to set the particle value of the particle as the target particle value is determined according to the particle value of the particle, until the particle value of each particle is determined to be the target particle value, the time evolution processing of the task model is stopped.
[0148] In a possible design, the time evolution processing module 14 is specifically used for:
[0149] Sending a time evolution task to the simulated bifurcation machine, the time evolution task includes a speed function and a loss function;
[0150] A start instruction is sent to the simulation bifurcation machine, where the start instruction is used to instruct the simulation bifurcation machine to start the time evolution processing of each particle in the task model.
[0151] In a possible design, the time evolution processing module 14 is specifically used for:
[0152] Get the kth particle value of each particle;
[0153] Determine a first particle among the plurality of particles according to the kth particle value of each particle, the kth particle value of the first particle being greater than the second preset value, or the kth particle value of the first particle being less than the first preset value;
[0154] According to the kth particle value of the first particle, the particle value of the first particle is set to the corresponding target particle value;
[0155] Among them, k is 1, 2, 3, etc. in sequence, until the particle value of each particle is determined to be the target particle value, and the time evolution processing of the task model is stopped.
[0156] In a possible design, the time evolution processing module 14 is specifically used for:
[0157] Sending a measurement acquisition instruction to the simulation fork machine, the measurement instruction is used to request to obtain the particle value of the particle;
[0158] The particle value of each particle at the current moment sent by the simulated fork is received. For any particle, the particle value of the particle at the current moment is the kth particle value.
[0159] In a possible design, the time evolution processing module 14 is specifically used for:
[0160] If the k-th particle value of the first particle is greater than the second preset value, setting the target particle value of the first particle to the second preset value;
[0161] If the k-th particle value of the first particle is less than the first preset value, the target particle value of the first particle is set to the first preset value.
[0162] Figure 6 A schematic diagram of the structure of another task processing device provided in an embodiment of the present application. Figure 6 Based on the examples shown, see Figure 6 The task processing device 10 further includes a sending module 16, wherein:
[0163] The sending module 16 is used to send a stop evolution instruction corresponding to the first particle to the simulated bifurcation machine, and the stop evolution instruction is used to instruct to stop the evolution of the first particle.
[0164] In a possible design, the first determining module 13 is specifically configured to:
[0165] The loss function is determined as:
[0166]
[0167] Among them, C is the loss function, E is the position of the non-zero elements in the preset matrix J, and x i is the coordinate of the ith particle, x j is the coordinate of the jth particle, J is the preset matrix, J ij is the value of the preset matrix in the i-th row and j-th column.
[0168] In a possible design, the first determining module 13 is specifically configured to:
[0169] The speed function is determined as:
[0170]
[0171] Among them, a(t) is the velocity function that evolves over time, t is time, is the first preset constant.
[0172] In a possible design, the second determining module 15 is specifically configured to:
[0173] Determine the semantic information of the target task;
[0174] For any particle, determine the object processing result of the object corresponding to the particle according to the target particle value and semantic information of the particle;
[0175] The task processing result is determined according to the object processing result of each object.
[0176] In a possible design, the second determining module 15 is specifically configured to:
[0177] Determine two preset processing results according to the semantic information, the two preset processing results including a first preset processing result and a second preset processing result;
[0178] According to the two preset processing results, the object processing result of the object corresponding to the particle is determined.
[0179] In a possible design, the second determining module 15 is specifically configured to:
[0180] Determine a correspondence between two preset processing results and two preset values, where the two preset values include a first preset value and a second preset value;
[0181] An object processing result of an object corresponding to the particle is determined according to the target particle value and the corresponding relationship of the particle, and the object processing result is a first preset processing result or a second preset processing result.
[0182] For the description of the features in the embodiment corresponding to the task processing device, reference can be made to the relevant description of the embodiment corresponding to the task processing method, which will not be repeated here.
[0183] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the electronic device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus.
[0184] In a specific implementation process, at least one processor 501 executes the computer execution instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned task processing method embodiment.
[0185] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0186] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0187] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0188] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0189] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned task processing method embodiments when running.
[0190] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0191] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above-mentioned task processing method embodiments are implemented.
[0192] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned task processing method embodiments are implemented.
[0193] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0194] The above is a detailed introduction to a task processing method, electronic device, storage medium and program product provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A task processing method, characterized in that: include: Acquire a target task, where the target task is used to determine object processing results of multiple objects; Generate a task model corresponding to the target task, wherein the task model includes particles corresponding to each object; Determine a speed function and a loss function corresponding to the target task, wherein the speed function is used to slow down the speed at which the target task evolves over time; According to the speed function and the loss function, performing time evolution processing on the task model for multiple times until the particle value of each particle is determined as a target particle value, the target particle value is a first preset value or a second preset value, and the second preset value is greater than the first preset value; According to the target particle value of each particle, a task processing result of the target task is determined, and the task processing result includes an object processing result of each object.
2. The method according to claim 1, characterized in that According to the speed function and the loss function, the task model is subjected to multiple time evolution processes until the particle value of each particle is determined as the target particle value, including: Performing initialization processing on the task model, wherein the initialization processing is used to set an initial particle value for each particle in the task model; Initiate time evolution processing of each particle in the task model according to the speed function and the loss function, wherein the time evolution processing is used to update a particle value of each particle; During the time evolution process, the particle values of the multiple particles are obtained multiple times, and it is determined whether to set the particle value of the particle as the target particle value according to the particle value of the particle, until the particle value of each particle is determined to be the target particle value, and then the time evolution processing of the task model is stopped.
3. The method according to claim 2, characterized in that According to the speed function and the loss function, starting time evolution processing of each particle in the task model includes: Sending a time evolution task to the simulated bifurcation machine, wherein the time evolution task includes the speed function and the loss function; A start instruction is sent to the simulation bifurcation machine, wherein the start instruction is used to instruct the simulation bifurcation machine to start time evolution processing of each particle in the task model.
4. The method according to claim 2, characterized in that: Acquiring the particle values of the plurality of particles multiple times, and judging whether to set the particle value of the particle as the target particle value according to the particle value of the particle, until the particle value of each particle is determined to be the target particle value, stopping the time evolution processing of the task model, including: Obtaining a k-th particle value of each particle, wherein the k-th particle value is used to indicate a particle value obtained by the simulated bifurcation machine at the k-th moment; Determine a first particle among the plurality of particles according to a k-th particle value of each particle, the k-th particle value of the first particle being greater than the second preset value, or the k-th particle value of the first particle being less than the first preset value; According to the k-th particle value of the first particle, setting the particle value of the first particle to a corresponding target particle value; The k is sequentially set to 1, 2, 3, ... until the particle value of each particle is determined to be the target particle value, and the time evolution processing of the task model is stopped.
5. The method according to claim 4, characterized in that Get the kth particle value of each particle, including: Sending a measurement acquisition instruction to the simulated fork machine, wherein the measurement instruction is used to request to acquire a particle value of a particle; The particle value of each particle at the current moment sent by the simulated fork machine is received, and for any particle, the particle value of the particle at the current moment is the kth particle value.
6. The method according to claim 4, characterized in that According to the kth particle value of the first particle, setting the particle value of the first particle to the corresponding target particle value includes: If the k-th particle value of the first particle is greater than the second preset value, setting the target particle value of the first particle to the second preset value; If the k-th particle value of the first particle is less than the first preset value, the target particle value of the first particle is set to the first preset value.
7. The method according to any one of claims 4 to 6, characterized in that: After setting the particle value of the first particle to the corresponding target particle value according to the i-th particle value of the first particle, the method further includes: A stop evolution instruction corresponding to the first particle is sent to the simulated fork machine, where the stop evolution instruction is used to instruct to stop evolving the first particle.
8. The method according to any one of claims 1 to 6, characterized in that: The loss function is: , Wherein, C is the loss function, E is the position of the non-zero elements in the preset matrix J, and x i is the coordinate of the ith particle, the x j is the coordinate of the jth particle, J is a preset matrix, and J ij is the value of the preset matrix in the i-th row and j-th column.
9. The method according to any one of claims 1 to 6, characterized in that: The speed function is: , Wherein, a(t) is a velocity function evolving over time, t is time, is the first preset constant.
10. The method according to any one of claims 1 to 6, characterized in that: Determining the task processing result of the target task according to the target particle value of each particle includes: Determining semantic information of the target task; For any particle, determining an object processing result of an object corresponding to the particle according to the target particle value of the particle and the semantic information; The task processing result is determined according to the object processing result of each object.
11. The method according to claim 10, characterized in that Determining an object processing result of an object corresponding to the particle according to the target particle value of the particle and the semantic information, including: Determine two preset processing results according to the semantic information, the two preset processing results comprising a first preset processing result and a second preset processing result; According to the two preset processing results, an object processing result of the object corresponding to the particle is determined.
12. The method according to claim 11, characterized in that Determining the object processing result of the object corresponding to the particle according to the two preset processing results includes: Determine a correspondence between the two preset processing results and two preset values, where the two preset values include the first preset value and the second preset value; An object processing result of an object corresponding to the particle is determined according to the target particle value of the particle and the corresponding relationship, and the object processing result is the first preset processing result or the second preset processing result.
13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the task processing method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the task processing method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the task processing method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Collaborative scheduling method and device for distributed computing tasks
CN108427602A
Method and device for obtaining resource allocation strategy, equipment and storage medium
CN113138848A
Task processing method and device, electronic equipment and storage medium
CN116089070A
Task processing method and device based on quantum computing and ground state energy level determination method
CN116205302A
Multi-task model training method, multi-task processing method and device
CN117830790A