Recommendation method and device based on real-time trajectory data and computer readable medium
By using a deep learning model based on users' historical trajectory data and contextual information to predict users' future trajectories, generate predicted paths, and recommend merchants, the problem of insufficient accuracy in merchant recommendations in existing technologies is solved, and more accurate merchant recommendations are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI JUNZHENG NETWORK TECH CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-17
AI Technical Summary
Existing merchant recommendation solutions lack dynamic location change analysis based on user trajectory data, resulting in insufficient recommendation accuracy and difficulty in meeting users' actual needs.
By acquiring users' historical trajectory sequences and contextual information, deep learning models are used to predict users' future trajectory points, generate predicted paths, and combine multi-dimensional information to recall and rank candidate merchants, pushing merchants that meet users' needs.
It improves the accuracy of merchant recommendations, enabling it to anticipate user needs and intentions, and provide more forward-looking merchant recommendations to meet users' actual needs.
Smart Images

Figure CN121883101A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a recommendation method, device and computer-readable medium based on real-time trajectory data. Background Technology
[0002] With the rapid development of mobile internet and shared mobility, ride-hailing, bike-sharing, and other transportation services have generated a massive amount of user trajectory data. This data contains rich information such as users' travel routes, dwell time, and location preferences, possessing enormous commercial value. Currently, transportation platforms primarily use user trajectory data for route planning and safety monitoring, neglecting to fully exploit its commercial value and lacking value-added services based on it. Conventional merchant recommendation schemes mainly rely on users' historical consumption records or static location information, failing to incorporate the dynamic location changes reflected in trajectory data for accurate recommendations. Consequently, merchant recommendations lack accuracy and fail to meet users' actual needs. Summary of the Invention
[0003] One objective of this application is to provide a recommendation method, device, and computer-readable medium based on real-time trajectory data to address the problem that existing solutions lack accuracy in merchant recommendations and fail to meet users' actual needs.
[0004] To achieve the above objectives, embodiments of this application provide a recommendation method based on real-time trajectory data, characterized in that the method includes: Obtain the user's historical trajectory sequence and corresponding context information. The historical trajectory sequence includes the location and timestamp of multiple historical trajectory points, and the context information includes the corresponding time information, environmental information, and user information. Based on the historical trajectory sequence and context information, multiple predicted trajectory points of the user at future moments are predicted, and a predicted path is generated based on the predicted trajectory points; Candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted to obtain a recommendation list including multiple candidate merchants; When the recommendation trigger condition is met, at least one candidate merchant is selected from the recommendation list as the recommended merchant according to the sorting result, and the recommended merchant is pushed to the user.
[0005] Further, based on the historical trajectory sequence and context information, multiple predicted trajectory points for the user at future times are predicted, and a predicted path is generated based on the predicted trajectory points, including: The historical trajectory sequence and context information are processed using a preset deep learning model to predict multiple predicted trajectory points of the user at future times, and a predicted path is generated based on the predicted trajectory points. The preset deep learning model is a deep learning model that can be used to extract the temporal dependencies between various historical trajectory points in the historical trajectory sequence, and an attention mechanism is used in the prediction process.
[0006] Furthermore, a preset deep learning model is used to process the historical trajectory sequence and contextual information to predict multiple predicted trajectory points for the user at future times, and a predicted path is generated based on the predicted trajectory points, including: The historical trajectory sequence and context information are feature-encoded to obtain the corresponding feature vectors; The feature vector is input into a preset deep learning model to extract the temporal dependencies between historical trajectory points in the historical trajectory sequence. The importance score of each historical trajectory point in the historical trajectory sequence is calculated based on the temporal dependency, and an attention vector is calculated based on the importance score. The user is input into a fully connected network based on contextual information and attention vectors, and the fully connected network is used to output multiple predicted trajectory points for the user at future time points. Map matching is performed based on the predicted trajectory points to generate a predicted path.
[0007] Further, based on the predicted trajectory points, map matching is performed to generate a predicted path, including: Based on the coordinates of the predicted trajectory points, map matching is performed to obtain the map location corresponding to the coordinates of each predicted trajectory point. Check the path reachability between predicted trajectory points; If reachable, generate a predicted path based on the sequence order of the predicted trajectory points; If the path is unreachable, an intermediate road segment is inserted between the unreachable predicted trajectory points, and a predicted path is generated based on the sequence order of the predicted trajectory points and the intermediate road segments.
[0008] Further, candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted to obtain a recommendation list including multiple candidate merchants, including: Candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted using multi-dimensional information to obtain a recommendation list including multiple candidate merchants. The multi-dimensional information includes at least one of the following: geographical location, user preference, merchant quality, and time factor.
[0009] Furthermore, the candidate merchants are sorted using multi-dimensional information to obtain a recommendation list including multiple candidate merchants, including: Based on factors such as geographic location, user preferences, merchant quality, and time, calculate the location matching score, preference matching score, quality matching score, and time matching score for each candidate merchant. Based on the location matching score, preference matching score, quality matching score, and time matching score, a comprehensive score is calculated for each candidate merchant, and the candidate merchants are sorted according to the comprehensive score to generate a recommendation list including multiple candidate merchants.
[0010] Furthermore, the candidate merchants are ranked according to the comprehensive score to obtain a recommendation list including multiple candidate merchants, including: The candidate merchants are ranked according to the comprehensive score to obtain a preliminary ranking result; The preliminary sorting results are adjusted based on the user's personalized information to obtain optimized sorting results; A recommendation list including multiple candidate merchants is generated based on the optimized ranking results.
[0011] Furthermore, the triggering condition includes at least one of the following: Users enter the first distance range around the candidate merchants; The user's predicted path passes through candidate merchants or the distance between the predicted path's destination and a candidate merchant is less than the second distance range; The current time has reached the preset time period, and the candidate merchants meet the preset merchant categories; The candidate merchants are currently offering promotional activities, and their merchant categories match user preferences.
[0012] Furthermore, pushing the recommended merchants to the user includes: The recommended merchants are pushed to the user according to the push frequency limit conditions, wherein the push frequency limit conditions include at least one of the following: The push interval for the same recommended merchant is greater than or equal to the first duration; When users are in the same area, the interval between two push notifications is greater than or equal to the second duration; The number of push notifications sent to the same user per day is less than or equal to the number sent the first time. The recommended merchants are pushed to the user based on the user's customized recommendation frequency preferences and do-not-disturb periods.
[0013] Furthermore, the method also includes: Collect feedback data and optimize the relevant parameters of the recommendation method based on the feedback data.
[0014] Furthermore, obtain the user's historical trajectory sequence, including: Collect users' raw trajectory data; The original trajectory data is preprocessed to obtain the user's historical trajectory sequence.
[0015] Furthermore, the method also includes: Based on relevant historical data of users, user profiles are constructed, which include at least: user travel habits, user preferences, and user interest tags.
[0016] Furthermore, recalling candidate merchants based on the predicted path includes: A multi-path recall strategy is adopted to recall candidate merchants based on the predicted path, wherein the multi-path recall strategy includes: Based on the user's current location, search for merchants within a third distance range and use the search results as candidate merchants; Based on the predicted path, search for merchants whose distance from the predicted path is less than the fourth distance range, and use the search results as candidate merchants. Based on user interest tags, search for merchants that match the user's interest tags, and use the search results as candidate merchants; Based on user preferences, search for merchants that match those preferences and use the search results as candidate merchants.
[0017] Furthermore, the method also includes: Provide merchants with an entry point for configuring advertising strategies, and obtain the advertising strategies configured by merchants from the entry point for configuring advertising strategies; Based on the ranking results, at least one candidate merchant is selected from the recommendation list as a recommended merchant, and the recommended merchant is pushed to the user, including: Based on the aforementioned delivery strategy, at least one candidate merchant is selected from the recommendation list as a recommended merchant according to the ranking results, and the recommended merchant is pushed to the user.
[0018] Some embodiments of this application also provide a recommendation device based on real-time trajectory data, wherein the device includes a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the aforementioned recommendation method based on real-time trajectory data.
[0019] Other embodiments of this application also provide a computer-readable medium having computer program instructions stored thereon, which can be executed by a processor to implement the recommendation method based on real-time trajectory data.
[0020] Compared to existing technologies, this application provides a recommendation scheme based on real-time trajectory data. This scheme can obtain a user's historical trajectory sequence and corresponding contextual information. The historical trajectory sequence includes the location and timestamps of multiple historical trajectory points, and the contextual information includes corresponding time information, environmental information, and user information. Based on the historical trajectory sequence and contextual information, multiple predicted trajectory points of the user at future times are predicted, and a predicted path is generated based on the predicted trajectory points. Since the historical trajectory sequence and contextual information can reflect the temporal dependencies between various historical trajectory points, the user's actual needs and intentions can be perceived in advance, making the predicted path more accurate. On this basis, candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted to obtain a recommendation list including multiple candidate merchants. When the recommendation trigger condition is met, at least one candidate merchant is selected from the recommendation list as a recommended merchant according to the sorting result, and the recommended merchant is pushed to the user. This completes a more forward-looking merchant recommendation, improves the accuracy of the recommendation, and better meets the user's actual needs. Attached Figure Description
[0021] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A flowchart illustrating a recommendation method based on real-time trajectory data provided in this application embodiment; Figure 2 This is a flowchart illustrating the process of obtaining predicted trajectory points and generating a predicted path in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of an LSTM trajectory prediction model used in the embodiments of this application; Figure 4 This is a flowchart illustrating the multi-dimensional matching and sorting algorithm used to generate the recommendation list in the embodiments of this application. Figure 5 This is a schematic diagram of a recommendation decision logic flow in an embodiment of this application; Figure 6 This is a schematic diagram of the effect monitoring and feedback optimization process used in the embodiments of this application; Figure 7 This is a graph showing the change in recommended accuracy over time in the embodiments of this application; Figure 8 A schematic diagram of the structure of an intelligent business traffic acquisition and recommendation system implemented using the solution in the embodiments of this application; Figure 9 This is a schematic diagram comparing the recommendation effect of the solution in this application embodiment with that of traditional recommendation methods; Figure 10This is a graph showing the changes in customer traffic for businesses before and after adopting the solution provided in this application embodiment; Figure 11 This is a graph showing the changing trends of user activity and retention rate on the platform after adopting the solution provided in the embodiments of this application; Figure 12 This is a comparison chart showing the recommendation effects of the solutions in this application under different scenarios; The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation
[0022] The present application will now be described in further detail with reference to the accompanying drawings.
[0023] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0024] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0025] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program instructions, data structures, program devices, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0026] This application provides a recommendation method based on real-time trajectory data. This method effectively utilizes the potential dynamic information in the user's historical trajectory sequence and corresponding contextual information. By understanding the temporal dependencies between various historical trajectory points reflected in the historical trajectory sequence and contextual information, it can perceive the user's actual needs and intentions in advance, making the predicted path more accurate. Furthermore, it can push suitable recommended merchants to the user based on this, thereby completing a more forward-looking merchant recommendation, improving the accuracy of the recommendation, and better meeting the user's actual needs.
[0027] In practical scenarios, the execution subject of this method can be a user device, a network device, or a device composed of user devices and network devices integrated through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, and tablets; the network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud consists of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0028] Figure 1 This application illustrates a recommendation method based on real-time trajectory data, which includes at least the following processing steps: Step S101: Obtain the user's historical trajectory sequence and corresponding context information.
[0029] The historical trajectory sequence refers to a sequence composed of multiple historical trajectory points, the specific content of which may include the location and timestamp of multiple historical trajectory points. In practical scenarios, location can be represented by latitude and longitude. For example, the historical trajectory sequence of user1 is T = {p1, p2, ..., pt}, where p1, p2, ..., pt represent each historical trajectory point in the sequence, specifically including longitude, latitude, and timestamp. The context information refers to information that can be used for the characteristics related to these historical trajectory points. In this embodiment, the context information includes at least three aspects: time information, environmental information, and user information. The time information refers to the characteristics related to the time of the historical trajectory point, such as the specific time, day of the week, and holidays of the historical trajectory point. The environmental information refers to the characteristics related to the environment of the historical trajectory point, such as the weather and traffic conditions at the time of the historical trajectory point. The user information refers to the characteristics related to the user of the historical trajectory point, such as user preferences, user travel purpose, mode of transportation, and other user profiles.
[0030] Step S102: Based on the historical trajectory sequence and context information, predict multiple predicted trajectory points for the user at future times, and generate a predicted path based on the predicted trajectory points. Since the historical trajectory sequence and context information can reflect the temporal dependencies between various historical trajectory points, the user's actual needs and intentions can be perceived in advance, making the predicted path more accurate.
[0031] In some embodiments of this application, when predicting multiple predicted trajectory points of the user at future times based on the historical trajectory sequence and context information, and generating a predicted path based on the predicted trajectory points, a preset deep learning model can be used to process the historical trajectory sequence and context information to predict multiple predicted trajectory points of the user at future times, and generate a predicted path based on the predicted trajectory points.
[0032] The preset deep learning model is a deep learning model that can be used to extract the temporal dependencies between various historical trajectory points in the historical trajectory sequence, and it also employs an attention mechanism during the prediction process. For example, the preset deep learning model in this embodiment can be an LSTM (Long Short-Term Memory) model, a Transformer model, etc., which can perceive the user's actual needs and intentions in advance through temporal dependencies and attention mechanisms, making the predicted path more accurate.
[0033] In some embodiments of this application, when processing the historical trajectory sequence and context information using a preset deep learning model to predict multiple predicted trajectory points for the user at future times, and generating a predicted path based on the predicted trajectory points, the specific methods may be as follows: Figure 2 The processing flow shown includes the following processing steps: Step S201 involves feature encoding the historical trajectory sequence and context information to obtain corresponding feature vectors. For example, after feature encoding the historical trajectory sequence T = {p1, p2, ..., pt} of user1 and the context information, a corresponding feature sequence [v1, v2, ..., v10] can be obtained, where each feature vector represents a historical trajectory point; for example, feature vector v1 corresponds to historical trajectory point p1. The dimension of each feature vector can be set according to the needs of the actual scenario; for example, in this embodiment, the dimension of each feature vector can be set to 128.
[0034] In practical scenarios, different encoding methods can be adopted according to actual needs. For example, for location information coordinate values, a conventional normalized encoding method can be used. By scaling the coordinate values proportionally to a uniform numerical range (such as between 0 and 1), the influence of differences in feature units can be effectively eliminated, improving the efficiency of subsequent processing. Alternatively, grid encoding can be used to process location information. This method divides continuous geographic space into discrete grid regions, each with a unique code. The coordinate values are then converted into the unique code of each grid, introducing regional spatial semantics. This allows the encoded feature vector to incorporate information about regional patterns, thereby improving the accuracy of the solution. For time information, a sine-cosine function is used to convert periodic time information into a continuous vector representation, preserving the cyclical nature of time. This allows the identification of periodic patterns through these feature vectors, further improving the accuracy of the solution.
[0035] Step S202: Input the feature vector into a preset deep learning model to extract the temporal dependency relationship between each historical trajectory point in the historical trajectory sequence. Taking the LSTM model as an example, the feature vectors in the feature sequence [v1, v2, ..., v10] are sequentially input into the LSTM model. After inputting the first feature vector v1, the LSTM model outputs a hidden state vector h1. Then, feature vector v2 can be input, and the LSTM model can combine it with the previously obtained hidden state vector h1 to output a hidden state vector h2, which integrates the information from feature vectors v1 and v2. After inputting feature vector v3, the LSTM model combines it with the previously obtained hidden state vector h2 to output the current hidden state vector h3, which integrates the information from feature vectors v1, v2, and v3. This process continues until feature vector v10 is input. At this point, the hidden state vector h10 output by the LSTM model integrates the information from all feature vectors in the feature sequence [v1, v2, ..., v10], including the temporal dependencies between historical trajectory points. The dimension of each hidden state vector can be set according to the needs of the actual scenario; for example, in this embodiment, the dimension of the hidden state vector can be set to 256.
[0036] Step S203: Calculate the importance score of each historical trajectory point in the historical trajectory sequence according to the temporal dependency relationship, and calculate the attention vector based on the importance score. In a practical scenario, the hidden state vector of the last output can be used as the query vector q. Compare its similarity with other output hidden state vectors, and determine the importance score of the historical trajectory point corresponding to each hidden state vector based on the similarity. For example, the importance score of the first historical trajectory point p1 is score1 = similarity(q, h1) = 0.1, where q is generated based on h10. In this way, the importance score of each historical trajectory point can be calculated separately.
[0037] After obtaining the importance scores of each historical trajectory point in the historical trajectory sequence, they can be normalized to obtain the weights of each historical trajectory point. For example, in this embodiment, after processing the importance scores using the softmax function, the following weights can be obtained: w1=0.01, w2=0.005, ..., w8=0.35, w9=0.30, w10=0.20. Then, the hidden state vector h1 corresponding to each historical trajectory point can be weighted and summed according to the corresponding weights to obtain the attention vector. For example, the calculation method of the attention vector attention_output in this embodiment is as follows: attention_output=w1·h1+ w2·h2+...+w8·h8+w9·h9+w10·h10 In this way, more important trajectory points in the historical trajectory can be assigned higher weights, enabling the scheme to perceive key points in the historical trajectory and focus on key trajectory segments, thereby improving the accuracy of subsequent predictions. The dimension of the attention vector `attention_output` is the same as the dimension of the hidden state vector. For example, in this embodiment, if the hidden state vector is 256, then the dimension of the attention vector `attention_output` is also 256.
[0038] Step S204: Input the attention vector into the fully connected network, and use the fully connected network to output multiple predicted trajectory points of the user at future times.
[0039] After inputting the attention vector into the fully connected network, the fully connected network can output multiple predicted trajectory points for future timeframes. The specific number can be set according to the needs of the actual scenario. For example, in this embodiment, it is set to 5, that is, output 5 predicted trajectory points, such as those for the next 5 minutes, 10 minutes, 20 minutes, 30 minutes, and 60 minutes, to achieve multi-scale predictions such as short-term prediction (e.g., 5-10 minutes) and medium-term prediction (e.g., 30-60 minutes). In actual scenarios, the activation function of the fully connected network can be ReLU. The fully connected network first outputs the location information of multiple predicted trajectory points for future timeframes. For example, in this embodiment, it can output the latitude and longitude coordinate sequence of 5 predicted trajectory points, such as [(116.45,39.92), (116.46,39.93), (116.47,39.94), ...].
[0040] Figure 3 The diagram illustrates the structure of an LSTM trajectory prediction model used in an embodiment of this application. The LSTM trajectory prediction model includes an input layer, an embedding layer, an LSTM layer, an attention layer, a fully connected layer, and an output layer. Data is passed sequentially between the layers, and the coordinate information of the predicted trajectory points is finally output.
[0041] Step S205: Perform map matching based on the predicted trajectory points to generate a predicted path.
[0042] When performing map matching, it can be based on POI (Point of Interest) information or related road information in the map data. For example, for the first predicted trajectory point p11 (116.45, 39.92), querying the map data can match "XX Street - Section A". Simultaneously, based on the coordinate information of "XX Street - Section A", the coordinates of the predicted trajectory point p11 can be corrected, such as to (116.451, 39.921), to further improve accuracy. Similarly, for other predicted trajectory points, the corresponding map locations can be obtained through map matching. For example, the second predicted trajectory point p12 matches "XX Street - Section B", and the third predicted trajectory point p13 matches "YY Road - Gym Entrance", etc. Therefore, by connecting these map locations in sequence, the corresponding predicted path can be generated.
[0043] In real-world scenarios, the map locations matched between adjacent predicted trajectory points may be unreachable. In such cases, additional processing is required to insert intermediate road segments between unreachable predicted trajectory points. For example, taking the aforementioned three predicted trajectory points p11, p12, and p13 as examples, if "XX Street - Section B" and "YY Road - Gym Entrance" are unreachable, then a suitable intermediate road segment "Section C" needs to be inserted to form a reachable predicted path ["XX Street - Section A" → "XX Street - Section B" → "Section C" → "YY Road - Gym Entrance"].
[0044] Therefore, in some embodiments of this application, when performing map matching based on the predicted trajectory points to generate a predicted path, the following processing method can be adopted: perform map matching based on the coordinates of the predicted trajectory points to obtain the map position corresponding to the coordinates of each predicted trajectory point; check the path reachability between the predicted trajectory points; if reachable, generate a predicted path according to the sequence order of the predicted trajectory points, for example, directly generate a predicted path of ["XX Street - Section A" → "XX Street - Section B" → "YY Road - Gym Entrance"]. If unreachable, insert intermediate road segments between the unreachable predicted trajectory points, and generate a predicted path according to the sequence order of the predicted trajectory points and intermediate road segments, for example, generate a predicted path after inserting intermediate road segments of ["XX Street - Section A" → "XX Street - Section B" → "Section C" → "YY Road - Gym Entrance"].
[0045] After generating the predicted path, more detailed information can be obtained about the path based on relevant contextual information, such as path length and estimated arrival time, to provide further information for subsequent recommendations, thereby improving the accuracy of merchant recommendations.
[0046] Step S103: Recall candidate merchants according to the predicted path, sort the candidate merchants, and obtain a recommendation list including multiple candidate merchants.
[0047] The solution in this application employs a multi-dimensional intelligent matching algorithm that comprehensively considers information from multiple dimensions, including geographical location, user preferences, merchant quality, and time factors, to score and rank candidate merchants, thereby obtaining a recommendation list that better meets user needs. Specifically, after recalling candidate merchants based on the predicted path, the candidate merchants can be ranked using multi-dimensional information to obtain a recommendation list including multiple candidate merchants. The multi-dimensional information includes at least one of the following: geographical location, user preferences, merchant quality, and time factors.
[0048] When sorting the candidate merchants using multi-dimensional information to obtain a recommendation list including multiple candidate merchants, the location matching score, preference matching score, quality matching score, and time matching score of each candidate merchant can be calculated based on relevant factors such as geographical location, user preference, merchant quality, and time factor. Then, the comprehensive score of each candidate merchant can be calculated based on the location matching score, preference matching score, quality matching score, and time matching score, and the candidate merchants can be sorted based on the comprehensive score to generate a recommendation list including multiple candidate merchants.
[0049] When calculating the location matching score for each candidate merchant based on geographic location factors, the following factors can be considered: distance factor, direction factor, and detour cost factor. The distance factor can be determined by calculating the shortest distance between the merchant and the user's current location or predicted path. For example, in this embodiment, the shortest distance d_path between the merchant's location and the predicted path can be calculated first, and then the distance factor corresponding to this shortest distance can be calculated using a decay function. The decay function used in this embodiment can be the natural exponential function exp(), and the distance factor f_distance can be calculated using the following formula: f_distance = exp(-d_path / σ) Where σ is the attenuation parameter, which can be an empirical value set according to the needs of the actual scenario. For example, in this embodiment, it can be a value between 500 and 1000 meters. Taking the following actual scenario as an example, if the merchant's location is (116.65, 39.83) and the predicted path is [(116.64, 39.82), (116.65, 39.83), (116.67, 39.84)], then the merchant is on the predicted path, and the calculated d_path = 0 meters, and the distance factor f_distance = exp(-0 / 500) = 1.0. However, if the merchant is not on the path, for example, if the merchant's location is (116.66, 39.90), the calculated d_path = 800 meters, and the distance factor f_distance = exp(-800 / 500) = exp(-1.6) ≈ 0.20.
[0050] The direction factor can be determined by judging whether the merchant is ahead of or along the predicted path's direction of movement. For example, in this embodiment, the user's movement direction vector (direction_vector) can be calculated first based on the predicted path and the user's current location, and the merchant's direction vector (shop_vector) can be calculated based on the merchant's location and the user's current location. Then, the cosine similarity (cos_θ) between the movement direction vector (direction_vector) and the merchant's direction vector (shop_vector) is calculated, and the specific result of the direction factor is determined based on the cosine similarity (cos_θ). The specific judgment logic is as follows: If cos_θ>= 0.7, it means the angle between the two is <45 degrees, and it is determined that the merchant is in front of the user's direction of movement. In this case, the direction factor f_direction = 1.0 is determined. If 0.7 > cos_θ >= 0, it means that the angle between the two is greater than or equal to 45 degrees and less than 90 degrees. It is determined that the merchant is to the side and front of the user's direction of movement. In this case, f_direction = 0.5 + 0.5 × cos_θ is determined. If cos_θ < 0, it means that the angle between the two is greater than or equal to 90 degrees, and it is determined that the merchant is behind the user's direction of movement. At this time, the direction factor f_direction = 0.1 × (1 + cos_θ) is determined.
[0051] For example, in this embodiment, the user's current location is (116.64, 39.82), the predicted path's endpoint is (116.67, 39.84), and the merchant's location is (116.65, 39.83). Based on the user's current location (116.64, 39.82) and the predicted path's endpoint (116.67, 39.84), and after normalizing the results, we get direction_vector = (0.83, 0.55). Based on the user's current location (116.64, 39.82) and the merchant's location (116.65, 39.83), and after normalizing the results, we get shop_vector = (0.71, 0.71). From this, we calculate cos_θ = 0.98. Since 0.98 >= 0.7, we can determine that the calculated direction factor f_direction = 1.0.
[0052] The detour cost factor can be determined by calculating the additional time cost required to reach the merchant. For example, in this embodiment, the original path length `path_original` of the predicted path can be obtained first, and the detour path length `path_detour` can be calculated based on the user's current location, the endpoint of the predicted path, and the merchant's location. Then, the extra distance `extra_distance` is determined based on the difference between the original path length `path_original` and the detour path length `path_detour`, and the extra time `extra_time` can be calculated by further combining information such as travel mode and actual road conditions. Then, the detour cost `f_detour` corresponding to the extra time can be calculated using a decay function. In this embodiment, the decay function can also be the natural exponential function `exp()`, and the distance factor `f_distance` can be calculated using the following formula: f_detour = exp(-extra_time / τ) Where τ is the attenuation parameter, which can be an empirical value set according to the needs of the actual scenario. For example, in this embodiment, it can be a value between 5 and 10 minutes. Taking the following actual scenario as an example, if the user's current location is (116.64, 39.82), the predicted path is [(116.64, 39.82), (116.65, 39.83), (116.67, 39.84)], and the merchant's location is (116.65, 39.83), which is on the predicted path. At this time, the original path length path_original = 2.0km, the detour path length path_detour = 2.0km, and therefore the extra path extra_distance = 0km, and the extra time extra_time = 0 minutes. Thus, the detour cost f_detour = exp(-0 / 5) = 1.0. Furthermore, if the merchant's location is not on the predicted path, for example, the original path length is path_original = 2.0km and the detour path length is path_detour = 3.0km, then the extra distance is extra_distance = 3km - 2km = 1km. If the extra time is calculated to be 8 minutes based on the travel mode, actual road conditions, etc., then the detour cost can be calculated as f_detour = exp(-8 / 5) ≈ 0.20.
[0053] After calculating the distance factor, direction factor, and detour cost factor separately, the location matching score S_location can be calculated by combining these factors. The specific calculation formula is as follows: S_location = w1 × f_distance + w2 × f_direction + w3 × f_detour Where w1, w2, and w3 are the weights corresponding to the distance factor, direction factor, and detour cost factor, respectively. For example, in this embodiment, w1=0.4, w2=0.3, and w3=0.3 are set. If the calculated distance factor f_distance=0.2, direction factor f_direction=1.0, and detour cost factor f_detour=0.2, then the final calculated S_location=0.4 × 0.2+ 0.3 × 1.0 + 0.3 × 0.2=0.44.
[0054] When calculating the preference matching score for each candidate merchant based on relevant user preference factors, the following factors can be considered: category preference factor, brand preference factor, and price matching factor. The category preference factor can be determined based on the user's historical consumption records and interest tags to calculate the user's preference for merchant categories. For example, the number of times a user has purchased from various merchant categories in their consumption records can be counted. For instance, for user1, within a preset time period, they purchased from restaurants 30 times, entertainment 5 times, and shopping 2 times. The category frequency f_category can then be calculated as the category preference factor. For example, in the aforementioned scenario, the category frequency f_category[restaurant] = 30 / 38 ≈ 0.79. In practical scenarios, to avoid a new category frequency of 0, the calculated category frequency can be smoothed as follows: f_category = (f_category + 0.1) / (1+ 0.1) For example, the frequency of the aforementioned food and beverage category is smoothed as follows: f_category = (0.79 + 0.1) / 1.1≈ 0.81 Brand preference factors are used to identify specific brands and chain stores that users like. They can also be determined based on users' historical spending records or interest tags to calculate the degree of user preference for certain merchant categories. For example, the number of times a user has purchased from different brands in their spending records can be counted. For instance, if user1 purchased from brand A 15 times, brand B 10 times, and brand C 2 times within a preset time period, the brand frequency f_brand can be calculated as the brand preference factor. For example, in the aforementioned scenario, the brand frequency f_brand[A brand] = 15 / 38 ≈ 0.39 for brand A, and the brand frequency f_brand[C brand] = 2 / 38 ≈ 0.05 for brand C.
[0055] The price matching factor is calculated based on the degree of matching between a user's spending power and a merchant's price range. For example, based on a user's spending history, we can calculate the user's average spending (user_avg_price) and spending range (user_price_range), while simultaneously obtaining the merchant's average price (shop_avg_price). Then, the price matching factor f_price is determined based on the user's average spending (user_avg_price), spending range (user_price_range), and merchant's average price (shop_avg_price). The specific judgment rule is as follows: if the merchant's average price (shop_avg_price) is within the user's spending range (user_price_range), the price matching factor is further calculated based on the merchant's average price (shop_avg_price) and the user's average spending (user_avg_price). The calculation principle is that the closer the merchant's average price (shop_avg_price) and the user's average spending (user_avg_price) are, the higher the price matching factor. For example, the following formula can be used: f_price=1.0-abs(shop_avg_price-user_avg_price) / user_avg_price If the average price of the merchant, shop_avg_price, is lower than the user's consumption range, user_price_range, then f_price = 0.5 × (shop_avg_price / user_price_range[0]); if the average price of the merchant, shop_avg_price, is higher than the user's consumption range, user_price_range, then f_price = 0.3 × (user_price_range[1] / shop_avg_price), where user_price_range[0] represents the lower limit of the user's consumption range, user_price_range, and user_price_range[1] represents the upper limit of the user's consumption range, user_price_range. Taking the aforementioned scenario as an example, if the average user spending is user_avg_price = 65 yuan and the spending range is user_price_range = [50, 80], for merchant shop1, the average price is 60 yuan, so the price matching factor f_price = 1.0 - abs(60-65) / 65 = 1.0 - 0.077 ≈ 0.92. For merchant shop2, the average price is 40 yuan, so the corresponding price matching factor f_price = 0.5 × (40 / 50) = 0.4.
[0056] After calculating the category preference factor, brand preference factor, and price matching factor separately, the preference matching score S_preference can be calculated by combining these factors. The specific calculation formula is as follows: S_preference = w4 × f_category + w5 × f_brand + w6 × f_price Where w4, w5, and w6 are the weights corresponding to the category preference factor, brand preference factor, and price matching factor, respectively. For example, in this embodiment, w4=0.4, w5=0.4, and w6=0.2. If the calculated category preference factor f_category=0.81, brand preference factor f_brand=0.39, and price matching factor f_price=0.92, then the final calculated S_preference = 0.4 × 0.81 + 0.4 × 0.39 + 0.2 × 0.92 = 0.664.
[0057] When calculating the quality matching score for each candidate merchant based on relevant factors of merchant quality, the following factors can be considered: merchant rating factor, popularity index factor, and certification level factor. Among these, the merchant rating factor can be determined based on the average user rating and the number of reviews. For example, if merchant shop1 has an average user rating of 4.8 and 1200 reviews, and merchant shop2 has an average user rating of 4.5 and 50 reviews, the average rating can first be normalized to calculate the corresponding normalized score. For example, the formula is: rating_normalized = (rating - 1). Therefore, the normalized score for merchant shop1 is rating_normalized = (4.8 - 1) / 4 = 0.95. Then, the credibility of the rating is calculated using the number of reviews. The more reviews, the higher the credibility of the corresponding rating. The calculation formula can be: credibility = min(1.0, log(1 + review_count) / log(1 +1000)). For example, if the review_count of merchant shop1 is 1200, then the credibility of the rating is calculated as: credibility = min(1.0, log(1201) / log(1001)≈1.0). Then, based on the normalized rating (rating_normalized) and the credibility, the merchant's rating factor f_rating = rating_normalized × credibility is calculated.
[0058] Taking shop1 in the aforementioned scenario as an example, its corresponding merchant rating factor f_rating = 0.95 × 1.0 = 0.95. For another merchant, shop2, its average rating is 4.5 and the number of reviews is 50. Therefore, the normalized rating is calculated as rating_normalized = (4.5-1) / 4 = 0.875, and the rating credibility is calculated as min(1.0, log(51) / log(1001)≈0.18. Finally, the merchant rating factor f_rating is calculated as 0.875×0.18≈0.16.
[0059] The popularity index factor can be calculated and determined based on popularity indicators such as the number of visitors, the number of favorites, and the number of clicks. For example, the popularity indicators such as the number of visitors, the number of favorites, and the number of clicks can be normalized to calculate the corresponding normalized indicators. In this embodiment, the following calculation formulas can be used respectively: Number of visitors: visit_score=min(1.0,log(1+visit_count) / log(1+10000)) Number of favorites: favorite_score=min(1.0,log(1+favorite_count) / log(1+1000)) Click count: click_score=min(1.0,log(1+click_count) / log(1+50000)) Then, by taking a weighted average of these normalized indicators, we can obtain the popularity index factor f_popularity in this scheme. For example, in this embodiment, the merchant shop1 has 5000 visitors, 500 favorites, and 8000 clicks in the past month. Based on these, the normalized indexes for visitor count (visit_score) are calculated as follows: visit_score = min(1.0, log(5001) / log(10001) ≈ 0.70, favorites (favorite_score) = min(1.0, log(501) / log(1001) ≈ 0.69, and clicks (click_score) = min(1.0, log(8001) / log(50001) ≈ 0.52. If the weights of these three are set to 0.5, 0.3, and 0.2 respectively, the popularity index factor f_popularity can be calculated as: f_popularity = 0.5 × 0.70 + 0.3 × 0.69 + 0.2 × 0.52 ≈ 0.65.
[0060] The certification level factor can be determined by whether a merchant has official certification, brand chain status, or premium merchant status. For example, in a real-world scenario, different scores can be assigned to different certification levels: no certification = 0.0, ordinary merchant = 0.3, premium merchant = 0.6, brand chain = 0.8, and official certification = 1.0. Therefore, the corresponding certification level factor f_certification can be determined based on the certification marks a merchant possesses. For instance, for merchant shop1, which has both "brand chain" and "official certification" marks, the higher score can be used as the final certification level factor; that is, merchant shop1's certification level factor f_certification = 1.0.
[0061] After calculating the merchant rating factor, popularity index factor, and certification level factor separately, the merchant quality score S_quality can be calculated by combining these factors. The specific calculation formula is as follows: S_quality = w7 × f_rating + w8 × f_popularity + w9 × f_certification Where w7, w8, and w9 are the weights corresponding to the merchant rating factor, popularity index factor, and certification level factor, respectively. For example, in this embodiment, w7=0.5, w8=0.3, and w9=0.2. If the calculated merchant rating factor f_rating=0.95, popularity index factor f_popularity=0.65, and certification level factor f_certification=1.0, then the final calculated S_quality = 0.5 × 0.95 + 0.3 × 0.65 + 0.2 × 1.0 = 0.87.
[0062] When calculating the time matching score for each candidate merchant based on relevant time factors, the following factors can be considered: business status factor, arrival time factor, and promotional activity factor. The business status factor can be determined based on whether the current time is within a business period. The business status factor is highest when the current time is within a business period, and when outside a business period, the closer the current time is to a business period, the higher the business status factor. For example, if merchant shop1's business start time t_open = 8:00 and business end time t_close = 22:00, and the current time t0 is within a business period, then the business status factor f_open = 1.0. If the current time t0 is before the business start time t_open, then the business status factor f_open = exp(-minutes_to_open / 60), where minutes_to_open is the difference between the business start time t_open and the current time t0. If the current time t0 is after the business end time t_close, then the business status factor f_open = exp(-minutes_after_close / 30), where minutes_after_close is the difference between the current time t0 and the business end time t_close.
[0063] The arrival time factor can be determined based on whether the user's expected arrival time falls within the business hours. For example, the arrival time factor is highest when the expected arrival time t1 is within the business hours. When the expected arrival time t1 is outside the business hours, the closer it is to the start of business hours, the higher the arrival time factor. If it is after business hours, the arrival time factor is set to zero. Furthermore, in practical scenarios, it is also necessary to avoid arrivals at the very beginning or near the end of business hours.
[0064] Therefore, the solution in this application embodiment can calculate the arrival time factor as follows: When the expected arrival time t1 is within the business hours, it is determined whether it is within the first hour of business opening or the last hour of business opening. If it is within the last hour, the arrival time factor f_arrival = 0.7. If the expected arrival time t1 is within the business hours but is not within the first hour of business opening or the last hour of business opening, the arrival time factor f_arrival = 1.0. For example, for the aforementioned shop1, its business start time t_open = 8:00 and business end time t_close = 22:00. If the expected arrival time t1 is 19:00, then the arrival time factor f_arrival = 1.0. If the expected arrival time t1 is before the business start time t_open, then the business status factor f_arrival = exp(-minutes_to_open / 30), where minutes_to_open is the difference between the business start time t_open and the expected arrival time t1. If the expected arrival time t1 is after the business close time t_close, then f_arrival=0.
[0065] The discount activity factor is determined based on whether the merchant currently has any promotional activities, special offers, or limited-time discounts. The calculation principle is: the greater the discount and the shorter the remaining time, the higher the score for the discount activity factor. For example, if merchant shop1's current promotion is "¥15 off for purchases over ¥50" with 1 hour remaining, the discount strength score can be calculated as discount_score = min(1.0, discount strength × 2), where discount strength = discount amount / original price = 15 / 50 = 0.3. Therefore, merchant shop1's discount strength score is discount_score = 0.6. The remaining time score, urgency_score, is determined based on the remaining time. For example, if the remaining time is less than 2 hours, the urgency_score is 1.0; if the remaining time is greater than or equal to 2 hours, the urgency_score is 0.5. If the weights for discount strength and remaining discount time are set to 0.7 and 0.3 respectively, then the discount activity factor f_promotion = 0.7 × discount_score + 0.3 × urgency_score = 0.7 × 0.6 + 0.3 × 1.0 = 0.72 can be calculated by combining the weights.
[0066] After calculating the business status factor, arrival time factor, and promotional activity factor separately, the time matching score S_time can be calculated by combining these factors. The specific calculation formula is as follows: S_time = w10 × f_open + w11 × f_arrival + w12 × f_promotion Where w10, w11, and w12 are the weights corresponding to the business status factor, arrival time factor, and promotional activity factor, respectively. For example, in this embodiment, w10=0.4, w11=0.4, and w12=0.2 are set. If the calculated business status factor f_open=1.0, arrival time factor f_arrival=1.0, and promotional activity factor f_promotion=0.72, then the final calculated S_time = 0.4 × 1.0 + 0.4 × 1.0 + 0.2 × 0.72 = 0.944.
[0067] Therefore, by utilizing the aforementioned multi-dimensional information such as geographical location, user preferences, merchant quality, and time factors, candidate merchants can be ranked more accurately, resulting in a recommendation list that better meets user needs. When calculating the overall score S_total for each candidate merchant based on the location matching score, preference matching score, quality matching score, and time matching score corresponding to geographical location, user preferences, merchant quality, and time factors, the following formula can be used: S_total = α × S_location + β × S_preference + γ × S_quality + δ × S_time Here, α, β, γ, and δ represent the weights corresponding to the location matching score, preference matching score, quality matching score, and time matching score, respectively. This weighted calculation method allows for the rapid and accurate calculation of the candidate merchant's overall score. Furthermore, the weights in this embodiment can be automatically learned using machine learning methods (such as gradient boosting and deep learning) to further optimize the processing results.
[0068] In other embodiments of this application, to further improve the fit between the ranking results and users, and enhance the effectiveness of merchant recommendations, personalized re-ranking can be performed when ranking candidate merchants according to the comprehensive score to obtain a recommendation list including multiple candidate merchants. First, candidate merchants can be ranked according to the comprehensive score to obtain a preliminary ranking result. Then, the preliminary ranking result is adjusted according to the user's personalized information to obtain an optimized ranking result. Finally, a recommendation list including multiple candidate merchants is generated based on the optimized ranking result. In practical scenarios, deep learning ranking models (such as Wide&Deep, DeepFM, etc.) can be used to personalize the preliminary ranking result, making the ranking result more compatible with the user's personalized needs. Furthermore, the ranking results can be filtered and deduplicated to avoid duplicate merchants.
[0069] When obtaining the recommendation list, a Top-k recommendation method can be used, selecting the top k merchants based on the sorting results as candidate merchants in the recommendation list. The value of k can be set according to the needs of the actual scenario, for example, it can usually be set to 3~5.
[0070] When generating the recommendation list, detailed information about candidate merchants in the list can be obtained simultaneously, so that it can be quickly provided to users during subsequent recommendations. For example, the detailed information in this embodiment may include: Basic merchant information: Name, Category, Address, Phone Number, Images; Distance and navigation information: distance, estimated time of arrival, navigation buttons; Ratings and user reviews: ratings, number of reviews, featured reviews; Special offers and services: coupons, discounts, signature dishes / services; Reason for recommendation: Personalized recommendation copy (such as "Brands you often visit" or "On the way").
[0071] Figure 4 The flowchart of the multi-dimensional matching and ranking algorithm used to generate the recommendation list in the embodiment of this application is shown, which includes candidate merchant recall, multi-dimensional matching, comprehensive scoring and ranking, result filtering, and recommendation list generation.
[0072] Step S104: When the recommendation triggering condition is met, at least one candidate merchant is selected from the recommendation list as the recommended merchant according to the sorting result, and the recommended merchant is pushed to the user.
[0073] In this embodiment, an intelligent recommendation decision-making mechanism and timing control strategy are implemented by setting reasonable recommendation trigger conditions. This ensures that the most suitable merchant information is pushed to the user at the optimal time. Furthermore, by setting push frequency limits, excessive user disturbance is avoided, improving user experience and increasing user acceptance and response rate. The trigger conditions include at least one of the following: Geographic trigger: The user enters the first distance range around the candidate merchant. For example, the first distance range can be set to 500 meters. Thus, when the distance between the user's current location and the location of the candidate merchant is less than 500 meters, the merchant will be selected for push notification.
[0074] Path triggering: The user's predicted path passes through a candidate merchant, or the distance between the predicted path's destination and the candidate merchant is less than a second distance range. For example, the second distance range can be set to 300 meters. Thus, when the user's predicted path passes through a candidate merchant, or the distance between the predicted path's destination and the candidate merchant is less than 300 meters, that merchant is selected for push notification.
[0075] Time-based trigger: The current time reaches a preset time period, and the candidate merchant matches the preset merchant category. For example, the preset time period may include dining hours, such as 11:30-13:30, 17:30-19:30, etc. In this case, if the candidate merchant is a catering business, then that candidate merchant can be selected for push notification.
[0076] Activity trigger: The candidate merchant is currently offering a promotional activity, and the merchant category of the candidate merchant matches the user's preferences.
[0077] Meanwhile, when pushing the recommended merchants to the user, a push frequency limit can be set, so that the recommended merchants are pushed to the user according to the push frequency limit. The push frequency limit includes at least one of the following: Single merchant restriction: The push interval for the same recommended merchant is greater than or equal to the first duration. For example, if the first duration is set to 7 days, the same merchant will only be pushed to the user once a week.
[0078] Regional restrictions: When users are in the same region, the interval between two push notifications will be greater than or equal to the second duration. For example, the second duration can be set to 2 hours, in which case the interval between two push notifications will be greater than or equal to 2 hours when users are in the same region.
[0079] Daily limit: The number of push notifications a single user can receive per day is less than or equal to the first notification. For example, the first notification can be set to 5, in which case the number of push notifications a single user can receive per day will not exceed 5.
[0080] User-defined restrictions: Recommended merchants are pushed to the user based on the user's defined recommendation frequency preferences and do-not-disturb periods. For example, a user can set 9:30-13:30 as a do-not-disturb period, during which recommended merchants will not be pushed to the user.
[0081] This solution can also adjust recommendation strategies based on the user's current state and scenario to achieve context-aware recommendations and improve recommendation relevance and usability. For example, when a user is driving, it recommends gas stations, service areas, and parking lots along the way; when a user is shopping on foot, it recommends nearby restaurants, entertainment venues, and leisure places; when a user is taking public transportation, it recommends businesses along the route or near the terminal station; and when a user is waiting, it recommends nearby cafes, convenience stores, etc., that can be reached quickly.
[0082] Furthermore, in the solutions of this application embodiment, the recommendation format can take various forms to enhance the information delivery effect. For example, the recommendation format in this embodiment may include, but is not limited to, the following: In-app recommendation cards: Display merchant recommendation cards in the homepage feed; Map annotation: Highlight the locations and icons of recommended businesses on the map; Push notifications: Send notification messages containing merchant information and offers; Voice prompts: During navigation, the system will provide voice reminders and recommend businesses along the way; Coupon distribution: Merchant coupons are directly distributed to user accounts.
[0083] In practical scenarios, the solution of this application embodiment can select an appropriate method to push recommended merchants to users according to the actual scenario. For example, when the user is using the application, push messages can be sent through recommendation cards in the application (such as in the form of an information stream); when the user is not using the application but allows push notifications, push notifications can be used; when the user is navigating, map markers and voice prompts can be used; and when the recommended merchant has a limited-time offer, a coupon message can be pushed, along with a coupon claim button in the message, so that the user can claim the coupon quickly.
[0084] Figure 5 This paper illustrates a recommendation decision logic flow in an embodiment of the present application, which performs trigger condition judgment, frequency control check, user status judgment and recommendation quality evaluation. If all of them pass, the push method is selected and the recommendation is executed.
[0085] In some embodiments of this application, a robust feedback optimization mechanism is also established to track the effectiveness of recommendations in real time and continuously optimize the relevant parameters of algorithms and strategies in the recommendation method based on feedback data. Therefore, the recommendation method based on real-time trajectory data provided in this application also includes collecting feedback data and optimizing the relevant parameters of the recommendation method based on the feedback data. For example, collecting feedback data may include user behavior tracking, explicit feedback, and negative feedback processing. For instance, user behavior tracking refers to recording user actions such as clicking, viewing, saving, navigating, and visiting stores related to recommendations; explicit feedback refers to collecting users' active feedback such as ratings, likes, and comments; and negative feedback processing refers to recording negative feedback data such as "not interested," "hide," and "report." Through this collected feedback data, the relevant parameters of the recommendation method can be optimized, thereby improving the quality and accuracy of subsequent processing.
[0086] For example, the optimization methods in this embodiment can mainly include the following: A / B testing: Compare the effects of different recommendation strategies and select the optimal solution; Parameter tuning: Adjust algorithm parameters (such as weights, thresholds, etc.) through grid search or Bayesian optimization. Model iteration: Regularly retrain the model using new feedback data to improve accuracy; Strategy Adjustment: Adjust recommendation rules and triggering conditions based on monitoring results; Negative feedback learning: Mark recommendation types that users are not interested in to avoid duplicate recommendations.
[0087] By employing appropriate optimization methods, the user experience can be continuously improved by dynamically adjusting relevant parameters in algorithms and strategies.
[0088] Furthermore, this embodiment can establish a comprehensive monitoring indicator system to more effectively quantify business value and conversion efficiency, and improve the effectiveness of feedback optimization. For example, monitoring indicators may include: Exposure: The number of times the recommended information is displayed; Click-through rate (CTR): The percentage of users who click on push notifications; Details view rate: The percentage of users who view the details page of recommended merchants; Navigation rate: The percentage of users who click on the navigation to go to recommended merchants; Store visit rate: The percentage of users who actually visit the recommended merchant after receiving the push notification; Consumer conversion rate: The percentage of users who make a purchase at the recommended merchants; User satisfaction: User ratings and feedback on push notifications.
[0089] Figure 6The effect monitoring and feedback optimization process adopted in the embodiments of this application is shown. After the merchant recommendation is executed, the following processes are included in sequence: monitoring indicator collection, data analysis, effect evaluation, optimization strategy formulation, algorithm / strategy adjustment, and online verification, thereby realizing a closed-loop optimization iterative process.
[0090] By adopting this continuous optimization approach, the accuracy of this recommendation will continue to improve as optimization progresses. Figure 7 The graph shows the change in recommendation accuracy of this scheme over time, with the horizontal axis representing time (months) and the vertical axis representing recommendation accuracy (%). The graph shows that the recommendation accuracy continuously increases over time, demonstrating the strong iterative optimization capability of this application's scheme.
[0091] In some embodiments of this application, obtaining a user's historical trajectory sequence may include: collecting the user's raw trajectory data; preprocessing the raw trajectory data to obtain the user's historical trajectory sequence. The preprocessing may include, but is not limited to, the following: data cleaning, dataset smoothing, map matching, trajectory segmentation, and feature extraction. Data cleaning includes removing duplicate points, outliers (such as drift points, jump points, etc.), and noisy data. Trajectory smoothing refers to processing the raw trajectory data using algorithms such as Kalman filtering or moving average to reduce positioning errors. Map matching refers to matching the coordinate points in the raw trajectory data to the actual road network to improve location accuracy. Trajectory segmentation refers to the process of identifying stop points (i.e., points where the dwell time exceeds a threshold) and dividing the complete trajectory into multiple sub-trajectories based on these stop points. Feature extraction refers to extracting the spatiotemporal features, statistical features, sequence features, and semantic features of the trajectory. Through these preprocessing steps, the quality of the trajectory data can be improved, providing a more reliable data foundation for subsequent processing, while also enabling the identification of user trajectory segments and dwell behaviors, and understanding of user travel patterns.
[0092] In some embodiments of this application, user profiles can also be constructed based on relevant historical data of the user. This relevant historical data may include the user's historical trajectory data, consumption records, etc., through which multi-dimensional user profiles can be constructed, including user travel habits, user preferences, and user interest tags.
[0093] In real-world scenarios, user travel habit profiles can include frequently used origins and destinations, common routes, travel times, and activity areas. Frequently used origins and destinations can be locations such as home addresses, work addresses, and frequently visited places that often serve as the starting or ending point for travel. Common routes refer to the user's high-frequency travel paths and route preferences, such as the user's commuting route to and from get off work. Travel times can be determined by the user's travel time patterns, such as commuting periods and leisure time periods. Activity areas are determined by identifying the user's frequently visited areas and activity range.
[0094] User preference profiles can include user preferences for merchant categories, brands, prices, and services. Category preferences refer to the types of merchants a user prefers, such as dining, entertainment, shopping, and services. Brand preferences refer to specific brands and chain stores a user likes. Price preferences refer to a user's spending power and price range preferences. Service preferences refer to a user's preferences for service quality, environment, and unique features.
[0095] User interest tags can be divided into two categories: explicit tags and implicit tags. Explicit tags refer to interest tags that users actively set, which can be set through the relevant settings page or entry provided by the solution. Implicit tags are interest tags that are mined from user behavior by the solution.
[0096] Therefore, the solution in this application embodiment, by constructing user profiles, enables a deeper understanding of user behavior intentions and preferences, supports more personalized merchant recommendations, and can update user profiles in real time to reflect changes in the user's current status and needs, making merchant recommendations more accurate.
[0097] In some embodiments of this application, when recalling candidate merchants according to the predicted path, a multi-path recall strategy can be adopted, wherein the multi-path recall strategy includes: Geographic Recall: Based on the user's current location, search for merchants within a third distance range and use the search results as candidate merchants. For example, in practical scenarios, Geohash or R-tree spatial indexing algorithms can be used to search for all merchants within a third distance range R from the user's current location as the recall results.
[0098] Path recall: Based on the predicted path, search for merchants whose distance from the predicted path is less than the fourth distance range, and use the search results as candidate merchants. This can search for merchants along the predicted path and near the destination.
[0099] Interest Recall: Based on user interest tags, search for merchants that match the user's interest tags, and use the search results as candidate merchants to recall specific types of merchants that match the user's specific interests.
[0100] Collaborative Recall: Based on user preferences, search for merchants that match the user's preferences and use the search results as candidate merchants, thereby recalling potentially interested merchants based on similar user preferences.
[0101] By employing this multi-pronged recall strategy, the solution in this application embodiment can effectively improve recall efficiency, thereby quickly obtaining a set of candidate merchants, while also ensuring recall coverage and avoiding the omission of high-quality merchants.
[0102] To avoid potential data security issues during implementation, this application employs multi-layered privacy protection measures, which may include the following: Data anonymization: De-identifying user trajectory data by removing identity information. Data encryption: Encryption algorithms are used to protect the storage and transmission of sensitive data. User authorization: When a user uses the service for the first time, the purpose and scope of data usage are clearly explained, and the user can choose whether to enable this feature. Minimize permissions: The system only collects the data necessary for recommendations, avoiding excessive data collection. Data cleanup: Regularly clean up expired data to reduce the risks associated with data retention. Security measures include HTTPS (Hypertext Transfer Protocol Secure) firewalls and intrusion detection during data exchange.
[0103] This can protect user privacy, comply with various laws and regulations, enhance user trust, increase service adoption, reduce the risk of data leakage, and ensure data security during the implementation of the solution.
[0104] Furthermore, some embodiments of this application can also support merchant-side campaign strategy configuration. For example, a campaign strategy configuration entry can be provided to merchants, and the campaign strategies configured by merchants can be obtained from the entry. This entry can be implemented as a configuration page, where merchants can visually input the campaign strategies they need to set, which may include targeted campaigns, bidding ranking, budget control, time-based control, and performance reports. Targeted campaigns allow merchants to set target user groups (such as age, gender, spending power, interest tags, etc.); bidding ranking allows merchants to increase recommendation priority through bidding; budget control allows merchants to set promotion budgets and daily spending limits; time-based control allows merchants to set promotion periods and peak-hour bidding strategies; and performance reports indicate whether promotion performance data reports (such as exposure rate, click-through rate, store visit rate, conversion rate, etc.) are required.
[0105] By supporting merchants' on-the-spot campaign strategy configuration, the solution in this application embodiment can better meet merchants' precise marketing needs, improve campaign efficiency, thereby increasing the platform's commercial revenue sources and enhancing the solution's commercialization capabilities.
[0106] Figure 8 This paper illustrates an intelligent business traffic generation and recommendation system implemented using the solution described in the embodiments of this application. The system architecture includes a data layer 810, an algorithm layer 820, a business layer 830, and an application layer 840. The data layer 810 is responsible for the collection, storage, and management of trajectory data, POI data, and user data. Trajectory data collection includes real-time collection of user location, speed, direction, and other trajectory information. POI data management includes storing and updating information such as the location, category, rating, and business hours of merchant POIs. User data management includes storing user profiles, historical behavior, and preference settings. Data storage utilizes distributed databases (such as MySQL and MongoDB) and a caching system (Redis).
[0107] Algorithm layer 820 includes core algorithm modules that implement the core logic of intelligent recommendation, including a trajectory preprocessing module, a user profiling module, a trajectory prediction module, and an intelligent matching module. The trajectory preprocessing module is used for data cleaning, trajectory segmentation, and feature extraction. The user profiling module is used for travel habit analysis, consumption preference modeling, and interest tag extraction. The trajectory prediction module is used for predicting future trajectories based on deep learning. The intelligent matching module is used for multi-dimensional matching scoring and comprehensive ranking.
[0108] The business layer 830 is used to implement business functions such as recommendation decision-making, performance monitoring, and merchant management, including a recommendation decision-making module, a performance monitoring module, a merchant management module, and a user management module. The recommendation decision-making module is used for trigger condition judgment, frequency control, and push method selection. The performance monitoring module is used for real-time statistics of recommendation performance metrics and generation of performance reports. The merchant management module is used for merchant onboarding, ad placement strategy configuration, and data integration. The user management module is used for user settings, privacy control, and feedback processing.
[0109] Application layer 840 provides API interfaces and user interfaces, supporting multi-platform applications, including API interfaces, mobile applications, a web management backend, and third-party integrations. The API interfaces provide RESTful APIs, supporting calls from both mobile and web platforms. Mobile applications include recommendation modules for various mobile operating systems (such as iOS and Android). The web management backend is used for merchant management, data statistics, and performance analysis. Third-party integrations support integration with map, navigation, and travel platforms.
[0110] After adopting the recommendation method based on real-time trajectory data provided in the embodiments of this application, the intelligent commercial traffic generation recommendation system has significantly improved its recommendation effect compared with traditional recommendation methods. Figure 9 The comparison of the recommendation effect of this solution with traditional recommendation methods is shown, with significant improvements in click-through rate, conversion rate, and user satisfaction. Figure 10 The graph shows the changes in customer traffic before and after adopting the solution provided in this application, indicating a significant increase in customer traffic. Figure 11 This graph shows the changing trends of user activity and retention rate on platforms that can provide recommendation services after adopting the solution provided in this application embodiment. As can be seen from the graph, both user activity and retention rate show a continuous upward trend. Therefore, it can be concluded that the solution provided in this application embodiment has high commercial value for merchants and platforms.
[0111] Furthermore, this application can be applied to different scenarios, such as ride-hailing, bike-sharing, map navigation, and food delivery. The comparison of recommendation performance in these scenarios is as follows: Figure 12 As shown in the figure, the solution provided in this application embodiment has good scene adaptability in multiple dimensions such as click-through rate, conversion rate, user satisfaction, and merchant satisfaction, and can have stable and good recommendation effect in different scenarios.
[0112] In another aspect of this application, embodiments of this application also provide a recommendation device based on real-time trajectory data. The device includes a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the aforementioned recommendation method based on real-time trajectory data.
[0113] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by a processing unit, it performs the functions defined in the methods of this application.
[0114] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0115] In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0116] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The aforementioned computer-readable medium carries one or more computer program instructions, which may be executed by a processor to implement the methods and / or technical solutions of the various embodiments of this application.
[0119] It should be noted that this application can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, a magnetic or optical drive, a floppy disk, or similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0120] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
Claims
1. A recommendation method based on real-time trajectory data, characterized in that, The method includes: Obtain the user's historical trajectory sequence and corresponding context information. The historical trajectory sequence includes the location and timestamp of multiple historical trajectory points, and the context information includes the corresponding time information, environmental information, and user information. Based on the historical trajectory sequence and context information, multiple predicted trajectory points of the user at future moments are predicted, and a predicted path is generated based on the predicted trajectory points; Candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted to obtain a recommendation list including multiple candidate merchants; When the recommendation trigger condition is met, at least one candidate merchant is selected from the recommendation list as the recommended merchant according to the sorting result, and the recommended merchant is pushed to the user.
2. The method according to claim 1, characterized in that, Based on the historical trajectory sequence and context information, multiple predicted trajectory points for the user at future times are predicted, and a predicted path is generated based on the predicted trajectory points, including: The historical trajectory sequence and context information are processed using a preset deep learning model to predict multiple predicted trajectory points of the user at future times, and a predicted path is generated based on the predicted trajectory points. The preset deep learning model is a deep learning model that can be used to extract the temporal dependencies between various historical trajectory points in the historical trajectory sequence, and an attention mechanism is used in the prediction process.
3. The method according to claim 2, characterized in that, The historical trajectory sequence and context information are processed using a pre-defined deep learning model to predict multiple predicted trajectory points for the user at future times, and a predicted path is generated based on the predicted trajectory points, including: The historical trajectory sequence and context information are feature-encoded to obtain the corresponding feature vectors; The feature vector is input into a preset deep learning model to extract the temporal dependencies between historical trajectory points in the historical trajectory sequence. The importance score of each historical trajectory point in the historical trajectory sequence is calculated based on the temporal dependency, and an attention vector is calculated based on the importance score. The user is input into a fully connected network based on contextual information and attention vectors, and the fully connected network is used to output multiple predicted trajectory points for the user at future time points. Map matching is performed based on the predicted trajectory points to generate a predicted path.
4. The method according to claim 3, characterized in that, Based on the predicted trajectory points, map matching is performed to generate a predicted path, including: Based on the coordinates of the predicted trajectory points, map matching is performed to obtain the map location corresponding to the coordinates of each predicted trajectory point. Check the path reachability between predicted trajectory points; If reachable, generate a predicted path based on the sequence order of the predicted trajectory points; If the path is unreachable, an intermediate road segment is inserted between the unreachable predicted trajectory points, and a predicted path is generated based on the sequence order of the predicted trajectory points and the intermediate road segments.
5. The method according to claim 1, characterized in that, Candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted to obtain a recommendation list including multiple candidate merchants, including: Candidate merchants are recalled based on the predicted path, and the candidate merchants are sorted using multi-dimensional information to obtain a recommendation list including multiple candidate merchants. The multi-dimensional information includes at least one of the following: geographical location, user preference, merchant quality, and time factor.
6. The method according to claim 4, characterized in that, The candidate merchants are sorted using multi-dimensional information to obtain a recommendation list including multiple candidate merchants, including: Based on factors such as geographic location, user preferences, merchant quality, and time, calculate the location matching score, preference matching score, quality matching score, and time matching score for each candidate merchant. Based on the location matching score, preference matching score, quality matching score, and time matching score, a comprehensive score is calculated for each candidate merchant, and the candidate merchants are sorted according to the comprehensive score to generate a recommendation list including multiple candidate merchants.
7. The method according to claim 6, characterized in that, The candidate merchants are ranked according to the comprehensive score to obtain a recommendation list including multiple candidate merchants, including: The candidate merchants are ranked according to the comprehensive score to obtain a preliminary ranking result; The preliminary sorting results are adjusted based on the user's personalized information to obtain optimized sorting results; A recommendation list including multiple candidate merchants is generated based on the optimized ranking results.
8. The method according to claim 1, characterized in that, The triggering condition includes at least one of the following: Users enter the first distance range around the candidate merchants; The user's predicted path passes through candidate merchants or the distance between the predicted path's destination and a candidate merchant is less than the second distance range; The current time has reached the preset time period, and the candidate merchants meet the preset merchant categories; The candidate merchants are currently offering promotional activities, and their merchant categories match user preferences.
9. The method according to claim 1, characterized in that, Pushing the recommended merchants to the user includes: The recommended merchants are pushed to the user according to the push frequency limit conditions, wherein the push frequency limit conditions include at least one of the following: The push interval for the same recommended merchant is greater than or equal to the first duration; When users are in the same area, the interval between two push notifications is greater than or equal to the second duration; The number of push notifications sent to the same user per day is less than or equal to the number sent the first time. The recommended merchants are pushed to the user based on the user's customized recommendation frequency preferences and do-not-disturb periods.
10. The method according to claim 1, characterized in that, The method further includes: Collect feedback data and optimize the relevant parameters of the recommendation method based on the feedback data.
11. The method according to claim 1, characterized in that, Obtain the user's historical trajectory sequence, including: Collect users' raw trajectory data; The original trajectory data is preprocessed to obtain the user's historical trajectory sequence.
12. The method according to claim 1, characterized in that, The method further includes: Based on relevant historical data of users, user profiles are constructed, which include at least: user travel habits, user preferences, and user interest tags.
13. The method according to claim 1, characterized in that, Recalling candidate merchants based on the predicted path includes: A multi-path recall strategy is adopted to recall candidate merchants based on the predicted path, wherein the multi-path recall strategy includes: Based on the user's current location, search for merchants within a third distance range and use the search results as candidate merchants; Based on the predicted path, search for merchants whose distance from the predicted path is less than the fourth distance range, and use the search results as candidate merchants. Based on user interest tags, search for merchants that match the user's interest tags, and use the search results as candidate merchants; Based on user preferences, search for merchants that match those preferences and use the search results as candidate merchants.
14. The method according to claim 1, characterized in that, The method further includes: Provide merchants with an entry point for configuring advertising strategies, and obtain the advertising strategies configured by merchants from the entry point for configuring advertising strategies; Based on the ranking results, at least one candidate merchant is selected from the recommendation list as a recommended merchant, and the recommended merchant is pushed to the user, including: Based on the aforementioned delivery strategy, at least one candidate merchant is selected from the recommendation list as a recommended merchant according to the ranking results, and the recommended merchant is pushed to the user.
15. A recommendation device based on real-time trajectory data, wherein, The device includes a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method of any one of claims 1 to 14.
16. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as claimed in any one of claims 1 to 14.