Task processing method, electronic device, storage medium and program product

By converting the target task into a particle model and introducing a velocity function time evolution processing method, the problem of inefficiency of simulation bifurcator when dealing with the combination optimization problem is solved, and more efficient task processing is achieved.

CN119720715BActive Publication Date: 2025-06-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510222685.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-27
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

In the prior art, when the simulation bifurcator deals with the combination optimization problem, it requires processing a large amount of data in a linear time, resulting in low efficiency in task processing.

Method used

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 the speed function and loss function are determined based on the target task, and the processing is carried out through multiple time evolution processes until the particle value of each particle is determined to be the target particle value.

Benefits of technology

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.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720715B_ABST
    Figure CN119720715B_ABST
Patent Text Reader

Abstract

The present application discloses a task processing method, an electronic device, a storage medium, and a program product, relating to the field of computer technologies. The method includes converting a target task into a corresponding task model, where each particle in the task model corresponds to the processing results of multiple objects of the target task, and then determining a corresponding velocity function (for slowing down the evolution speed of the target task) and a loss function according to the target task, so as to perform multiple time evolution processes on the task model until the particle values of each particle are determined as target particle values, and determining the target particle values of each particle as the task processing result of the target task. In this way, by introducing the velocity function, the evolution speed is first fast and then slow, so as to make full use of the characteristics of the analog bifurcation machine at the bifurcation point, obtain the task processing result in a shorter time, and improve the task processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a task processing method, an electronic device, a storage medium, and a 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 roads can be processed to obtain the optimal installation method of the cameras.

[0003] In the related art, by converting the combinatorial optimization problem into a mathematical model and inputting it into a simulated bifurcation machine, 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] This application provides a task processing method, an electronic device, a storage medium, and a program product to at least solve the problem of low efficiency in task processing in the related art.

[0005] This application provides a task processing method, including:

[0006] Obtaining a target task, where the target task is used to determine the object processing results of multiple objects;

[0007] Generating a task model corresponding to the target task, where the task model includes particles corresponding to each object;

[0008] Determining a velocity function and a loss function corresponding to the target task, where the velocity function is used to slow down the velocity of the evolution of the target task over time;

[0009] Performing multiple time evolution processes on the task model according to the velocity function and the loss function until the particle values of each particle are determined as target particle values, where the target particle values are a first preset value or a second preset value, and the second preset value is greater than the first preset value;

[0010] Determining the task processing result of the target task according to the target particle values of each particle, where the task processing result includes the object processing results of each object.

[0011] This application also provides a task processing device, including: an obtaining module, a generating module, a first determining module, a time evolution processing module, and a second determining module, where

[0012] The obtaining module is configured to obtain a target task, where the target task is used to determine the 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 a velocity function and a loss function corresponding to the target task. The velocity function is used to indicate that the evolution speed for evolving and solving the target task becomes slower in sequence;

[0015] The time evolution processing module is used to perform multiple time evolution processes on the task model according to the velocity function and the loss function until the particle values of each particle are determined as target particle values. The target particle values are the first preset value or the 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 values of each particle. The task processing result includes the object processing results of each object.

[0017] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any one of the above task processing methods when executing the computer program.

[0018] This 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 one of the above task processing methods are implemented.

[0019] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any one of the above task processing methods are implemented.

[0020] Through this application, since the target task is transformed 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 a corresponding velocity function (used to slow down the evolution speed of the target task) and a loss function are determined according to the target task, so as to perform multiple time evolution processes on the task model until the particle values of each particle are determined as target particle values, and the target particle values of each particle are determined as the task processing result of the target task. In this way, by introducing the velocity function, the evolution speed is first fast and then slow, so as to make full use of the characteristics of the analog bifurcation machine at the bifurcation point and obtain the task processing result in a shorter time. Therefore, the efficiency of task processing can be improved. Description of the Drawings

[0021] In order to more clearly illustrate the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 Schematic diagram of the system architecture provided by the embodiment of the present application;

[0023] Figure 2 Schematic flow chart of the task processing method provided by the embodiment of the present application;

[0024] Figure 3 Schematic diagram of the determination process of the target particle value provided by the embodiment of the present application;

[0025] Figure 4 Schematic diagram of the process of the task processing result of the target task provided by the embodiment of the present application;

[0026] Figure 5 Schematic diagram of the structure of the task processing device provided by the embodiment of the present application;

[0027] Figure 6 Schematic diagram of the structure of another task processing device provided by the embodiment of the present application;

[0028] Figure 7 Schematic diagram of the structure of the electronic device provided by the present application. Detailed implementation manners

[0029] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0030] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0031] First, the nouns involved in the present application are explained:

[0032] Analog bifurcation machine: A device or experimental setup used to simulate and study bifurcation phenomena in dynamic systems. Bifurcation refers to the situation in a nonlinear system where, when a certain control parameter changes, the stability or behavior pattern of the system undergoes a sudden change or transformation. For example, the system may change from a stable equilibrium state to a periodic or chaotic state. The analog bifurcation machine reproduces this behavioral change in an experimental environment by varying control parameters (such as current, voltage, physical forces, etc.), helping researchers observe and analyze the performance of the system under different conditions. Such a device typically includes electronic circuits, mechanical devices, or computer simulation systems, and by adjusting certain key parameters of the system, it simulates the occurrence of bifurcation phenomena. For example, by adjusting the resistance and capacitance in a circuit, or by controlling the force and speed in a mechanical system, the analog bifurcation machine can observe the transition process of the system from a stable state to an unstable state. This simulation method enables researchers to intuitively understand bifurcation phenomena and conduct in-depth analysis, and it is applied in multiple 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 and finite solution space. Its core lies in selecting and combining different elements or decision variables to satisfy specific constraints and make the objective function reach the optimal value. The combinatorial optimization problem involves finding a solution among multiple possible combinations that can minimize or maximize a certain objective.

[0034] Ising model: The Ising model is a class of stochastic process models that describe the phase transitions of substances. When a substance undergoes a phase transition, new structures and physical properties will appear. The systems undergoing phase transitions are generally systems with strong interactions between molecules. The systems studied by the Ising model consist of multi-dimensional periodic lattices, and the geometric structure of the lattices can be cubic or hexagonal. Each lattice site is assigned a value representing a spin variable, that is, the spin is either up or down. The Ising model assumes that there are interactions only between the nearest-neighbor spins, and the configuration of the lattice is determined by a set of spin variables. In the schematic diagram of the common two-dimensional Ising model, the arrow direction is used to represent the spin direction.

[0035] In the related art, by converting the combinatorial optimization problem into a mathematical model and inputting it into the analog bifurcation machine, and through the analog bifurcation machine simulating and processing this mathematical model, the optimal solution of the problem can be obtained. However, in the above method, since the simulation process of the analog 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 embodiments of the present application, when a target task needs to be processed, the target task can be first converted into a corresponding task model. Each particle in the task model corresponds to the processing results of multiple objects of the target task. Then, a corresponding velocity function (used to slow down the evolution speed of the target task) and loss function are determined according to the target task, so as to perform multiple time evolution processes on the task model until the particle values of each particle are determined as the target particle values, and the target particle values of each particle are determined as the task processing results of the target task. In this way, by introducing a velocity 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 analog bifurcation machine at the bifurcation point and obtain the task processing results in a shorter time, improving the efficiency of task processing.

[0037] To enable those skilled in the art of the present technology to better understand the solutions of the present application, the following further describes the present application in detail with reference to the accompanying drawings and specific implementation manners.

[0038] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the task processing method depends, the specific application environment architecture or specific hardware architecture is described herein. Refer to Figure 1 , Figure 1 which is a schematic diagram of the system architecture provided by the embodiments of the present application. Please refer to Figure 1 , including a classical computer 101 and an analog bifurcation machine 102. The classical computer 101 can refer to the user's computer device, and the classical computer 101 uses binary calculation methods to process data. The analog bifurcation machine 102 can refer to a device or system specifically used to simulate and study bifurcation phenomena in dynamic systems, and the analog bifurcation machine 102 can simulate the bifurcation phenomena of particles. The classical computer 101 can convert the target task to be processed into a task model and send it to the analog bifurcation machine 102. The analog bifurcation machine 102 can perform time evolution processing on the task model, obtain the particle values of the particles, and send the particle values to the classical computer 101, so as to obtain the task processing results.

[0039] The following uses specific embodiments to describe in detail the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of the present application with reference to the accompanying drawings.

[0040] Figure 2 which is a schematic flowchart of the task processing method provided by the embodiments of the present application. As Figure 2 shown, the embodiments of the present application provide a task processing method, and the method is described in detail as follows:

[0041] S201. Obtain a target task.

[0042] The execution subject of the embodiments of the present application can be a terminal device, for example, a classical computer. It can also be a task processing device set in the terminal device. The task processing device can be implemented by software or by a combination of software and hardware.

[0043] The target task can refer to a combinatorial optimization problem for determining the object processing results of multiple objects. The target task can refer to a task input by the user into the terminal device.

[0044] For example, the target task can include the traveling salesman problem, the knapsack problem, the minimum spanning tree problem, the graph coloring problem, etc. Specifically, assume that in the traveling salesman problem, the goal is to find a path such that the traveling salesman visits each city among multiple cities once and the total distance to return to the starting point is the shortest; assume that in the knapsack problem, the goal is to select items such that the total value of the knapsack is maximized and the total weight of the items does not exceed the weight limit of the knapsack.

[0045] S202. Generate a task model corresponding to the target task.

[0046] The task model can refer to a model system composed of multiple particles, and each object corresponding to the target task is included in the task model.

[0047] The task model can describe multiple objects of the target task in the form of particles.

[0048] For example, assume that the target task is to install street lights on the roads in a certain area. Each road can be used as an object. When generating the task model 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 can refer to the Ising model, that is, the target task can be mapped to the form of the 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 the particle spins in the Ising model, and each spin value can take 1 or -1, representing two states of the decision (for example, 1 represents selection, and -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 the particles to tilt towards a specific decision state for simulating the constraints or preferences in the task; construct the task model.

[0051] S203. Determine the velocity 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] Suppose, x i is the coordinate of the i-th particle, and x j is the coordinate of the j-th particle. J is a preset matrix, and J ij is the value of the preset matrix J at 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 velocity function can refer to an external control function that satisfies the property of variable-speed time evolution. The velocity function is used to slow down the evolution speed of the target task over time. That is, the main role of the velocity function is to gradually slow down the evolution speed of the particles.

[0056] Suppose, t is the time, is the first preset constant. Then the velocity function a(t) can be expressed as:

[0057]

[0058] Specifically, during the time evolution process, the particles in the task model are initially in the exploration stage and have not reached the optimal solution of the target task. By introducing the velocity 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 the precise optimal solution. Thus, the efficiency of task processing is improved.

[0059] S204. According to the velocity function and the loss function, perform multiple time evolution processes on the task model until the particle values of each particle are determined as the target particle values.

[0060] The time evolution process can refer to controlling the evolution of particles in the task model through the velocity function, that is, through multiple iterations, making the particles gradually approach the optimal solution.

[0061] The particle value of a particle can refer to the coordinate of the particle in the task model. For example, suppose the coordinate of the particle is 0.8, then the particle value of this particle can be determined as 0.8.

[0062] The target particle value is the first preset value or the second preset value, and the second preset value is greater than the first preset value. For example, the first preset value can be -1, and the second preset value can be 1.

[0063] The target particle value can be determined in the following way: Initialize the task model, where the initialization process is used to set initial particle values and initial momentum values for each particle in the task model; According to the velocity function and the loss function, start the time evolution process for each particle in the task model, and the time evolution process is used to update the particle values of each particle; During the time evolution process, obtain the particle values of multiple particles multiple times, and determine whether to set the particle value of a particle as the target particle value according to the particle value of the particle, until the particle values of each particle are determined as the target particle values, then stop the time evolution process for the target task.

[0064] The first preset value and the second preset value can be determined in the following way: Obtain the initial particle values set for each particle, sort the initial particle values in ascending order, and determine the maximum initial particle value and the minimum initial particle value among the initial particle values; Obtain a preset threshold, and the preset threshold can be a value set by the user in advance in the terminal device; Determine the first preset value, where the first preset value is the value obtained by subtracting the preset threshold from the minimum initial particle value; Determine the second preset value, where the second preset value is the value obtained by adding the preset threshold to the maximum initial particle value.

[0065] S205. Determine the task processing result of the target task according to the target particle values of each particle.

[0066] The task processing result includes the object processing results of each object.

[0067] The task processing result can be determined in the following way: Determine the semantic information of the target task; For any one particle, determine the object processing result of the object corresponding to the particle according to the target particle value of the particle and the semantic information; Determine the task processing result according to the object processing results of each object.

[0068] For example, assume that the determined semantic information of the target task is: Install cameras on the roads in the target area to ensure that each road in the target area can be monitored by the cameras and the number of installed cameras is the least. Assume that according to the target particle value of the particle and the semantic information, it can be determined that if the target particle value is 1, it means to install a camera on the road corresponding to the particle, and if the target particle value is -1, it means not to install a camera 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 the embodiments of the present application, when a task needs to be processed, a target task can be obtained first. The target task can refer to a combinatorial optimization problem for determining the object processing results of multiple objects. According to the target task, a corresponding task model is generated, and each object in the task model corresponds to a particle. A velocity function and a loss function corresponding to the target task are determined. The velocity function is used to indicate that the evolution speed for evolving and solving the target task gradually slows down, and the loss function can refer to a function for measuring the quality of the current solution. According to the velocity function and the loss function, the task model is subjected to multiple time evolution processes until the particle values of each particle are determined as target particle values. According to the target particle values of each particle, the task processing result of the target task is thus 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 the particle values of the particles, so as to obtain the task processing result of the target task through the way of time evolution. Moreover, by determining the first preset value and the second preset value based on the initial particle values, the time used to determine the particle values of each particle as the target particle values (i.e., reducing the number of iterations of time evolution) can be reduced, and the efficiency of time evolution can be improved. At the same time, by introducing the velocity function, the evolution speed is accelerated when the optimal solution of the target task has not been reached, and the evolution speed is slowed down when approaching the optimal solution, so that while improving the efficiency of task processing, the accuracy of the optimal solution can also be improved.

[0070] Based on any one of the above embodiments, below, in combination with Figure 3 , the determination process of the target particle value ( Figure 2 S204 in the embodiment) is described in detail.

[0071] Figure 3 It is a schematic diagram of the determination process of the target particle value provided by the embodiments of the present application. Please refer to Figure 3 , and the method may include:

[0072] S301. Perform an initialization process on the task model.

[0073] The initialization process may refer to setting initial particle values and initial momentum values for each particle in the task model. The initial momentum value of a particle can be used to describe the motion state of the particle.

[0074] S302. Send a time evolution task to the simulation bifurcation machine according to the velocity function and the loss function.

[0075] The time evolution task can instruct the simulation bifurcation machine to evolve the particles according to the velocity function and the loss function. The time evolution task includes the velocity function and the loss function.

[0076] S303. Send a start instruction to the simulation bifurcation machine.

[0077] The start instruction is used to instruct the analog bifurcation machine to start the time evolution process for each particle in the task model. The time evolution process is used to update the particle values of each particle.

[0078] Each particle can be time-evolved as follows: for any i-th particle, the potential energy V of the particle can be determined first SB , and then based on V SB the energy H of the particle is determined SB . Furthermore, based on H SB the coordinate change rate of the i-th particle evolving with time can be determined and the kinetic energy change rate of the i-th particle evolving with time .

[0079] Assume that a(t) is the velocity function, a0 is the second preset constant, c0 is the third preset constant, x i is the coordinate of the i-th particle, x j is the coordinate of the j-th particle, J is the preset matrix, and J ij is the value of the preset matrix J at 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 can be expressed as:

[0080]

[0081] Assume that a0 is the second preset constant, N is the number of variables in the loss function, y i is the momentum of the i-th particle, and V SB is the potential energy of the particle. Then the energy H of the system composed of each particle SB 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 i-th particle, x j is the coordinate of the j-th particle, a0 is the second preset constant, c0 is the third preset constant, a(t) is the velocity function, J is the preset matrix, and J ij is 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 kinetic energy change rate of the i-th particle evolving with time can be expressed as:

[0084]

[0085] Assume that H SB is the energy of the system composed of each particle, and y iis the momentum of the i-th particle, and a0 is the second preset constant. Then, the rate of change of the coordinate of the i-th particle with time can be expressed as:

[0086]

[0087] S304. Obtain the k-th particle value of each particle.

[0088] Where k takes 1, 2, 3,... in sequence.

[0089] The k-th particle value of a particle can refer to the particle value of the particle obtained by the simulation bifurcation 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 for acquisition to the simulation bifurcation machine. The measurement instruction is used to request to obtain the particle value of the particle; the particle values of each particle obtained by the simulation bifurcation machine at the k-th moment; Receive the particle values of each particle sent by the simulation bifurcation machine at the current moment. For any particle, the particle value of the particle at the current moment is the k-th particle value.

[0091] S305. Determine the 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 way: Obtain the k-th particle value of each particle in sequence; For any particle, judge whether the k-th particle value of the particle is greater than the second preset value, or whether the k-th particle value of the particle is less than the first preset value; If so, determine the particle as the first particle; Determine multiple first particles among multiple particles.

[0093] Wherein, the first preset value can be -1, and the second preset value can be 1.

[0094] S306. Set the particle value of the first particle to the corresponding target particle value according to the k-th particle value of the first particle.

[0095] The particle value of the first particle can be set to the corresponding target particle value in the following way: Obtain the k-th particle value of the first particle; If the k-th particle value of the first particle is greater than the second preset value, set 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, set the target particle value of the first particle to the first preset value.

[0096] S307. Increment k by 1.

[0097] S308. Judge whether the particle values of all particles are the target particle values.

[0098] If so, execute S309.

[0099] If not, then execute S304.

[0100] S309. Send a stop evolution instruction corresponding to the first particle to the analog bifurcation machine.

[0101] The stop evolution instruction can be used to indicate the stop evolution of the first particle.

[0102] In the embodiment of the present application, when a task needs to be processed, the target particle value can be determined first. By initializing the task model, initial particle values are set for each particle in the task model; according to the velocity function and the loss function, a time evolution task is sent to the analog bifurcation machine, and a start instruction is sent to the analog bifurcation machine to instruct the analog bifurcation machine to start the time evolution process for each particle in the task model; a measurement acquisition instruction is sent to the analog bifurcation machine, and the k-th particle value of each particle at the current moment sent by the analog bifurcation machine is received; according to the k-th particle value of each particle, the first particle is determined among multiple particles; according to the k-th 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 all particles are the target particle values. If so, a stop evolution instruction corresponding to the first particle is sent to the analog bifurcation machine. If not, the (k + 1)-th particle value of each particle is continuously acquired. In the above method, the target particle value of the target particle 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 the velocity 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 approaching the optimal solution, so that while improving the efficiency of task processing, the accuracy rate of the optimal solution can also be improved.

[0103] Based on any one of the above embodiments, below, in combination with Figure 4 , the determination process of the task processing result of the target task ( Figure 2 S205 in the embodiment) will be described in detail.

[0104] Figure 4 It is a schematic diagram of the process of the task processing result of the target task provided by the embodiment of the present application. Please refer to Figure 4 , and the method may include:

[0105] S401. Determine the 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, the semantic information may refer to whether to install street lights on the road.

[0108] Optionally, the semantic information can be determined in the following way: perform natural language processing on the text information of the target task, and extract the key information in the target task through steps such as word segmentation, named entity recognition, syntactic analysis, and sentiment analysis; determine the key variables and relationships involved in the target task through data mining processing, so as to determine 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 the semantic information is: whether to install street lights on the road, then it can be determined that the first preset processing result is not to install street lights, and the second preset processing result is to install street lights.

[0112] S403. Determine the corresponding relationship between the 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 can be -1 and the second preset value can be 1.

[0114] The corresponding relationship between the two preset processing results and the two preset values can 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 the first preset processing result is not to install street lights, 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, then 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 of the particle and the corresponding relationship.

[0117] The object processing result is the first preset processing result or the second preset processing result.

[0118] For example, assuming the objects corresponding to the particle 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 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.

[0119] S405. Determine the task processing result according to the object processing result of each object.

[0120] For example, assume 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 result is: install street lights on the First Road, do not install street lights on the Second Road, and do not install street lights on the Third Road.

[0121] In the embodiments of the present application, when a task needs to be processed, the task processing result of the target task can be determined according to the target particle values of the particles. According to the semantic information of the target task, the problem that the target task actually wants to solve can be 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 corresponding relationship 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 of the particle and the corresponding relationship, 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 particle evolution processing and combined with the semantic information of the target task, by determining the object processing result of each object, the task processing result is determined, improving the efficiency and accuracy of task processing.

[0122] Next, on the basis of the above embodiments, the task processing method will be described in detail through specific examples.

[0123] For example, there is a target task: cameras need to be installed on the streets of a certain city, and under the condition of using as few cameras as possible, the monitoring range of the cameras can cover all streets. If one camera can monitor all the information of one street, then 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 and do not install a camera.

[0124] According to the target task, a task model corresponding to the target task can be generated. Each intersection in the city represents multiple objects of the target task, that is, in this task model, each intersection represents a particle.

[0125] Assume that x i represents the i-th intersection in the city, x j represents the j-th intersection in the city, J represents a preset matrix, and J ij represents the value of the preset matrix at the i-th row and j-th column. E represents the set of streets connected by two intersections. Then the loss function corresponding to this target task can be determined as:

[0126]

[0127] Assume that t represents time, Denoting the first preset constant, the velocity function a(t) can be determined as follows:

[0128]

[0129] Based on the above velocity function and loss function, the task model is processed through multiple time evolutions.

[0130] Assume that the first preset value is -1 and the second preset value is 1. Obtain the k-th particle value of each particle. For any particle, if the k-th particle value is greater than the second preset value, or the k-th particle value of the first particle is less than the first preset value, then determine this particle as the first particle; according to the k-th particle value of the first particle, set the particle value of the first particle to the corresponding target particle value; where k takes 1, 2, 3... in sequence, until the particle values of all particles are determined as target particle values, then stop the time evolution processing of 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 a camera, and the second preset processing result is to install a camera.

[0133] Assume that the correspondence 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] Assume 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 it can be determined that the task processing result is: install a camera at the first intersection, do not install a camera at the second intersection, do not install a camera at the third intersection, and install a camera at the fourth intersection.

[0135] The task processing method provided by the embodiments of this application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, so they will not be elaborated here.

[0136] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner.

[0137] Figure 5The structural schematic diagram of the task processing device provided by the embodiment of the present application. As Figure 5 shown, the embodiment of the present application also provides a task processing device 10, including: 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, where

[0138] The acquisition module 11 is configured to acquire a target task, and the target task is used to determine the object processing results of multiple objects;

[0139] The generation module 12 is configured to generate a task model corresponding to the target task, and the task model includes particles corresponding to each object;

[0140] The first determination module 13 is configured to determine a velocity function and a loss function corresponding to the target task, and the velocity function is used to slow down the evolution speed of the target task over time;

[0141] The time evolution processing module 14 is configured to perform multiple time evolution processes on the task model according to the velocity function and the loss function until the particle values of each particle are determined to be target particle values, and the target particle values are the first preset value or the second preset value, and the second preset value is greater than the first preset value;

[0142] The second determination module 15 is configured to determine the task processing result of the target task according to the target particle values of each particle, and the task processing result includes the object processing results of each object.

[0143] The task processing device provided by the embodiment of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be elaborated here.

[0144] In a possible design, the time evolution processing module 14 is specifically configured to:

[0145] Perform an initialization process on the task model, and the initialization process is used to set initial particle values for each particle in the task model;

[0146] Start time evolution processing on each particle in the task model according to the velocity function and the loss function, and the time evolution processing is used to update the particle values of each particle;

[0147] During the time evolution process, obtain the particle values of multiple particles multiple times, and determine whether to set the particle values of the particles to the target particle values according to the particle values of the particles, and stop the time evolution process of the task model until the particle values of each particle are determined to be the target particle values.

[0148] In a possible design, the time evolution processing module 14 is specifically configured to:

[0149] Send a time evolution task to the simulation bifurcation machine, where the time evolution task includes a velocity function and a loss function;

[0150] Send a start instruction to the simulation bifurcation machine, where the start instruction is used to instruct the simulation bifurcation machine to start the time evolution process for each particle in the task model.

[0151] In a possible design, the time evolution processing module 14 is specifically configured to:

[0152] Obtain the k-th particle value of each particle;

[0153] Determine a first particle among multiple particles according to the k-th particle value of each particle, where the k-th particle value of the first particle is greater than a second preset value, or the k-th particle value of the first particle is less than a first preset value;

[0154] Set the particle value of the first particle to the corresponding target particle value according to the k-th particle value of the first particle;

[0155] Wherein, k takes 1, 2, 3... in sequence, and when the particle values of each particle are determined to be the target particle values, the time evolution process for the task model is stopped.

[0156] In a possible design, the time evolution processing module 14 is specifically configured to:

[0157] Send a measurement acquisition instruction to the simulation bifurcation machine, where the measurement acquisition instruction is used to request to obtain the particle value of the particle;

[0158] Receive the particle values of each particle sent by the simulation bifurcation machine at the current moment. For any one particle, the particle value of the particle at the current moment is the k-th particle value.

[0159] In a possible design, the time evolution processing module 14 is specifically configured to:

[0160] If the k-th particle value of the first particle is greater than the second preset value, set 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, set the target particle value of the first particle to the first preset value.

[0162] Figure 6 This is a schematic structural diagram of another task processing device provided by the embodiments of the present application. On the basis of the embodiment shown in Figure 6 please refer to Figure 6 , the task processing device 10 further includes: a sending module 16, wherein,

[0163] The sending module 16 is configured to send a stop evolution instruction corresponding to the first particle to the simulation bifurcation machine, where the stop evolution instruction is used to instruct to stop the evolution of the first particle.

[0164] In a possible design, the first determination module 13 is specifically configured to:

[0165] Determine the loss function as:

[0166]

[0167] where C is the loss function, E is the position of non-zero elements in the preset matrix J, x i is the coordinate of the i-th particle, x j is the coordinate of the j-th particle, J is the preset matrix, and J ij is the value of the preset matrix at the i-th row and j-th column.

[0168] In a possible design, the first determination module 13 is specifically configured to:

[0169] Determine the velocity function as:

[0170]

[0171] where a(t) is the velocity function evolving with time, t is the time, is the first preset constant.

[0172] In a possible design, the second determination 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] Determine the task processing result according to the object processing results of each object.

[0176] In a possible design, the second determination module 15 is specifically configured to:

[0177] Determine two preset processing results according to the semantic information, where the two preset processing results include the first preset processing result and the second preset processing result;

[0178] Determine the object processing result of the object corresponding to the particle according to the two preset processing results.

[0179] In a possible design, the second determination module 15 is specifically configured to:

[0180] Determine the correspondence between the two preset processing results and the two preset values, where the two preset values include the first preset value and the second preset value;

[0181] According to the target particle value of the particle and the corresponding relationship, determine the object processing result of the particle corresponding object, and the object processing result is the first preset processing result or the second preset processing result.

[0182] For the description of the features in the corresponding embodiments of the task processing device, reference can be made to the relevant descriptions in the corresponding embodiments of the task processing method, which will not be elaborated here one by one.

[0183] Figure 7 It is a schematic structural diagram of the electronic device provided by this application. As Figure 7 shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the electronic device 50 further includes a communication component 503. Among them, the processor 501, the memory 502, and the communication component 503 are connected through a bus.

[0184] In the 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] For the specific implementation process of the processor 501, reference can be made to the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0186] In the above embodiment, it should be understood that the processor may be a central processing unit (Central Processing Unit, abbreviated as: CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, abbreviated as: DSP), application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly implemented by the execution of the hardware processor, or implemented by the combination of the 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 (Non-volatile Memory, NVM), such as at least one disk memory.

[0188] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the buses in the drawings of the present application are not limited to only one bus or one type of bus.

[0189] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any of the above-mentioned task processing method embodiments when running.

[0190] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.

[0191] An embodiment of the present application also provides a computer program product. The above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-mentioned task processing method embodiments.

[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 stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above-mentioned task processing method embodiments.

[0193] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0194] The above has introduced in detail a task processing method, an electronic device, a storage medium, and a program product provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope 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 multiple time evolution processes on the task model 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; Determining a task processing result of the target task according to the target particle value of each particle, wherein the task processing result includes an object processing result of each object; 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 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.

2. The method according to claim 1, 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.

3. The method according to claim 1, 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 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; 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.

4. The method according to claim 3, 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.

5. The method according to claim 3, 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.

6. The method according to any one of claims 3 to 5, 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.

7. The method according to any one of claims 1 to 5, 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.

8. The method according to any one of claims 1 to 5, 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.

9. The method according to any one of claims 1 to 5, 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.

10. The method according to claim 9, 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.

11. The method according to claim 10, 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.

12. 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 11 when executing the computer program.

13. 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 11.

14. 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 11 are implemented.

Citation Information

Patent Citations

  • Method and device for obtaining resource allocation strategy, equipment and storage medium

    CN113138848A

  • Task processing method and device, electronic equipment and storage medium

    CN116089070A