A method for cloud user identity identification task allocation and parallel processing
By applying a multi-strategy parallel genetic algorithm based on reinforcement learning in mobile terminals, combined with the improved gray wolf optimization algorithm and K-means clustering algorithm, the problems of low facial recognition recognition rate in mobile terminals and low efficiency of identity recognition tasks in cloud computing environments are solved, and efficient and secure identity recognition is achieved.
Patent Information
- Application Number
- CN202210378320.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-04-12
AI Technical Summary
When the prior art realizes facial recognition in a mobile terminal, the recognition rate is low, making it difficult to prevent illegal users from stealing information. In the cloud computing environment, the allocation and parallel processing of identity recognition tasks are not efficient.
A multi-strategy parallel genetic algorithm based on reinforcement learning is proposed, combined with the improved gray wolf optimization algorithm and K-means clustering algorithm, for the allocation and parallel processing of identity recognition tasks. This method optimizes the allocation of tasks and edge servers through the improved gray wolf optimization algorithm, uses the K-means clustering algorithm to process face features in parallel, and combines the parameter self-learning strategies of Sarsa and Q-learning algorithms to improve identity recognition efficiency.
It improves the recognition rate and efficiency of face recognition in mobile terminals, enhances the protection ability of illegal users, optimizes the allocation and parallel processing of identity recognition tasks in cloud computing environments, and significantly improves the time and speed of identity recognition.
Smart Images

Figure CN115019359B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of edge computing cloud security, and in particular relates to an edge computing cloud user identity identification task allocation and parallel processing method. Background Art
[0002] Identity recognition technology is an effective solution generated by the process of confirming the identity of operators in computer networks. All information in the computer network world, including user identity information, is represented by a set of specific data. Computers can only recognize users' digital identities, and all authorizations to users are also authorizations for users' digital identities. How to ensure that the operator who operates with a digital identity is the legal owner of this digital identity, that is, to ensure that the operator's physical identity corresponds to the digital identity? Identity recognition technology is designed to solve this problem. As the first barrier to protect network assets, identity recognition technology plays a vital role.
[0003] Since its birth, cloud computing has developed rapidly due to its ease of use, convenience, and on-demand features, and has been widely used in all walks of life. With the rapid development of mobile technology and the rapid popularization of mobile devices, mobile smart devices can provide Internet access anytime and anywhere. The security issue of mobile cloud computing is the biggest obstacle to the large-scale use of mobile cloud computing. Once it involves access to mobile devices, this obstacle will become even greater. Mobile devices are easy to be stolen, and various information in them is very easy to obtain. Therefore, it is necessary to implement identity recognition technology on mobile terminals to ensure the security of information. Mobile terminal face identity authentication can be used in various fields. For example, John has memory loss and begins to find it difficult to recognize people he knew before. Using smart glasses, the glasses take a photo of the person facing John and whisper the person's name in John's ear. This cognitive assistance ability can help John continue to live a normal life. All of these illustrate the feasibility and importance of identity authentication in mobile terminals. In mobile terminals, more biometrics are used to implement identity authentication technology, among which face recognition has the advantage of being natural and not being detected by the individual being tested, and is studied more. The so-called naturalness means that the recognition method is the same as the biological characteristics used by humans for individual recognition; the unnoticeable feature is that face recognition completely uses light to obtain face image information, which is different from fingerprint recognition or iris recognition, which requires the use of electronic pressure sensors to collect fingerprints or infrared rays to collect iris images. This special collection method is easy to be detected by people, making it more likely to be deceived by disguise. Therefore, the key issue of face recognition is to improve the recognition rate to prevent illegal users from stealing information in mobile terminals. Summary of the invention
[0004] The present invention aims to solve the problems existing in the prior art, proposes a new identity recognition task allocation method, and in the identity recognition stage, proposes a multi-strategy parallel genetic algorithm based on reinforcement learning to improve the efficiency of identity recognition.
[0005] In view of this, the technical solution adopted by the present invention is as follows:
[0006] A method for allocating and parallelizing cloud user identity identification tasks includes the following steps:
[0007] S1, the mobile terminal uses a camera to collect face images, which are represented by triples (TS, AC, TM), where TS, AC, and TM represent the data volume of the task, the computing volume of the task, and the maximum tolerance time of the task respectively. The edge node is represented by a triple (C, S, P), where C, S, and P represent the computing power of the edge node, the total storage capacity of the edge node, and the network bandwidth of the edge node respectively.
[0008] S2, uses the improved grey wolf optimization algorithm to solve the identity recognition task and edge server allocation problem.
[0009] S3, performing image preprocessing and facial feature extraction on the original image acquired by the system.
[0010] S4, builds a parallel processing model and introduces secondary edge servers.
[0011] S5, using the parallel strategy of K-means clustering algorithm, clusters the features according to a certain attribute and evenly distributes them to each sub-feature to ensure that the similarity of individual attributes in each sub-feature is low, narrow the differences between sub-features, and increase the chance of obtaining the optimal solution to the problem.
[0012] S6, combines the parameter self-learning strategy based on Sarsa algorithm and Q-learning algorithm with the parallel strategy of genetic algorithm to achieve parallel processing of identity recognition tasks.
[0013] Furthermore, the improved gray wolf optimization algorithm described in step S2 is improved on the basis of the traditional gray wolf optimization algorithm in the following ways:
[0014] 1) Exponential law convergence factor adjustment strategy: Use the following formula to adjust the convergence factor b, b = 2e -t / T , t represents the current number of iterations, and T represents the set maximum number of iterations;
[0015] 2) Adaptive position update strategy: The distance weights between the current gray wolf individual and α, β, and δ are:
[0016]
[0017]
[0018]
[0019] Among them, ε is a constant, α, β, δ represent the hierarchy, α is the leader and decision maker, β and δ help α make decisions; X1, X2, X3 represent the moving distance of the gray wolf individual towards α, β, δ respectively;
[0020] Finally, the gray wolf's position update method is expressed as follows:
[0021]
[0022] represents the position of ω wolf after iteration;
[0023] 3) Prey judgment: The prey judgment process is added. The mathematical model for judging prey is as follows:
[0024] The process of judging prey requires the use of the intermediate vector J α ,J β ,J δ , and X α ,X β ,X δ Assign to J α ,J β ,J δ ;
[0025] J α =X α
[0026] J β =X β
[0027] J δ =X δ
[0028] J for each dimension α ,J β ,J δ The update formula is:
[0029]
[0030]
[0031]
[0032] in, represents the position value of the i-th dimension of the j-th ω wolf; J α ,J β ,J δ The i-th dimension of is replaced by Then compare J α and X α If J α X α The position of J α Assign the position of α Otherwise, X α No change; X β and X δ Repeat the same operation. represents the i-th dimension J α ,J β ,J δ The value of .
[0033] Furthermore, in step S4, a mathematical model of the parallel processing problem is constructed:
[0034] 1) Decision variables
[0035]
[0036] C k,j = Time required for the kth task on edge node j
[0037] k={1,2,…,n}, j={1,2,…,m}
[0038] 2) Optimization goals
[0039] minC max =C n,m
[0040] Among them C n,m represents the completion time of feature n being assigned from the primary server to the secondary edge server m; C max Indicates the maximum completion time.
[0041] 3) Constraints
[0042] It is guaranteed that a position can only be occupied by one task:
[0043]
[0044]
[0045] Controls the time it takes for the first and subsequent edge nodes to complete all assigned tasks:
[0046]
[0047]
[0048] Ensure that the previous sub-feature of the task has been completed and the assignment of the previous task to the edge node has also been completed:
[0049]
[0050] Guarantee of the value range of decision variables:
[0051] C k,j ≥0, k={1,2,...,n}, j={1,2,...,m}
[0052] X i,k ∈{0,1},j,k={1,2,...,n}
[0053] Where n represents the number of features, m represents the number of secondary edge servers; t i,j It represents the time required for task feature i to be assigned from the first-level edge node to the second-level edge node j.
[0054] Furthermore, the parallel strategy of the K-means clustering algorithm in step S5 includes:
[0055] 1) Define data: Initialize a randomly generated population of N, where each individual is a chromosome and is considered as a piece of data, forming a data set P of size N;
[0056] 2) Clustering: Use the original K-means clustering method to obtain the results and the category to which each individual belongs;
[0057] 3) Adjustment: Place each individual in the class to which they belong, so that {{C (1) , C (2) , ..., C (k)}}A total of k subclasses are placed in order, that is, the new data set = {{C (1) The data in C (2) The data in,...,C (k) The data in}}, thus forming a new population newP;
[0058] 4) Divide into subpopulations: In the adjusted population newP, it is divided into k subpopulations. The first subpopulation consists of {newP[1], newP[1+k], newP[1+2k], ..., newP[-k]}, and so on, for a total of k subpopulations.
[0059] Furthermore, the step S6 specifically is to use K-means to initialize the population, and then adopt different parameter strategies for different sub-populations. For sub-populations that meet the reinforcement learning conversion conditions, the parameter self-learning strategy of the Sarsa algorithm is used to achieve autonomous control and adaptation of parameters; for sub-populations that do not meet the conditions, the parameter self-learning strategy of Q-learning is adopted to achieve multi-strategy parallel computing.
[0060] Parameter self-learning strategy based on reinforcement learning: Crossover and mutation play an important role in the performance of genetic algorithms. The parameters of crossover and mutation operations are P c and P m If P c and P m When P is large, the more suitable individuals in the population are easily destroyed, which is not conducive to the convergence of the solution and the generation of the optimal solution. c and P m When P is small, it is difficult to generate new individuals. In traditional genetic algorithms, P c and P m It takes a lot of experiments to determine, which is very time-consuming. A self-learning genetic algorithm is designed to intelligently adjust the key parameters of the genetic algorithm based on RL, where P c and P m Not only based on the current state, but also based on past states and appropriate predictions of future states.
[0061] The main idea of the parameter self-learning strategy based on reinforcement learning is to regard the genetic algorithm as the environment, RL as the intelligent agent, parameter learning as their goal, and define their states and actions. A hybrid learning strategy is used for continuous trial and error learning, combining exploration and utilization strategies, and setting a reward mechanism in the learning process to encourage the intelligent agent to learn in the expected direction, thereby obtaining better parameters.
[0062] The present invention proposes a hybrid learning strategy combining Q-learning algorithm and Sarsa algorithm to improve the performance of genetic algorithm, and applies different reinforcement learning algorithms at different stages. The specific steps of the parameter self-learning strategy algorithm are as follows:
[0063] Step 1: Initialize the Q value table for each state-action;
[0064] Step 2: Get the current state S t , S←S t ;
[0065] Step 3: According to the transition conditions, use the Sarsa algorithm or Q-learning algorithm to select action a in the action set from state s;
[0066] Step 4: Execute action a;
[0067] Step 5: Obtain the reinforcement reward r based on the reward obtained by adjusting the crossover rate and the reward obtained by adjusting the mutation rate, and obtain the new state S t+1 ;
[0068] Step 6: If the termination state of the GA algorithm is reached, terminate the process, otherwise, continue to step 7;
[0069] Step 7: Update the Q value according to the Sarsa algorithm or Q-learning algorithm;
[0070] Step 8: Update the state S←S t+1
[0071] Step 9: Determine whether the conversion conditions are met. If so, convert the Sarsa algorithm to the Q-learning algorithm and go to step 2. Otherwise, go directly to step 2.
[0072] In the initial stage, the Sarsa algorithm is combined with the GA algorithm and the Q value is updated by the following formula.
[0073] Q(s t ,a t )←(1-α)Q(s t ,a t )+α(r t+1 +γQ(s t+1 ,a t+1 ))
[0074] In the formula, Q(s t ,a t ) is in the current state S t Take action a t Q value, r t+1 In state S t Execute action a t The reward value after, γ is the discount rate, Q(s t+1 ,a t+1 ) is in the current state S t+1 Take action a t+1 The Q value of , α is the learning rate.
[0075] If the following conversion conditions are met, the Sarsa algorithm is converted to the Q-learning algorithm. This conversion condition ensures that the Q-learning algorithm has sufficient learning experience or learning materials.
[0076]
[0077] Where N ti Indicates the current iteration number, Nts Indicates the total number of states, N ta Represents the total number of actions.
[0078] After the initial stage, the Q-learning algorithm replaces the Sarsa algorithm and is combined with the GA algorithm to update the Q value by the following formula.
[0079]
[0080] In the formula, Indicates that when state S t+1 Execute action a t+1 The highest Q value in the Q value table.
[0081] 1. State set: The purpose of parallel processing is to complete the task in the shortest time, that is, the fitness value of GA. In reinforcement learning, the state space should be constructed from many aspects, including: 1) the average fitness of the population 2) the diversity of the population 3) the best individual fitness.
[0082] The average fitness of the population obtained after normalization of the average fitness of the first generation population is calculated by the following formula:
[0083]
[0084] The population diversity obtained after normalization of the first generation population diversity is calculated by the following formula:
[0085]
[0086] The best individual fitness of the first generation population is normalized to obtain the best individual fitness:
[0087]
[0088] The population status value is calculated by weighting the average fitness of the population, the diversity of the population, and the fitness of the best individual:
[0089] S * =w1f * +w2d * +w3m *
[0090] In the formula, represents the fitness of the ith individual in the tth generation, represents the fitness of the i-th individual in the first generation, Indicates the fitness max of the jth individual in the first generation represents the best individual fitness of the tth generation, w1, w2, w3 are weight factors and w1+w2+w3=1. In this paper, population fitness and population diversity reflect the state of the population, which helps to improve the quality of the population and make it easier to obtain excellent individuals. Therefore, w1 and w2 are more important than w3.
[0091] 2. Action set: Each generation of agents will take different actions to obtain the appropriate P c and P m .P c The value of is generally 0.4 to 0.9 and the interval value of each action is 0.05. When the action is set to a1, P c ∈[0.4,0.45), and take a random value in this range; when the action is set to a2, P c ∈[0.45,0.5). The same method applies to P m , the value range is 0.01 to 0.21 and the interval value is 0.02. When the action is set to a2, P m ∈[0.01,0.03) and take a random value in this range, where a1 represents action 1 and a1 represents action 2.
[0092] 3. Reward method: In the hybrid learning strategy, the reward is determined by the best individual fitness and the average fitness of the population. The agent is not told which action to take, but tries which action can get a higher reward. This method is a positive reward. If the best individual fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P c is valid. If the average fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P m is effective.
[0093] Rewards from adjusting the crossover rate:
[0094]
[0095] Bonus for adjusting mutation rate:
[0096]
[0097] In the formula, represents the fitness of the i-th individual in the t-th generation.
[0098] 4. Action selection strategy: The action selection strategy of reinforcement learning is also called exploration strategy, which ensures the balance between exploration and utilization. Explore the unknown environment and use the acquired knowledge to guide the agent to choose actions. Initially, all Q values are 0, which means that the agent has no learning experience to use, and only exploration can be performed and learned.
[0099] The advantages and beneficial effects of the present invention are as follows:
[0100] 1. The present invention satisfies the problem of task and edge server allocation to a greater extent in the setting of identity recognition task allocation. In the process of identity recognition task allocation, an improved gray wolf optimization algorithm is used to construct a new identity recognition task allocation model, and then the comprehensive performance of the edge server is measured according to its computing, transmission and storage capabilities to determine the matching of the identity recognition task and the edge server.
[0101] 2. In the process of identity recognition, a parallel strategy combining the parameter self-learning strategy based on reinforcement learning and the genetic algorithm is proposed. Different sub-populations in parallel adopt different parameter selection strategies. First, the population is initialized using K-means, and then different parameter strategies are adopted for different sub-populations. For sub-populations that meet the reinforcement learning conversion conditions, the parameter self-learning strategy of the Sarsa algorithm is used to achieve autonomous control and adaptation of parameters; for sub-populations that do not meet the conditions, the parameter self-learning strategy of the Q-learning algorithm is adopted to achieve multi-strategy parallel computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0102] Figure 1 It is a schematic diagram of the model establishment of the present invention;
[0103] Figure 2 Assigning models to edge computing identity recognition tasks;
[0104] Figure 3 Parallel processing model for edge computing identity recognition. DETAILED DESCRIPTION
[0105] A method for allocating and parallelizing user identity identification tasks in edge computing clouds, such as Figure 1 As shown, the following steps are included:
[0106] S1, the mobile terminal uses the camera to obtain face images, and then the mobile terminal sends the collected face images as identity recognition tasks to the first-level edge server to build an identity recognition task allocation model; the mobile terminal uses the camera to collect face images, and the face images are represented by triples (TS, AC, TM), where TS, AC, and TM represent the data volume of the task, the computing volume of the task, and the maximum tolerance time of the task respectively. The edge node is represented by a triple (C, S, P), where C, S, and P represent the computing power of the edge node, the total storage capacity of the edge node, and the network bandwidth of the edge node respectively.
[0107] S2,constructs a model for the task allocation of identity recognition in edge computing, such as Figure 2The gray wolf optimization algorithm is improved and applied to solve the identity recognition task and edge server allocation problem.
[0108] S3, the edge server preprocesses and extracts features of facial images through face recognition algorithms. The original images obtained by the system are often not used directly due to various restrictions and random interference. They must be preprocessed with grayscale correction, noise filtering and other image preprocessing in the early stages of image processing; facial feature extraction is the process of feature modeling of the face.
[0109] S4, builds a parallel processing model, divides the edge server into primary servers and secondary servers, and introduces secondary edge servers, such as Figure 3 shown.
[0110] S5, using K-means clustering algorithm, clusters the features according to a certain attribute and evenly distributes them to each sub-feature to ensure that the similarity of individual attributes in each sub-feature is low, narrow the differences between sub-features, and increase the chance of obtaining the optimal solution to the problem.
[0111] S6, combines the parameter self-learning strategy based on Sarsa algorithm and Q-learning algorithm with the parallel strategy of genetic algorithm to achieve parallel processing of identity recognition tasks.
[0112] Furthermore, the identity recognition task allocation strategy based on the improved GWO algorithm in step S2 includes:
[0113] 1) Exponential law convergence factor adjustment strategy: Use the following formula to adjust the convergence factor b, b = 2e -t / T , t represents the current number of iterations, and T represents the set maximum number of iterations;
[0114] 2) Adaptive position update strategy: The distance weights between the current gray wolf individual and α, β, and δ are:
[0115]
[0116]
[0117]
[0118] Among them, ε is a constant, α, β, δ represent the hierarchy, α is the leader and decision maker, β and δ help α make decisions; X1, X2, X3 represent the moving distance of the gray wolf individual towards α, β, δ respectively;
[0119] Finally, the gray wolf's position update method is expressed as follows:
[0120]
[0121] represents the position of ω wolf after iteration;
[0122] 3) Prey judgment: The prey judgment process is added. The mathematical model for judging prey is as follows:
[0123] The process of judging prey requires the use of the intermediate vector J α ,J β ,J δ , and X α ,X β ,X δ Assign to J α ,J β ,J δ ;
[0124] J α =X α
[0125] J β =X β
[0126] J δ =X δ
[0127] J for each dimension α ,J β ,J δ The update formula is:
[0128]
[0129]
[0130]
[0131] in, represents the position value of the i-th dimension of the j-th ω wolf; J α ,J β ,J δ The i-th dimension of is replaced by Then compare J α and X α If J α X α The position of J α Assign the position of α Otherwise, X α No change; X β and X δ Repeat the same operation. represents the i-th dimension J α ,J β ,J δ The value of .
[0132] Furthermore, the parallel processing model in step S4 includes:
[0133] 1) Decision variables
[0134]
[0135] C k,j = Time required for the kth task on edge node j
[0136] k={1,2,...,n}, j={1,2,...,m}
[0137] 2) Optimization goals
[0138] minC max =C n,m
[0139] Among them C n,m represents the completion time of feature n being assigned from the primary server to the secondary edge server m; C max Indicates the maximum completion time.
[0140] 3) Constraints
[0141] It is guaranteed that a position can only be occupied by one task:
[0142]
[0143]
[0144] Controls the time it takes for the first and subsequent edge nodes to complete all assigned tasks:
[0145]
[0146]
[0147] Ensure that the previous sub-feature of the task has been completed and the assignment of the previous task to the edge node has also been completed:
[0148]
[0149] Guarantee of the value range of decision variables:
[0150] C k,j ≥0, k={1,2,...,n}, j={1,2,...,m}
[0151] X i,k ∈{0,1},j,k={1,2,...,n}
[0152] Where n represents the number of features, m represents the number of secondary edge servers; t i,j It represents the time required for task feature i to be assigned from the first-level edge node to the second-level edge node j.
[0153] Furthermore, the parallel strategy based on the K-means clustering algorithm in step S5 includes:
[0154] 1) Define data: Initialize a randomly generated population of N, where each individual is a chromosome and is considered as a piece of data, forming a data set P of size N;
[0155] 2) Clustering: Use the original K-means clustering method to obtain the results and the category to which each individual belongs;
[0156] 3) Adjustment: Place each individual in the class to which they belong, so that {{C (1) , C (2) , ..., C (k)}}A total of k subclasses are placed in order, that is, the new data set = {{C (1) The data in C (2) The data in,...,C (k) The data in}}, thus forming a new population newP;
[0157] 4) Divide into subpopulations: In the adjusted population newP, it is divided into k subpopulations. The first subpopulation consists of {newP[1], newP[1+k], newP[1+2k], ..., newP[-k]}, and so on, for a total of k subpopulations.
[0158] Furthermore, the parallel genetic algorithm based on reinforcement learning in step S6 includes:
[0159] Parameter self-learning strategy based on reinforcement learning: Crossover and mutation play an important role in the performance of genetic algorithms. The parameters of crossover and mutation operations are P c and P m If P c and P m When P is large, the more suitable individuals in the population are easily destroyed, which is not conducive to the convergence of the solution and the generation of the optimal solution. c and P m When P is small, it is difficult to generate new individuals. In traditional genetic algorithms, P c and P m It takes a lot of experiments to determine, which is very time-consuming. A self-learning genetic algorithm is designed to intelligently adjust the key parameters of the genetic algorithm based on RL, where P c and P mNot only based on the current state, but also based on past states and appropriate predictions of future states.
[0160] The main idea of the parameter self-learning strategy based on reinforcement learning is to regard the genetic algorithm as the environment, RL as the intelligent agent, parameter learning as their goal, and define their states and actions. A hybrid learning strategy is used for continuous trial and error learning, combining exploration and utilization strategies, and setting a reward mechanism in the learning process to encourage the intelligent agent to learn in the expected direction, thereby obtaining better parameters.
[0161] The present invention proposes a hybrid learning strategy combining Q-learning algorithm and Sarsa algorithm to improve the performance of genetic algorithm, and applies different reinforcement learning algorithms at different stages. The specific steps of the parameter self-learning strategy algorithm are as follows:
[0162] Step 1: Initialize the Q value table for each state-action;
[0163] Step 2: Get the current state S t , S←S t ;
[0164] Step 3: According to the transition conditions, use the Sarsa algorithm or Q-learning algorithm to select action a in the action set from state s;
[0165] Step 4: Execute action a;
[0166] Step 5: Obtain the reinforcement reward r based on the reward obtained by adjusting the crossover rate and the reward obtained by adjusting the mutation rate, and obtain the new state S t+1 ;
[0167] Step 6: If the termination state of the GA algorithm is reached, terminate the process, otherwise, continue to step 7;
[0168] Step 7: Update the Q value according to the Sarsa algorithm or Q-learning algorithm;
[0169] Step 8: Update the state S←S t+1
[0170] Step 9: Determine whether the conversion conditions are met. If so, convert the Sarsa algorithm to the Q-learning algorithm and go to step 2. Otherwise, go directly to step 2.
[0171] In the initial stage, the Sarsa algorithm is combined with the GA algorithm and the Q value is updated by the following formula.
[0172] Q(s t ,a t )←(1-α)Q(st ,a t )+α(r t+1 +γQ(s t+1 ,a t+1 ))
[0173] In the formula, Q(s t ,a t ) is in the current state S t Take action a t Q value, r t+1 In state S t Execute action a t The reward value after, γ is the discount rate, Q(s t+1 ,a t+1 ) is in the current state S t+1 Take action a t+1 The Q value of , α is the learning rate.
[0174] If the following conversion conditions are met, the Sarsa algorithm is converted to the Q-learning algorithm. This conversion condition ensures that the Q-learning algorithm has sufficient learning experience or learning materials.
[0175]
[0176] Where N ti Indicates the current iteration number, N ts Indicates the total number of states, N ta Represents the total number of actions.
[0177] After the initial stage, the Q-learning algorithm replaces the Sarsa algorithm and is combined with the GA algorithm to update the Q value by the following formula.
[0178]
[0179] In the formula, Indicates that when state S t+1 Execute action a t+1 The highest Q value in the Q value table.
[0180] 1. State set: The purpose of parallel processing is to complete the task in the shortest time, that is, the fitness value of GA. In reinforcement learning, the state space should be constructed from many aspects, including: 1) the average fitness of the population 2) the diversity of the population 3) the best individual fitness.
[0181] The average fitness of the population obtained after normalization of the average fitness of the first generation population is calculated by the following formula:
[0182]
[0183] The population diversity obtained after normalization of the first generation population diversity is calculated by the following formula:
[0184]
[0185] The best individual fitness of the first generation population is normalized to obtain the best individual fitness:
[0186]
[0187] The population status value is calculated by weighting the average fitness of the population, the diversity of the population, and the fitness of the best individual:
[0188] S * =w1f * +w2d * +w3m *
[0189] In the formula, represents the fitness of the ith individual in the tth generation, represents the fitness of the i-th individual in the first generation, Indicates the fitness max of the jth individual in the first generation represents the best individual fitness of the tth generation, w1, w2, w3 are weight factors and w1+w2+w3=1. In this paper, population fitness and population diversity reflect the state of the population, which helps to improve the quality of the population and make it easier to obtain excellent individuals. Therefore, w1 and w2 are more important than w3.
[0190] 2. Action set: Each generation of agents will take different actions to obtain the appropriate P c and P m .P c The value of is generally 0.4 to 0.9 and the interval value of each action is 0.05. When the action is set to a1, P c ∈[0.4,0.45), and take a random value in this range; when the action is set to a2, P c ∈[0.45,0.5). The same method applies to P m , the value range is 0.01 to 0.21 and the interval value is 0.02. When the action is set to a2, P m ∈[0.01,0.03) and take a random value in this range, where a1 represents action 1 and a1 represents action 2.
[0191] 3. Reward method: In the hybrid learning strategy, the reward is determined by the best individual fitness and the average fitness of the population. The agent is not told which action to take, but tries which action can get a higher reward. This method is a positive reward. If the best individual fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P c is valid. If the average fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P m is effective.
[0192] Rewards from adjusting the crossover rate:
[0193]
[0194] Bonus for adjusting mutation rate:
[0195]
[0196] In the formula, represents the fitness of the i-th individual in the t-th generation.
[0197] 4. Action selection strategy: The action selection strategy of reinforcement learning is also called exploration strategy, which ensures the balance between exploration and utilization. Explore the unknown environment and use the acquired knowledge to guide the agent to choose actions. Initially, all Q values are 0, which means that the agent has no learning experience to use, and only exploration can be performed and learned.
[0198] Combining the parameter self-learning strategy based on reinforcement learning with the parallel strategy based on K-means clustering, different sub-populations in parallel adopt different parameter selection strategies. First, the K-means algorithm is used to initialize the population, and then different parameter strategies are adopted for different sub-populations. For sub-populations that meet the reinforcement learning conversion conditions, the parameter self-learning strategy of the Sarsa algorithm is used to achieve autonomous control and adaptation of parameters; for sub-populations that do not meet the conditions, the parameter self-learning strategy of the Q-learning algorithm is used to achieve multi-strategy parallel computing.
[0199] The cloud user identity recognition task allocation and parallel processing method in edge computing can not only determine the matching problem between the identity recognition task and the edge server, but also proposes a multi-strategy parallel genetic algorithm based on reinforcement learning in the identity recognition stage, which makes the feature matching process shorter and faster, thereby improving the time and speed of identity recognition.
[0200] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0201] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for allocating and parallelizing cloud user identity identification tasks, characterized in that: The following steps are involved: S1, the mobile terminal uses a camera to collect face images, which are represented by triples (TS, AC, TM), where TS, AC, and TM represent the data volume of the task, the computing volume of the task, and the maximum tolerance time of the task respectively. The edge node is represented by a triple (C, S, P), where C, S, and P represent the computing power of the edge node, the total storage capacity of the edge node, and the network bandwidth of the edge node respectively; S2, using an improved gray wolf optimization algorithm to solve the identity recognition task and edge server allocation problem; the improved gray wolf optimization algorithm is improved on the basis of the traditional gray wolf optimization algorithm as follows: 1) Exponential law convergence factor adjustment strategy: Use the following formula to adjust the convergence factor b, b = 2e -t / T , t represents the current number of iterations, and T represents the set maximum number of iterations; 2) Adaptive position update strategy: The distance weights between the current gray wolf individual and α, β, and δ are: Among them, ε is a constant, α, β, δ represent the hierarchy, α is the leader and decision maker, β and δ help α make decisions; X1, X2, X3 represent the moving distance of the gray wolf individual towards α, β, δ respectively; Finally, the gray wolf's position update method is expressed as follows: represents the position of ω wolf after iteration; 3) Prey judgment: The prey judgment process is added. The mathematical model for judging prey is as follows: The process of judging prey requires the use of the intermediate vector J α ,J β ,J δ , and X α ,X β ,X δ Assign to J α ,J β ,J δ ; I α =X α I β =X β I δ =X δ J for each dimension α ,J β ,J δ The update formula is: in, represents the position value of the i-th dimension of the j-th ω wolf; J α ,J β ,J δ The i-th dimension of is replaced by Then compare J α and X α If J α X α The position of J α Assign the position of α Otherwise, X α No change; X β and X δ Repeat the same operation. represents the i-th dimension J α ,J β ,J δ The value of S3, performing image preprocessing and facial feature extraction on the original image acquired by the system; S4, builds a parallel processing model and introduces secondary edge servers; Constructing a mathematical model of the parallel processing problem: 1) Decision variables C k,j = Time required for the kth task on edge node j k={1,2,...,n}, j={1,2,...,m} 2) Optimization goals my C max =C n,m Among them C n,m represents the completion time of feature n being distributed from the primary server to the secondary edge server m; C max Indicates the maximum completion time; 3) Constraints It is guaranteed that a position can only be occupied by one task: Controls the time it takes for the first and subsequent edge nodes to complete all assigned tasks: Ensure that the previous sub-feature of the task has been completed and the assignment of the previous task to the edge node has also been completed: Guarantee of the value range of decision variables: C k,j ≥0,k={1,2,...,n},j={1,2,...,m} X i,k ∈{0,1},j,k={1,2,…,n} Where n represents the number of features, m represents the number of secondary edge servers; t i,j It represents the time required for task feature i to be assigned to secondary edge node j from the primary edge node; S5, using the K-means clustering algorithm parallel strategy, clustering the features according to a certain attribute, and evenly distributing them to each sub-feature, so as to ensure that the similarity of individual attributes in each sub-feature is low, reduce the difference between each sub-feature, and increase the chance of obtaining the optimal solution to the problem; the K-means clustering algorithm parallel strategy includes: 1) Define data: Initialize a randomly generated population of N, where each individual is a chromosome and is considered as a piece of data, forming a data set P of size N; 2) Clustering: Use the original K-means clustering method to obtain the results and the category to which each individual belongs; 3) Adjustment: Place each individual in the class to which they belong, so that {{C (1) , C (2) , ..., C (k) }}A total of k subclasses are placed in order, that is, the new data set = {{C (1) The data in C (2) The data in,...,C (k) The data in}}, thus forming a new population newP; 4) Divide into subpopulations: In the adjusted population newP, divide it into k subpopulations. The first subpopulation consists of {newP[1], newP[1+k], newP[1+2k], ..., newP[-k]}, and so on, a total of k subpopulations; S6, combines the parameter self-learning strategy based on Sarsa algorithm and Q-learning algorithm with the parallel strategy of genetic algorithm to realize parallel processing of identity recognition tasks; after initializing the population with K-means, different parameter strategies are adopted for different sub-populations. For sub-populations that meet the reinforcement learning conversion conditions, the parameter self-learning strategy of Sarsa algorithm is used to realize autonomous control and adaptation of parameters; for sub-populations that do not meet the conditions, the parameter self-learning strategy of Q-learning is adopted to realize multi-strategy parallel computing; Combining the hybrid learning strategy of Q-learning algorithm and Sarsa algorithm, different reinforcement learning algorithms are applied at different stages. The specific steps are as follows: Step 1: Initialize the Q value table for each state-action; Step 2: Get the current state S t , S←S t ; Step 3: According to the transition conditions, use the Sarsa algorithm or Q-learning algorithm to select action a in the action set from state s; Step 4: Execute action a; Step 5: Obtain the reinforcement reward r based on the reward obtained by adjusting the crossover rate and the reward obtained by adjusting the mutation rate, and obtain the new state S t+1 ; Step 6: If the termination state of the GA algorithm is reached, terminate the process, otherwise, continue to step 7; Step 7: Update the Q value according to the Sarsa algorithm or Q-learning algorithm; Step 8: Update the state S←S t+1 Step 9: Determine whether the conversion conditions are met. If so, convert the Sarsa algorithm to the Q-learning algorithm and go to Step 2. Otherwise, go directly to Step 2. In the initial stage, the Sarsa algorithm is combined with the GA algorithm and the Q value is updated by the following formula; Q(s t ,a t )←(1-α)Q(s t ,a t )+α(r t+1 +γQ(s t+1 ,a t+1 )) In the formula, Q(s t ,a t ) is in the current state S t Take action a t Q value, r t+1 In state S t Execute action a t The reward value after, γ is the discount rate, Q(s t+1 ,a t+1 ) is in the current state S t+1 Take action a t+1 The Q value of , α is the learning rate; If the following conversion conditions are met, the Sarsa algorithm is converted to the Q-learning algorithm; Where N ti Indicates the current iteration number, N ts Indicates the total number of states, N ta represents the total number of actions; RL represents the reinforcement learning algorithm; After the initial stage, the Q-learning algorithm replaces the Sarsa algorithm and is combined with the GA algorithm to update the Q value by the following formula; In the formula, Indicates that when state S t+1 Execute action a t+1 The highest Q value in the Q value table; 1. State set: constructed from the following three aspects, including: 1) the average fitness of the population, 2) the diversity of the population, and 3) the best individual fitness; The average fitness of the population obtained after normalization of the average fitness of the first generation population is calculated by the following formula: The population diversity obtained after normalization of the first generation population diversity is calculated by the following formula: The best individual fitness of the first generation population is normalized to obtain the best individual fitness: The population status value is calculated by weighting the average fitness of the population, the diversity of the population, and the fitness of the best individual: S * =w1f * +w2d * +w3m * In the formula, represents the fitness of the ith individual in the tth generation, represents the fitness of the i-th individual in the first generation, represents the fitness of the jth individual in the first generation, represents the best individual fitness of the tth generation, w1, w2, w3 are weight factors and w1+w2+w3=1; 2. Action set: Each generation of agents will take different actions to obtain the appropriate P c and P m , when the action is set to a1, P c ∈[0.4,0.45, and take a random value in this range; when the action is set to a2, P c ∈[0.45,0.5, when the action is set to a2, P m ∈[0.01,0.03) and take a random value in this range, where a1 represents action 1 and a1 represents action 2; 3. Reward method: If the best individual fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P c is valid, if the average fitness of the tth generation is better than that of the t-1th generation, then the agent gets a reward and the current P m is effective; Rewards from adjusting the crossover rate: Bonus for adjusting mutation rate: In the formula, represents the fitness of the i-th individual in the t-th generation; 4. Action selection strategy: Explore the unknown environment and use the acquired knowledge to guide the agent to choose actions. Initially, all Q values are 0, which means that the agent has no learning experience to use and only exploration can be performed and learned.
Citation Information
Patent Citations
Permanent magnet synchronous motor parameter recognition method based on improved grey wolf optimization algorithm
CN112861427A
Residential power data clustering method and device based on grey wolf optimization GHFCM
CN113688960A