Parking lot recommendation method based on multiple attention weights

By employing a parking recommendation method based on multi-attention weights, and utilizing feature matrices and attention mechanism networks combined with user preferences, parking recommendations are dynamically calculated. This solves the problems of real-time response and personalization in smart parking solutions, and achieves personalized and interpretable parking recommendations.

CN121579767APending Publication Date: 2026-02-27CHANGSHU PUBLIC SECURITY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511575509.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing smart parking solutions cannot respond to urban emergencies in real time and cannot meet users' personalized parking needs, resulting in inaccurate recommendations or parking space shortages.

Method used

A parking recommendation method based on multi-attention weights is adopted. By constructing a feature matrix and an attention mechanism network, the importance weights of features are dynamically calculated. Combined with user preference coefficients, a personalized parking recommendation list is generated and user preferences are updated in real time.

Benefits of technology

It enables real-time, personalized, and interpretable parking lot recommendations, reduces the risk of system jitter, and improves response speed and the interpretability of recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579767A_ABST
    Figure CN121579767A_ABST
Patent Text Reader

Abstract

The invention discloses a parking lot recommendation method based on multiple attention weights, and the method comprises the steps: retrieving an adjacent parking lot according to a user request, and collecting related information; preprocessing the data to obtain a feature matrix integrating all parking lot feature information; constructing and training a prediction model, and obtaining recommendation weights of different parking lots in user preferences by using the model for parking lot feature information and user requests; and taking the weight as the input of a recommendation algorithm, obtaining an optimized recommendation list, pushing the optimized recommendation list to the user, recording user selection and updating the preference weight of the user. According to the invention, personalized parking lot pushing to the user in a real-time updating manner can be realized, the attention mechanism network and the recommendation pushing module are decoupled, the system jitter risk is reduced, the response speed of the system is improved, and the interpretability of the pushing result is improved based on the user preference coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical fields of route planning, smart parking, and data processing, and in particular to a parking lot recommendation method based on multi-attention weights. Background Technology

[0002] With the improvement of social and economic levels, the number of motor vehicles is increasing day by day. While meeting the increasingly diverse travel needs of citizens, this has also brought about social problems such as parking difficulties. In particular, in the urban environment, how to rationally allocate public parking resources in the city has become an urgent problem to be solved.

[0003] The concept of smart parking has brought new ideas to solving this problem. Smart parking refers to the use of modern information technology such as the Internet of Things, big data, and cloud computing to intelligently manage parking resources, realize functions such as real-time parking space inquiry, reservation, navigation, and payment, and help guide and manage vehicles with parking needs in the city, improve urban traffic conditions, increase citizens' travel efficiency, and meet the needs of modern urban intelligent development.

[0004] However, among existing smart parking solutions, one approach is based on a scoring system to recommend parking lots. Different scoring factors result in different recommended scores for different parking lots, but these scoring rules are relatively fixed and cannot respond to unexpected events in the city. This one-way recommendation fails to meet users' personalized parking needs. Another approach displays the real-time number of parking spaces in all parking lots in the area. While this provides current parking information, it doesn't consider users' personalized needs, such as parking fees and convenience from their final destination. Furthermore, it doesn't predict the number of available parking spaces when the user arrives, potentially leading to situations where there are no spaces available when parking is scarce. Summary of the Invention

[0005] The present invention aims to at least partially solve one of the technical problems existing in the related art.

[0006] The purpose of this invention is to provide a parking lot recommendation method based on multi-attention weights. Through a multi-attention dynamic weights + user preference closed-loop architecture, it can achieve real-time, personalized, interpretable and stable personalized parking lot recommendations.

[0007] To achieve the above objectives, the present invention provides a parking lot recommendation method based on multi-attention weights, comprising the following steps:

[0008] S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list for each parking lot. The feature list includes at least: the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, and the estimated charge amount.

[0009] S2. Combine the feature lists of multiple parking lots into a feature matrix and input it into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension to obtain the attention weight matrix of each parking lot.

[0010] S3. Obtain the user preference coefficient and fuse it element-wise with the attention weight matrix to generate a hybrid weight matrix;

[0011] S4. Based on the hybrid weight matrix and the feature matrix, establish a mathematical optimization model for the comprehensive score of parking lots, solve the mathematical optimization model, obtain the comprehensive score of each parking lot, and output a parking lot recommendation list.

[0012] S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

[0013] A further preferred technical solution of the present invention is that, in step S1, the navigation request initiated by the user takes the user's current location as the navigation starting point and the user's destination as the navigation ending point to generate a navigation path; the content of the navigation request includes the latitude and longitude coordinates of the user's current location, the latitude and longitude coordinates of the destination location, the estimated parking time, and the user's preferred parking lot; wherein the user's preferred parking lot includes parking lots with low fees, parking lots with many vacant spaces, and parking lots that are close to the destination, and the user's preferred parking lot is represented by the user preference coefficient Φ, with the initial value set to 0.

[0014] Preferably, in step S1, available parking lots around the destination are retrieved, and feature vectors for each parking lot are constructed; specifically:

[0015] Using the latitude and longitude coordinates of the destination as the center, search for all parking lots within a radius of n meters around it. The search distance n is set according to the city size and the number of parking lots.

[0016] All retrieved parking lots are inserted into the user's navigation path as waypoints to obtain several path combinations from the user's current location to the parking lot to the user's destination. The user's way to the parking lot is assumed to be driving a motor vehicle, and the way to the destination from the parking lot is assumed to be walking.

[0017] Obtain relevant information for each parking lot and represent it in a unified structure as a feature list.

[0018] As a preferred option, the relevant information obtained from the parking lot includes real-time parking lot occupancy data, parking lot fee data, and historical parking lot occupancy data; and at the same time, the traffic conditions along the navigation route and the weather conditions of the area where the parking lot is located are also obtained.

[0019] The constructed parking lot feature list includes the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, the estimated fee, and weather conditions. After integration, a structured parking lot feature list is obtained, the specific structure of which is as follows: ;

[0020] Among them, the parking lot ID is the ID assigned when searching for available parking lots around the destination, and is used to represent the parking lot in subsequent processing; the driving time from the user to the parking lot and the walking time from the parking lot to the destination are calculated based on the navigation route and the traffic conditions on the navigation route; the estimated charge is calculated based on the estimated parking time in the user's navigation request and the parking lot charging data; the predicted future occupancy rate is the parking lot occupancy rate predicted when the user arrives at the parking lot, based on the real-time occupancy rate data of the parking lot, the historical occupancy rate data of the parking lot, the weather conditions of the area where the parking lot is located, and the user's arrival time at the parking lot.

[0021] Preferably, step S2 involves assembling a feature matrix from the feature lists of multiple parking lots; specifically:

[0022] Stacking all the parking lot feature lists together yields the parking lot feature matrix. ,in, Number of parking lots For feature dimensions;

[0023] Then, the parking lot feature matrix is ​​normalized using either the Min-Max or Z-Score algorithm.

[0024] Preferably, the attention mechanism network in step S2 consists of an input layer, a feature embedding layer, an attention mechanism layer, a dynamic weight layer, and an output layer; the attention mechanism network is pre-trained using historical parking lot data.

[0025] The input layer parses the parking lot feature matrix, converts the parking lot features into feature vectors, and transfers them to the feature embedding layer. The feature embedding layer consists of a fully connected layer and an activation function, used to map the original features to a high-dimensional space and capture the non-linear relationships between features. The attention mechanism layer dynamically learns the importance weight of each feature, captures the user's preference for different features, and then outputs the feature attention weight of each parking lot. The dynamic weight layer receives the attention weights output by the attention mechanism layer, normalizes them, and outputs an attention weight vector. The output layer stacks the attention weight vectors of each parking lot to obtain an attention weight matrix representing the weight of all parking lots in different dimensions. The higher the weight, the greater the recommendation influence, and vice versa.

[0026] Preferably, step S3 involves obtaining the user preference coefficients and fusing them element-wise with the attention weight matrix to generate a hybrid weight matrix; specifically:

[0027] The parking lot preferences obtained from users include those with lower fees, more available parking spaces, and closer proximity to the destination. These preferences are then ranked using a user preference coefficient. This means that the initial value is set to 0;

[0028] User preference coefficient Attention weight matrix output by the attention mechanism network To combine, it is represented as:

[0029] ;

[0030] in This represents the mixed weights obtained from element-wise multiplication. It reflects the degree of user preference for different features and is used to calculate the weighted score of the parking lot.

[0031] Preferably, the mathematical optimization model for the comprehensive parking score established in step S4 consists of an objective function, which is based on the parking feature matrix. Mixed weight matrix Decision variables The output maximizes the weighted feature score, expressed as:

[0032] ;

[0033] in, The number of candidate parking lots. The number of feature dimensions for parking lots. For the first The parking lot is Normalized eigenvalues ​​on the feature dimension;

[0034] The objective function value is obtained to measure the weighted score of each parking lot and to make an optimal selection.

[0035] As a preferred option, in step S4, the mathematical optimization model is solved by taking the objective function value and constraints as input, and the optimal solution is obtained through a linear programming solver, and finally the parking lot recommendation list is output.

[0036] The constraints include distance constraints, i.e., the maximum distance acceptable to the user; capacity constraints, i.e., the minimum remaining capacity of the parking lot; and unique choice constraints, i.e., whether the user ultimately chooses the parking lot.

[0037] The linear programming solution algorithm is either GLPK or CPLEX, which are algorithms for finding the optimal solution.

[0038] The final output parking lot recommendation list is a dictionary structure, containing the score, features, and ranking of each parking lot under different features;

[0039] After the user makes a final selection, retrieve the corresponding ID based on the parking lot selected by the user, and set its unique selection constraint to 1.

[0040] Preferably, step S5 involves recording the user's actual selection results on the recommendation list and updating the user preference coefficient vector based on these results for the next recommendation; specifically:

[0041] First, user preference coefficients are calculated based on user selection behavior. The update is represented as:

[0042] ;

[0043] in, This represents the updated user preference coefficient. This represents the user preference coefficient before the update. Indicates the update step size. parking lot The normalized eigenvectors;

[0044] Then, the user preference coefficient is injected into the weight calculation of the recommendation algorithm, and the constraints are dynamically adjusted according to user preferences.

[0045] In another aspect, the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, which cause a computer to execute the above-described parking recommendation method based on multiple attention weights.

[0046] In another aspect, the present invention provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus, and the processor calls logical instructions in the memory to execute the above-described parking recommendation method based on multiple attention weights.

[0047] In another aspect, the present invention provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer executes the aforementioned parking recommendation method based on multiple attention weights.

[0048] Beneficial effects: The parking recommendation method based on multi-attention weights of the present invention can realize personalized parking recommendations for users that can be updated in real time, and decouples the attention mechanism network and the recommendation push module, thereby reducing the risk of system jitter and improving the system response speed. Based on the user preference coefficient, the interpretability of the push results is improved. Attached Figure Description

[0049] Figure 1 This is a flowchart of the parking lot recommendation method based on multi-attention weights according to Embodiment 1 of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, embodiments of this invention, and should not be construed as limiting the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0051] The following is combined Figure 1 This invention describes a parking recommendation method based on multi-attention weights.

[0052] Example 1: This example provides a parking lot recommendation method based on multi-attention weights. The specific steps are as follows:

[0053] S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list of each parking lot.

[0054] In this embodiment, the navigation request information includes the current location's latitude and longitude, the destination's latitude and longitude, the estimated parking time period, and user preference parameters. Then, during the destination retrieval process, the system uses the navigation destination as the center and a set radius R to search for nearby parking lots. The search radius can be dynamically set according to the density of parking lots in the city or suburbs; in this embodiment, the search radius R is set to 5km. Geographic proximity retrieval can be performed quickly using techniques including but not limited to geohashing or spatial indexing (such as R-Tree).

[0055] Then, for each retrieved parking lot, a complete path "starting point - parking lot - destination" is generated. The default mode of transportation from the starting point to the parking lot is driving, and the default mode of transportation from the parking lot to the destination is walking. Driving and walking path generation can be implemented using any existing method, and the driving time and distance, walking time and distance, and current traffic conditions are obtained. If the user is navigating for the first time, their preference coefficient is initialized to the system default value, which is 0 in this embodiment; if the user has navigated before, their preference coefficient is read.

[0056] For each retrieved parking lot, relevant information is collected. In this embodiment, this includes real-time occupancy data, parking fee data, and historical occupancy data. Specifically, the formula for calculating the real-time occupancy rate of a parking lot is:

[0057] ;

[0058] Where occ represents the parking lot occupancy rate at that moment. This represents the number of parking spaces currently in use in the parking lot. This represents the total number of parking spaces in the parking lot.

[0059] Parking fee data is calculated based on parking fee rules and the user's estimated parking time. The specific calculation formula is as follows:

[0060] ;

[0061] in Indicates the expected charge, function This indicates the parking fee rules. This indicates the user's expected parking time.

[0062] Subsequently, using real-time parking lot occupancy data, historical parking lot occupancy data, weather conditions in the parking lot area, and user arrival time, the parking lot occupancy rate at the time of user arrival is predicted. The prediction method can be any time-series prediction method, including but not limited to LSTM and TCN. In this embodiment, user parking duration and historical parking lot occupancy data are used as input data for the prediction model to ultimately obtain the parking occupancy rate during the user's parking period. Then, the weather conditions of the parking lot area are obtained, which can be done using any existing method.

[0063] Finally, for each retrieved parking lot, an ID is recommended to represent that parking lot in subsequent processing. This ID is then integrated with previously obtained data such as user driving time to the parking lot, walking time from the parking lot to the destination, parking lot weather conditions, future occupancy rates, and estimated charges to obtain a structured list of parking lot features. The specific structure is as follows: ;

[0064] Specifically, in this embodiment, the feature list for a retrieved parking lot can be: [1, 180,30, rain, 50%, 10,0], [2, 180, 30, rain, 50%, 10,0]. Here, the first dimension represents the parking lot ID; the second dimension represents the driving time from the user's current location to the parking lot, in minutes; the fourth dimension represents weather characteristics; the fifth dimension represents the ratio of available parking spaces to the total number of parking spaces when the user arrives at the parking lot, expressed as a percentage; the sixth dimension represents the user's expected charge in that parking lot, in this embodiment, set to yuan; and the seventh dimension represents the user's preferences. For first-time navigation users, this value is the system default value; for users who have navigated previously, this value is the user preference coefficient from historical records.

[0065] S2. Combine the feature lists of multiple parking lots into a feature matrix and normalize it;

[0066] In this embodiment, the obtained feature lists are first compressed. Specifically, taking the feature list obtained in S1 as an example, the feature matrix is: [[1, 180, 30, rain, 50%. 10,0], [2, 180, 30, rain, 50%.10,0]], with a dimension of x;

[0067] Then, the feature matrix is ​​normalized using any normalization algorithm, including but not limited to Min-Max and Z-Score. Specifically, in this embodiment, the Min-Max normalization algorithm is used to obtain the input feature matrix for subsequent prediction by the neural network.

[0068] S3. Input the feature matrix into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension, and obtains the attention weight matrix for each parking lot.

[0069] The attention mechanism network consists of an input layer, a feature embedding layer, an attention mechanism layer, a dynamic weight layer, and an output layer.

[0070] The input layer receives the normalized parking feature matrix and inputs it as a tensor into the feature embedding layer.

[0071] The feature embedding layer is used to perform vectorized mapping and feature space transformation on each feature dimension of the input feature matrix to generate embedded feature representations;

[0072] The attention mechanism layer is used to calculate the attention weight coefficients of the embedded feature representations on each parking lot and each feature dimension, so as to obtain the attention weight matrix of all parking lots, reflecting the relative importance of different features to parking lot recommendations.

[0073] The dynamic weight layer combines attention weights and user preference coefficients to generate a fused hybrid weight matrix. The formula for calculating the hybrid weights is as follows:

[0074] ;

[0075] in, Represents the mixed weight matrix. Represents the attention weight matrix. This represents the user preference coefficient;

[0076] The output layer outputs the weight matrix for each parking lot under different features. The dimension of the weight matrix is... ,in, Indicates the number of parking lots. Indicates the feature dimension.

[0077] In this embodiment, historical data is used to train the attention mechanism network. The training data is collected from historical navigation records and user selection feedback from the parking recommendation system. Each record includes the user's location, destination location, retrieved candidate parking lots and their feature information, and the parking lot identifier finally selected by the user during a navigation session. Specifically, this embodiment selects approximately 50,000 sets of data from the past 6 months as training data, dividing them into training and validation sets in an 8:2 ratio.

[0078] Specifically, in the model training loop, Adam is selected as the training optimizer, and the initial learning rate is set to... The learning rate is adjusted using a cosine return algorithm, and Listwise Loss is used as the loss function. The number of training epochs is defined as 50 to 200. After each training epoch, the model is evaluated using validation set samples to adjust the parameters of the model weights and keep them within a reasonable range. Finally, the trained attention mechanism network is obtained.

[0079] The network uses feature matrices As input, the dimension is ,in This indicates the number of candidate parking lots in the session. This represents the feature dimension. In the feature embedding layer, the input feature matrix is ​​projected onto the embedding space through a fully connected mapping, while maintaining the dimension as 1. In the attention mechanism layer, attention weights are calculated for each parking lot of the embedded features, resulting in an attention weight matrix. Its dimensions are The attention weight matrix is ​​then normalized along the feature dimension so that the sum of each row's elements is 1. With user preference coefficient vector Element-wise multiplication yields the mixed weight matrix. , dimension The mixed weight matrix is ​​element-wise multiplied with the original feature matrix, and then summed along the feature dimension to obtain the parking lot comprehensive score vector, score, with dimension 1. The output layer will process the overall score. The function is converted into a probability distribution to represent the relative probability of each candidate parking lot being selected.

[0080] S4. Input the obtained parking lot attention weight matrix into the dynamic recommendation algorithm module to obtain an optimized recommendation list of parking lots and push it to the user, while recording the parking lot finally selected by the user.

[0081] In this embodiment, the feature matrix, attention weight matrix, and user preference coefficient are input into the dynamic recommendation module. Specifically, in this module, a mixed weight calculation is first performed based on the user preference coefficient and the attention weight matrix; for first-time users, the mixed result is equivalent to directly using the attention weight; for historical users, the user preference coefficient is used to calculate the weight. When incorporated into the mixed weight calculation, the formula for calculating the mixed weight is:

[0082] ;

[0083] in This indicates element-wise multiplication, and the resulting mixed weights reflect the user's preference for different features, used to calculate the weighted score of the parking lot.

[0084] Then, using a recommendation model, the final score for each parking lot is calculated. The score calculation formula consists of an objective function and constraints. The objective function calculates the weighted feature score based on the parking lot's feature matrix, mixed weight matrix, and decision variables. The specific formula is as follows:

[0085] ;

[0086] in, The number of candidate parking lots. The number of feature dimensions for parking lots. For the first The parking lot is Normalized eigenvalues ​​on the characteristic dimension.

[0087] Specifically, the constraints include a distance constraint, representing the maximum acceptable distance for a user to travel from the requested location to the parking lot; a capacity constraint, representing the minimum number of available parking spaces when recommending parking to the user; and a unique selection constraint, meaning that only one parking lot is recommended for each recommendation.

[0088] Finally, a linear programming solver is used, with the objective function and constraints as input. In this embodiment, GLPK is used as the main linear programming algorithm to solve the problem, outputting the optimal score and ranking of each parking lot, and obtaining a parking lot recommendation list, which includes parking lot ID, score, feature value, and ranking dictionary structure under each feature. In this embodiment, the ranking lists of parking lots corresponding to the charging amount and arrival time are pushed to the user respectively.

[0089] S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

[0090] After navigation is complete, the user's preference coefficient is updated based on the parking lot selected. For first-time users, an initial set of historical preference coefficients is generated for subsequent recommendations. For existing users, their preference coefficients are optimized based on the original coefficients. The formula for calculating the user preference coefficient is:

[0091]

[0092] in This represents the updated user preference coefficient. This represents the user preference coefficient before the update. The update step size is set manually and is used to represent the influence of the original preference coefficient. In this embodiment, it is set to 0.7. parking lot The normalized eigenvectors.

[0093] Example 2: This example provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to execute a parking recommendation method based on multi-attention weights. The method includes the following steps:

[0094] S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list for each parking lot. The feature list includes at least: the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, and the estimated charge amount.

[0095] S2. Combine the feature lists of multiple parking lots into a feature matrix and input it into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension to obtain the attention weight matrix of each parking lot.

[0096] S3. Obtain the user preference coefficient and fuse it element-wise with the attention weight matrix to generate a hybrid weight matrix;

[0097] S4. Based on the hybrid weight matrix and the feature matrix, establish a mathematical optimization model for the comprehensive score of parking lots, solve the mathematical optimization model, obtain the comprehensive score of each parking lot, and output a parking lot recommendation list.

[0098] S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

[0099] Example 3: This example provides an electronic device that may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor can call logical instructions from the memory to execute a parking recommendation method based on multiple attention weights. This method includes the following steps:

[0100] S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list for each parking lot. The feature list includes at least: the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, and the estimated charge amount.

[0101] S2. Combine the feature lists of multiple parking lots into a feature matrix and input it into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension to obtain the attention weight matrix of each parking lot.

[0102] S3. Obtain the user preference coefficient and fuse it element-wise with the attention weight matrix to generate a hybrid weight matrix;

[0103] S4. Based on the hybrid weight matrix and the feature matrix, establish a mathematical optimization model for the comprehensive score of parking lots, solve the mathematical optimization model, obtain the comprehensive score of each parking lot, and output a parking lot recommendation list.

[0104] S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

[0105] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] Example 4: This example provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a parking recommendation method based on multiple attention weights. The method includes the following steps:

[0107] S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list for each parking lot. The feature list includes at least: the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, and the estimated charge amount.

[0108] S2. Combine the feature lists of multiple parking lots into a feature matrix and input it into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension to obtain the attention weight matrix of each parking lot.

[0109] S3. Obtain the user preference coefficient and fuse it element-wise with the attention weight matrix to generate a hybrid weight matrix;

[0110] S4. Based on the hybrid weight matrix and the feature matrix, establish a mathematical optimization model for the comprehensive score of parking lots, solve the mathematical optimization model, obtain the comprehensive score of each parking lot, and output a parking lot recommendation list.

[0111] S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0113] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A parking lot recommendation method based on multi-attention weights, characterized in that, Includes the following steps: S1. Based on the navigation request initiated by the user, obtain the user's current location and destination location, retrieve available parking lots around the destination, and construct a feature list for each parking lot. The feature list includes at least: the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, and the estimated charge amount. S2. Combine the feature lists of multiple parking lots into a feature matrix and input it into the attention mechanism network. The attention mechanism network dynamically calculates the importance weight of each feature to the recommendation result for each parking lot and each feature dimension to obtain the attention weight matrix of each parking lot. S3. Obtain the user preference coefficient and fuse it element-wise with the attention weight matrix to generate a hybrid weight matrix; S4. Based on the hybrid weight matrix and the feature matrix, establish a mathematical optimization model for the comprehensive score of parking lots, solve the mathematical optimization model, obtain the comprehensive score of each parking lot, and output a parking lot recommendation list. S5. Record the user's actual selection results on the recommendation list, and update the user preference coefficient based on the results for the next recommendation.

2. The parking lot recommendation method based on multi-attention weights according to claim 1, characterized in that, In step S1, the navigation request initiated by the user takes the user's current location as the navigation starting point and the user's destination as the navigation ending point to generate a navigation path; the content of the navigation request includes the latitude and longitude coordinates of the user's current location, the latitude and longitude coordinates of the destination location, the estimated parking time, and the user's preferred parking lot. The parking lots preferred by users include those with lower fees, more available parking spaces, and closer proximity to the destination. The parking lot preferences are represented by the user preference coefficient Φ, with an initial value of 0.

3. The parking lot recommendation method based on multi-attention weights according to claim 2, characterized in that, In step S1, available parking lots around the destination are retrieved, and feature vectors for each parking lot are constructed; specifically: Using the latitude and longitude coordinates of the destination as the center, search for all parking lots within a radius of n meters around it. The search distance n is set according to the city size and the number of parking lots. All retrieved parking lots are inserted into the user's navigation path as waypoints to obtain several path combinations from the user's current location to the parking lot to the user's destination. The user's way to the parking lot is assumed to be driving a motor vehicle, and the way to the destination from the parking lot is assumed to be walking. Obtain relevant information for each parking lot and represent it in a unified structure as a feature list.

4. The parking lot recommendation method based on multi-attention weights according to claim 3, characterized in that, The system acquires relevant parking information, including real-time parking occupancy data, parking fee data, and historical parking occupancy data; it also acquires traffic conditions along the navigation route and weather conditions for the area where the parking lot is located. The constructed parking lot feature list includes the user's driving time to the parking lot, the walking time from the parking lot to the destination, the predicted future occupancy rate, the estimated fee, and weather conditions. After integration, a structured parking lot feature list is obtained, the specific structure of which is as follows: ; Among them, the parking lot ID is the ID assigned when searching for available parking lots around the destination, and is used to represent the parking lot in subsequent processing; the driving time from the user to the parking lot and the walking time from the parking lot to the destination are calculated based on the navigation route and the traffic conditions on the navigation route; the estimated charge is calculated based on the estimated parking time in the user's navigation request and the parking lot charging data; the predicted future occupancy rate is the parking lot occupancy rate predicted when the user arrives at the parking lot, based on the real-time occupancy rate data of the parking lot, the historical occupancy rate data of the parking lot, the weather conditions of the area where the parking lot is located, and the user's arrival time at the parking lot.

5. The parking lot recommendation method based on multi-attention weights according to claim 1, characterized in that, Step S2 involves assembling a feature matrix from the feature lists of multiple parking lots; Specifically: Stacking all the parking lot feature lists together yields the parking lot feature matrix. ,in, Number of parking lots For feature dimensions; Then, the parking lot feature matrix is ​​normalized using either the Min-Max or Z-Score algorithm.

6. The parking lot recommendation method based on multi-attention weights according to claim 1, characterized in that, In step S2, the attention mechanism network consists of an input layer, a feature embedding layer, an attention mechanism layer, a dynamic weight layer, and an output layer; the attention mechanism network is pre-trained using historical parking lot data. The input layer parses the parking lot feature matrix, converts the parking lot features into feature vectors, and transfers them to the feature embedding layer. The feature embedding layer consists of a fully connected layer and an activation function, used to map the original features to a high-dimensional space and capture the non-linear relationships between features. The attention mechanism layer dynamically learns the importance weight of each feature, captures the user's preference for different features, and then outputs the feature attention weight of each parking lot. The dynamic weight layer receives the attention weights output by the attention mechanism layer, normalizes them, and outputs an attention weight vector. The output layer stacks the attention weight vectors of each parking lot to obtain an attention weight matrix representing the weight of all parking lots in different dimensions. The higher the weight, the greater the recommendation influence, and vice versa.

7. The parking lot recommendation method based on multi-attention weights according to claim 1, characterized in that, Step S3 involves obtaining user preference coefficients and fusing them element-wise with the attention weight matrix to generate a hybrid weight matrix; specifically: The parking lot preferences obtained from users include those with lower fees, more available parking spaces, and closer proximity to the destination. These preferences are then ranked using a user preference coefficient. This means that the initial value is set to 0; User preference coefficient Attention weight matrix output by the attention mechanism network To combine, it is represented as: ; in This represents the mixed weights obtained from element-wise multiplication. It reflects the degree of user preference for different features and is used to calculate the weighted score of the parking lot.

8. The parking lot recommendation method based on multi-attention weights according to claim 7, characterized in that, The mathematical optimization model for the comprehensive parking lot score established in step S4 consists of an objective function, which is based on the parking lot feature matrix. Mixed weight matrix Decision variables The output maximizes the weighted feature score, expressed as: ; in, The number of candidate parking lots. The number of feature dimensions for parking lots. For the first The parking lot is Normalized eigenvalues ​​on the feature dimension; The objective function value is obtained to measure the weighted score of each parking lot and to make an optimal selection.

9. The parking lot recommendation method based on multi-attention weights according to claim 8, characterized in that, In step S4, the mathematical optimization model is solved. The objective function value and constraints are used as inputs. The optimal solution is obtained through a linear programming solver, and the final output is a list of recommended parking lots. The constraints include distance constraints, i.e., the maximum distance acceptable to the user; capacity constraints, i.e., the minimum remaining capacity of the parking lot; and unique choice constraints, i.e., whether the user ultimately chooses the parking lot. The linear programming solution algorithm is either GLPK or CPLEX, which are algorithms for finding the optimal solution. The final output parking lot recommendation list is a dictionary structure, containing the score, features, and ranking of each parking lot under different features; After the user makes a final selection, retrieve the corresponding ID based on the parking lot selected by the user, and set its unique selection constraint to 1.

10. The parking lot recommendation method based on multi-attention weights according to claim 9, characterized in that, Step S5 involves recording the user's actual selection results on the recommendation list and updating the user preference coefficient vector based on these results for the next recommendation; specifically: First, user preference coefficients are calculated based on user selection behavior. The update is represented as: ; in, This represents the updated user preference coefficient. This represents the user preference coefficient before the update. Indicates the update step size. parking lot The normalized eigenvectors; Then, the user preference coefficient is injected into the weight calculation of the recommendation algorithm, and the constraints are dynamically adjusted according to user preferences.