Equipment deployment method and device, computer equipment and storage medium
By applying neural network prediction key parameters and iterative solution to quantum ant colony algorithm in device deployment, the problems of low efficiency and high labor cost in the existing technology are solved, and more efficient equipment deployment and cost reduction are achieved.
Patent Information
- Application Number
- CN202411534943.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art relies on manual design and calibration when deploying monitoring equipment, resulting in low efficiency and high labor cost. Especially in different environments in different construction sites, it requires a lot of design time to meet a higher recognition rate.
By establishing the device deployment optimization target, using preset neural networks to predict key parameters, and using them as the initial parameter value of the quantum ant colony algorithm, iteratively solves to obtain the global optimal device deployment solution.
It effectively improves the efficiency of equipment deployment, reduces labor costs, reduces design errors when sample data is limited, and can calculate the optimal equipment deployment plan for different parking lots and roads.
Smart Images

Figure CN119417042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment deployment, and in particular to an equipment deployment method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of smart cities, the number of urban population and vehicles is constantly expanding, so the importance of urban security monitoring is becoming increasingly prominent. Especially for parking lots and other areas, although monitoring equipment such as cameras have been widely used to automatically capture and identify vehicles and personnel, the deployment of monitoring equipment such as cameras currently relies mainly on manual drawing and design on existing project drawings, and then on-site construction personnel perform on-site deployment, adjustment and optimization.
[0003] Due to the different environments of different construction sites, the recognition range of monitoring equipment is limited, so a lot of design time is needed. In addition, to meet the requirements of construction sites with a good recognition rate, experienced implementation personnel are required to calibrate on site for a long time. However, the level of on-site construction personnel varies, and some construction personnel have limited skills, which requires constant adjustments by designers and construction personnel to complete the final deployment, resulting in low equipment deployment efficiency and high labor costs. Summary of the invention
[0004] Based on this, it is necessary to provide a device deployment method, apparatus, computer equipment and storage medium to address the above technical issues, so as to solve at least one problem existing in the above-mentioned prior art.
[0005] In a first aspect, in an embodiment of the present application, a device deployment method is provided, the method comprising the following steps:
[0006] Establish equipment deployment optimization goals and determine objective functions and constraints;
[0007] Based on the equipment deployment information of the deployed project, the key parameters are predicted through the preset neural network, and the key parameters are used as the initial parameter values of the quantum ant colony algorithm;
[0008] Iterate the quantum ant colony algorithm for a preset number of iterations, and calculate the objective function value corresponding to each device deployment solution that satisfies the constraint condition based on the objective function, so as to obtain a local optimal device deployment solution generated in each iteration process based on the objective function value;
[0009] The best solution is selected from all the local optimal device deployment solutions as the global optimal device deployment solution.
[0010] In a second aspect, a device deployment apparatus is provided, comprising:
[0011] An optimization target establishment unit is used to establish equipment deployment optimization targets and determine objective functions and constraints;
[0012] A key parameter prediction unit, used to predict key parameters based on the equipment deployment information of the deployed project through a preset neural network, and the key parameters are used as initial parameter values of the quantum ant colony algorithm;
[0013] A solving unit, configured to iterate the quantum ant colony algorithm for a preset number of iterations, perform feasibility determination on the device deployment scheme generated during each iteration by using the constraint conditions, and calculate the objective function value corresponding to each device deployment scheme satisfying the constraint conditions based on the objective function, so as to obtain a local optimal device deployment scheme generated during each iteration based on the objective function value;
[0014] The global optimal device deployment solution determining unit is used to select the optimal solution from all the local optimal device deployment solutions as the global optimal device deployment solution.
[0015] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, wherein the processor implements the device deployment method as described above when executing the computer-readable instructions.
[0016] In a fourth aspect, a readable storage medium is provided, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the device deployment method as described above is implemented.
[0017] The above-mentioned equipment deployment method, device, computer equipment and storage medium, the method implementation includes: establishing equipment deployment optimization goals, determining objective functions and constraints; based on the equipment deployment information of deployed projects, predicting key parameters through a preset neural network, and the key parameters are used as initial parameter values of the quantum ant colony algorithm; iterating the quantum ant colony algorithm for a preset number of iterations, and based on the objective function, calculating the objective function value corresponding to each equipment deployment scheme that meets the constraints, so as to obtain the local optimal equipment deployment scheme generated in each iteration process based on the objective function value; selecting the optimal solution from all the local optimal equipment deployment schemes as the global optimal equipment deployment scheme. In an embodiment of the present application, a neural network is trained by acquiring information such as a deployed project point map and a device recognition rate to obtain initial parameters of a quantum ant colony algorithm for solving the device deployment optimization goal, so as to iterate the quantum ant colony algorithm, and solve the optimal solution for device deployment based on the iteration result. By converting the device deployment problem into an optimization goal and combining the neural network with the quantum ant algorithm for solving it, the optimal equipment deployment solution can be calculated for each different parking lot road when sample data is limited and manual deployment design is prone to large errors, thereby effectively improving equipment deployment efficiency and reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 This is a schematic diagram of a process of a device deployment method in an embodiment of the present application. Figure 1 ;
[0020] Figure 2 This is a schematic diagram of an application environment of the recognition coverage range of a camera device in one embodiment of the present application;
[0021] Figure 3 This is a flow chart of a method for solving an optimization target in an embodiment of the present application;
[0022] Figure 4 This is a flow chart of a method for selecting a device deployment node in an embodiment of the present application;
[0023] Figure 5 This is a schematic diagram of a process of a device deployment method in an embodiment of the present application. Figure 2 ;
[0024] Figure 6It is a structural schematic diagram of a device deployment apparatus in one embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] In one embodiment, if Figure 1 As shown, a device deployment method is provided, comprising the following steps:
[0028] In step S110, the equipment deployment optimization goal is established, and the objective function and constraint conditions are determined;
[0029] In the embodiment of the present application, a parking lot is taken as an example to deploy monitoring equipment, such as camera equipment, in the parking lot. Assuming that the route information of several roads in the parking lot, the location coordinates and length of each road, and the coverage area of the camera equipment are known, the camera equipment is deployed along the road starting from any road intersection, and the coverage task of the camera equipment on all roads is completed, and the area of the road covered by a single camera equipment cannot exceed the coverage range of the camera equipment. For example, a coverage area of a camera equipment i is [e i ,l i ],e i is the shortest recognition distance allowed by camera device i, l i is the maximum recognition distance allowed by camera device i. The coverage area of the road by the camera device must be within [e i ,l i ] and is required to complete the deployment task with the least camera equipment and the highest average recognition rate.
[0030] The road coverage map of the camera device can be Figure 2 As shown in the figure, for the deployment problem of camera equipment, a directed graph corresponding to the area to be deployed can be generated, that is, a weighted graph, which can be recorded as G(V, E), where V = {1, 2, 3, Λ, n} is the vertex set, E is the edge set, and the weight between each point is c ij (c ij >0,c ii =∞,i,j∈V), the recognition rate of each camera device is D, and the recognition rate requirement of each device deployment point is d i (i∈V). iIndicates the closest recognition distance allowed by camera device i, sl i Indicates the maximum recognition distance allowed by camera device i, s i Indicates the actual recognition distance after the camera is deployed, that is, s i =sl i -se i ;s ij is the distance from camera i to camera j, and S is the entire distance of the road.
[0031] Then, the following variables can be obtained;
[0032]
[0033] Based on the above variables, the optimization goal of equipment deployment can be established, and its objective function can be expressed as:
[0034]
[0035] The objective function can be expressed as a solution set of device deployment nodes with the highest camera device recognition rate and the least number of camera devices.
[0036] The constraint problem of the above objective function can be expressed as:
[0037]
[0038] Among them, constraint (1) can be the recognition rate limit of the camera equipment. Here, it can be assumed that all cameras are the same and have the same recognition rate. Constraint (2) is used to ensure that each camera can only cover each road point at most twice. S is any subset of the vertex set V, and |S| is the number of vertices of the graph G contained in the set S. Therefore, for each possible S, constraint (5) means a set of constraints. Constraints (3)-(5) are used to jointly ensure the formation of a feasible circuit after the camera equipment covers. Constraint (6) can represent the condition for the existence of two adjacent recognition areas on a road. Constraint (7) can be a recognition distance constraint.
[0039] In step S120, based on the equipment deployment information of the deployed project, key parameters are predicted through a preset neural network, and the key parameters are used as initial parameter values of the quantum ant colony algorithm;
[0040] Among them, a better equipment deployment project can be selected from the deployed projects, and the corresponding equipment deployment information can be collected. The equipment deployment information can specifically include route information, equipment coordinate location, equipment quantity, equipment recognition rate, and recognition area information.
[0041] Optionally, the preset neural network can be iteratively trained based on a pre-constructed sample data set until all samples are trained, and the key parameters are determined by combining the training results obtained from each sample training. That is, a training sample set can be constructed based on the collected device deployment information, and the training samples can be labeled by manual labeling. The preset neural network is iteratively trained using the labeled training sample set, and after each iteration, the output result and the expected value can be used to calculate the loss, and the parameters of the preset neural network can be updated based on the loss value to select another sample for the next iteration. Until all samples are trained, the initial parameters of the quantum ant colony algorithm can be comprehensively calculated based on the results obtained after each sample training.
[0042] Optionally, the preset neural network can also be trained through the device deployment information of the deployed project. Then, the optimal deployment project can be selected from all deployed projects, and the device deployment information of the optimal deployment project can be obtained. Based on the device deployment information, the key parameters can be predicted by the trained preset neural network. It should be noted that the optimal deployment project can be determined manually and through actual use effects, and the optimal deployment project can be adjusted dynamically.
[0043] Among them, the preset neural network can be a feedback neural network, a feedforward Bible network or other neural networks.
[0044] Among them, the key parameter vector P = [α, β, ρ, Q, γ, λ, θ] T , α (α≥0) is the information heuristic factor, which indicates the relative importance of the trajectory. The larger its value, the more ants tend to choose the path with more ants passing through; β (β≥0) is the expected heuristic factor; γ (γ≥0) is the quantum bit heuristic factor, which indicates the relative importance of the quantum state probability amplitude of the point. The larger its value, the more ants tend to choose the point with more quantum information; λ (λ≥0) is the relative importance of the distance difference; θ (θ≥0) is the relative importance of the camera recognition rate, ρ indicates the trajectory persistence, Q indicates the pheromone amount, and T indicates the transpose.
[0045] Among them, α is between 1 and 2, β is between 1 and 3, ρ is in the range of 0.7 to 0.9, Q ≥ 10, γ is 1 to 3, and λ and θ are 1 to 2.
[0046] In step S130, the quantum ant colony algorithm is iterated for a preset number of iterations, and based on the objective function, the objective function value corresponding to each device deployment scheme that meets the constraint condition is calculated, so as to obtain the local optimal device deployment scheme generated in each iteration process based on the objective function value;
[0047] In the embodiment of the present application, the key parameters are used as the initial parameter values of the quantum ant colony algorithm to initialize the quantum ant colony algorithm, wherein the quantum population size can be n, the number of quantum bits is m, and the population in, is the jth individual in the population at the tth iteration,
[0048]
[0049] Where: |α i | 2 +|β i | 2 =1(i=1, 2,…, m).
[0050] Its pheromone is represented by quantum bits as p = (p1, p2, p3, ..., p n ), here, p j (j=1,2,Λ,n), initial number of iterations t=0, maximum number of iterations t max .
[0051] Then, each ant can be located at the initial device deployment node of the directed graph corresponding to the area to be deployed, and randomly select a candidate device deployment node, calculate the transition probability from the initial device deployment node to the candidate device node, and if the transition probability is greater than a random number between 0 and 1, the transfer can be performed. If not, the candidate device deployment node is reselected and the above steps are repeated until there is no candidate device deployment node, and the device deployment solution obtained by the ant during this traversal can be obtained. It can be understood that the initial device deployment node of each ant can be different or the same, and can be a randomly selected node.
[0052] It should be noted that in each iteration, each ant can obtain a device deployment plan based on the transition probability, that is, k device deployment plans can be obtained after one iteration.
[0053] After each iteration, after obtaining k device deployment solutions, all device deployment solutions can be screened according to the constraint conditions to obtain device deployment solutions that meet the constraint conditions, thereby determining the feasibility of the k device deployment solutions generated in each iteration. Then, the objective function value Z of each ant can be calculated through the objective function k (k=1, 2, ..., m), that is, each device deployment plan that meets the constraint condition and selects the device deployment plan that can achieve a higher recognition rate and a longer recognition distance among all objective function values as the local optimal device deployment plan obtained in this iteration process.
[0054] In step S140, the best solution is selected from all local optimal device deployment solutions as the global optimal device deployment solution.
[0055] In an embodiment of the present application, the local optimal device deployment plan obtained in each iteration can be compared with the local optimal device deployment plan obtained in the previous iteration or the local optimal device deployment plan saved in the previous iteration, and the device deployment plan with a higher recognition rate and a longer recognition distance is selected and saved. After the iteration is completed, the currently saved device deployment plan can be used as the global optimal device deployment plan.
[0056] In an embodiment of the present application, after obtaining the global optimal equipment deployment plan, it can be sent to the back-end management personnel. The back-end management personnel can manually review the global optimal equipment deployment plan based on the on-site environment, installation difficulty, etc. to determine whether it is feasible, whether there are defects, etc. If so, re-execute steps S120 to S140 to determine the global optimal equipment deployment plan again until it passes the manual review.
[0057] The embodiment of the present application provides a method for equipment deployment, including: establishing equipment deployment optimization goals, determining objective functions and constraints; based on the equipment deployment information of deployed projects, predicting key parameters through a preset neural network, and the key parameters are used as initial parameter values of a quantum ant colony algorithm; iterating the quantum ant colony algorithm for a preset number of iterations, and calculating the objective function value corresponding to each equipment deployment scheme that meets the constraints based on the objective function, so as to obtain the local optimal equipment deployment scheme generated in each iteration process based on the objective function value; selecting the optimal solution from all local optimal equipment deployment schemes as the global optimal equipment deployment scheme. In the embodiment of the present application, the neural network is trained by obtaining information such as the deployed project point map and the equipment recognition rate to obtain the optimal parameters of the quantum ant colony algorithm for solving the equipment deployment optimization goal, so as to iterate the quantum ant colony algorithm, and solve the optimal solution for equipment deployment based on the iteration results. By converting the equipment deployment problem into an optimization goal and combining the neural network with the quantum ant algorithm for solving it, the optimal equipment deployment point can be calculated for each different parking lot road when the sample data is limited and the manual deployment design is prone to large errors, effectively improving the equipment deployment efficiency and reducing labor costs.
[0058] In one embodiment of the present application, the quantum ant colony algorithm includes k ants, and the quantum ant colony algorithm is iterated for a preset number of iterations, including:
[0059] Based on the route information of the area to be deployed and the device coverage information, a device deployment directed graph is constructed, where the directed graph includes multiple device deployment nodes, and adjacent device deployment nodes are connected by edges;
[0060] In each iteration, each ant traverses the device deployment nodes through the transition probability to obtain k device deployment solutions generated in each iteration. The transition probability is used to determine the ant's transfer path.
[0061] After each iteration, the pheromone of the edge between each device deployment node is updated according to the trajectory strength update equation, and the quantum information of each device deployment node is updated through the quantum revolving door;
[0062] Based on the updated pheromone and quantum information, the next iteration is performed until the preset number of iterations is reached.
[0063] Optionally, determine the route information of several roads in the area to be deployed, such as a parking lot, the location coordinates and length of each road, and the coverage area of the camera equipment. Then, starting from any road intersection, start deploying camera equipment along the road and complete the coverage task of camera equipment on all roads. The area of road covered by a single camera equipment cannot exceed the coverage range of the camera equipment. For example, a camera equipment has a coverage area of [e i , l i ],e i is the shortest recognition distance allowed by camera device i, l i is the maximum recognition distance allowed by camera device i. The coverage area of the road by the camera device must be within [e i , l i ], and requires the deployment task to be completed with the least number of cameras and the highest average recognition rate. For the deployment problem of camera equipment, a corresponding directed graph, namely a weighted graph, can be generated, which can be recorded as G(V, E), where V = {1,2,3,Λ,n} is the vertex set, E is the edge set, and the weight between each point is c ij (c ij >0,c ii =∞,i,j∈V).
[0064] Each ant transfers the path based on the directed graph. After selecting the next device deployment node, it can calculate the transfer probability once and compare the transfer probability with a random number between 0 and 1. When the transfer probability is greater than the random number, the ant is transferred to the device deployment node, otherwise, the next device deployment node is reselected. When it is impossible to find a device deployment node j that meets the requirements, it means that the traversal is complete. At this time, all the selectable device deployment nodes of the ant can be placed in the pre-established solution set. At this time, the number of ants can be recorded as m←k (that is, the value of k is assigned to m), otherwise, k←k+1 (that is, the value of k+1 is assigned to k).
[0065] It should be noted that in each iteration, the pheromone of the edge between the device deployment nodes can be updated according to the estimated strength update equation. The trajectory strength update equation can be expressed as:
[0066]
[0067] Where ρ is the persistence of the trajectory (0≤ρ<1), is the number of pheromones per unit length trail left by ant k on the edge arc (i, j).
[0068] When performing local pheromone updates, since the amount of pheromone released each time is a constant, the more ants pass through the edge arc (i, j), the more times the local update will be performed, and the difference in the amount of pheromone between edges will also become larger and larger, which makes the algorithm easily fall into the local optimal solution. At the same time, the size of the Q value will also affect the search efficiency of the algorithm. When the Q value is too large, the algorithm is easy to converge to the local minimum, and when the Q value is too large, the convergence speed of the algorithm will slow down.
[0069] according to Different methods can form different types of ant algorithms. This application improves the Q value into a dynamic adjustment value and introduces the quantum state probability amplitude. When the j point collapses to the probability |β j | 2 The larger the value, the easier it is for point j to be selected by ants, and the smaller the Q value. This can prevent the excessive gap in the amount of pheromone between edges, thereby effectively preventing the algorithm from falling into the local optimum and improving the convergence speed. It is defined as:
[0070]
[0071] Wherein, Q is a constant (1≤Q≤10000).
[0072] Similarly, after each iteration, the quantum revolving gate can be used to update the quantum information of the device deployment node, and the quantum bit can also be expressed as the probability amplitude: is the phase of the quantum bit. The change of the quantum bit phase can be achieved by using a quantum rotating gate. The adjustment method of the quantum rotating gate can be defined as:
[0073]
[0074] i=1,2,Λ,m, is the probability amplitude of the ith qubit at the tth iteration, θ iis the rotation angle of the ith qubit. The amplitude of the rotation angle directly affects the convergence speed and search ability of the algorithm. If the amplitude is too large, it will lead to premature convergence. If the amplitude is too small, the convergence speed will be slowed down. Its value is generally between 0.001π and 0.05π. Its size and direction are based on the relationship θ i =Δθ i ·s(α i , β i ) to determine, s(α i , β i ) is the factor that determines θ i The sign function of the rotation direction, Δθ i is the size of the rotation angle, and its value is obtained by table lookup method, t←t+1, the number of iterations increases by 1, if the number of iterations t <t max , each ant will traverse the device deployment nodes and construct the device deployment plan again until the number of iterations reaches the maximum number of iterations.
[0075] See also Figure 3 In one embodiment of the present application, the directed graph includes a device deployment start node and a device deployment end node. During each iteration, each ant traverses the device deployment nodes by using the transition probability, including:
[0076] In step S210, each ant starts at the device deployment start node and selects the next transferable device deployment node according to the transfer probability until the ant moves to the device deployment end node;
[0077] In step S220, all device deployment nodes in each ant's moving path are recorded to obtain a device deployment solution constructed by each ant in each iteration process.
[0078] Optionally, a start node is selected in a pre-constructed directed graph, and k ants are placed at the start node. Each ant can randomly select the next device deployment node and calculate the corresponding transition probability. If the transition probability meets the transition condition, it is moved to the device deployment node, otherwise the next device deployment node is selected. This process continues until no node can be moved, indicating that the ant has moved to the end node. At this time, all device deployment nodes in the moving path of each ant recorded in the solution set can be determined to obtain the device deployment solution constructed by each ant in each iteration process, that is, k device deployment solutions can be obtained in each iteration process.
[0079] See also Figure 4 In one embodiment of the present application, each ant selects the next transferable device deployment node according to the transfer probability, including:
[0080] In step S310, the transition probability of the candidate device deployment node currently selected by each ant is calculated;
[0081] In step S320, it is determined whether the transition probability is greater than a preset threshold;
[0082] In step S330, if yes, the candidate device deployment node is used as the next transferable device deployment node;
[0083] In step S340 , if not, reselect a candidate device deployment node.
[0084] Optionally, each ant can randomly select the next device deployment node j and calculate the transition probability represents the transition probability of ant k, which can be specifically expressed as:
[0085]
[0086] Among them, l represents all possible values; τ ij is the trajectory strength of the edge arc (i, j); α (α ≥ 0) is the information heuristic factor, which indicates the relative importance of the trajectory. The larger its value, the more ants tend to choose the path with more ants passing through; γ (γ ≥ 0) is the quantum bit heuristic factor, which indicates the relative importance of the quantum state probability amplitude of the point. The larger its value, the more ants tend to choose the point with more quantum information. ij represents the distance difference between the ant’s arrival distance from point i to point j and the upper limit of the maximum recognition distance; λ (λ ≥ 0) is the relative importance of the distance difference; w ij represents the camera recognition rate at point j after the ant moves from point i to point j; θ (θ ≥ 0) is the relative importance of the camera recognition rate; μ j is the quantum information intensity of point j; η ij is the visibility of the edge arc (i, j), and its expression is:
[0087]
[0088] Among them, d ij is the distance between two adjacent points; β (β ≥ 0) is the expected heuristic factor, which indicates the relative importance of visibility. The larger its value, the more ants tend to choose a shorter path; μ j is the quantum information intensity of point j, and its expression is:
[0089]
[0090] Among them, |α j | 2 represents the probability that the quantum state of the jth qubit collapses to |0>, that is, for ant k, |α j | 2 The smaller μ is, the jThe bigger, the The bigger it is;
[0091] From the formula, we can see that when the trajectory intensity between i and j is greater, the distance is shorter, and the quantum information intensity of point j is greater, the proportion of their product will be greater, and therefore the probability of selecting point j will be greater.
[0092] It should be noted that in order to ensure that the number of deployed camera points covers the entire field and is as small as possible, nodes with higher recognition rates and longer recognition distances should be selected as much as possible.
[0093] like If random represents a random number, ant k moves to the device deployment node j of its choice and places the device deployment node j in the current solution set, otherwise, reselect the next device deployment node. If no device deployment node j that meets the requirements can be found and all points have been placed in the solution set, then record the number of ants m←k (that is, assign the value of k to m), otherwise, k←k+1 (that is, assign the value of k+1 to k).
[0094] In one embodiment of the present application, the optimal solution is selected from all local optimal device deployment solutions as the global optimal device deployment solution, including:
[0095] Compare the local optimal device deployment solution obtained in each iteration process with the local optimal device deployment solution obtained in the previous iteration process to obtain the current local optimal device deployment solution, and add it to the current best solution set, while deleting the local optimal device deployment solution generated in the previous iteration process saved in the best solution set;
[0096] When the iteration is completed, the local optimal device deployment solution retained in the best solution set is used as the global optimal device deployment solution.
[0097] Optionally, each ant can construct a device deployment plan in each iteration process, and then the objective function can be used to calculate the objective function value corresponding to all device deployment plans generated in each iteration process, and the local optimal device deployment plan generated in this iteration process can be determined based on the objective function value. The local optimal device deployment plan generated in this iteration process is compared with the local optimal device deployment plan obtained in the previous iteration process. In order to obtain the local optimal device deployment plan with the highest recognition rate and the least number of devices, it is retained in the best solution set, so that the best local optimal device deployment plan is always retained in the best solution set. When the iteration reaches the preset number of iterations, the local optimal device deployment plans generated in all iterations are compared and completed, and the local optimal device deployment plan finally retained can be used as the global optimal device deployment plan.
[0098] It should be noted that the local optimal device deployment solution obtained in the previous iteration process may be the local optimal device deployment solution finally retained in the previous iteration process or the local optimal device deployment solution generated after the previous iteration.
[0099] See also Figure 5 In one embodiment of the present application, based on the equipment deployment information of the deployed project, the key parameters are predicted by a preset neural network, including:
[0100] In step S410, a sample data set is constructed based on the device information of the deployed project, and the sample data set includes a plurality of training sample data;
[0101] In step S420, the training sample data are sequentially input into a preset neural network for training to obtain a training result corresponding to each training sample data;
[0102] In step S430, the training results corresponding to each training sample data are integrated to obtain key parameters;
[0103] The training sample data includes at least one of path information of a deployed area in a deployed project, device installation location information, device quantity information, device recognition rate, and device recognition area information.
[0104] Optionally, a sample data set can be constructed through the collected device deployment information, and the preset neural network can be iteratively trained based on the pre-constructed sample data set until all samples are trained, and the key parameters are determined by combining the training results obtained from each sample training. That is, each sample in the sample data set can be labeled by manual labeling. Then they are input into the preset neural network for iterative training until all samples are trained. Based on the training results of all samples, appropriate key parameters are selected as the initial parameter values of the quantum ant colony algorithm.
[0105] Optionally, for each key parameter obtained from sample training, it can be tried as the initial parameter value of the quantum ant colony algorithm, and the quantum ant colony algorithm is iterated to determine the global device deployment plan. By comparing the global device deployment plan finally obtained from different sample data, the optimal key parameters can be determined as the initial parameter value of the quantum ant colony algorithm.
[0106] Among them, the key parameter vector P = [α, β, ρ, Q, γ, λ, θ] T, (α≥0), is the information heuristic factor, which indicates the relative importance of the trajectory. The larger its value, the more ants tend to choose the path with more ants passing through; β (β≥0) is the expected heuristic factor; γ (γ≥0) is the quantum bit heuristic factor, which indicates the relative importance of the quantum state probability amplitude of the point. The larger its value, the more ants tend to choose the point with more quantum information; λ (λ≥0) is the relative importance of the distance difference; θ (θ≥0) is the relative importance of the camera recognition rate, ρ indicates the trajectory persistence, Q indicates the pheromone amount, and T indicates the transpose.
[0107] Among them, α is between 1 and 2, β is between 1 and 3, ρ is in the range of 0.7 to 0.9, Q ≥ 10, γ is 1 to 3, and λ and θ are 1 to 2.
[0108] It should be noted that the best equipment deployment plan can be selected from existing manually deployed projects, and then compared with the equipment deployment plan solved by the quantum ant colony algorithm. According to the comparison results, the key parameters can be adjusted. The adjusted key parameters can be input into the neural network as samples for training. When there is no deployed project, the key parameters obtained through training can be directly used as the key parameters of the quantum ant colony algorithm.
[0109] In one embodiment of the present application, the training sample data is sequentially input into a preset neural network for training, including:
[0110] Step a: Input the randomly selected training sample data into the preset neural network to obtain the actual output value output in this iterative training;
[0111] Step b: Based on the actual output value and the target expected value, the loss value of this iteration is calculated by using the preset loss function;
[0112] Step c: based on the loss value, updating the weight value of the preset neural network;
[0113] Repeat steps ac until all training sample data are trained.
[0114] Optionally, a training sample can be randomly selected from the sample training set, input into the preset neural network for training, and the actual output value can be output through the preset neural network. Then, the actual output value and the target expected value can be calculated according to the loss function, such as the cross entropy function, regularization, etc., and the parameters of the preset neural network can be updated based on the loss value, and then another training sample is selected again and input into the preset neural network again for the next iterative training. Until all samples are trained, the key parameters of the quantum ant colony algorithm can be comprehensively calculated based on the results obtained after each sample training. That is, the key parameters with the smallest loss value are selected from all training results as the initial parameter values of the quantum ant colony algorithm.
[0115] The preset neural network can be a feedforward neural network, a feedback neural network, etc. After the sample is input, the input s can be calculated through the intermediate layers of the preset neural network. j , and use s j The transfer function To calculate the output b of the intermediate layer unit j , where the output of the neural network can be expressed as After the calculation is completed, the output b in the hidden layer j , connection weight w j and threshold θ j Perform calculations to obtain the output l in each layer unit j , and use the transfer function to calculate the response value c of the unit node in the output layer of the neural network t , in the result c t After that, the target expected value and actual output value of the neural network can be used to calculate the loss value of the neural network, and then the weight can be adjusted based on the loss value.
[0116] Among them, the response value c t It means that the input is passed to the next layer of units by weighted summation, which can be expressed by the following formula:
[0117]
[0118] Among them, w i represents the connection weight between the ith processing unit and this processing unit, x i is the input of the ith neuron.
[0119] The loss value can be calculated by the following formula:
[0120]
[0121] Among them, E p is the sum of squares of all errors in the neural network, t pkis the expected output value in the neural network, o pk is the actual output value of the unit in the neural network.
[0122]
[0123] Among them, w ji is the weight between the ith input node and the jth node, represents differentiation, and h represents the hth neuron.
[0124] The weight can be adjusted by the following formula:
[0125]
[0126] where x pi is the input vector of the i-th hidden layer node in the neural network, δ pj When the output expectation in the neural network is t pj When , the output node loss value is obtained, that is, δ pj =t pj -o pj .
[0127] In an embodiment of the present application, a neural network is trained by acquiring information such as a deployed project point map and a device recognition rate to obtain the optimal parameters of a quantum ant colony algorithm for solving the device deployment optimization goal, so as to iterate the quantum ant colony algorithm, and solve the optimal solution for device deployment based on the iteration result. By converting the device deployment problem into an optimization goal and combining the neural network with the quantum ant algorithm for solving it, the optimal device deployment point can be calculated for each different parking lot road when sample data is limited and manual deployment design is prone to large errors, thereby effectively improving the efficiency of equipment deployment.
[0128] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0129] In one embodiment, a device deployment apparatus is provided, which corresponds one-to-one to the device deployment method in the above embodiment. Figure 6 As shown, the equipment deployment device includes an optimization target establishment unit 10, a key parameter prediction unit 20, a solution unit 30 and a global optimal equipment deployment solution determination unit 40. Each functional module is described in detail as follows:
[0130] The optimization target establishing unit 10 is used to establish the equipment deployment optimization target and determine the objective function and constraint conditions;
[0131] A key parameter prediction unit 20 is used to predict key parameters based on the equipment deployment information of the deployed project through a preset neural network, and the key parameters are used as initial parameter values of the quantum ant colony algorithm;
[0132] A solving unit 30 is used to iterate the quantum ant colony algorithm for a preset number of iterations, and based on the objective function, calculate the objective function value corresponding to each device deployment scheme that meets the constraint condition, so as to obtain a local optimal device deployment scheme generated in each iteration process based on the objective function value;
[0133] The global optimal device deployment solution determining unit 40 is used to select the optimal solution from all local optimal device deployment solutions as the global optimal device deployment solution.
[0134] In an embodiment of the present application, the ants include k, and the solving unit 30 is further used for:
[0135] Based on the route information of the area to be deployed and the device coverage information, a device deployment directed graph is constructed, where the directed graph includes multiple device deployment nodes, and adjacent device deployment nodes are connected by edges;
[0136] In each iteration, each ant traverses the device deployment nodes through the transition probability to obtain k device deployment solutions generated in each iteration. The transition probability is used to determine the ant's transfer path.
[0137] After each iteration, the pheromone of the edge between each device deployment node is updated according to the trajectory strength update equation, and the quantum information of each device deployment node is updated through the quantum revolving door;
[0138] Based on the updated pheromone and quantum information, the next iteration is performed until the preset number of iterations is reached.
[0139] In an embodiment of the present application, the directed graph includes a device deployment start node and a device deployment end node, and the solving unit 30 is further used to:
[0140] Each ant starts at the device deployment start node and selects the next device deployment node that can be transferred according to the transfer probability until the ant moves to the device deployment end node;
[0141] All equipment deployment nodes in each ant's moving path are recorded to obtain the equipment deployment plan constructed by each ant in each iteration.
[0142] In one embodiment of the present application, the solving unit 30 is further configured to:
[0143] Calculate the transfer probability of the candidate device deployment node currently selected by each ant;
[0144] Determine whether the transition probability is greater than a preset threshold;
[0145] If so, the candidate device deployment node is used as the next transferable device deployment node;
[0146] If not, reselect the candidate device deployment node.
[0147] In one embodiment of the present application, the global optimal device deployment solution determining unit 40 is further configured to:
[0148] Compare the local optimal device deployment solution obtained in this iteration process with the local device deployment solution obtained in the previous iteration process to obtain the current local optimal device deployment solution, add it to the best solution set, and delete the local optimal device deployment solution generated in the previous iteration process saved in the best solution set;
[0149] When the iteration is completed, the local optimal device deployment solution retained in the best solution set is used as the global optimal device deployment solution.
[0150] In one embodiment of the present application, the key parameter prediction unit 20 is further used for:
[0151] Based on the device information of the deployed project, a sample data set is constructed, where the sample data set includes multiple training sample data;
[0152] Input the training sample data into the preset neural network in sequence for training, and obtain the training results corresponding to each training sample data;
[0153] The key parameters are obtained by synthesizing the training results corresponding to each training sample data;
[0154] The training sample data includes at least one of the path information of the area to be deployed, the equipment installation location information, the equipment quantity information, the equipment recognition rate and the equipment recognition area information.
[0155] In one embodiment of the present application, the key parameter prediction unit 20 is further used for:
[0156] Step a: Select random training sample data and input it into the preset neural network to obtain the actual output value output in this iterative training;
[0157] Step b: Based on the actual output value and the target expected value, the loss value of this iteration is calculated by using the preset loss function;
[0158] Step c: based on the loss value, updating the weight value of the preset neural network;
[0159] Repeat steps ac until all training sample data are trained.
[0160] In an embodiment of the present application, a neural network is trained by acquiring information such as a deployed project point map and a device recognition rate to obtain the optimal parameters of a quantum ant colony algorithm for solving the device deployment optimization goal, so as to iterate the quantum ant colony algorithm, and solve the optimal solution for device deployment based on the iteration result. By converting the device deployment problem into an optimization goal and combining the neural network with the quantum ant algorithm for solving it, the optimal device deployment point can be calculated for each different parking lot road when sample data is limited and manual deployment design is prone to large errors, thereby effectively improving the efficiency of equipment deployment.
[0161] For the specific definition of the device deployment device, please refer to the definition of the device deployment method above, which will not be repeated here. Each module in the above-mentioned device deployment device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0162] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a device deployment method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0163] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and when the processor executes the computer-readable instructions, the steps of the above-mentioned device deployment method are implemented.
[0164] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the above-mentioned device deployment method are implemented.
[0165] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0166] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0167] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A device deployment method, characterized in that: The method comprises: Establish equipment deployment optimization goals and determine objective functions and constraints; Based on the equipment deployment information of the deployed project, the key parameters are predicted through the preset neural network, and the key parameters are used as the initial parameter values of the quantum ant colony algorithm; Iterate the quantum ant colony algorithm for a preset number of iterations, and calculate the objective function value corresponding to each device deployment solution that satisfies the constraint condition based on the objective function, so as to obtain a local optimal device deployment solution generated in each iteration process based on the objective function value; The best solution is selected from all the local optimal device deployment solutions as the global optimal device deployment solution.
2. The device deployment method according to claim 1, characterized in that: The quantum ant colony algorithm includes k ants, and iterating the quantum ant colony algorithm for a preset number of iterations includes: Based on the route information of the area to be deployed and the device coverage information, construct a device deployment directed graph, wherein the directed graph includes a plurality of the device deployment nodes, and adjacent device deployment nodes are connected by edges; During each iteration, each ant traverses the device deployment node through the transition probability to obtain k device deployment solutions generated during each iteration. The transition probability is used to determine the transfer path of the ant; After each iteration, the pheromone of the edge between each device deployment node is updated according to the trajectory strength update equation, and the quantum information of each device deployment node is updated through the quantum revolving door; Based on the updated pheromone and quantum information, the next iteration is performed until the preset number of iterations is reached.
3. The device deployment method according to claim 2, characterized in that: The directed graph includes a device deployment start node and a device deployment end node. During each iteration, each ant traverses the device deployment nodes by using a transition probability, including: Each ant starts at the device deployment start node and selects the next transferable device deployment node according to the transfer probability until the ant moves to the device deployment end node; All equipment deployment nodes in each ant's moving path are recorded to obtain the equipment deployment plan constructed by each ant in each iteration.
4. The device deployment method according to claim 3, characterized in that: Each ant selects the next transferable device deployment node according to the transfer probability, including: Calculate the transfer probability of the candidate device deployment node currently selected by each ant; Determining whether the transition probability is greater than a preset threshold; If yes, taking the candidate device deployment node as the next transferable device deployment node; If not, reselect the candidate device deployment node.
5. The device deployment method according to claim 1, characterized in that: The device deployment information based on the deployed project is used to predict key parameters through a preset neural network, including: Based on the device information of the deployed project, a sample data set is constructed, wherein the sample data set includes a plurality of training sample data; Inputting the training sample data into the preset neural network in sequence for training, and obtaining a training result corresponding to each training sample data; Combining the training results corresponding to each training sample data to obtain the key parameters; The training sample data includes at least one of path information of the area to be deployed, equipment installation location information, equipment quantity information, equipment recognition rate, and equipment recognition area information.
6. The device deployment method according to claim 5, characterized in that: The step of sequentially inputting the training sample data into the preset neural network for training includes: Step a: Select random training sample data and input them into the preset neural network to obtain the actual output value output in this iterative training; Step b: Based on the actual output value and the target expected value, the loss value of this iteration is calculated by a preset loss function; Step c: Based on the loss value, updating the weight value of the preset neural network; Repeat steps ac until all the training sample data are trained.
7. The device deployment method according to any one of claims 1 to 6, characterized in that: The selecting the best solution from all the local optimal device deployment solutions as the global optimal device deployment solution includes: Compare the local optimal device deployment solution obtained in this iteration process with the local device deployment solution obtained in the previous iteration process to obtain the current local optimal device deployment solution, and add it to the best solution set, while deleting the local optimal device deployment solution generated in the previous iteration process saved in the best solution set; When the iteration is completed, the local optimal device deployment solution retained in the best solution set is used as the global optimal device deployment solution.
8. A device deployment apparatus, characterized in that: The device comprises: An optimization target establishment unit is used to establish equipment deployment optimization targets and determine objective functions and constraints; A key parameter prediction unit, used to predict key parameters based on the equipment deployment information of the deployed project through a preset neural network, and the key parameters are used as initial parameter values of the quantum ant colony algorithm; A solving unit, configured to iterate the quantum ant colony algorithm for a preset number of iterations, and based on the objective function, calculate the objective function value corresponding to each device deployment scheme that satisfies the constraint condition, so as to obtain a local optimal device deployment scheme generated in each iteration process based on the objective function value; The global optimal device deployment solution determining unit is used to select the optimal solution from all the local optimal device deployment solutions as the global optimal device deployment solution.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, characterized in that: When the processor executes the computer-readable instructions, the device deployment method according to any one of claims 1 to 7 is implemented.
10. A readable storage medium having computer readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the device deployment method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Welding unit layout planning method and device, electronic equipment and storage medium
CN120597532A
Welding unit layout planning method and device, electronic equipment and storage medium
CN120597532B