Method and system for predicting next interest point of user based on large language model, terminal equipment and storage medium
By converting GPS geographic coordinates into a hierarchical quad-key representation and fusing Fourier location coding, combined with point of interest transition maps and graph convolutional networks, the problem of large language models being unable to accurately perceive geographic data is solved, thus improving the accuracy of point of interest recommendations.
Patent Information
- Application Number
- CN202510903422.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-11-04
AI Technical Summary
When existing technologies directly convert geographic coordinates and POI information into natural language descriptions and input them into large language models (LLMs) for point of interest prediction, they cannot accurately perceive geographic data, resulting in inaccurate recommendation results.
The geographic coordinate injection module converts GPS geographic coordinates into a hierarchical quad-key representation and fuses Fourier position codes. The interest point alignment module constructs an interest point transfer map and uses a graph convolutional network to extract transfer preference features. Finally, the Transformer layer of the large language model is used for prediction.
Accurately capturing spatial proximity and complex geographical relationships enhances the ability of large language models to perceive geographical data and improves the accuracy of point-of-interest recommendations.
Smart Images

Figure CN120892584A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of point of interest prediction, and in particular to a user next point of interest prediction method and system based on a large language model, a terminal device and a storage medium. BACKGROUND
[0002] With the rapid development of location-based services (LBS) and personalized recommendation systems, users have increasingly high demands for accurate recommendations of the next point of interest (POI). Accurate next POI recommendations not only help improve user experience, but also play an important role in tourism planning, city navigation, business promotion, and other fields. However, due to the complexity of user movement patterns and the diversity of spatial dependencies, how to effectively capture and utilize this information for accurate recommendations has become a research hotspot in the field of recommendation systems.
[0003] Existing POI recommendation methods based on large language models (LLM) usually convert geographic coordinates and POI information into natural language descriptions and input them into the model. However, large language models (LLM) are not inherently suitable for directly perceiving geographic data such as global positioning system (GPS) coordinates, resulting in poor performance in capturing spatial proximity and complex spatial relationships, and thus inaccurate POI recommendations.
[0004] Therefore, the existing technology directly converts geographic coordinates and POI information into natural language descriptions and inputs them into large language models (LLM) for POI prediction, which can lead to inaccurate POI recommendations due to the inability of large language models (LLM) to accurately perceive geographic data. SUMMARY
[0005] The present application provides a user next point of interest prediction method and system based on a large language model, a terminal device and a storage medium, which can solve the problem of inaccurate POI recommendations caused by the inability of large language models (LLM) to accurately perceive geographic data due to the direct conversion of geographic coordinates and POI information into natural language descriptions and input into large language models (LLM) for POI prediction.
[0006] To solve the above technical problems, an embodiment of the present application provides a user next point of interest prediction method based on a large language model, comprising:
[0007] Obtaining current check-in trajectory record data of a user; wherein the check-in trajectory record data includes a point of interest, a point of interest category, a point of interest timestamp, and a point of interest geographic coordinate;
[0008] The geographic coordinates of the check-in are extracted from the current check-in trajectory record data of the user, the geographic coordinates are input into the geographic coordinate injection module of the trained large language model, the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain geographic coordinate features;
[0009] The current check-in trajectory record data of the user is input into the interest point alignment module of the trained large language model, the interest point alignment module performs interest point embedding feature extraction according to the current check-in trajectory record data of the user, obtains interest point embedding features, and embeds the interest point embedding features in the semantic space of the large language model to obtain interest point features;
[0010] The Transformer layer of the trained large language model performs user next interest point prediction according to the geographic coordinate features and the interest point features in the semantic space, and generates a recommendation result of the user next interest point.
[0011] Further, the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain geographic coordinate features, including:
[0012] The longitude and latitude of the geographic coordinates of each interest point are converted into plane Cartesian coordinates by the Mercator projection formula to obtain the plane Cartesian coordinates of each geographic coordinate;
[0013] For the plane Cartesian coordinates of each geographic coordinate, the plane Cartesian coordinates are divided into grid positions according to a preset grid level, and each layer of grid is assigned a corresponding quaternary digital identification character to obtain a quaternary string of the grid to which each geographic coordinate belongs;
[0014] The quaternary string of the grid to which each geographic coordinate belongs is subjected to a sliding interception operation according to a preset step size to obtain a plurality of unit combinations, and each unit combination is subjected to position coding and vector embedding to obtain a unit combination sequence enhanced in position for each geographic coordinate;
[0015] The unit combination sequence enhanced in position for each geographic coordinate is subjected to local feature enhancement by a self-attention mechanism to obtain local geographic features of each geographic coordinate;
[0016] The quaternary string of the grid to which each geographic coordinate belongs is subjected to Fourier embedding calculation by Fourier position coding to obtain global geographic features of each geographic coordinate;
[0017] The local geographical feature and the global geographical feature of each geographical coordinate are spliced to obtain a geographical embedding feature, and the geographical embedding feature is input into a semantic space of a large language model to obtain a geographical coordinate feature.
[0018] Further, the Mercator projection formula is:
[0019]
[0020] wherein x and y are plane Cartesian coordinates; alpha and beta are the longitude and latitude of each geographical coordinate; and l is a grid level.
[0021] Further, a calculation formula of the Fourier embedding calculation is:
[0022]
[0023] wherein F(S) is a global geographical feature of each geographical coordinate; S is a quaternary string of a grid to which each geographical coordinate belongs; and M is a preset input dimension size. is a learnable projection matrix, L is a string length, and is initialized as a Gaussian distribution W s ~ N(0, gamma -2 ), gamma is a width of a control space kernel; cos(·) and sin(·) represent element-wise cosine and sine functions respectively; and || represents a splicing operation.
[0024] Further, the interest point alignment module extracts an interest point embedding feature according to current check-in trajectory record data of a user to obtain an interest point embedding feature, and embeds the interest point embedding feature into a semantic space of a large language model to obtain an interest point feature, including:
[0025] An interest point transition graph is constructed according to an interest point and a timestamp of the interest point in the current check-in trajectory record data of the user.
[0026] An initialized low-dimensional embedding vector is generated for an interest point node in the interest point transition graph by a random generation method or a one-hot encoding method, and a low-dimensional embedding vector of the interest point node is subjected to a multi-layer convolution operation by a graph convolution network algorithm to obtain an interest point embedding feature with transition preference information.
[0027] The interest point embedding feature with transition preference information is mapped into the semantic space of the large language model by a multi-layer perception, and is spliced with an interest point category to obtain the interest point feature.
[0028] On the basis of the above method embodiment, the present application correspondingly provides a system embodiment;
[0029] An embodiment of the present application provides a user next interest point prediction system based on a large language model, comprising: a data acquisition module and a large language model prediction module; the large language model prediction module comprises a geographic coordinate feature extraction subunit, an interest point feature extraction subunit and a next interest point prediction subunit;
[0030] The data acquisition module is configured to acquire current check-in trajectory record data of a user; wherein the check-in trajectory record data comprises an interest point, an interest point category, a timestamp of the interest point and geographic coordinates of the interest point;
[0031] The geographic coordinate feature extraction subunit is configured to extract the geographic coordinates of the check-in from the current check-in trajectory record data of the user, input the geographic coordinates into a geographic coordinate injection module of the trained large language model, so that the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in a semantic space of the large language model to obtain geographic coordinate features;
[0032] The interest point feature extraction subunit is configured to input the current check-in trajectory record data of the user into an interest point alignment module of the trained large language model, so that the interest point alignment module performs interest point embedding feature extraction according to the current check-in trajectory record data of the user, obtains interest point embedding features, and embeds the interest point embedding features in the semantic space of the large language model to obtain interest point features;
[0033] The next interest point prediction subunit is configured to perform user next interest point prediction according to the geographic coordinate features and the interest point features in the semantic space by a Transformer layer of the trained large language model, and generate a recommendation result of the user next interest point.
[0034] Further, the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain geographic coordinate features, comprising:
[0035] The longitude and latitude of the geographic coordinates of each interest point are converted into a plane Cartesian coordinate by a Mercator projection formula to obtain a plane Cartesian coordinate of each geographic coordinate;
[0036] For the plane Cartesian coordinate of each geographic coordinate, the plane Cartesian coordinate is divided according to a preset grid level, and each layer of grid is assigned a corresponding quaternary digital identification character to obtain a quaternary string of the grid to which each geographic coordinate belongs;
[0037] The sliding intercept operation is performed on the quaternary string of the grid to which each geographic coordinate belongs according to a preset step size, a plurality of cell combinations are obtained, and position encoding and vector embedding are performed on each cell combination to obtain a position-enhanced cell combination sequence of each geographic coordinate;
[0038] The position-enhanced cell combination sequence of each geographic coordinate is subjected to local feature enhancement through a self-attention mechanism to obtain a local geographic feature of each geographic coordinate.
[0039] The quaternary string of the grid to which each geographic coordinate belongs is subjected to Fourier embedding calculation through Fourier position encoding to obtain a global geographic feature of each geographic coordinate.
[0040] The local geographic feature and the global geographic feature of each geographic coordinate are spliced to obtain a geographic embedding feature, and the geographic embedding feature is input into a semantic space of a large language model to obtain a geographic coordinate feature.
[0041] Further, the interest point alignment module extracts an interest point embedding feature according to the current check-in trajectory record data of the user to obtain the interest point embedding feature, and embeds the interest point embedding feature into a semantic space of a large language model to obtain an interest point feature, including:
[0042] An interest point transition graph is constructed according to the interest points and the timestamps of the interest points in the current check-in trajectory record data of the user.
[0043] An initialized low-dimensional embedding vector is generated for the interest point nodes in the interest point transition graph through a random generation method or a one-hot encoding method, and a low-dimensional embedding vector of the interest point nodes is subjected to multi-layer convolution operation through a graph convolution network algorithm to obtain an interest point embedding feature with transition preference information.
[0044] The interest point embedding feature with transition preference information is mapped into a semantic space of a large language model through a multi-layer perception, and is spliced with an interest point category to obtain an interest point feature.
[0045] On the basis of the above method embodiment, another embodiment of the present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, a user next interest point prediction method based on a large language model is realized as described in the above embodiment.
[0046] On the basis of the above method embodiment, another embodiment of the present application provides a computer readable storage medium, the computer readable storage medium comprises a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located executes the above-mentioned embodiment of a large language model-based user next interest point prediction method.
[0047] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0048] The present application obtains the user's current check-in track record data containing interest points, categories, timestamps and geographic coordinates, first converts the GPS geographic coordinates into a hierarchical four-key representation through a geographic coordinate injection module, and fuses the Fourier position coding, so that the large language model can accurately capture spatial proximity and complex geographic relationships, solving the problem that the large language model cannot directly perceive geographic data; at the same time, the interest point transfer graph is constructed through an interest point alignment module, and the transfer preference features are extracted using a graph convolution network, and then the semantic space of the large language model is aligned, effectively integrating information such as interest point transfer relationships; finally, the next interest point of the user is predicted through the Transformer layer of the large language model, combining the geographic coordinate features and the interest point features, through the complete process of "accurate geographic feature injection + deep interest point relationship alignment + model layer fusion prediction", the short board of LLM in perceiving geographic data is made up for, the spatial relationship capture and POI information utilization ability are improved, and the problem that the existing technology directly converts geographic coordinates and interest point (POI) information into natural language description and inputs into a large language model (LLM) for interest point prediction, which causes the recommended result of the interest point to be inaccurate due to the large language model (LLM) being unable to accurately perceive geographic data, is solved. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 A step flowchart of a large language model-based user next interest point prediction method provided by the embodiments of the present application;
[0050] Figure 2 A module diagram of a large language model-based user next interest point prediction system provided by the embodiments of the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0052] In the description of the present application, it should be understood that the terms "first", "second" and "third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features.
[0053] Embodiment 1:
[0054] Referring to Figure 1 A step flow chart of a user next interest point prediction method based on a large language model is provided for an embodiment of the present application; in order to solve the problem that the existing technology directly converts geographic coordinates and POI information into natural language description to input into a large language model (LLM) for interest point prediction, which can cause the large language model (LLM) to be unable to accurately perceive geographic data, resulting in inaccurate recommendation results of interest points, the method at least includes the following steps:
[0055] Step S1: obtaining current check-in trajectory record data of a user; wherein the check-in trajectory record data includes an interest point, an interest point category, a time stamp of the interest point, and geographic coordinates of the interest point;
[0056] In this embodiment, the user check-in trajectory record data can be collected in real time through a mobile application or a positioning service platform; wherein the check-in trajectory record is represented as a tuple q=(u,p,c,t,g), u represents a user, p represents an interest point POI, c is the category of the interest point POI (for example, restaurant, park), t is the time stamp, and g=(a,b) is the geographic coordinates of the interest point POI, given a user u, T u (t)={(p1,c1,t1,g1),...,(p k ,c k ,t k ,g k )} is the check-in trajectory data until time t.
[0057] Step S2: extracting the geographic coordinates of the check-in from the current check-in trajectory record data of the user, inputting the geographic coordinates into the geographic coordinate injection module of the trained large language model, so that the geographic coordinate injection module extracts geographic embedding features according to the geographic coordinates, obtains the geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain the geographic coordinate features;
[0058] In this embodiment, the geographic coordinate injection module extracts geographic embedding features according to the geographic coordinates, obtains the geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain the geographic coordinate features, including:
[0059] The longitude and latitude of the geographic coordinates of each interest point are converted into plane Cartesian coordinates by the Mercator projection formula to obtain the plane Cartesian coordinates of each geographic coordinate;
[0060] In this embodiment, the Mercator projection formula is:
[0061]
[0062] Where x and y are Cartesian coordinates in the plane; α and β are the latitude and longitude of each geographic coordinate; and l is the grid level.
[0063] For each geographic coordinate's planar Cartesian coordinate, the planar Cartesian coordinate is divided into grid positions according to a preset grid level, and a corresponding quaternary numeric identifier character is assigned to each grid level to obtain the quaternary string of the grid to which each geographic coordinate belongs.
[0064] In this embodiment, specifically, the map is divided into grids according to the 2D tiled map system. The initial first level contains four grids, which belong to the second level. Each grid in the second level is further divided into four grids in the third level, and so on. Each increase in grid level represents a more precise geographic location. Each quadkey, taking values in (0, 1, 2, 3), uniquely identifies four grid tiles at different resolution levels. Therefore, latitude and longitude coordinates can be converted into a unified location representation represented by several quadkeys. The length of each quadkey corresponds to the grid level l, and this quadkey can represent a geographic location at a resolution of l, referred to as the quadkey-based representation S, defined as S = (s1, s2, ..., s...). L ), where L represents the number of levels in the quadtree. Each s i (i = 1, ..., L) represents the grid index identified by the i-th level quadkey. As i increases, a finer resolution spatial structure can be captured step by step. This transformation discretizes continuous GPS coordinates into grid cells, ensuring that nearby locations share similar quadkeys and reducing sparsity. It also encapsulates the hierarchical spatial information of the quadkey, improving upon the shortcomings of traditional latitude and longitude representations, which lack hierarchical information and are difficult for large language models (LLMs) to intuitively understand.
[0065] The quaternary string of each geographic coordinate's grid is truncated by a preset step size to obtain several unit combinations. Each unit combination is then encoded and embedded with a vector to obtain a sequence of unit combinations with enhanced geographic coordinate position.
[0066] In this embodiment, first, slide in the quaternary string S by steps, intercept n units, each unit contains three quaternary characters (quadkey), n is determined by the maximum number of hierarchical levels. (For example: S with length L: (03201…) can generate n-tuple {032, 320, 201, …}), this method can capture local context and sequence patterns inside it;
[0067] Then encode the position of each unit combination. Adding position encoding is a common step before performing self-attention enhancement, mainly to ensure that the self-attention model can effectively capture the order information of elements when processing sequence data. Since the order between unit combinations in the quaternary string is very important, it relates to whether it can accurately represent the geographical position, therefore, a position encoding needs to be constructed for each unit combination in the quaternary string, which is used to save its relative position in the quaternary string. The position encoding can be generated by the following formula: and Where pos is the index of the position of the unit, i is the dimension index (from 0 to d / 2-1), and d is the input dimension of the self-attention model. Thus, the position encoding P n of each n-tuple position can be generated.
[0068] Then generate an embedding vector for each unit combination in the quaternary string, specifically: initialize a trainable d-dimensional vector E n for each unit, and add the embedding vectors of each unit combination in the quaternary string E: {E1, E2…E n} and its corresponding position encoding sequence P: {P1, P2, …P n} element by element, which can generate a position-enhanced unit combination sequence representation
[0069] Through the self-attention mechanism, the local feature of each geographical coordinate position-enhanced unit combination sequence is enhanced, and the local geographical feature of each geographical coordinate is obtained.
[0070] In this embodiment, the self-attention mechanism can dynamically allocate weights for each unit combination in the quaternary string, while capturing local spatial dependencies and global relationships, thereby enhancing the spatial representation ability of the model. The enhanced representation obtained by the self-attention mechanism will be used in subsequent representation splicing.
[0071] Through Fourier position encoding, the Fourier embedding calculation of the quaternary string of each geographical coordinate belonging to the grid is performed, and the global geographical feature of each geographical coordinate is obtained.
[0072] In this embodiment, the Fourier position coding is used to calculate the Fourier embedding of the quaternary string of the grid to which each geographic coordinate belongs, so that it can effectively capture the fine-grained spatial pattern across multiple frequencies. By learning the projection matrix W s , the coding can adapt to the spatial structure represented by the quaternary number identification character in the quaternary string, thereby refining the embedding for downstream tasks. The Fourier position coding preserves high-frequency variations to capture subtle local changes, while low-frequency patterns reflect more widespread geographical trends, ensuring a comprehensive representation of spatial relationships. Inspired by the learnable Fourier position coding method, this module directly applies Fourier embedding to latitude and longitude, and adjusts this technique to operate on the representation generated based on the quaternary number identification character. The quaternary number identification character better captures the hierarchical spatial structure by discretizing geographic space into grid tiles.
[0073] In this embodiment, the calculation formula of the Fourier embedding calculation is:
[0074]
[0075] where F(S) is the global geographical feature of each geographic coordinate; S is the quaternary string of the grid to which each geographic coordinate belongs; M is the preset input dimension size; is a learnable projection matrix, L is the length of the string, which is initialized as a Gaussian distribution W s ~ N(0, γ -2 , γ is the width of the spatial kernel; cos(·) and sin(·) represent the element-wise cosine and sine functions, respectively; || represents the concatenation operation.
[0076] The local geographical feature and the global geographical feature of each geographic coordinate are concatenated to obtain a geographical embedding feature, and the geographical embedding feature is input into the semantic space of the large language model to obtain a geographic coordinate feature.
[0077] In this embodiment, the GPS geographic coordinates are converted into hierarchical quaternary key representations and fused with Fourier position coding by the geographic coordinate injection module, so that the large language model can accurately capture spatial proximity and complex geographical relationships, solving the problem that the large language model cannot directly perceive geographical data.
[0078] Step S3: input the current check-in trajectory record data of the user into the interest point alignment module of the trained large language model, so that the interest point alignment module extracts interest point embedding features according to the current check-in trajectory record data of the user, obtains the interest point embedding features, and embeds the interest point embedding features into the semantic space of the large language model to obtain interest point features;
[0079] In the embodiment, the interest point alignment module extracts interest point embedding features according to the current check-in trajectory record data of the user, obtains interest point embedding features, and embeds the interest point embedding features into a semantic space of a large language model to obtain interest point features, including:
[0080] According to the interest points and the timestamps of the interest points of the current check-in trajectory record data of the user, an interest point transition graph is constructed.
[0081] An initialized low-dimensional embedding vector is generated for the interest point nodes in the interest point transition graph by a random generation method or a one-hot encoding method, and a low-dimensional embedding vector of the interest point nodes is subjected to multi-layer convolution operation by a graph convolution network algorithm to obtain interest point embedding features with transition preference information.
[0082] The interest point embedding features with transition preference information are mapped into the semantic space of the large language model by a multi-layer perception, and are spliced with the interest point categories to obtain the interest point features.
[0083] In the embodiment, the interest point alignment module is constructed based on a graph model. In the graph model, first, the check-in trajectory of the user is regarded as a POI sequence in time order: T u =[p1,p2,...p n ], then each pair of adjacent check-in behaviors is constructed as a directed transition edge: In addition, the time interval or the transition frequency of each edge is also recorded as the weight or the attribute of the edge to capture the preference migration strength; the graph model uses these dynamic information to construct a POI transition graph, and the construction method is: the nodes V in the graph are the set of POIs, and the edges E in the graph come from the directed transitions in the check-in trajectory, and the edge weight w(p i →p j ) represents the transition probability or frequency, which can be calculated as follows:
[0084] Then, an embedding is initialized for each node (POI), which can use a random generation or one-hot vector encoding method, and when the graph model learns and adjusts these embeddings, a low-dimensional embedding vector of the interest point nodes is subjected to multi-layer convolution operation by a graph convolution (GCN) algorithm to obtain interest point embedding features with transition preference information; the goal of the graph convolution is to let each node obtain a new feature with "structure perception" after aggregating neighbor information, and the single-layer propagation formula of the GCN is: where H (l) is the node representation of the lth layer (the 0th layer is the embedding at the initialization time), that is, the adjacency matrix plus the self-loop, is the degree matrix of , and W (l)is the trainable weight matrix, and σ is the activation function; usually, multiple layers of GCN are used to allow information to pass to further neighbors, and the final H (n) is the POI embedding matrix needed, where each row is an embedding vector of a POI, containing the transition preference information of the POI;
[0085] Finally, the POI embedding features with transition preference information are mapped to the semantic space of the large language model through a multi-layer perception, and are spliced with the text description of the POI category to obtain POI features.
[0086] Step S4: The Transformer layer of the trained large language model is used to predict the next POI of the user according to the geographic coordinate features and the POI features in the semantic space, to generate a recommendation result of the next POI of the user.
[0087] In this embodiment, the model training of the large language model includes:
[0088] The historical check-in trajectory record data of the user is obtained; wherein the check-in trajectory record data includes POI, POI category, timestamp of the POI, and geographic coordinates of the POI;
[0089] The geographic coordinates of the check-in are extracted from the historical check-in trajectory record data of the user, and the geographic coordinates are input into the geographic coordinate injection module of the large language model to be trained, so that the geographic coordinate injection module extracts geographic embedding features according to the geographic coordinates, obtains the geographic embedding features, and embeds the geographic embedding features into the semantic space of the large language model to be trained, to obtain the geographic coordinate features;
[0090] The historical check-in trajectory record data of the user is input into the POI alignment module of the large language model to be trained, so that the POI alignment module extracts POI embedding features according to the historical check-in trajectory record data of the user, obtains the POI embedding features, and embeds the POI embedding features into the semantic space of the large language model to be trained, to obtain the POI features;
[0091] The Transformer layer of the large language model to be trained is used to predict the next POI of the user according to the geographic coordinate features and the POI features in the semantic space, to generate a prediction result of the next POI of the user;
[0092] The prediction result of the next POI of the user is compared with the real result of the next POI of the user, a loss value is calculated through a loss function, the model parameters of the large language model are optimized according to the loss value, until the loss value converges, and a trained large language model is obtained.
[0093] Embodiment 2:
[0094] Reference Figure 2A module diagram of a user next interest point prediction system based on a large language model is provided for an embodiment of the present application; in order to solve the problem that the existing technology directly converts geographic coordinates and POI information into natural language description to input into a large language model (LLM) for interest point prediction, which may cause the large language model (LLM) to be unable to accurately perceive geographic data, resulting in inaccurate recommended results of interest points, the system at least includes the following modules: a data acquisition module and a large language model prediction module; the large language model prediction module includes a geographic coordinate feature extraction subunit, an interest point feature extraction subunit and a next interest point prediction subunit;
[0095] The data acquisition module is configured to acquire current check-in trajectory record data of a user; wherein the check-in trajectory record data includes an interest point, an interest point category, a timestamp of the interest point and geographic coordinates of the interest point;
[0096] The geographic coordinate feature extraction subunit is configured to extract the geographic coordinates of the check-in from the current check-in trajectory record data of the user, input the geographic coordinates into a geographic coordinate injection module of the trained large language model, so that the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain geographic coordinate features;
[0097] The interest point feature extraction subunit is configured to input the current check-in trajectory record data of the user into an interest point alignment module of the trained large language model, so that the interest point alignment module performs interest point embedding feature extraction according to the current check-in trajectory record data of the user, obtains interest point embedding features, and embeds the interest point embedding features in the semantic space of the large language model to obtain interest point features;
[0098] The next interest point prediction subunit is configured to perform user next interest point prediction according to the geographic coordinate features and the interest point features in the semantic space by the Transformer layer of the trained large language model, and generate a recommended result of the user next interest point.
[0099] In the present embodiment, the geographic coordinate injection module performs geographic embedding feature extraction according to the geographic coordinates, obtains geographic embedding features, and embeds the geographic embedding features in the semantic space of the large language model to obtain geographic coordinate features, including:
[0100] The longitude and latitude of the geographic coordinates of each interest point are converted into plane Cartesian coordinates by the Mercator projection formula to obtain the plane Cartesian coordinates of each geographic coordinate;
[0101] For the plane Cartesian coordinates of each geographic coordinate, the plane Cartesian coordinates are divided into grid positions according to a preset grid level, and a corresponding quaternary digital identification character is assigned to each grid, to obtain a quaternary string of the grid to which each geographic coordinate belongs;
[0102] The quaternary string of the grid to which each geographic coordinate belongs is subjected to a sliding interception operation according to a preset step length, to obtain a plurality of unit combinations, and each unit combination is subjected to position coding and vector embedding, to obtain a unit combination sequence of each geographic coordinate position enhancement;
[0103] The unit combination sequence of each geographic coordinate position enhancement is subjected to local feature enhancement through a self-attention mechanism, to obtain a local geographic feature of each geographic coordinate;
[0104] The quaternary string of the grid to which each geographic coordinate belongs is subjected to Fourier embedding calculation through Fourier position coding, to obtain a global geographic feature of each geographic coordinate;
[0105] The local geographic feature and the global geographic feature of each geographic coordinate are spliced to obtain a geographic embedding feature, and the geographic embedding feature is input into a semantic space of a large language model to obtain a geographic coordinate feature.
[0106] In the present embodiment, the interest point alignment module extracts an interest point embedding feature according to the current check-in trajectory record data of the user, obtains the interest point embedding feature, and embeds the interest point embedding feature into a semantic space of a large language model to obtain an interest point feature, including:
[0107] According to the interest points and the timestamps of the interest points in the current check-in trajectory record data of the user, an interest point transition graph is constructed;
[0108] An initialization low-dimensional embedding vector is generated for the interest point nodes in the interest point transition graph through a random generation method or a one-hot encoding method, and a multi-layer convolution operation is performed on the low-dimensional embedding vectors of the interest point nodes through a graph convolution network algorithm to obtain an interest point embedding feature with transition preference information;
[0109] The interest point embedding feature with transition preference information is mapped into the semantic space of the large language model through a multi-layer perceptron, and is spliced with the interest point category to obtain the interest point feature.
[0110] Another embodiment of the present application also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements a large language model based next interest point prediction method for a user as described in the above embodiments when executing the computer program. The terminal device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The terminal device can include, but is not limited to, a processor and a memory.
[0111] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The processor is a control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.
[0112] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function, and the like; and the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device or other volatile solid-state memory device.
[0113] Another embodiment of the present application provides a computer readable storage medium, comprising a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute a large language model based next interest point prediction method for a user as described in the above embodiments when the computer program is running.
[0114] The storage medium is a computer readable storage medium, and the computer program is stored in the computer readable storage medium. When the computer program is executed by a processor, steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0115] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only for specific embodiments of the present application and is not intended to limit the protection scope of the present application. It is particularly pointed out that any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting a user's next point of interest based on a large language model, characterized in that, include: Obtain the user's current check-in trajectory record data; wherein, the check-in trajectory record data includes points of interest, point of interest categories, timestamps of points of interest, and geographical coordinates of points of interest; Extract the geographic coordinates of the user's current check-in trajectory record data, input the geographic coordinates into the geographic coordinate injection module of the trained large language model, so that the geographic coordinate injection module can extract geographic embedding features based on the geographic coordinates, obtain geographic embedding features, and embed the geographic embedding features into the semantic space of the large language model to obtain geographic coordinate features. The user's current check-in trajectory record data is input into the interest point alignment module of the trained large language model, so that the interest point alignment module can extract interest point embedding features based on the user's current check-in trajectory record data, obtain interest point embedding features, and embed the interest point embedding features into the semantic space of the large language model to obtain interest point features; The Transformer layer of a pre-trained large language model predicts the user's next point of interest based on geographic coordinate features and point of interest features in the semantic space, generating a recommendation result for the user's next point of interest.
2. The method for predicting the next point of interest of a user based on a large language model according to claim 1, characterized in that, The geographic coordinate injection module extracts geographic embedding features based on geographic coordinates, obtains geographic embedding features, and embeds these features into the semantic space of the large language model to obtain geographic coordinate features, including: The latitude and longitude coordinates of each point of interest are converted into Cartesian coordinates using the Mercator projection formula, thus obtaining the Cartesian coordinates of each geographical coordinate. For each geographic coordinate's planar Cartesian coordinate, the planar Cartesian coordinate is divided into grid positions according to a preset grid level, and a corresponding quaternary numeric identifier character is assigned to each grid level to obtain the quaternary string of the grid to which each geographic coordinate belongs. The quaternary string of each geographic coordinate's grid is truncated by a preset step size to obtain several unit combinations. Each unit combination is then encoded and embedded with a vector to obtain a sequence of unit combinations with enhanced geographic coordinate position. By using a self-attention mechanism to enhance the local features of the unit combination sequence for each geographic coordinate, the local geographic features of each geographic coordinate are obtained. Fourier embedding calculations are performed on the quaternary string of the grid to which each geographic coordinate belongs by Fourier position coding to obtain the global geographic features of each geographic coordinate. The local and global geographic features of each geographic coordinate are concatenated to obtain geographic embedding features, which are then input into the semantic space of the large language model to obtain geographic coordinate features.
3. The method for predicting a user's next point of interest based on a large language model according to claim 2, characterized in that, The Mercator projection formula is: Where x and y are Cartesian coordinates in the plane; α and β are the latitude and longitude of each geographic coordinate; and l is the grid level.
4. The method for predicting a user's next point of interest based on a large language model according to claim 3, characterized in that, The calculation formula for the Fourier embedding is as follows: Where F(S) is the global geographic feature of each geographic coordinate; S is the quaternary string of the grid to which each geographic coordinate belongs; M is the preset input dimension size; It is a learnable projection matrix, where L is the string length, initialized with a Gaussian distribution W. s ~N(0, γ) -2 ), where γ controls the width of the control space kernel; cos(·) and sin(·) represent the element-wise cosine and sine functions, respectively; || represents the concatenation operation.
5. The method for predicting the next point of interest of a user based on a large language model according to claim 4, characterized in that, The interest point alignment module extracts interest point embedding features based on the user's current check-in trajectory record data, obtains interest point embedding features, and embeds these features into the semantic space of the large language model to obtain interest point features, including: Construct an interest point transition map based on the user's current check-in trajectory data, including the points of interest and their timestamps. Initial low-dimensional embedding vectors are generated for interest point nodes in the interest point transfer graph using random generation or one-hot encoding. Then, multi-layer convolution operations are performed on the low-dimensional embedding vectors of the interest point nodes using graph convolutional network algorithms to obtain interest point embedding features with transfer preference information. By using a multilayer perceptron, interest points with transfer preference information are embedded into the semantic space of a large language model and then concatenated with the interest point category to obtain interest point features.
6. A user's next point of interest prediction system based on a large language model, characterized in that, include: The system includes a data acquisition module and a large language model prediction module; the large language model prediction module includes a geographic coordinate feature extraction subunit, an interest point feature extraction subunit, and a next interest point prediction subunit. The data acquisition module is used to acquire the user's current check-in trajectory record data; wherein, the check-in trajectory record data includes points of interest, point of interest categories, timestamps of points of interest, and geographical coordinates of points of interest; The geographic coordinate feature extraction subunit is used to extract the geographic coordinates of the check-in from the user's current check-in trajectory record data, input the geographic coordinates into the geographic coordinate injection module of the trained large language model, so that the geographic coordinate injection module can perform geographic embedding feature extraction based on the geographic coordinates, obtain geographic embedding features, and embed the geographic embedding features into the semantic space of the large language model to obtain geographic coordinate features. The interest point feature extraction subunit is used to input the user's current check-in trajectory record data into the interest point alignment module of the trained large language model, so that the interest point alignment module can extract interest point embedding features based on the user's current check-in trajectory record data, obtain interest point embedding features, and embed the interest point embedding features into the semantic space of the large language model to obtain interest point features. The next point of interest prediction subunit is used to predict the user's next point of interest based on the geographic coordinate features and point of interest features in the semantic space through the Transformer layer of the trained large language model, and generate a recommendation result for the user's next point of interest.
7. A user's next point of interest prediction system based on a large language model according to claim 6, characterized in that, The geographic coordinate injection module extracts geographic embedding features based on geographic coordinates, obtains geographic embedding features, and embeds these features into the semantic space of the large language model to obtain geographic coordinate features, including: The latitude and longitude coordinates of each point of interest are converted into Cartesian coordinates using the Mercator projection formula, thus obtaining the Cartesian coordinates of each geographical coordinate. For each geographic coordinate's planar Cartesian coordinate, the planar Cartesian coordinate is divided into grid positions according to a preset grid level, and a corresponding quaternary numeric identifier character is assigned to each grid level to obtain the quaternary string of the grid to which each geographic coordinate belongs. The quaternary string of each geographic coordinate's grid is truncated by a preset step size to obtain several unit combinations. Each unit combination is then encoded and embedded with a vector to obtain a sequence of unit combinations with enhanced geographic coordinate position. By using a self-attention mechanism to enhance the local features of the unit combination sequence for each geographic coordinate, the local geographic features of each geographic coordinate are obtained. Fourier embedding calculations are performed on the quaternary string of the grid to which each geographic coordinate belongs by Fourier position coding to obtain the global geographic features of each geographic coordinate. The local and global geographic features of each geographic coordinate are concatenated to obtain geographic embedding features, which are then input into the semantic space of the large language model to obtain geographic coordinate features.
8. A user's next point of interest prediction system based on a large language model according to claim 7, characterized in that, The interest point alignment module extracts interest point embedding features based on the user's current check-in trajectory record data, obtains interest point embedding features, and embeds these features into the semantic space of the large language model to obtain interest point features, including: Construct an interest point transition map based on the user's current check-in trajectory data, including the points of interest and their timestamps. Initial low-dimensional embedding vectors are generated for interest point nodes in the interest point transfer graph using random generation or one-hot encoding. Then, multi-layer convolution operations are performed on the low-dimensional embedding vectors of the interest point nodes using graph convolutional network algorithms to obtain interest point embedding features with transfer preference information. By using a multilayer perceptron, interest points with transfer preference information are embedded into the semantic space of a large language model and then concatenated with the interest point category to obtain interest point features.
9. A terminal device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a user next interest prediction method based on a large language model as described in any one of claims 1 to 5.
10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the storage medium is located to perform a user's next point of interest prediction method based on a large language model as described in any one of claims 1 to 5.
Citation Information
Cited By
Hierarchical zero sample trajectory prediction method based on large language model
CN121365120A
A hierarchical zero-shot trajectory prediction method based on a large language model
CN121365120B