Interest point recommendation method based on simulated annealing particle swarm optimization algorithm
Through the simulation annealed particle swarm algorithm, the problem of time-consuming recommendation of points of interest and local optimal solutions is solved, and efficient and accurate recommendation of points of interest is achieved. Combined with simulated annealing and particle swarm optimization methods, it quickly converges to the global optimal solution.
Patent Information
- Application Number
- CN202011298454.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-19
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-11-19
AI Technical Summary
In the prior art, the recommendation of point of interest is problematic that it takes a long time and cannot consider multiple factors at the same time, and the particle swarm optimization algorithm is prone to fall into the local optimal solution, which reduces the accuracy of the recommendation.
Adopt the point of interest recommendation method based on the simulated annealing particle swarm algorithm. By generating attribute information list, establishing the optimization solution algorithm objective function, initializing the particle swarm and setting simulated annealing parameters, the simulated annealing algorithm iteratively updates the particle swarm, combining the self-learning rate and The population learning rate updates the particle position and quickly converges to the global optimal solution.
It realizes efficient recommendation of points of interest while comprehensively considering the influencing factors of multiple independent variables, improves the accuracy and efficiency of recommendations, and avoids the fall of local optimal solutions.
Smart Images

Figure CN114519135B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of automobile cockpit interest recommendation, and in particular to a method for recommending points of interest based on a simulated annealing particle swarm algorithm. Background Art
[0002] The issue of POI recommendation is an important research issue in smart cockpits. The optimized recommendation products of POI directly improve the comfort and experience of driving users. This issue is also one of the research hotspots in academia, integrating computer science, operations research, optimization science and other disciplines. It is closely related to urban path planning, navigation planning, traffic scheduling, traffic flow control and other issues in smart cities.
[0003] The current POI recommendation products still mainly consider user evaluation information, and use big data recommendation algorithms to rank and recommend in combination with user portraits. The main recommendation algorithms include collaborative filtering recommendation algorithms based on user information and item information, regression algorithms, etc., but these recommendation algorithms need to be based on the accumulation of user portrait data of more than one million orders of magnitude, and need to be combined with offline data training models. The computing power required for online real-time recommendations is also relatively high. In addition, the current algorithms are not convenient for comprehensively considering various influencing factors such as mileage distance, evaluation information, all road information, user preference information, and POI information. Therefore, the use of big data to recommend POIs has the disadvantages of being time-consuming and unable to consider multiple factors at the same time.
[0004] In order to solve the above problems of big data recommendation algorithms, heuristic intelligent algorithms such as particle swarm optimization and genetic algorithms are widely used in fast solutions for multi-objective optimization recommendation. Among them, particle swarm optimization is widely used in engineering due to its strong robustness. However, particle swarm optimization is prone to fall into local optimal solutions, which will reduce the accuracy of POI recommendation. Summary of the invention
[0005] The purpose of the present invention is to solve the problems in the prior art that the recommendation of points of interest using big data is time-consuming and cannot consider multiple factors at the same time, and the particle swarm optimization algorithm is prone to fall into a local optimal solution, which will reduce the accuracy of the recommendation of points of interest.
[0006] To solve the above problems, an embodiment of the present invention discloses a method for recommending points of interest based on a simulated annealing particle swarm algorithm, comprising the following steps:
[0007] S1: Generate attribute information lists corresponding to each type of interest point set according to the type of interest point preselected by the user and the influencing factors of the type of interest point; wherein each attribute information list includes the number of each interest point in the corresponding type of interest point set and the influencing factors of the interest point;
[0008] S2: Establish the expression of the objective function of the optimization solution algorithm for all types of interest point sets;
[0009] S3: establishing an initial particle swarm for all types of interest point sets, and setting initial particle swarm parameters of the simulated annealing particle swarm algorithm for the initial particle swarm; wherein the initial particle swarm parameters include the number of particles in the initial particle swarm, the preset number of iteration steps of the initial particle swarm, and the dimension of each particle in the initial particle swarm, and the dimension of each particle in the initial particle swarm corresponds to the number of interest point types preselected by the user;
[0010] S4: Calculate and record the initial objective function value of each particle in the initial particle swarm and its corresponding particle position, as well as the historical optimal value of the group objective function of the initial particle swarm and its corresponding particle position according to the expression of the objective function of the optimization solution algorithm;
[0011] S5: setting annealing algorithm parameters of the simulated annealing particle swarm algorithm, and iteratively updating each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters;
[0012] S6: Calculate and record the historical optimal value of the objective function of each particle and its corresponding particle position in each generation of particle swarm after iterative update according to the expression of the objective function of the optimization solution algorithm, as well as the historical optimal value of the group objective function of each generation of particle swarm after iterative update and its corresponding particle position; when the number of iteration steps of the updated particle swarm is equal to the preset number of iteration steps, end the update;
[0013] S7: Output the particle corresponding to the historical optimal value of the group objective function of the particle swarm, and use it as the recommended point of interest.
[0014] Compared with the traditional recommendation algorithm based on big data, this solution solves the problem of personalized recommendation of points of interest by combining simulated annealing algorithm with particle swarm optimization, and realizes efficient recommendation of points of interest under the premise of comprehensive consideration of multiple independent variables. In the iterative process of particle swarm optimization solution, the idea of simulated annealing algorithm is used, and the annealing temperature is gradually reduced, so that the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm.
[0015] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, step S1 includes:
[0016] S11: Establishing a list of points of interest according to the types of points of interest preselected by the user; wherein each type of point of interest includes at least one point of interest;
[0017] S12: Obtaining influencing factors of interest point types;
[0018] S13: acquiring attribute information of a set of points of interest of a corresponding type according to the influencing factors of each type of point of interest, and generating a list of attribute information;
[0019] In step S12, the method for obtaining the influencing factors of the user's pre-selected point of interest type includes:
[0020] Get the influencing factors of the user's preset point of interest type, or
[0021] Gets the influencing factors of the default POI type.
[0022] With the above solution, users can pre-select the types of points of interest that need to be traversed according to actual needs, build the entire path, and then sort out the factors that affect the types of points of interest preset by users. This effectively realizes personalized point of interest recommendation by comprehensively considering multiple influencing factors.
[0023] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, step S2 includes:
[0024] S21: according to the influencing factors of each type of interest point, respectively establish a sub-function expression corresponding to each influencing factor for each type of interest point;
[0025] S22: performing a sum operation on the sub-function expressions of all types of interest point sets to establish an expression of the objective function of the optimization solution algorithm.
[0026] According to another specific embodiment of the present invention, in the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, step S2 further includes:
[0027] S23: setting constraint conditions for various influencing factors of the POI type; wherein the constraint conditions include equality conditions and inequality conditions.
[0028] By adopting the above solution, by setting constraints on various influencing factors, the needs of users can be considered as much as possible, so that points of interest can be recommended more accurately.
[0029] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, establishing an initial particle swarm for all types of points of interest sets includes:
[0030] S31: Initialize particles in the initial particle group and set boundary conditions for the particles in the initial particle group;
[0031] S32: Initializing the initial velocity vector of the particles in the initial particle group; wherein the initial velocity vector is 0.5 to 0.7 times the initial value of the particle.
[0032] According to another specific embodiment of the present invention, in the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, step S3 further includes:
[0033] The number of initial particles in the initial particle swarm and the preset number of iteration steps of the initial particle swarm are determined according to the calculation principle of the shortest time required for convergence.
[0034] In this embodiment, the number of initial particles of the initial particle swarm and the preset number of iteration steps of the initial particle swarm are determined according to the calculation principle of the shortest time required for convergence, which can improve the efficiency of the algorithm.
[0035] According to another specific embodiment of the present invention, in the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, in step S5, the annealing algorithm parameters include an initial annealing temperature, and the initial annealing temperature is and,
[0036] Setting the annealing algorithm parameters of the simulated annealing particle swarm algorithm, and iteratively updating each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters includes:
[0037] S51: Calculate the mutation probability of each particle according to the exponential probability formula, the current annealing temperature, the historical optimal value of the objective function of each particle, and the historical optimal value of the group objective function of the particle swarm; wherein the mutation probability is the degree of approximation between the historical optimal value of the objective function of each particle and the historical optimal value of the group objective function of the particle swarm;
[0038] S52: According to the distribution of mutation probability, the roulette algorithm is used to determine the optimal particle in the contemporary particle swarm;
[0039] S53: According to the self-learning rate, the group learning rate, the speed and the speed inertia weight coefficient, and the random rate between 0 and 1, each particle in the iteratively updated particle swarm of each generation moves to the particle position corresponding to the historical optimal value of the objective function of each particle and the optimal particle position in the contemporary particle swarm, so as to update each particle in the particle swarm of each generation.
[0040] By adopting the above scheme, in the iterative process of particle swarm optimization solution, a certain random probability is introduced by using the idea of simulated annealing algorithm. With the gradual decrease of annealing temperature, the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm.
[0041] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention has an exponential probability formula as follows:
[0042] Where p is the historical optimal value of the objective function of each particle; Gbest is the historical optimal value of the group objective function of the particle swarm; and
[0043] Update each particle in each particle group according to the following formula:
[0044] V k+1 =C 0 *V k +C 1 *rand*(Y k -X k )+C 2 *rand*(Pg plus -X k )
[0045] X k+1 =X k +V k+1
[0046] Wherein, the subscript k+1 indicates the current iteration step number; V is the velocity vector of the particle; X is the current particle position; Y is the particle position corresponding to the historical optimal value of the objective function of the current particle; Pg plus It is the best particle in the current particle swarm determined by the roulette algorithm under the current iteration number; C 0 is the speed inertia weight coefficient; C 1 is the self-learning rate of the particle; C 2 is the group learning rate of particles.
[0047] By adopting the above scheme, the self-learning rate of the particles, the group learning rate of the particles, the speed inertia weight coefficient, etc. are comprehensively considered in the process of updating the particle swarm, so that the updated particle swarm can quickly move to its own historical optimal value and the optimal particle of the swarm.
[0048] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, after step S5, further includes the following steps:
[0049] S5': Determine whether the dimension value of each particle exceeds the boundary condition;
[0050] If so, the particles that exceed the boundary conditions are returned to the boundary conditions;
[0051] If not, execute step S6.
[0052] By adopting the above scheme, the dimension of each particle in each updated particle group is judged, and particles that do not meet the conditions can be quickly screened out, making the calculation efficiency of the algorithm higher.
[0053] According to another specific embodiment of the present invention, the method for recommending points of interest based on simulated annealing particle swarm algorithm disclosed in the embodiment of the present invention, after step S6, further includes:
[0054] S6': updating the annealing temperature according to the preset proportional coefficient; and updating the annealing temperature according to the following formula: T = T*lamda, wherein T is the annealing temperature, lamda is the preset proportional coefficient, and the range of the preset proportional coefficient is a random number between 0 and 1;
[0055] S6”: Determine whether it is equal to the preset number of iteration steps;
[0056] If yes, the iteration ends and S7 is executed;
[0057] If not, enter the next iteration.
[0058] By adopting the above scheme, the annealing temperature is updated according to the preset proportional coefficient, and as the annealing temperature gradually decreases, the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm.
[0059] The beneficial effects of the present invention are:
[0060] By adopting the above scheme, compared with the traditional recommendation algorithm based on big data, this scheme solves the problem of personalized recommendation of points of interest by combining the simulated annealing algorithm with the particle swarm optimization method, and realizes efficient recommendation of points of interest under the premise of comprehensive consideration of the influencing factors of multiple independent variables. Furthermore, in the iterative process of particle swarm optimization solution, a certain random probability is introduced by using the idea of simulated annealing algorithm, accompanied by updating the annealing temperature according to the preset proportional coefficient, so that the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0062] Figure 2 is another flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0063] Figure 3 is another flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0064] Figure 4 is another flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0065] Figure 5is another flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0066] Figure 6 is another flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention;
[0067] Figure 7 is a schematic diagram of an algorithm convergence curve in a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided in an embodiment of the present invention;
[0068] Figure 8 is a schematic diagram of recommending points of interest in a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided in an embodiment of the present invention;
[0069] Fig. 9 It is a schematic diagram of a list of attribute information corresponding to each type of interest point set in the interest point recommendation method based on simulated annealing particle swarm algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0070] The following specific embodiments illustrate the implementation of the present invention, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may extend based on the claims of the present invention. In order to provide a deep understanding of the present invention, the following description will include many specific details. The present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0071] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0072] In the description of this embodiment, it should be noted that the terms "upper", "lower", "inner", "bottom", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or are the orientations or positional relationships in which the inventive product is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0073] The terms “first”, “second”, etc. are only used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0074] In the description of this embodiment, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.
[0075] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0076] In order to solve the shortcomings of the prior art of using big data to recommend points of interest, which is time-consuming and cannot consider multiple factors at the same time, and the particle swarm optimization algorithm is prone to fall into a local optimal solution, which will reduce the accuracy of the point of interest recommendation, this embodiment provides a point of interest recommendation method based on simulated annealing particle swarm algorithm. Specifically, refer to Figure 1 The flowchart of the method for recommending points of interest based on the simulated annealing particle swarm algorithm provided by an embodiment of the present invention is shown. The method for recommending points of interest based on the simulated annealing particle swarm algorithm provided by this embodiment specifically includes the following steps:
[0077] S1: Generate attribute information lists corresponding to each type of interest point set according to the type of interest point preselected by the user and the influencing factors of the type of interest point; wherein each attribute information list includes the number of each interest point in the corresponding type of interest point set and the influencing factors of the interest point;
[0078] S2: Establish the expression of the objective function of the optimization solution algorithm for all types of interest point sets;
[0079] S3: establishing an initial particle swarm for all types of interest point sets, and setting initial particle swarm parameters of the simulated annealing particle swarm algorithm for the initial particle swarm; wherein the initial particle swarm parameters include the number of particles in the initial particle swarm, the preset number of iteration steps of the initial particle swarm, and the dimension of each particle in the initial particle swarm, and the dimension of each particle in the initial particle swarm corresponds to the number of interest point types preselected by the user;
[0080] S4: Calculate and record the initial objective function value of each particle in the initial particle swarm and its corresponding particle position, as well as the historical optimal value of the group objective function of the initial particle swarm and its corresponding particle position according to the expression of the objective function of the optimization solution algorithm;
[0081] S5: setting algorithm parameters of the simulated annealing particle swarm algorithm, and iteratively updating each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters;
[0082] S6: Calculate and record the historical optimal value of the objective function of each particle and its corresponding particle position in each generation of particle swarm after iterative update according to the expression of the objective function of the optimization solution algorithm, as well as the historical optimal value of the group objective function of each generation of particle swarm after iterative update and its corresponding particle position; when the number of iteration steps of the updated particle swarm is equal to the preset number of iteration steps, end the update;
[0083] S7: Output the particle corresponding to the historical optimal value of the group objective function of the particle swarm, and use it as the recommended point of interest.
[0084] By adopting the above scheme, compared with the traditional recommendation algorithm based on big data, this scheme solves the problem of personalized recommendation of points of interest by combining the simulated annealing algorithm with the particle swarm optimization method, and realizes efficient recommendation of points of interest under the premise of comprehensive consideration of the influencing factors of multiple independent variables. Furthermore, in the iterative process of particle swarm optimization solution, a certain random probability is introduced by using the idea of simulated annealing algorithm, accompanied by updating the annealing temperature according to the preset proportional coefficient, so that the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm.
[0085] Combine the following Figure 1-9 The method for recommending points of interest based on simulated annealing particle swarm algorithm provided in this embodiment is described in detail. Figure 1-6 It is a flowchart of a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention; Figure 7 A schematic diagram of an algorithm convergence curve in a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided by an embodiment of the present invention; Figure 8 is a schematic diagram of recommending points of interest in a method for recommending points of interest based on a simulated annealing particle swarm algorithm provided in an embodiment of the present invention; Fig. 9 It is a schematic diagram of a list of attribute information corresponding to each type of interest point set in the interest point recommendation method based on simulated annealing particle swarm algorithm provided by an embodiment of the present invention.
[0086] refer to Figure 1 First, execute step S1 to generate attribute information lists corresponding to each type of interest point set according to the interest point type preselected by the user and the influencing factors of the interest point type; wherein each attribute information list includes the number of each interest point in the interest point set of the corresponding type and the influencing factors of the interest point.
[0087] Specifically, refer to Figure 2 In this embodiment, step S1 includes:
[0088] S11: Establishing a list of points of interest according to the types of points of interest preselected by the user; wherein each type of point of interest includes at least one point of interest;
[0089] S12: Obtain influencing factors of the interest point type.
[0090] It should be noted that, in this embodiment, the method for obtaining the influencing factors of the user's pre-selected point of interest type includes:
[0091] Get the influencing factors of the POI type preset by the user, or get the influencing factors of the default POI type.
[0092] S13: Acquire attribute information of a set of points of interest of a corresponding type according to the influencing factors of each type of point of interest, and generate an attribute information list.
[0093] It should be noted that in this embodiment, an example is taken in which a user uses the central control screen or other intelligent cockpit system to input points of interest that need to be experienced, and then the intelligent cockpit system selects the optimal solution according to the user's needs.
[0094] Specifically, in step S1, the types of points of interest preselected by the user can be the places that the user needs to visit after going out until returning home, which are determined according to specific needs. For example, after going out, the user needs to buy flowers first, then go to eat, and finally go to the cinema, then the types of points of interest include flower shops, restaurants and cinemas.
[0095] The influencing factors of the POI types refer to the factors that influence the user's choice when selecting these POIs, such as average consumption per person, waiting time, store location, etc.
[0096] The points of interest set is all the stores that meet the requirements selected by the system for the user.
[0097] In a specific embodiment of the present invention, the user selects the points of interest to be traversed as needed, and the order of the points of interest is the order of the stores that the user needs to traverse during the trip. Assuming that the points of interest selected by the user in sequence are a flower shop, a restaurant, and a cinema, then the user starts from home and then returns home, which is a total journey.
[0098] After the user selects points of interest in sequence, a list of points of interest will be established based on the user's selections, such as Fig. 9 As shown, the list of points of interest only includes the numbers of shops, such as flower shop 1, flower shop 2, flower shop 3... restaurant 1, restaurant 2, restaurant 3... cinema 1, cinema 2, cinema 3...
[0099] Then, the influencing factors that affect the user's selection in these points of interest lists need to be obtained. It should be noted that these factors can be preset by the user or by the system default. Assume that the user presets the influencing factors for selecting flower shops, restaurants and cinemas, including store ratings, per capita consumption, store coordinates and waiting time. Of course, the user can set different influencing factors for different points of interest according to actual needs, and this embodiment does not limit this. In this embodiment, the actual store rating, per capita consumption, store coordinates, waiting time and other influencing factors of each store can be obtained through a third-party engine.
[0100] Next, we need to select some of the points of interest in the list according to the influencing factors, and then generate a list of attribute information. Fig. 9 The attribute information list includes the store number and influencing factors.
[0101] Next, step S2 is executed to establish an expression of the objective function of the optimization solution algorithm for all types of interest point sets.
[0102] Specifically, refer to Figure 3 In this embodiment, step S2 includes:
[0103] S21: according to the influencing factors of each type of interest point, respectively establish a sub-function expression corresponding to each influencing factor for each type of interest point;
[0104] S22: performing a sum operation on the sub-function expressions of all types of interest point sets to establish an expression of the objective function of the optimization solution algorithm.
[0105] It should be noted that, in this embodiment, the expression of the objective function of the optimization solution algorithm is established, that is, the function expression of each independent variable to the objective function value is constructed for each point of interest, and the function expressions of all points of interest that need to be traversed in a total process are accumulated and added to obtain the expression of the objective function of the optimization solution algorithm. The process of finding the best point of interest is the process of solving the optimal solution (maximum value or minimum value) of the function expression. The numbers of the various types of points of interest that are traversed in sequence corresponding to the optimal solution constitute the list of optimal points of interest recommended to the user.
[0106] It should also be noted that the step of constructing the expression of the objective function of the optimization solution algorithm specifically includes setting a reasonable objective function value so that each independent variable and the objective function value can establish a function mapping relationship and evaluate the value. Then, each independent variable (x1, (x2, y2), x3, x4) of each point of interest is mapped to generate a uniformly measurable evaluation value. The sum of the evaluation values of the user's total journey (including n points of interest that need to be traversed) is obtained, that is, the expression of the objective function of the optimization solution algorithm is Z = f1(x1) + f2(x2, y2) + f3(x3) + f4(x4).
[0107] Specifically, in this embodiment, the evaluation coefficient Z is set as the objective function value of the expression of the objective function. Z and the score of the jth POI point in the i-th category by the third-party information engine (x1 ij ) is set as: Among them, max is the maximum value of i.
[0108] The mapping relationship f2 between Z and the position coordinates (x2, y2) of all traversed points of interest (assuming there are n points) is set to: 0.6*L. L is the total mileage, where 0.6 is the fuel consumption price per kilometer. Of course, the fuel consumption price per kilometer is determined according to the actual situation, and this embodiment does not make any specific restrictions on this.
[0109] In the total process, it is assumed that the position coordinates of the home are (0, 0), and the position coordinates of the jth interest point in the traversed i-th category (i=1~n) are (x2 ij , y2 ij ), the total mileage is calculated as:
[0110]
[0111] The mapping relationship f3i between Z and the per capita consumption (x3) of the i-th type of interest point is set as: x3 (yuan).
[0112] The expression of the objective function of a user's total journey (including n points of interest that need to be traversed) is:
[0113] constraint.
[0114] Continue to refer Figure 3 , step S2 further includes:
[0115] S23: setting constraint conditions for various influencing factors of the POI type; wherein the constraint conditions include equality conditions and inequality conditions.
[0116] It should be noted that the set constraints performed in step S23 are the f constraints in the expression of the above objective function. The equality constraint condition means that the influencing factors (x1, x2, x3, x4) form an equation, such as x1 + x2 = constant. The inequality constraint condition means that several influencing factors form an inequality, such as x3 + x4 < constant. For example, the set constraints set by the user can be whether the user is willing to wait at a certain type of point of interest. For different types of points of interest, the user can set whether to wait, and if willing to wait, the maximum allowable waiting time can be set.
[0117] In the specific implementation manner of the present invention, the user sets waiting time constraint conditions for two types of points of interest, namely flower shops and restaurants, and the respective waiting times cannot exceed 15 minutes and 20 minutes. When the waiting time t of the flower shop > 15, the f constraint = ∞, otherwise it is 0. When the waiting time t of the restaurant > 20, the f constraint = ∞, otherwise it is 0.
[0118] Next, execute step S3 to establish an initial particle swarm for all types of point-of-interest sets and set the initial particle swarm parameters of the simulated annealing particle swarm algorithm for the initial particle swarm; wherein, the initial particle swarm parameters include the number of particles in the initial particle swarm, the preset number of iteration steps of the initial particle swarm, and the dimensions of each particle in the initial particle swarm, and, the dimensions of each particle in the initial particle swarm correspond to the number of types of points of interest preselected by the user.
[0119] It should be noted that in this embodiment, in step S3, establishing an initial particle swarm for all types of point-of-interest sets includes:
[0120] S31: Initialize the particles in the initial particle swarm and set boundary conditions for the particles in the initial particle swarm;
[0121] S32: Initialize the initial velocity vector of the particles in the initial particle swarm; wherein, the initial velocity vector is 0.5 to 0.7 times the initial value of the particle.
[0122] It should also be noted that the initial velocity vector is 0.5 to 0.7 times the initial value of the particle, specifically it can be 0.5 times, 0.6 times, 0.7 times, or other values within this range, and this embodiment does not limit this.
[0123] In this embodiment, it is necessary to find the optimal solution of the expression of the above objective function according to the particle swarm. Therefore, in this step, it is necessary to establish an initial particle swarm for all types of point-of-interest sets to find the optimal value of the particle swarm, and then determine the optimal solution of the objective function.
[0124] It should be noted that in this embodiment, as Figure 7As shown, the preset number of iteration steps of the simulated annealing particle swarm algorithm is determined according to the calculation principle of the shortest time required for convergence.
[0125] In a specific embodiment of the present invention, a particle in a particle group is defined as (unidrnd(7), unidrnd(6), unidrnd(7)), where unidrnd(n) represents the generation of a random integer between 1 and n.
[0126] Then, each particle in the initial particle swarm is defined and parameters are set. Specifically, when setting the dimensions of each particle, the value of each dimension of the particle represents the optional list number (No.) of this type of interest point. In other words, in this embodiment, each particle has three dimensions, and the three dimensions represent flower shops, restaurants, and cinemas, respectively. When setting the initialization velocity vector, the initial value of the velocity vector is set to 0.7*(unidrnd(7), unidrnd(6), unidrnd(7)) for each particle. When setting the number of initial particles, the number of particles in the group is set. For example, the number of particles in the group is set to 20, 20 particles are randomly generated, and 20 initial velocities are generated accordingly. When setting the preset number of iteration steps, the number of times the particle swarm needs to be updated is set. For example, the preset number of iteration steps can be set to 10.
[0127] Next, step S4 is executed to calculate and record the initial objective function value of each particle in the initial particle swarm and its corresponding particle position, as well as the historical optimal value of the group objective function of the initial particle swarm and its corresponding particle position according to the expression of the objective function of the optimization solution algorithm.
[0128] In a specific embodiment of the present invention, the historical optimal value p(1:20) of the objective function of 20 particles and the position Y(1:20) of the corresponding particles are calculated and recorded according to the expression of the objective function of the optimization solution algorithm, and the historical optimal value Gbest of the objective function of the group and the corresponding particle are pg.
[0129] Then, step S5 is executed to set the annealing algorithm parameters of the simulated annealing particle swarm algorithm, and to iteratively update each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters.
[0130] In this embodiment, the annealing algorithm parameters include an initial annealing temperature, which is set to Among them, abs represents Perform absolute value processing.
[0131] Specifically, refer to Figure 4In this embodiment, the iterative updating of each particle in each initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters includes:
[0132] S51: Calculate the mutation probability of each particle according to the exponential probability formula, the current annealing temperature, the historical optimal value of the objective function of each particle, and the historical optimal value of the group objective function of the particle swarm;
[0133] S52: According to the distribution of mutation probability, the roulette algorithm is used to determine the optimal particle in the contemporary particle swarm;
[0134] S53: According to the self-learning rate, the group learning rate, the speed and the speed inertia weight coefficient, and the random rate between 0 and 1, each particle in the iteratively updated particle swarm of each generation moves to the particle position corresponding to the historical optimal value of the objective function of each particle and the optimal particle position in the contemporary particle swarm, so as to update each particle in the particle swarm of each generation.
[0135] It should be noted that the mutation probability is the degree of closeness between the historical optimal value of the objective function of each particle and the historical optimal value of the group objective function of the particle swarm. The closer the two are, the greater the probability.
[0136] It should be noted that, in this embodiment, the exponential probability formula is: Among them, p is the historical optimal value of the objective function of each particle; Gbest is the historical optimal value of the group objective function of the particle swarm.
[0137] Preferably, in this embodiment, each particle in each particle group is updated according to the following formula:
[0138] V k+1 =C 0 *V k +C 1 *rand*(Y k -X k )+C 2 *rand*(Pg plus -X k )
[0139] X k+1 =X k +V k+1
[0140] Wherein, the subscript k+1 indicates the current iteration step number; V is the velocity vector of the particle; X is the current particle position; Y is the particle position corresponding to the historical optimal value of the objective function of the current particle; Pg plus It is the best particle in the current particle swarm determined by the roulette algorithm under the current iteration number; C 0 is the velocity inertia weight coefficient; it is usually a random number between (0, 1). 1is the self-learning rate of the particle; C 2 is the population learning rate of particles. c1 and c2 are usually random numbers between (0, 2).
[0141] That is to say, in this embodiment, it is necessary to iteratively update the particles in the initial particle group and select the optimal value of each generation. This process is equivalent to the process of establishing a database and selecting the optimal value in the database. When the roulette algorithm is used to determine the optimal particle in the particle group formed by the initial particle group and the updated particle group, the particle with a greater mutation probability is more likely to be selected.
[0142] It should be noted that, in this embodiment, reference Figure 5 , after step S5, the following steps are also included:
[0143] S5': Determine whether the dimension value of each particle exceeds the boundary condition;
[0144] If so, the particles that exceed the boundary conditions are returned to the boundary conditions;
[0145] If not, execute step S6.
[0146] Specifically, it is determined whether the dimension of each particle exceeds the boundary condition. If so, the particle that exceeds the boundary condition is returned to the boundary condition. That is, the dimensions of each particle X after the update are restricted not to exceed the specified boundary condition. The particle that exceeds the condition is returned to the boundary condition, that is, Among them, Lb is the lower limit of the boundary condition, and Ub is the upper limit of the boundary condition.
[0147] It should also be noted that, in this embodiment, when the particle swarm is updated, the particle swarm parameters may also be reset, for example, the moving speed of each particle of the current generation may be set.
[0148] Then, step S6 is executed to calculate and record the historical optimal value of the objective function of each particle and its corresponding particle position in each generation of particle swarms after iterative update, and the historical optimal value of the group objective function of each generation of particle swarms after iterative update and its corresponding particle position according to the expression of the objective function of the optimization solution algorithm; when the number of iteration steps of the updated particle swarm is equal to the preset number of iteration steps, the update is terminated.
[0149] Further, in this embodiment, after step S6, refer to Figure 6 , also includes:
[0150] S6': Update the annealing temperature according to the preset proportionality coefficient.
[0151] Specifically, in this embodiment, the annealing temperature is updated according to the following formula: T=T*lamda, wherein T is the annealing temperature, and lamda is a preset proportional coefficient.
[0152] It should be noted that the preset proportionality coefficient can be limited according to the actual annealing conditions. In this embodiment, the preset proportionality coefficient is a random number between 0 and 1, preferably 0.4 to 0.7. Specifically, it can be 0.4, 0.5, 0.6, 0.7, or other values within the range.
[0153] S6”: Determine whether it is equal to the preset number of iteration steps;
[0154] If yes, the iteration ends and S7 is executed;
[0155] If not, enter the next round of iteration and continue to determine whether it is equal to the preset number of iteration steps.
[0156] After the iteration is finished, step S7 is executed to output the particle corresponding to the historical optimal value of the group objective function of the particle swarm and use it as the recommended interest point.
[0157] Specifically, refer to Figure 8 , assuming that the particle corresponding to the optimal value of the objective function is pg = [2, 2, 4], it means that in this embodiment, pg = [2, 2, 4] is used as the recommendation list finally recommended to the user. That is, the user starts from home, visits the flower shop numbered 2, the restaurant numbered 2, and the cinema numbered 4 in sequence, and then returns home.
[0158] By adopting the above scheme, compared with the traditional recommendation algorithm based on big data, this scheme solves the problem of personalized recommendation of points of interest by combining the simulated annealing algorithm with the particle swarm optimization method, and realizes efficient recommendation of points of interest under the premise of comprehensive consideration of the influencing factors of multiple independent variables. Furthermore, in the iterative process of particle swarm optimization solution, a certain random probability is introduced by using the idea of simulated annealing algorithm, accompanied by updating the annealing temperature according to the preset proportional coefficient, so that the particle swarm can converge to the global optimal solution faster than the traditional particle swarm algorithm.
[0159] Although the present invention has been illustrated and described with reference to certain preferred embodiments of the present invention, it should be understood by those skilled in the art that the above contents are further detailed descriptions of the present invention in conjunction with specific embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present invention.
Claims
1. A method for recommending points of interest based on simulated annealing particle swarm algorithm, characterized in that: The following steps are involved: S1: Generate attribute information lists corresponding to each type of interest point set according to the interest point type preselected by the user and the influencing factors of the interest point type; wherein each of the attribute information lists includes the number of each interest point in the interest point set of the corresponding type and the influencing factors of the interest point; S21: according to the influencing factors of each of the interest point types, respectively establish a sub-function expression corresponding to each of the influencing factors for each of the interest point types; S22: performing a sum operation on the sub-function expressions of all types of interest point sets to establish an expression of an optimization solution algorithm objective function for all types of interest point sets; S3: establishing an initial particle swarm for all types of interest point sets, and setting initial particle swarm parameters of a simulated annealing particle swarm algorithm for the initial particle swarm; wherein the initial particle swarm parameters include the number of particles in the initial particle swarm, the preset number of iteration steps of the initial particle swarm, and the dimension of each particle in the initial particle swarm, and the dimension of each particle in the initial particle swarm corresponds to the number of interest point types preselected by the user; S4: Calculate and record the initial objective function value of each particle in the initial particle swarm and its corresponding particle position, as well as the historical optimal value of the group objective function of the initial particle swarm and its corresponding particle position according to the expression of the objective function of the optimization solution algorithm; S5: setting annealing algorithm parameters of the simulated annealing particle swarm algorithm, and iteratively updating each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters; S6: Calculate and record the historical optimal value of the objective function of each particle and its corresponding particle position in each generation of particle swarm after iterative update according to the expression of the objective function of the optimization solution algorithm, as well as the historical optimal value of the group objective function of each generation of particle swarm after iterative update and its corresponding particle position; when the number of iteration steps of the updated particle swarm is equal to the preset number of iteration steps, end the update; S7: Output the particle corresponding to the historical optimal value of the group objective function of the particle swarm, and use it as a recommended point of interest.
2. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 1, characterized in that: Step S1 includes: S11: Establishing a list of points of interest according to the types of points of interest preselected by the user; wherein each type of point of interest includes at least one point of interest; S12: Obtaining influencing factors of the interest point type; S13: acquiring attribute information of a set of interest points of a corresponding type according to the influencing factors of each type of interest point, and generating an attribute information list; Among them, in step S12, the method of obtaining the influencing factors of the user's pre-selection of the point of interest type includes: Obtain the influencing factors of the interest point type preset by the user, or Get the default influencing factors of the point of interest type.
3. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 1, characterized in that: Step S2 also includes: S23: Setting constraint conditions for each influencing factor of the interest point type; wherein the constraint conditions include equality conditions and inequality conditions.
4. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 3, characterized in that: In step S3, the establishing of an initial particle swarm for all types of interest point sets includes: S31: Initializing particles in the initial particle group and setting boundary conditions for the particles in the initial particle group; S32: Initializing the initialization velocity vector of the particles in the initial particle group; wherein the initialization velocity vector is 0.5 to 0.7 times the initial value of the particle.
5. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 4, characterized in that: Step S3 also includes: The preset number of iteration steps of the simulated annealing particle swarm algorithm is determined according to the calculation principle of the shortest time required for convergence.
6. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 5, characterized in that: In step S5, the annealing algorithm parameters include an initial annealing temperature, which is and, Setting the annealing algorithm parameters of the simulated annealing particle swarm algorithm, and iteratively updating each particle in the initial particle swarm using the simulated annealing particle swarm algorithm according to the annealing algorithm parameters comprises: S51: Calculate the mutation probability of each particle according to the exponential probability formula, the current annealing temperature, the historical optimal value of the objective function of each particle, and the historical optimal value of the group objective function of the particle swarm; wherein the mutation probability is the degree of approximation between the historical optimal value of the objective function of each particle and the historical optimal value of the group objective function of the particle swarm; S52: according to the distribution of the mutation probability, determining the best particle in the contemporary particle swarm by using a roulette algorithm; S53: According to the self-learning rate, the group learning rate, the speed and the speed inertia weight coefficient, and the random rate between 0 and 1, each particle in the iteratively updated particle swarm of each generation moves to the particle position corresponding to the historical optimal value of the objective function of each particle and the optimal particle position in the contemporary particle swarm, so as to update each particle in the particle swarm of each generation.
7. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 6, characterized in that: The exponential probability formula is: Wherein, p is the historical optimal value of the objective function of each particle; Gbest is the historical optimal value of the group objective function of the particle swarm; and Update each particle in each particle group according to the following formula: V k+1 =C0*V k +C1*rand*(Y k -X k )+C2*rand*(Pg plus -X k ) X k+1 =X k +V k+1 Wherein, the subscript k+1 indicates the current iteration step number; V is the velocity vector of the particle; X is the current particle position; Y is the particle position corresponding to the historical optimal value of the objective function of the current particle; Pg plus It is the optimal particle in the current particle swarm determined by the roulette algorithm under the current iteration step; C0 is the velocity inertia weight coefficient; C1 is the self-learning rate of the particle; C2 is the group learning rate of the particle.
8. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 7, characterized in that: After step S5, the following steps are also included: S5': Determine whether the value of each dimension of each particle exceeds the boundary condition; If so, the particles that exceed the boundary condition are returned to the boundary condition; If not, execute step S6.
9. The method for recommending points of interest based on simulated annealing particle swarm algorithm according to claim 8, characterized in that: After step S6, the method further includes: S6': updating the annealing temperature according to the preset proportional coefficient; and updating the annealing temperature according to the following formula: T=T*lamda, wherein T is the annealing temperature, lamda is the preset proportional coefficient, and the range of the preset proportional coefficient is a random number between 0 and 1; S6”: Determine whether it is equal to the preset number of iteration steps; If yes, the iteration ends and S7 is executed; If not, enter the next iteration.
Citation Information
Patent Citations
Risk avoidance method based on particle swarm and risk avoidance method for flying object
CN107992936A
Recommended music track determination method and device and storage medium
CN109726310A
Cited By
Vehicle-mounted sensor spatial layout optimization method based on simulated annealing algorithm
CN121030922A