Task issuing method and device, electronic equipment and nonvolatile storage medium
By constructing the initial sample collection, screening and fragment splitting, combined with simulated annealing algorithm, the issuance strategy of edge computing tasks is determined, which solves the limited resources and heterogeneity problems in edge computing, and realizes efficient task dispatch at the edge end to meet the delay dual demands of time and energy consumption.
Patent Information
- Application Number
- CN202411287862.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-31
AI Technical Summary
In edge computing, edge computing resources are limited and there are heterogeneous problems, making it difficult to effectively determine the task issuance strategy. It not only meets the users' delay needs, but also reduces energy consumption and improves efficiency.
By obtaining the total number of tasks to be deployed and the amount of resources required for each task, an initial sample set is constructed, filtering and fragment splitting is performed, and the optimal solution is calculated in combination with the simulated annealing algorithm to determine the task issuance strategy.
Under limited resources, effectively determine the task issuance strategy, improve efficiency, meet users' delay needs, and reduce energy consumption.
Smart Images

Figure CN119225965A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of edge computing, and specifically, to a method, device, electronic device and non-volatile storage medium for issuing tasks. Background Art
[0002] As an emerging network computing model, edge computing sinks functions such as computing, storage, control and communication to the edge nodes of the network to realize data processing at the edge, effectively solving problems existing in data transmission, processing, storage and other links in the cloud computing model.
[0003] With the development of edge computing technology, we have entered the era of cloud computing. The business demand for edge computing in various industries is growing, and higher requirements are placed on the computing power and storage capacity of edge nodes. Terminal devices generate huge amounts of data, and there are many "low latency, high bandwidth" demand scenarios in such huge amounts of data. However, traditional centralized cloud computing platforms are difficult to meet the requirements due to restrictions such as transmission distance and network bandwidth. In addition, the transmission of huge amounts of data will generate a lot of energy loss, and the loss of equipment cannot be ignored. Edge computing has become a suitable solution. The computing, storage and communication resource requirements of edge tasks (i.e., mobile edge computing (MEC)) and edge tasks are usually greater than those of cloud tasks. Therefore, deploying some services to the edge can effectively reduce latency, reduce resource consumption, improve computing capabilities, and better meet business needs.
[0004] However, in actual deployment, edge computing resources are limited and there are heterogeneous problems. Sending all computing tasks to the edge requires a large amount of physical equipment to support it, and it also requires a lot of personnel, which is costly. It is difficult to implement the computing task delivery strategy with limited resources, and to determine when tasks should be delivered to the edge and when to the center (traditional centralized cloud computing platform), and to deliver tasks according to the delivery strategy. This not only satisfies the user's good experience, but also reduces the corresponding energy consumption. Maximizing performance has become an urgent problem to be solved.
[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present application provide a method, device, electronic device and non-volatile storage medium for issuing tasks, so as to at least solve the technical problem of how to determine the task issuing strategy and improve the efficiency under limited resources.
[0007] According to one aspect of an embodiment of the present application, a method for task issuance is provided, including: obtaining the total number of tasks to be deployed and the amount of resources required for each task; constructing an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task; screening the initial sample set to obtain a first sample set, wherein each sample in the first sample set corresponds to a task issuance strategy; splitting the samples in the first sample set into fragments to obtain a second sample set; cross-exchanging and reorganizing the fragments in the second sample set to obtain a third sample set; calculating the optimal solution for the third sample set based on a simulated annealing algorithm, and issuing the tasks according to the task issuance strategy of the sample corresponding to the optimal solution.
[0008] In some embodiments of the present application, an initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task, including: repeatedly performing the following steps until the number of initial samples in the initial sample set is equal to a first preset threshold: constructing an initial array; using a random generation function to generate random numbers and assigning them to elements in the initial array until the size of the initial array reaches the total number of tasks and stopping the assignment, and using the initial array after the assignment as an initial sample, wherein the random number takes a value between 0 and 1, and for any element in the initial array, if the random number corresponding to any element is greater than a second preset threshold, assign 1 to any element, and if the random number corresponding to any element is less than or equal to the second preset threshold, assign 0 to any element, wherein 1 represents edge deployment and 0 represents center deployment.
[0009] In some embodiments of the present application, the initial sample set is screened to obtain a first sample set, including: calculating a first loss value for each initial sample in the initial sample set based on a first loss function; selecting initial samples whose first loss values are less than a third preset threshold from the initial sample set to form a first sample set, wherein the total number of samples included in the first sample set is less than a fourth preset threshold.
[0010] In some embodiments of the present application, when the total number of samples included in the first sample set is greater than or equal to a fourth preset threshold, the following steps are iterated until the total number of samples included in the first sample set is less than the fourth preset threshold: constructing an initial sample set based on the total number of tasks and the amount of resources required for each task; calculating a first loss value for each initial sample in the initial sample set based on a first loss function, and selecting initial samples whose first loss values are less than a third preset threshold from the initial sample set to form the first sample set.
[0011] In some embodiments of the present application, samples in a first sample set are segmented to obtain a second sample set, including: segmenting the samples in the first sample set into segments of different lengths and numbers; performing at least one of the following processing on each segment to obtain the second sample set: fragment ectopic processing, fragment displacement processing, fragment mutation processing, fragment flipping processing, and no processing.
[0012] In some embodiments of the present application, an optimal solution is calculated for the third sample set based on a simulated annealing algorithm, and tasks are issued according to the task issuance strategy for samples corresponding to the optimal solution, including: selecting samples less than a fifth preset threshold from the third sample set to form a fourth sample set; calculating the optimal solution for the fourth sample set based on the second loss function in the simulated annealing algorithm; and issuing tasks according to the task issuance strategy for samples corresponding to the optimal solution.
[0013] In some embodiments of the present application, an optimal solution is calculated for a fourth sample set based on a second loss function in a simulated annealing algorithm, including: obtaining a preset initial temperature, the initial temperature decreases in a preset form at each iteration, and taking the first target sample in the fourth sample as the initial solution, iterating the following steps until the initial temperature is less than a sixth preset threshold, and when the solution after the iteration is less than a seventh preset threshold, taking the solution after the iteration as the optimal solution: calculating a second loss value of the initial solution based on the second loss function of the simulated annealing algorithm; calculating a neighborhood solution of the initial solution based on a neighborhood algorithm, wherein the neighborhood algorithm includes at least one of the following processing: fragment ectopic processing, fragment displacement processing, and fragment mutation processing; calculating a second loss value of the neighborhood solution based on the second loss function of the simulated annealing algorithm; when the second loss value of the neighborhood solution is less than the second loss value of the initial solution, taking the neighborhood solution as a new initial solution.
[0014] In some embodiments of the present application, during the iteration process, the method also includes: when the second loss value of the neighborhood solution is greater than or equal to the second loss value of the initial solution, using a random generation function to determine whether to use the neighborhood solution as a new initial solution; when the number generated by the random generation function is less than an eighth preset threshold, using the neighborhood solution as a new initial solution; when the number generated by the random generation function is greater than or equal to the eighth preset threshold, not using the neighborhood solution as a new initial solution, and directly using the current initial solution for the next iteration.
[0015] According to another aspect of an embodiment of the present application, a device for issuing tasks is also provided, including: an acquisition module, used to obtain the total number of tasks to be deployed and the amount of resources required for each task; a construction module, used to construct an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task issuing strategy; a fragment splitting module, used to perform fragment splitting on the samples in the first sample set to obtain a second sample set; a sample cross-exchange and recombination module, used to perform sample cross-exchange and recombination on the fragments in the second sample set to obtain a third sample set; a task issuing module, used to calculate the optimal solution for the third sample set based on a simulated annealing algorithm, and issue the task according to the task issuing strategy of the sample corresponding to the optimal solution.
[0016] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, a method for controlling a device where the non-volatile storage medium is located to execute the above task issuance is provided.
[0017] According to another aspect of an embodiment of the present application, an electronic device is further provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above task issuing method is executed when the program is running.
[0018] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the above task issuance method when executed by a processor.
[0019] In an embodiment of the present application, the total number of tasks to be deployed and the amount of resources required for each task are obtained; an initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task issuance strategy; the samples in the first sample set are fragmented to obtain a second sample set; the fragments in the second sample set are cross-interchanged and reorganized to obtain a third sample set; the optimal solution for the third sample set is calculated based on a simulated annealing algorithm, and the tasks are issued according to the task issuance strategy of the sample corresponding to the optimal solution. By determining the total number of tasks and the amount of resources required for each task, an initial sample is constructed under a fixed resource amount, and the initial sample is screened, fragmented, cross-interchanged and reorganized. Finally, the optimal solution is calculated based on a simulated annealing algorithm, and the tasks are issued according to the task issuance strategy of the sample corresponding to the optimal solution, thereby solving the technical problem of how to determine the task issuance strategy and improve efficiency under limited resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a method for issuing tasks according to an embodiment of the present application;
[0022] Figure 2 It is a flowchart of a method for issuing tasks according to an embodiment of the present application;
[0023] Figure 3 is a flowchart of another method for issuing tasks according to an embodiment of the present application;
[0024] Figure 4 It is a structural diagram of a device for issuing tasks according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0028] Simulated Annealing (SA) is a heuristic global optimization algorithm that simulates the annealing process of solid materials, that is, gradually cooling from a high temperature state to a low temperature state to reach the state with the lowest energy. In optimization problems, the simulated annealing algorithm attempts to find the optimal solution to the problem in a similar way. It is particularly suitable for dealing with complex problems with multiple local optimal solutions, avoiding falling into local optimal solutions and failing to find the global optimal solution. The core idea of the simulated annealing algorithm is to allow the algorithm to accept a solution that is worse than the current solution in some iterations. The probability of accepting a worse solution gradually decreases as the iteration proceeds (i.e., the temperature decreases).
[0029] In the related technology, in actual deployment, the computing resources at the edge are limited, and there are heterogeneous problems. Sending all computing tasks to the edge requires a large amount of physical equipment to support it, and it also requires a lot of personnel, which is very costly. It is difficult to implement the strategy for sending computing tasks under limited resources, and to know when the task is sent to the edge and when it is sent to the center. Sending tasks according to the sending strategy not only satisfies the user's good experience, but also reduces the corresponding energy consumption. Maximizing efficiency has become an urgent problem to be solved. Therefore, there is a problem of how to determine the task sending strategy and improve efficiency under limited resources. In order to solve this problem, a relevant solution is provided in the embodiment of the present application, which is described in detail below.
[0030] According to an embodiment of the present application, an embodiment of a method for issuing tasks is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for issuing tasks. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method of task distribution in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method of task distribution described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0036] In the above operating environment, the present application embodiment provides a flowchart of a method for issuing a task, such as Figure 2As shown, the method comprises the following steps:
[0037] Step S202, obtaining the total number of tasks to be deployed and the amount of resources required for each task.
[0038] In the technical solution provided in step S202, the total amount of resources is determined by obtaining the total number of tasks to be deployed and the amount of resources required for each task. The total number of tasks includes the number of tasks and the amount of resources required for each task at the edge end (i.e., the mobile edge computing (MEC) end, hereinafter referred to as the edge end), and the number of tasks and the amount of resources required for each task at the center end (the traditional centralized cloud computing platform, hereinafter referred to as the center end).
[0039] It is also necessary to obtain the specific physical conditions of edge resources (for example, processor power, memory size, storage capacity, and network bandwidth, etc.), as well as the CPU computing power required for computing tasks, the uplink rate of networks on different transmission lines, etc. For example, these can be obtained in the following ways: deploy resource monitoring tools on edge devices to obtain data such as CPU usage, memory occupancy, storage status, and network performance in real time or periodically, analyze the tasks to be executed, and extract key features such as their CPU requirements, which can be done through preprocessing or task description files; perform network performance tests on different transmission lines to obtain parameters such as the uplink rate, which can be done using network testing tools or APIs; perform network performance tests on different transmission lines to obtain parameters such as the uplink rate, which can be done using network testing tools or APIs.
[0040] Step S204: construct an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task, and screen the initial sample set to obtain a first sample set, wherein each sample in the first sample set corresponds to a task delivery strategy.
[0041] In the technical solution provided in step S204, there are many ways to implement constructing an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task. For example, the initial sample set can be constructed in the following way: Repeat the following steps until the number of initial samples in the initial sample set is equal to a first preset threshold (for example, equal to the total number of tasks): Construct an initial array; Use a random function to generate random numbers and assign them to elements in the initial array until the size of the initial array reaches the total number of tasks and stop assigning values, and use the initial array after the assignment as an initial sample, wherein the random number takes a value between 0 and 1, and for any element in the initial array, if the random number corresponding to any element is greater than the second preset threshold, assign 1 to any element, and if the random number corresponding to any element is less than or equal to the second preset threshold (for example, 0.5), assign 0 to any element, wherein 1 represents edge deployment and 0 represents center deployment.
[0042] The following is a specific embodiment:
[0043] The following steps are repeated until the number of initial samples in the initial sample set is equal to a first preset threshold (for example, equal to the total number of tasks). The construction process of each initial sample is as follows:
[0044] The initial array is represented by the following formula:
[0045] C={C1,C2,C3....C W},
[0046] Among them, C represents an initial sample, C1-C W represents the elements in the initial sample, w is equal to the total number of tasks, C1-C W The value is 0 or 1.
[0047] Use the random generation function to assign a value to each element in array C using the following formula. 1 represents edge deployment and 0 represents central deployment. The assignment is stopped when the size of the initial array reaches the total number of tasks. The assigned array C is used as an initial sample.
[0048] s k =rand(0,1),
[0049] Among them, S k Represents a random generation function, rand(0, 1) means randomly generating a random number between 0 and 1.
[0050]
[0051] Among them, σ represents any element in the initial array. When the random number generated by the random function is greater than 0.5, it is assigned a value of 1. When the random number generated by the random function is less than or equal to 0.5 and greater than 0, it is assigned a value of 0.
[0052] In the technical solution provided in step S204, there are many ways to screen the initial sample set to obtain the first sample set, for example: calculating a first loss value for each initial sample in the initial sample set based on a first loss function; selecting initial samples from the initial sample set whose first loss value is less than a third preset threshold (for example, α, the specific value of α should be based on the understanding of the expected range and distribution of the loss function output, and a reasonable α value range can be determined through preliminary experiments, for example, selecting the average value of the loss function output plus 2 standard deviations) to form a first sample set, wherein the total number of samples contained in the first sample set is less than a fourth preset threshold (for example, the total length of the initial samples divided by 3 and rounded up).
[0053] It should be noted that when the total number of samples is greater than or equal to the fourth preset threshold, the process returns to constructing the initial sample set and executes all subsequent steps, i.e., iterates the following steps until the total number of samples is less than the fourth preset threshold: constructing an initial sample set based on the total number of tasks and the amount of resources required for each task; calculating a first loss value for each initial sample in the initial sample set based on a first loss function, and selecting initial samples whose first loss values are less than the third preset threshold from the initial sample set to form a first sample set.
[0054] The following is a specific embodiment:
[0055] Screening the initial sample set: Calculating a first loss value for each initial sample in the initial sample set based on a first loss function, where the first loss function is represented by the following formula:
[0056]
[0057] Among them, loss represents the first loss value calculated for an initial sample, ρ and δ represent the task weight coefficients, which are constants. The sensitivity of the calculation task to delay, such as unmanned vehicle scenarios, AR game scenarios, and medical scenarios, needs to pay attention to delay requirements. The task weight coefficients need to be adjusted for different scenarios. w represents the total time delay function, E w Represents the total energy consumption loss function, and w is equal to the total number of tasks.
[0058] ρ and δ need to satisfy the following constraints: ρ+δ=1,
[0059] T w It is expressed as follows:
[0060]
[0061] Among them, T w represents the total time delay function, Indicates the time delay of the cloud computing center (i.e. the above-mentioned center end), represents the delay loss at the edge, w is equal to the total number of tasks, Q w Represents the sensitivity of the task to time delay, which is a constant.
[0062] Above It is expressed as follows:
[0063]
[0064] in, Indicates the time delay of the center end, C w represents the number of resources required for the wth task, f l Indicates the CPU computing power of the center when executing the wth task.
[0065] Above It is expressed as follows:
[0066]
[0067] in, represents the delay loss at the edge. Indicates the delay in data transmission. Indicates the delay caused by data calculation.
[0068] Above It is expressed as follows:
[0069]
[0070] in, Indicates the delay in data transmission, D w Indicates the data transmission size, r w Indicates the network uplink rate.
[0071] E w It is expressed as follows:
[0072]
[0073] Among them, E w represents the total energy loss function, It represents the energy loss caused by the computing tasks of the cloud computing center (i.e. the above-mentioned center end), represents the energy consumption generated by edge computing tasks, w is equal to the total number of tasks, Q wRepresents the sensitivity of the task to time delay, which is a constant.
[0074] Above It is expressed as follows:
[0075]
[0076] in, represents the energy loss generated by the computing task of the cloud computing center (i.e., the above-mentioned center end). k is a constant value that is not affected by external operating factors. C w represents the number of resources required for the wth task, f l Indicates the CPU computing power of the center when executing the wth task.
[0077] Above It is expressed as follows:
[0078]
[0079] in, represents the energy consumption generated by edge computing tasks, p t Indicates the transmission rate, Indicates the delay loss at the edge.
[0080] After the first loss function values of all samples are calculated using the above formula, initial samples whose first loss values are less than a third preset threshold (for example, α, the specific value of α should be based on the understanding of the expected range and distribution of the loss function output, and a reasonable α value range can be determined through preliminary experiments, for example, the average value of the loss function output plus 2 standard deviations is selected, and α is ultimately a constant with a value between 0 and 1) are selected from the initial sample set to form the first sample set. The number of samples in the first sample set needs to be less than a fourth preset threshold, and the fourth preset threshold is expressed by the following formula:
[0081] Z<ceil(length(C) / 3),
[0082] Wherein, Z represents the number of samples in the first sample set, and ceil(length(C) / 3 represents the total length of the initial sample C divided by 3 and then rounded up (i.e., the fourth preset threshold).
[0083] Then, a final function threshold β (i.e., the seventh preset threshold) is set, and the relationship between β and α is expressed by the following formula: α=nβ, n>1 (for example, n is set to 10). β should be stricter than α, in order to further screen out high-quality solutions and determine whether the solution obtained by the simulated annealing algorithm can be used as the optimal solution.
[0084] Step S206: split the samples in the first sample set into segments to obtain a second sample set.
[0085] In the technical solution provided in step S206, there are multiple ways to implement splitting the samples in the first sample set into fragments to obtain the second sample set, for example: splitting the samples in the first sample set into fragments of different lengths and different numbers; performing at least one of the following processing on each fragment to obtain the second sample set: fragment ectopic processing, fragment shift processing, fragment mutation processing, fragment flipping processing and no processing.
[0086] The following is a specific embodiment:
[0087] Use segments of different lengths and numbers for batch processing (the total number of segments should not be too short, and the length of each segment should not be too small, depending on the actual number of tasks, for example, segment lengths of 3, 4, and 5 are split respectively), and determine the final processing method for each segment using the following formula:
[0088]
[0089] Among them, α is the above-mentioned third preset threshold, which is a predetermined constant between 0 and 1. When α<0.125, fragment flipping processing is performed, when 0.125≤α<0.25, fragment ectopic processing is performed, when 0.25≤α<0.375, fragment displacement processing is performed, when 0.375≤α<0.5, fragment mutation processing is performed, and when 0.5≤α<1, no processing is performed.
[0090] The fragment flipping process is to flip the numerical values from beginning to end, for example, if C={1,0,0,1,0}, the sequence after flipping is C={0,1,0,0,1}.
[0091] The fragment translocation processing is to perform translocation processing on each element of the sample in the first sample set. For example, if the sample data is C={1,0,0,1,0}, the translocated sample data is C={0,1,1,0,1}.
[0092] The fragment shifting process is to insert a small part of the fragment data at the tail of the sample in the first sample set into the head, for example, C = {1, 0, 0, 1, 0}, and the shifting process is performed with 2 fragments, then the processed sample data is C = {1, 0, 1, 0, 0}, and so on.
[0093] The fragment mutation process is to re-randomly process the elements of each sample in the first sample set.
[0094] The above-mentioned changes are intended to break the correlation of the data, because simply through the cross-exchange of genes, some positive data may obtain a greater positive effect, but the generated data may have a certain degree of correlation. Through the probabilistic neighborhood transformation (that is, the above-mentioned fragment ectopic processing, fragment shift processing, fragment mutation processing, and fragment flipping processing), the data is positively strengthened while breaking the problem of local aggregation, and there is a greater probability of searching for the global optimal solution.
[0095] Step S208: perform sample cross-exchange and recombination on the fragments in the second sample set to obtain a third sample set.
[0096] The following is a specific embodiment:
[0097] Determine the crossover point: First, select two samples from the sample set as parents (the parents are selected from the current sample set (population) according to a certain selection mechanism (such as roulette selection, tournament selection, etc.)).
[0098] Then, one or more crossover points are selected in the chromosomes of the two samples. The selection of crossover points can be single-point, multi-point crossover, or uniform crossover (that is, each gene position (each element in the array corresponding to the sample) has a certain probability of being exchanged). The number and position of the selected crossover points depend on the specific requirements of the task and the settings of the algorithm; perform the crossover operation: once the crossover point is determined, a crossover operation is performed between the chromosomes of the two samples, a single-point crossover, that is, at the selected crossover point, the chromosome fragments of the two samples are exchanged. For example, for two samples C_1={1,0,0,1,0} and C_2={0,1,1,0,1}, if the crossover point is selected at the third position, then the samples after the crossover will be C'_1={1,0,1,0,1} and C'_2={0,1,0,1,0}; generate new samples. After the crossover operation is completed, the generated new sample set (that is, the third sample set mentioned above) contains the combined features of the original sample set (that is, the second sample set mentioned above). Each sample in the new sample set is composed of some features of the parent sample. This recombination of features may produce a better task delivery strategy. Repeat the crossover operation In order to increase sample diversity, multiple pairs of crossover operations need to be performed in the second sample set until a sufficient number of new samples are generated (for example, equal to the total number of tasks). The crossover and recombination process is part of the iterative optimization of the genetic algorithm. By repeatedly repeating the process of mutation, crossover, evaluation, and selection, the algorithm gradually approaches the optimal solution. In edge computing scenarios, this process helps to find the best task delivery strategy under fixed resource conditions, which not only meets user needs but also reduces energy consumption. Through the crossover operation of the genetic algorithm, a variety of samples can be effectively generated, providing a wider range of candidate solutions that are closer to the optimal solution for the subsequent simulated annealing algorithm.
[0099] Step S210, calculating the optimal solution for the third sample set based on the simulated annealing algorithm, and issuing the task according to the task issuing strategy of the sample corresponding to the optimal solution.
[0100] In the technical solution provided in step S210, there are multiple ways to calculate the optimal solution for the third sample set based on the simulated annealing algorithm and issue the task corresponding to the optimal solution, for example: select samples less than a fifth preset threshold (the same as the third preset threshold, for example, α) from the third sample set (the third sample set is filtered again using the threshold α, and only samples less than the threshold α are retained) to form a fourth sample set; calculate the optimal solution for the fourth sample set based on the second loss function in the simulated annealing algorithm; and issue the task according to the task issuance strategy for the sample corresponding to the optimal solution.
[0101] Performing threshold filtering again in the above steps can reduce the time required for calculation. The simulated annealing algorithm can be considered as an improvement on the Newton gradient algorithm. The annealing temperature of this algorithm should not be too large, because it may skip the optimal solution. If the entire sample is searched, a lot of calculation time will be generated. Removing some samples with large deviations is a certain optimization in calculation time.
[0102] For example, the optimal solution for the fourth sample set based on the second loss function in the simulated annealing algorithm can be calculated in the following manner: a preset initial temperature is obtained, the initial temperature decreases in a preset form at each iteration (for example, each iteration decreases exponentially), and the first target sample in the fourth sample is used as the initial solution, and the following steps are iterated until the initial temperature is less than a sixth preset threshold, and when the solution after the iteration is less than a seventh preset threshold (for example, β), the solution after the iteration is used as the optimal solution: a second loss value of the initial solution is calculated based on the second loss function of the simulated annealing algorithm; a neighborhood solution of the initial solution is calculated based on a neighborhood algorithm, wherein the neighborhood algorithm includes at least one of the following processing: fragment dislocation processing, fragment displacement processing, and fragment mutation processing; a second loss value of the neighborhood solution is calculated based on the second loss function of the simulated annealing algorithm; when the second loss value of the neighborhood solution is less than the second loss value of the initial solution, the neighborhood solution is used as a new initial solution.
[0103] It should be noted that in the above steps, when the second loss value of the neighborhood solution is greater than or equal to the second loss value of the initial solution, a random generation function is used to determine whether to use the neighborhood solution as a new initial solution: when the number generated by the random generation function is less than an eighth preset threshold (for example, 1), the neighborhood solution is used as a new initial solution; when the number generated by the random generation function is greater than or equal to the eighth preset threshold, the neighborhood solution is not used as a new initial solution, and the current initial solution is directly used for the next iteration.
[0104] It should be noted that if the solution after the iteration is greater than or equal to the seventh preset threshold (for example, β), the process returns to the step of constructing the initial sample set and executes all steps after this step until the solution after the iteration is less than the seventh preset threshold.
[0105] The simulated annealing algorithm is used in the process of obtaining the local optimal solution. This algorithm is an optimization algorithm designed to simulate the physical annealing process. It is different from the traditional Newton-like search algorithm. The traditional search algorithm is very likely to fall into the local optimal solution. The annealing algorithm, because of the existence of the Metropolis criterion, will accept the iterative solution that is worse than the initial solution as the initial solution for the next calculation with a certain probability. Therefore, it can jump out of the local optimal solution in the space of the local optimal solution with probability and eventually tend to the global optimal solution; but the higher the initial temperature, the better it tends to tend to the optimal solution. Therefore, the threshold for sample screening should not be too small, and the temperature attenuation should not be too large, because there is a certain probability of skipping the optimal solution. After decomposing and transforming the second loss function, it is found that the minimum resource is composed of the task weight coefficient ρ, the number of task resources C w , and CPU computing power, and is expressed by the following formula:
[0106]
[0107] Among them, g(f) represents the minimum resource, ρ represents the task weight coefficient, C w represents the number of resources required for the wth task, f w Indicates the CPU computing power when executing the wth task.
[0108] The sum of the resources at this edge is less than the total resource F, so the Lagrangian function expression under this constraint is expressed as follows:
[0109]
[0110] Among them, ρ represents the task weight coefficient, θ and w represent the weight coefficients of the Lagrangian function, which are constants, f represents the total CPU computing power, C w represents the number of resources required for the wth task, f w It represents the CPU computing power when executing the wth task, and F represents the total amount of resources.
[0111] The following is a specific embodiment:
[0112] 1. Initialization solution and temperature: First, select an initial solution (i.e., the first target sample in the fourth sample above) and set an initial temperature T. The initial temperature should be set high enough to make the worst solution (relative to the current initial solution), for example, set to 10000. This temperature is very high at the beginning of the algorithm and gradually decreases exponentially with iterations, thereby controlling the acceptance probability of the solution.
[0113] 2. Generate neighborhood solution: Based on the current solution, use neighborhood algorithms (such as fragment dislocation processing, fragment shift processing, and fragment mutation processing) to generate a new solution within the neighborhood (ie, the above-mentioned neighborhood solution).
[0114] 3. Calculate the difference in objective function: Use the second loss function to calculate the second loss function value of the neighborhood solution and the current solution. If the second loss value of the neighborhood solution is less than the second loss value of the initial solution, the neighborhood solution is used as the new initial solution.
[0115] 4. Acceptance probability calculation: When the second loss value of the neighborhood solution is greater than or equal to the second loss value of the initial solution, use the random generation function to determine whether to use the neighborhood solution as a new initial solution: When the number generated by the random generation function is less than 1 (for example, the eighth preset threshold), use the neighborhood solution as a new initial solution; When the number generated by the random generation function is greater than or equal to 1, do not use the neighborhood solution as a new initial solution, and directly use the current initial solution for the next iteration.
[0116] 5. Temperature update: Update the temperature T according to a certain temperature decay formula (such as exponential decay). Usually the temperature will gradually decrease with the increase in the number of iterations so that the algorithm gradually converges to the optimal solution.
[0117] Iteration and stopping condition: Repeat steps 2 to 5 until the temperature drops to the preset termination temperature (i.e., the sixth threshold mentioned above, which should be set low enough to reduce the probability of accepting a poor solution, thereby helping the algorithm converge to a better solution. For example, set to 1), at which time the algorithm ends and outputs the current solution.
[0118] Compare with the preset threshold: Compare the solution obtained by the simulated annealing algorithm with the preset threshold β. If β is satisfied, it is taken as the optimal solution. If not, return to the first step, recreate the initial sample set, and perform all subsequent steps.
[0119] The core of the simulated annealing algorithm is that it allows the algorithm to accept a "worse" solution with a certain probability during the iteration process. In this way, the algorithm can conduct a wider exploration in the solution space, avoid falling into the local optimum too early, and ultimately help find the global optimal solution. In the scenario of edge computing task delivery, this global search capability is particularly important because it can help find the most reasonable task allocation solution under limited resource conditions while meeting the requirements of minimizing latency and energy consumption.
[0120] Through the above steps S202-S210, the method for creating the initial sample is simple, the calculation process is fixed, and the applicability is strong. The local optimal problem is fully considered. Before the sample fragments are cross-interchangeable, the neighborhood algorithm is used for conversion, which breaks the similarity between samples and can jump out of the local optimal solution with a high probability. The traditional optimization algorithm is prone to fall into the local optimal solution and cannot find the global optimal solution. The method in the embodiment of the present application introduces a simulated annealing algorithm, which can accept a solution worse than the current solution with a certain probability during the search process, thereby jumping out of the local optimal trap and increasing the possibility of finding the global optimal solution. It fully considers the actual situation of resource limitations in edge computing and can flexibly adapt to the task requirements in different scenarios, such as unmanned vehicles, AR games, medical care and other delay-sensitive scenarios. The parameters of the algorithm (such as thresholds α, β, fragment length, etc.) can be adjusted according to the actual resource conditions and task characteristics to ensure that the optimal task distribution plan can be found under any circumstances.
[0121] The present application embodiment also provides a flowchart of another method for issuing tasks, such as Figure 3 As shown,
[0122] First, the number of tasks at the end (i.e., the edge end mentioned above) and resource summary (for example, the specific physical conditions of edge end resources (for example, processor power, memory size, storage capacity, and network bandwidth, etc.) and the CPU computing power required for computing tasks, the uplink rate of networks with different transmission lines, etc.) are collected, and then a sample data set is randomly generated (i.e., the initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task), and a loss value is calculated for the sample data set (i.e., the initial sample set mentioned above) using a loss function (i.e., the first loss value is calculated for each initial sample in the initial sample set based on the first loss function), and it is determined whether the first loss value meets the threshold α, and whether the number of samples after the threshold α screening meets the conditions, and a reasonable number of samples is screened out (i.e., the initial samples whose first loss values are less than the third preset threshold are selected from the initial sample set to form the first sample set, and the total number of samples contained in the first sample set is less than the third preset threshold). At a fourth preset threshold (for example, the total length of the initial samples divided by 3 and then rounded up), fragment splitting is then performed (i.e., the samples in the first sample set are fragmented to obtain the second sample set), and the probability value is less than 0.5 (i.e., α is less than 0.5) corresponding to the neighborhood transformation (i.e., the fragment dislocation processing, fragment shift processing, fragment mutation processing, and fragment flipping processing), otherwise, cross-exchange is directly performed to generate new random samples (i.e., the fragments in the second sample set are cross-exchanged and reorganized to obtain the third sample set), the sample set is filtered again using the threshold α, and the second loss value is calculated using the simulated annealing algorithm to obtain the final solution. When the final solution is less than the final threshold β, the solution is used as the optimal solution, and the task is issued according to the task issuance strategy of the sample corresponding to the optimal solution. When the final solution is greater than or equal to the final threshold β, return to the first step to recreate the sample set, and execute all the following steps.
[0123] The present application embodiment provides a structural diagram of a device for issuing tasks, such as Figure 4 As shown, it includes an acquisition module 402 , a construction module 404 , a fragment splitting module 406 , a sample cross-exchange and recombination module 408 , and a task issuing module 410 .
[0124] The acquisition module 402 is used to acquire the total number of tasks to be deployed and the amount of resources required for each task.
[0125] The construction module 404 is used to construct an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task delivery strategy.
[0126] The construction module 404 is also used to repeatedly execute the following steps until the number of initial samples in the initial sample set is equal to a first preset threshold: construct an initial array; use a random generation function to generate random numbers and assign them to elements in the initial array until the size of the initial array reaches the total number of tasks and stop the assignment, and use the initial array after the assignment as an initial sample, wherein the random number value is between 0 and 1, for any element in the initial array, if the random number corresponding to any element is greater than the second preset threshold, assign 1 to any element, and if the random number corresponding to any element is less than or equal to the second preset threshold, assign 0 to any element, wherein 1 represents edge deployment and 0 represents cloud deployment.
[0127] The construction module 404 is also used to calculate a first loss value for each initial sample in the initial sample set based on the first loss function; select initial samples whose first loss values are less than a third preset threshold from the initial sample set to form a first sample set, wherein the total number of samples included in the first sample set is less than a fourth preset threshold.
[0128] The construction module 404 is also used to iterate the following steps until the total number of samples contained in the first sample set is less than the fourth preset threshold value when the total number of samples contained in the first sample set is greater than or equal to the fourth preset threshold value: construct an initial sample set based on the total number of tasks and the amount of resources required for each task; calculate a first loss value for each initial sample in the initial sample set based on the first loss function, and select initial samples whose first loss values are less than the third preset threshold value from the initial sample set to form the first sample set. The fragment splitting module 406 is used to perform fragment splitting on the samples in the first sample set to obtain a second sample set.
[0129] The segmentation module 406 is used to segment the samples in the first sample set to obtain a second sample set.
[0130] The fragment splitting module 406 is also used to split the samples in the first sample set into fragments of different lengths and numbers; perform at least one of the following processing on each fragment to obtain a second sample set: fragment ectopic processing, fragment displacement processing, fragment mutation processing and no processing.
[0131] The sample cross-exchange and recombination module 408 is used to perform sample cross-exchange and recombination on the fragments in the second sample set to obtain a third sample set.
[0132] The task issuing module 410 is used to calculate the optimal solution for the third sample set based on the simulated annealing algorithm, and issue the task according to the task issuing strategy of the sample corresponding to the optimal solution.
[0133] The task issuing module 410 is also used to select samples less than a fifth preset threshold from the third sample set to form a fourth sample set; calculate the optimal solution for the fourth sample set based on the second loss function in the simulated annealing algorithm; and issue the task according to the task issuing strategy of the sample corresponding to the optimal solution.
[0134] The task issuing module 410 is also used to obtain a preset initial temperature, which decreases in a preset form at each iteration, and takes the first target sample in the fourth sample as the initial solution, iterates the following steps until the initial temperature is less than the sixth preset threshold, and when the solution after the iteration is less than the seventh preset threshold, takes the solution after the iteration as the optimal solution: calculate the second loss value of the initial solution based on the second loss function of the simulated annealing algorithm; calculate the neighborhood solution of the initial solution based on the neighborhood algorithm, wherein the neighborhood algorithm includes fragment out-of-situ processing, fragment displacement processing, and fragment mutation processing; calculate the second loss value of the neighborhood solution based on the second loss function of the simulated annealing algorithm; when the second loss value of the neighborhood solution is less than the second loss value of the initial solution, take the neighborhood solution as the new initial solution.
[0135] The task issuing module 410 is also used to use a random generation function to determine whether to use the neighborhood solution as a new initial solution when the second loss value of the neighborhood solution is greater than or equal to the second loss value of the initial solution: when the number generated by the random generation function is less than an eighth preset threshold, the neighborhood solution is used as a new initial solution; when the number generated by the random generation function is greater than or equal to the eighth preset threshold, the neighborhood solution is not used as a new initial solution, and the current initial solution is directly used for the next iteration.
[0136] It should be noted that the various modules in the device to which the above-mentioned tasks are issued can be program modules (for example, a set of program instructions for implementing a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0137] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above method of task issuance. For example, the total number of tasks to be deployed and the amount of resources required for each task are obtained; an initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task issuance strategy; the samples in the first sample set are fragmented to obtain a second sample set; the fragments in the second sample set are cross-interchanged and reorganized to obtain a third sample set; the optimal solution for the third sample set is calculated based on a simulated annealing algorithm, and the tasks are issued according to the task issuance strategy of the sample corresponding to the optimal solution.
[0138] The embodiment of the present application also provides an electronic device, the electronic device includes a processor, the processor is used to run a program, wherein the above method of task issuance is executed when the program is running. For example, the total number of tasks to be deployed and the amount of resources required for each task are obtained; an initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task issuance strategy; the samples in the first sample set are fragmented to obtain a second sample set; the fragments in the second sample set are cross-interchanged and reorganized to obtain a third sample set; the optimal solution for the third sample set is calculated based on a simulated annealing algorithm, and the tasks are issued according to the task issuance strategy of the sample corresponding to the optimal solution.
[0139] According to another aspect of the embodiment of the present application, a computer program product is also provided, including a computer program, which implements the above method of task distribution when executed by a processor. For example, the total number of tasks to be deployed and the amount of resources required for each task are obtained; an initial sample set is constructed based on the total number of tasks to be deployed and the amount of resources required for each task; the initial sample set is screened to obtain a first sample set, wherein each sample in the first sample set corresponds to a task distribution strategy; the samples in the first sample set are fragmented to obtain a second sample set; the fragments in the second sample set are cross-interchanged and reorganized to obtain a third sample set; the optimal solution for the third sample set is calculated based on a simulated annealing algorithm, and the tasks are distributed according to the task distribution strategy of the sample corresponding to the optimal solution.
[0140] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0143] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0145] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for issuing tasks, characterized in that: include: Get the total number of tasks to be deployed and the amount of resources required for each task; Constructing an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each of the tasks; Screening the initial sample set to obtain a first sample set, wherein each sample in the first sample set corresponds to a task delivery strategy; Splitting the samples in the first sample set into segments to obtain a second sample set; Performing sample cross-exchange and recombination on the fragments in the second sample set to obtain a third sample set; An optimal solution is calculated for the third sample set based on a simulated annealing algorithm, and the task is issued according to a task issuing strategy for the sample corresponding to the optimal solution.
2. The method according to claim 1, characterized in that Constructing the initial sample set based on the total number of tasks to be deployed and the amount of resources required by each of the tasks includes: Repeat the following steps until the number of initial samples in the initial sample set is equal to a first preset threshold: Build the initial array; A random number is generated using a random generation function and assigned to the elements in the initial array until the size of the initial array reaches the total number of tasks, and the assignment is stopped. The initial array after the assignment is completed is used as an initial sample, wherein the random number takes a value between 0 and 1. For any element in the initial array, if the random number corresponding to any element is greater than a second preset threshold, the element is assigned a value of 1; if the random number corresponding to any element is less than or equal to the second preset threshold, the element is assigned a value of 0, wherein 1 represents edge deployment and 0 represents center deployment.
3. The method according to claim 1, characterized in that Screening the initial sample set to obtain the first sample set includes: Based on a first loss function, a first loss value is calculated for each initial sample in the initial sample set; initial samples whose first loss value is less than a third preset threshold are selected from the initial sample set to form the first sample set, wherein the total number of samples included in the first sample set is less than a fourth preset threshold.
4. The method according to claim 3, characterized in that: The method further includes: when the total number of samples included in the first sample set is greater than or equal to the fourth preset threshold, iterating the following steps until the total number of samples included in the first sample set is less than the fourth preset threshold: Constructing the initial sample set based on the total number of tasks and the amount of resources required by each of the tasks; The first loss value is calculated for each of the initial samples in the initial sample set based on the first loss function, and initial samples whose first loss values are less than the third preset threshold are selected from the initial sample set to form the first sample set.
5. The method according to claim 1, characterized in that The samples in the first sample set are segmented to obtain the second sample set, including: The samples in the first sample set are divided into fragments of different lengths and numbers; at least one of the following processing is performed on each of the fragments to obtain the second sample set: fragment ectopic processing, fragment displacement processing, fragment mutation processing, fragment flipping processing and no processing.
6. The method according to claim 1, characterized in that Calculating an optimal solution for the third sample set based on a simulated annealing algorithm, and issuing the task according to a task issuing strategy for the sample corresponding to the optimal solution, including: Selecting samples smaller than a fifth preset threshold from the third sample set to form a fourth sample set; Calculating an optimal solution for the fourth sample set based on a second loss function in a simulated annealing algorithm; The task is issued according to the task issuing strategy of the sample corresponding to the optimal solution.
7. The method according to claim 6, characterized in that Calculating an optimal solution for the fourth sample set based on a second loss function in a simulated annealing algorithm includes: Obtain a preset initial temperature, the initial temperature decreases in a preset form in each iteration, and the first target sample in the fourth sample is used as the initial solution, iterate the following steps until the initial temperature is less than a sixth preset threshold, and when the solution after the iteration is less than a seventh preset threshold, the solution after the iteration is used as the optimal solution: Calculate a second loss value of the initial solution based on a second loss function of the simulated annealing algorithm; Calculating a neighborhood solution of the initial solution based on a neighborhood algorithm, wherein the neighborhood algorithm includes at least one of the following processing: fragment ectopic processing, fragment displacement processing, and fragment mutation processing; Calculate a second loss value of the neighborhood solution based on a second loss function of the simulated annealing algorithm; When the second loss value of the neighborhood solution is less than the second loss value of the initial solution, the neighborhood solution is used as a new initial solution.
8. The method according to claim 7, characterized in that During the iteration, the method further includes: when the second loss value of the neighborhood solution is greater than or equal to the second loss value of the initial solution, using a random generation function to determine whether to use the neighborhood solution as the new initial solution: When the number generated by the random generation function is less than the eighth preset threshold, using the neighborhood solution as the new initial solution; When the number generated by the random generation function is greater than or equal to the eighth preset threshold, the neighborhood solution is not used as the new initial solution, and the current initial solution is directly used for the next iteration.
9. A device for issuing tasks, characterized in that: include: The acquisition module is used to obtain the total number of tasks to be deployed and the amount of resources required for each task; A construction module, used to construct an initial sample set based on the total number of tasks to be deployed and the amount of resources required for each task; Screening the initial sample set to obtain a first sample set, wherein each sample in the first sample set corresponds to a task delivery strategy; A fragment splitting module, used for splitting the samples in the first sample set into fragments to obtain a second sample set; A sample cross-exchange and recombination module, used for performing sample cross-exchange and recombination on the fragments in the second sample set to obtain a third sample set; The task issuing module is used to calculate the optimal solution for the third sample set based on the simulated annealing algorithm, and issue the task according to the task issuing strategy of the sample corresponding to the optimal solution.
10. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for issuing tasks as described in any one of claims 1 to 8.
11. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the method for issuing tasks as described in any one of claims 1 to 8 when running.
12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for issuing tasks described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Signal processing method and device, equipment, storage medium and computer product
CN119469095A
Signal processing method, device, equipment, storage medium and computer product
CN119469095B
