Position representation method and device, equipment and storage medium

By constructing a trajectory network and performing edge feature embedding and contrastive learning training, the problem of lost temporal and spatial information in existing models is solved, the accuracy of location representation is improved, and thus the performance of urban computing tasks is enhanced.

CN120821782APending Publication Date: 2025-10-21CHINA MOBILE GROUP JILIN BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510652544.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

Existing location representation transformation models are greatly affected by common location data during training, resulting in the loss of temporal and spatial information, which affects the accuracy of location representation and consequently the performance of urban computing tasks.

Method used

By constructing a trajectory network to obtain the user's trajectory network, edge features are embedded into nodes using a pre-defined location representation model and aggregated. Combined with contrastive learning to train the model, the accuracy of location representation is improved.

Benefits of technology

It effectively prevents the loss of time and spatial information, improves the accuracy of location representation, and thus enhances the effectiveness of urban computing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821782A_ABST
    Figure CN120821782A_ABST
Patent Text Reader

Abstract

The invention discloses a position representation method and device, equipment and a storage medium, and relates to the technical field of data processing, and the position representation method comprises the steps: obtaining a track network of a user, and enabling the edge features of all edges to be embedded into corresponding nodes through a preset position representation model, and aggregating the edge features and the node features to obtain a position representation vector of each node. According to the method, the edge features are embedded into the corresponding nodes through the graph structure of the trajectory network, and then the edge features and the node features are aggregated, so that time information and space information are better aggregated through the relationship between the edges and the nodes in the trajectory network, and the time information and the space information are prevented from being lost. In addition, by comparing the learning training model, rare position information can be sufficiently trained. Therefore, the accuracy of position representation can be improved, and then the effect of a subsequent city calculation task is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, apparatus, device and storage medium for representing a position. Background Art

[0002] Location service data plays an important role in urban computing tasks. To improve the performance of urban computing tasks, location service data, including temporal and spatial data, is typically converted into corresponding location representation vectors by training a location representation conversion model.

[0003] However, the location representation conversion model trained by the current method is greatly affected by common location data, and some temporal or spatial information will be lost during the conversion process, resulting in poor accuracy of location representation, which in turn affects subsequent urban computing tasks. Summary of the Invention

[0004] The main purpose of this application is to provide a location representation method, device, equipment and storage medium, aiming to solve the technical problem of poor accuracy of location representation, which in turn affects subsequent urban computing tasks.

[0005] To achieve the above objectives, the present application proposes a location representation method, which includes:

[0006] Acquire a trajectory network of the user, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data;

[0007] Through a preset position representation model, the edge features of each edge are embedded into the corresponding node, and the edge features and the node features are aggregated to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

[0008] In one embodiment, before the step of obtaining the user's trajectory network, the method further includes:

[0009] Acquire a trajectory network sample of the user, wherein the trajectory network sample includes a sample edge and a sample node, the sample edge includes a sample edge feature converted from the time data, and the sample node includes a sample node feature converted from the spatial data;

[0010] Encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges;

[0011] Embedding the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the to-be-trained model, and aggregating the features of the embedded sample nodes to obtain the sample position representation vector of each sample node;

[0012] Calculating a contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrast loss function;

[0013] Based on the contrast loss value, the parameters of the spatial graph convolution layer are adjusted to obtain the position representation model.

[0014] In one embodiment, the sample time features include access time features, residence time features, and transfer time features, the spatial graph convolution layer includes multiple aggregation layers, and the steps of embedding the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the to-be-trained model, and aggregating the features of the embedded sample nodes to obtain the sample position representation vector of each sample node include:

[0015] Embedding the access time feature and the residence time feature into the corresponding sample node;

[0016] Calculating the node spatiotemporal characteristics of each of the sample nodes based on the access time characteristics, the residence time characteristics, the sample node characteristics of each of the sample nodes in the previous aggregation layer, and a preset nonlinear function;

[0017] Based on the node spatiotemporal features and the transfer time features, aggregating the node spatiotemporal features of the sample upstream nodes and the sample downstream nodes respectively corresponding to each of the sample nodes to obtain a node aggregation feature of each of the sample nodes;

[0018] Based on the node aggregation feature, the sample node feature in the previous aggregation layer and the preset update parameter, updating the sample node feature of each sample node in the current aggregation layer;

[0019] If the current aggregation layer is the last aggregation layer, the updated sample node feature is determined to be the sample position representation vector.

[0020] In one embodiment, the trajectory subgraph pair includes two trajectory subgraphs, each of the trajectory subgraphs includes an anchor node and an anchor upstream node and an anchor downstream node corresponding to the anchor node, wherein the anchor node is a node passed through by each trajectory segment in the trajectory subgraph. The step of calculating the contrast loss value between the trajectory subgraph pair based on the sample position representation vector and a preset contrast loss function includes:

[0021] Based on the sample position representation vector of each sample node, respectively calculating the anchor upstream mean vector corresponding to the anchor upstream node and the anchor downstream mean vector corresponding to the anchor downstream node;

[0022] Calculating a node representation loss based on the anchor upstream mean vector, the anchor downstream mean vector, the sample position representation vector of the anchor node, and a preset node representation loss function;

[0023] Selecting nodes from the anchor node, the anchor upstream node, and the anchor downstream node, and combining the selected nodes in pairs in a random order to obtain a plurality of sequential node pairs;

[0024] Calculating a node sequence loss based on the sequential node pairs and a preset node sequence loss function;

[0025] Based on a preset trade-off parameter, the sum of the node representation loss and the node sequence loss is calculated to obtain the contrast loss value.

[0026] In one embodiment, before the step of calculating the contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrast loss function, the step further includes:

[0027] Determining an anchor node from the trajectory network, wherein the anchor node is a node that multiple trajectories in the trajectory network pass through;

[0028] determining a plurality of trajectory segments from the trajectory network based on the anchor nodes and a preset trajectory segment length;

[0029] The plurality of trajectory segments are equally divided to obtain the trajectory subgraph pairs.

[0030] In one embodiment, the sample time features include access time features, residence time features, and transfer time features; the sample edge features include user arrival time and user departure time of the sample node corresponding to the sample edge; and the step of encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges includes:

[0031] Splitting the user arrival time into hierarchical access times under various time length units;

[0032] Encoding each layer access time to obtain each layer access time feature;

[0033] Calculating the sum of the access time features of each layer to obtain the access time feature;

[0034] Calculate the difference between the user's departure time and the user's arrival time at the same sample node corresponding to the sample edge to obtain the user's stay time;

[0035] Encoding the user's stay time to obtain the stay time feature;

[0036] Calculate the difference between the user departure time of the user's departure node and the user arrival time of the user's destination node in the two sample nodes corresponding to the sample edge to obtain the user transfer time;

[0037] The user transfer time is encoded to obtain the transfer time feature.

[0038] In one embodiment, before the step of obtaining the user's trajectory network, the method further includes:

[0039] Obtaining location service data of users, wherein the location service data includes the time and location of each user's movement;

[0040] Sorting the action time of each user to obtain a user time ranking;

[0041] Taking the action locations as nodes of the trajectory network, determining the user arrival time and the user departure time of each node based on the user time sorting, the action time, and the action location;

[0042] Determining edge features of the edges between the nodes based on the user arrival time and the user departure time;

[0043] Each of the nodes is randomly initialized to obtain node features of each of the nodes.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a position indicating device, which includes:

[0045] a trajectory network acquisition module, configured to acquire a user's trajectory network, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data;

[0046] A position representation generation module is used to embed the edge features of each edge into the corresponding node through a preset position representation model, and aggregate the edge features and the node features to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes a position representation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the position representation method as described above.

[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the position representation method described above are implemented.

[0049] One or more technical solutions proposed in this application have at least the following technical effects:

[0050] The user's trajectory network is obtained, and the edge features of each edge are embedded into the corresponding node through a preset position representation model, and the edge features and the node features are aggregated to obtain a position representation vector of each node.

[0051] Since the edges and nodes of the trajectory network include time data and space data in the location service data, the converted edge features and node features also include corresponding time information and space information. This application uses the graph structure of the trajectory network to first embed edge features into corresponding nodes, and then aggregate edge features and node features, so as to better aggregate time information and space information through the relationship between edges and nodes in the trajectory network, thereby preventing the loss of time information and space information. In addition, this application uses comparative learning training models to enable rare location information to obtain sufficient training. Therefore, this application can improve the accuracy of location representation, thereby improving the effectiveness of subsequent urban computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0054] Figure 1 A flowchart of the first embodiment of the position representation method of the present application is provided;

[0055] Figure 2 A schematic diagram of a scenario provided for the first embodiment of the location representation method of this application;

[0056] Figure 3 A flow chart of the second embodiment of the position representation method of the present application is provided;

[0057] Figure 4 A flowchart of the third embodiment of the position representation method of the present application is provided;

[0058] Figure 5 A schematic diagram of a scenario provided in Example 3 of the location representation method of this application;

[0059] Figure 6 This is a schematic diagram of the module structure of the position indication device according to an embodiment of the present application;

[0060] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the position representation method in the embodiment of the present application.

[0061] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0063] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0064] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication, and program execution capabilities, such as a tablet computer, personal computer, or mobile phone, or an electronic device or location display device capable of performing the aforementioned functions. This embodiment and the following embodiments will be described below using a location display device as an example.

[0065] Location service data plays an important role in urban computing tasks. To improve the performance of urban computing tasks, location service data, including temporal and spatial data, is typically converted into corresponding location representation vectors by training a location representation conversion model.

[0066] Current location representation conversion models mainly include sequence-based methods, graph-based methods, and fusion methods: Sequence-based methods regard user trajectory data as a time series and use models such as recurrent neural networks (RNNs) for learning to capture the temporal dynamic characteristics of the trajectory. This method only focuses on a single trajectory and has difficulty in fully capturing global spatial information; Graph-based methods construct location and trajectory data into a graph structure and use graph neural networks (GNNs) for learning to integrate global spatial information from multiple trajectories. This method loses the temporal dynamic characteristics of the trajectory and cannot accurately capture timing information; Fusion methods model the temporal information and spatial information of trajectory data separately and then fuse them. This method has high model complexity and is difficult to train, and there is still the problem of some temporal and spatial information being lost.

[0067] Furthermore, current methods are ineffective at handling the long-tail distribution of location visit frequencies. Common locations dominate model training, leading to inaccurate representation of rare locations. Consequently, using current methods results in poor location representation accuracy, which in turn impacts subsequent urban computing tasks.

[0068] Based on this, the embodiment of the present application provides a method for indicating a position. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the position representation method of the present application.

[0069] In this embodiment, the position representation method includes steps S10 to S20:

[0070] Step S10: Acquire a trajectory network of the user, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data;

[0071] It should be noted that the location service data is the user's geographic location information obtained through mobile devices, network communication technology and satellite positioning systems. The trajectory network is a network composed of the user's path that changes over time, which can be referred to Figure 2 .

[0072] As you can understand, a trajectory network is a graph-structured data structure that can represent a user's spatial location and temporal dynamics through nodes and edges, thus avoiding the problems of temporal information loss or spatial information isolation in traditional methods. By building a trajectory network, we can model the user's movement paths between different locations and their temporal sequence based on location-based service data, including both temporal and spatial data, thereby capturing the complex relationships between time and space.

[0073] Nodes and edges correspond to spatial data and temporal data respectively. The nodes and edges of the trajectory network effectively integrate these two types of information, thereby providing high-quality input data for subsequent deep learning models.

[0074] In step S20, the edge features of each edge are embedded into the corresponding node through a preset position representation model, and the edge features and the node features are aggregated to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

[0075] It should be noted that contrastive learning is a learning method based on comparing positive sample pairs and negative sample pairs to learn useful feature representations. In this embodiment, the positive sample pairs and negative sample pairs of contrastive learning are determined based on the trajectory subgraph pairs.

[0076] It is understandable that in this embodiment, node features are primarily spatial features, while edge features are primarily temporal features. Embedding edge features into nodes allows for a deep fusion of temporal and spatial information, thereby capturing the complete spatiotemporal characteristics of user behavior. Furthermore, since user behavior patterns are influenced not only by a location itself but also by its relationships with other locations, embedding edge features into nodes allows each node to contain more contextual information about its neighbors and connection paths, thereby improving the richness and accuracy of location representation.

[0077] After embedding edge features into corresponding nodes, the nodes now contain both the temporal features corresponding to the edges and the spatial features corresponding to the nodes. Aggregation can be used to combine these temporal and spatial information into a compact vector representation, making it easier to use in subsequent models.

[0078] Because the node-edge correspondence described above is based on the spatial and temporal data corresponding to location-based service data, data for certain locations or time periods may be very sparse in location-based service data. Therefore, to avoid the problem of long-tail distribution, this embodiment performs comparative learning on trajectory subgraphs corresponding to the trajectory network. Comparison between trajectory subgraphs can improve the model's ability to represent rare locations, thereby avoiding the bias caused by common location-dominated training in current methods and improving the accuracy of location representation.

[0079] In a feasible implementation, the specific implementation before the step of obtaining the user's trajectory network may also be:

[0080] Acquire the user's location service data, wherein the location server data includes the action time and action location of each user, sort the action time of each user to obtain a user time sort, use the action location as a node of the trajectory network, and determine the user arrival time and user departure time of each node based on the user time sort, the action time, and the action location; determine the edge features of the edges between each node based on the user arrival time and the user departure time, randomly initialize each node, and obtain the node features of each node.

[0081] It is understood that the nodes and edges in the trajectory network correspond to different information, and the nodes and edges have corresponding connections. To obtain the best input for the model, it is necessary to construct a corresponding trajectory network based on the relationship between temporal and spatial information in the location service data. Therefore, the location service data needs to be processed accordingly.

[0082] User mobility behavior is time-ordered. Sorting can restore users' actual movement paths and avoid erroneous trajectory network modeling due to time confusion. Nodes in a trajectory network represent specific geographic locations, while edges represent users' movement paths between different locations. By using users' arrival and departure times at specific nodes, we can establish connections between nodes and edges. This abstracts complex user behavior into nodes and edges in the trajectory network, making them convenient inputs for subsequent networks, enabling them to better learn from user behavior.

[0083] In summary, this embodiment obtains the user's trajectory network, embeds the edge features of each edge into the corresponding node through a preset position representation model, and aggregates the edge features and the node features to obtain the position representation vector of each node.

[0084] Since the edges and nodes of the trajectory network include the time data and spatial data in the location service data, the converted edge features and node features also include the corresponding time information and spatial information. This embodiment uses the graph structure of the trajectory network to first embed the edge features into the corresponding nodes, and then aggregate the edge features and node features, so as to better aggregate the time information and spatial information through the relationship between the edges and nodes in the trajectory network, thereby preventing the loss of time information and spatial information. In addition, this embodiment uses comparative learning to train the model, so that rare location information can also receive sufficient training. Therefore, this embodiment can improve the accuracy of location representation, thereby improving the effectiveness of subsequent urban computing tasks.

[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 Before step S10, the position representation method further includes steps S01 to S05:

[0086] Step S01: Acquire a trajectory network sample of a user, wherein the trajectory network sample includes sample edges and sample nodes, the sample edges include sample edge features converted from the time data, and the sample nodes include sample node features converted from the spatial data;

[0087] It should be noted that the trajectory network samples are sample data used for model training.

[0088] It is understandable that the model to be trained needs to be trained before it can generate a better location representation. Therefore, it is necessary to obtain the corresponding trajectory network sample data and train the model to be trained with the obtained sample data so that the model can learn the specific behavior of users in the location service data.

[0089] Step S02, encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges;

[0090] Understandably, the edge features of a sample primarily consist of the specific time information in the location-based service data. This time information is inherently complex, and directly using the raw time data may result in the model failing to fully understand the semantic information contained therein. Therefore, a time encoding layer is required to convert the raw time data into high-dimensional feature vectors. The encoded features can better capture the semantic information of time, providing richer input for subsequent layers, thereby enhancing the model's ability to understand time information.

[0091] In a feasible implementation, the sample time features include access time features, residence time features, and transfer time features; the sample edge features include user arrival time and user departure time of the sample node corresponding to the sample edge; and the specific implementation of encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges may also be:

[0092] The user arrival time is split into layered access times under each time length unit, each layered access time is encoded to obtain each layered access time feature, the sum of each layered access time feature is calculated to obtain the access time feature, the difference between the user departure time and the user arrival time of the same sample node corresponding to the sample edge is calculated to obtain the user stay time, the user stay time is encoded to obtain the stay time feature, the difference between the user departure time of the user departure node and the user arrival time of the user target node in the two sample nodes corresponding to the sample edge is calculated to obtain the user transfer time, the user transfer time is encoded to obtain the transfer time feature.

[0093] It's understandable that the timing of a place's visit is influenced by tidal patterns. Places with different functions will have different tidal patterns, and these functions will also change over time. Tidal patterns are influenced by hierarchical timestamps (hours, weeks, months, and years). For example, people behave very differently on weekdays and weekends, resulting in significantly different distributions of places in their trajectories.

[0094] Therefore, this embodiment breaks down the user's arrival time into layered visit times for various time units, encodes each layered visit time, obtains each layered visit time feature, and calculates the sum of each layered visit time feature to obtain the visit time feature. This layered operation enables the model to learn the tidal pattern of visit time and better understand the relationship between visit time and visit location in a user's visit behavior. The formula for encoding visit time in this embodiment is as follows:

[0095]

[0096] Where Ht = {minute, hour, week} is a set of hierarchical timestamp categories, Convert the timestamp to a hierarchical timestamp, is the embedding function: R→R K VTEi is the encoded access time vector, whose dimension is K.

[0097] Dwell time varies between different locations and between different functions at the same location. The distribution of dwell time varies for different location categories. For example, the dwell time for visiting an office is larger than that for visiting a market. Compared to a market, the mean and variance of dwell time at an office are larger and smaller, respectively. For the same location, dwell time is associated with different functions, such as dining in a restaurant or ordering takeout. Therefore, this example first calculates the dwell time for each location using the following formula:

[0098]

[0099] Among them, φ s The calculation is the interval between the arrival and departure times. Then, this embodiment captures the periodicity and relative position relationship in the time information through the periodic characteristics of the sine and cosine functions, and the formula is:

[0100]

[0101] in, is a trainable parameter, is the embedding function, | is the connection operation, STEi is the encoded residence time vector, and its dimension is K.

[0102] The transmission time between locations often has a significant impact on information transmission. For location-based service data, the shorter the transmission time between two locations, the higher the correlation. Therefore, this embodiment first calculates the transfer time between locations, and its expression is:

[0103]

[0104] Among them, φ t The calculation is the interval between the departure time of the origin and the arrival time of the destination. When the target node i is the starting position of the trajectory, its departure time is input, otherwise its arrival time is input. Then, the transfer time embedding of the target node i is generated, and its formula is:

[0105]

[0106] in, is a trainable parameter, || is a connection operation, TTEi is the encoded transfer time vector, and its dimension is K.

[0107] This embodiment processes the above three components to obtain access time, residence time, and transfer time encoding vectors to represent time information, thereby comprehensively capturing the user's time behavior pattern.

[0108] Step S03: embedding the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the model to be trained, and aggregating the features of each sample node after embedding to obtain the sample position representation vector of each sample node;

[0109] It can be understood that the sample time feature describes the time characteristics of the user moving between different locations, while the sample node describes the specific location where the user stays or passes. By embedding the time feature into the node, the deep fusion of time and space information can be achieved.

[0110] After temporal feature embedding, each node in the trajectory network contains both its own spatial features and its associated temporal features. These features can be fused into a compact vector representation through aggregation.

[0111] In a feasible implementation, the sample time features include access time features, residence time features, and transfer time features. The spatial graph convolution layer includes multiple aggregation layers. The spatial graph convolution layer of the model to be trained embeds the sample time features into the corresponding sample nodes, and aggregates the features of the embedded sample nodes to obtain the sample position representation vector of each sample node. A specific implementation method may also be:

[0112] The access time feature and the residence time feature are embedded in the corresponding sample nodes. Based on the access time feature, the residence time feature, the sample node feature of each sample node in the previous aggregation layer and a preset nonlinear function, the node spatiotemporal feature of each sample node is calculated. Based on the node spatiotemporal feature and the transfer time feature, the node spatiotemporal features of the sample upstream node and the sample downstream node corresponding to each sample node are aggregated to obtain the node aggregation feature of each sample node. Based on the node aggregation feature, the sample node feature in the previous aggregation layer and the preset update parameter, the sample node feature of each sample node in the current aggregation layer is updated. If the current aggregation layer is the last aggregation layer, the updated sample node feature is determined to be the sample position representation vector.

[0113] It should be noted that, in this embodiment, spatial graph convolution includes two processes: information transfer and embedding update.

[0114] It is understandable that in order to achieve deep aggregation of temporal information and spatial information, the access time and residence time need to be embedded into the node, and the expression is:

[0115]

[0116] Among them, φ t is a nonlinear function initialized by a join operation and an aggregation function, h τ is the node vector representation of the current layer. Since the transfer time contains the user's transfer information between multiple nodes, after embedding the visit time and residence time, the upstream and downstream nodes of the target node can be aggregated based on the transfer time.

[0117] The aggregation formula of the upstream node is:

[0118]

[0119] in, and W in is a trainable parameter.

[0120] The aggregation formula for the downstream node is:

[0121]

[0122] in and W out is a trainable parameter.

[0123] After aggregating the upstream and downstream nodes respectively, the aggregation results of the upstream and downstream nodes are added together to obtain the aggregation result of the target node for the upstream and downstream nodes. The expression is:

[0124]

[0125] Represents the aggregation information of the (τ+1)th layer; Represents the characteristics of the edge, namely VTEk, STEk and TTEk. represents the node embedding output of the τth layer, Indicates the number of nodes of the upstream node, The node number representing the downstream node.

[0126] The above operations are the aggregation operations for nodes in each layer of the spatial graph convolution layer. The overall aggregation process is to gradually capture information from local to global through a multi-layer graph convolutional network. For example, when aggregating in the first layer, the node will integrate the information of its direct neighbors; while in higher layers of aggregation, the node will further integrate the information of more distant neighbors. Therefore, it is necessary to update the nodes based on the aggregation results of the current layer. The expression is:

[0127]

[0128] where Fu is a function used to stack linear layers and activation functions to update the representation of target node i.

[0129] The position representation vector generated after multiple layers of aggregation and updating typically has higher accuracy and generalization capabilities, significantly improving the overall performance of the model. If the current aggregation layer is the final aggregation layer, it can be determined that the nodes in the current layer have fully aggregated the information of each node. Therefore, the updated sample node features can be determined as the sample position representation vector.

[0130] Step S04, calculating the contrast loss value between the trajectory sub-graph pairs based on the sample position representation vector and a preset contrast loss function;

[0131] It can be understood that the sample position representation vector is the final feature representation of each node in the trajectory network, integrating both temporal and spatial information. Since the sample position representation vector is primarily trained based on data from common locations, to improve the representation of rare location data, it is necessary to calculate the contrastive loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrastive loss function. This comparison between the trajectory subgraph pairs improves the representation of rare location data.

[0132] Step S05: Based on the contrast loss value, adjust the parameters of the spatial graph convolution layer to obtain the position representation model.

[0133] It is understood that the spatial graph convolution layer is a key component of the location representation model, responsible for aggregating and updating features of nodes and their neighbors in the trajectory network. Its parameters determine how spatiotemporal information is extracted and integrated from the input data. This embodiment adjusts the parameters of the spatial graph convolution layer by using a comparative loss value, enabling the spatial graph convolution layer to increase learning of rare location data, thereby avoiding the problem of long-tail distribution and improving the accuracy of rare location representation.

[0134] In summary, this embodiment obtains the user's trajectory network sample, encodes each sample edge feature through the time coding layer of the model to be trained, and obtains the sample time feature of each sample edge. The sample time feature is embedded into the corresponding sample nodes through the spatial graph convolution layer of the model to be trained, and the features of each sample node after embedding are aggregated to obtain the sample position representation vector of each sample node. Based on the sample position representation vector and the preset contrast loss function, the contrast loss value between the trajectory subgraph pairs is calculated. Based on the contrast loss value, the parameters of the spatial graph convolution layer are adjusted to obtain the position representation model.

[0135] This embodiment comprehensively captures users' temporal behavior patterns by processing the three components of temporal information. The resulting temporal features are embedded in nodes, achieving deep aggregation of temporal and spatial information. Through multi-layer aggregation of upstream and downstream nodes, each node can aggregate information from other nodes, resulting in an accurate and comprehensive location representation. Furthermore, through comparative learning, the influence of rare location data in the training process is increased, thereby improving the accuracy of location representation for rare location data.

[0136] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the first and second embodiments can be referred to above and will not be described in detail. Figure 4The trajectory subgraph pair includes two trajectory subgraphs, each of which includes an anchor node and an anchor upstream node and an anchor downstream node corresponding to the anchor node. The anchor node is a node that each trajectory segment in the trajectory subgraph passes through. Step S04 further includes steps S041 to S045:

[0137] Step S041, based on the sample position representation vector of each sample node, respectively calculating the anchor upstream mean vector corresponding to the anchor upstream node and the anchor downstream mean vector corresponding to the anchor downstream node;

[0138] It is understandable that due to the complexity of people's behaviors and goals in real-world scenarios, nodes with similar functions may be incorrectly classified into different categories in the subgraph, making parameter training difficult. Therefore, to make the node representation more stable, this embodiment uses a mean aggregation function to calculate the anchor upstream mean vector corresponding to the anchor upstream node and the anchor downstream mean vector corresponding to the anchor downstream node.

[0139] Step S042: Calculate the node representation loss based on the anchor upstream mean vector, the anchor downstream mean vector, the sample position representation vector of the anchor node, and a preset node representation loss function;

[0140] It should be noted that the node representation loss is used to estimate the distance between nodes in the representation space.

[0141] It is understandable that since the node representation loss is used to estimate the distance between nodes in the representation space, calculating the node representation loss can ensure that the position representation vector generated by the model can accurately reflect the spatiotemporal relationship between nodes. The anchor upstream mean vector reflects the user's behavior pattern before arriving at the anchor node, and the anchor downstream mean vector reflects the user's behavior pattern after leaving the anchor node. The sample position representation vector of the anchor node represents the position representation of the node itself. By combining the above three features, the user's movement path and time characteristics near the anchor node can be fully captured. Its expression is:

[0142]

[0143] in, and are the mean vectors of upstream nodes of the contrasting subgraph i, and βr∈[0,1] is a hyperparameter, which is a trade-off parameter between minimizing and maximizing the distance. r , whose expression is:

[0144] l r (x,y)=(xy) 2

[0145] Step S043: Select nodes from the anchor node, the anchor upstream node, and the anchor downstream node, and combine the selected nodes in pairs in a random order to obtain a plurality of sequential node pairs;

[0146] It's understandable that in actual user movement trajectories, the temporal order between nodes is crucial, and learning this order is crucial for better location representation. Anchor nodes have a clear temporal order relationship with their upstream and downstream nodes. By randomly pairing anchor nodes, upstream nodes, and downstream nodes, we can simulate the user's temporal order and generate training samples for model optimization.

[0147] Step S044: Calculate the node sequence loss based on the sequential node pairs and a preset node sequence loss function;

[0148] It is understandable that the node order loss is mainly used to learn time information to enhance time representation. If the temporal feature representation generated by the model cannot accurately reflect the true time order between nodes (such as the upstream node appears before the anchor node), the node order loss will be higher. By calculating the node order loss, the model's ability to understand time information can be evaluated and a clear direction for model optimization can be provided. In this embodiment, the node order loss is formulated as a classification problem, that is, if the input representation is arranged from the starting point to the end point, it is a positive sample, otherwise it is a negative sample. Its expression is:

[0149]

[0150] Among them, the downstream node vector mean, as well as the upstream node vector mean and downstream node vector mean of subgraph j. βc∈[0,1] is a hyperparameter, which is a trade-off parameter between the anchor node and other nodes: c :R 2d →R 2 It consists of stacked layers, namely connection operation, linear layer, activation function and log-likelihood loss function, and its formula is:

[0151] l c (x,y)=log(σ(W c [x|y]))+log(1-σ(W c [y|x]))#(15)

[0152] Among them, Wc is a trainable parameter, || is the connection operation, and σ is the activation function.

[0153] Step S045 : Based on a preset trade-off parameter, the sum of the node representation loss and the node sequence loss is calculated to obtain the comparison loss value.

[0154] By calculating the sum of the node representation loss and the node order loss, we can learn in both time and space, thereby generating a more comprehensive spatiotemporal representation, which is expressed as:

[0155]

[0156] Among them, the hyperparameter θ∈[0,1] is the trade-off parameter between Lr and Lc. By reasonably setting the trade-off parameter, a balance point can be found among multiple learning objectives, thereby achieving multi-objective optimization.

[0157] In a feasible implementation manner, the specific implementation manner before the step of calculating the contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and the preset contrast loss function may also be:

[0158] An anchor node is determined from the trajectory network, wherein the anchor node is a node that multiple trajectories in the trajectory network pass through in common. Based on the anchor node and a preset trajectory segment length, multiple trajectory segments are determined from the trajectory network, and the multiple trajectory segments are evenly divided to obtain the trajectory subgraph pair.

[0159] It is understandable that the construction of trajectory comparison samples mainly obtains positive and negative samples by constructing subgraph pairs, including trajectory segment generation and comparison trajectory subgraph construction. First, a position is selected as an anchor node, and then the trajectory segment containing the anchor node is sampled. seg ), N seg and (N seg ,2N seg +1] are set as upstream node, anchor node and downstream node respectively, and a trajectory of length 2Nseg+1 is obtained, where N seg Finally, an index is created to quickly find the desired sequence segment.

[0160] First, for 2N traj Anchor nodes are sampled for the trajectory segment at the same position, where the 2N traj is the number of anchor nodes used to construct the trajectory subgraph. Then, the sampled trajectory segments are evenly divided into two parts. Finally, the trajectory network nodes and edges corresponding to these trajectory segments are selected to construct two subgraphs as comparison sample pairs. The specific process can be referred to Figure 5 .

[0161] This embodiment uses the above-mentioned trajectory subgraph generation method to provide corresponding positive and negative samples for subsequent contrastive learning, fully utilizing the spatiotemporal information in the trajectory network and providing high-quality data support for model training through a reasonable data processing process.

[0162] In summary, this embodiment calculates the anchor upstream mean vector corresponding to the anchor upstream node and the anchor downstream mean vector corresponding to the anchor downstream node based on the sample position representation vector of each sample node, and calculates the node representation loss based on the anchor upstream mean vector, the anchor downstream mean vector, the sample position representation vector of the anchor node and the preset node representation loss function, selects nodes from the anchor node, the anchor upstream node and the anchor downstream node, and combines the selected nodes in pairs in a random order to obtain multiple sequential node pairs, and calculates the node sequence loss based on the sequential node pairs and the preset node sequence loss function, and calculates the node sequence loss based on the preset trade-off parameter, and calculates the sum of the node representation loss and the node sequence loss to obtain the contrast loss value.

[0163] This example trains the model in both time and space by calculating node representation loss and node order loss separately. Trajectory subgraph pairs are constructed based on the trajectory network and contrastive learning is performed on these constructed trajectory subgraph pairs, allowing nodes to learn both temporal and spatial information. During contrastive learning, the representation of infrequently accessed location data is enhanced due to the contrastive relationship, allowing infrequently visited nodes to receive sufficient training.

[0164] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the position representation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0165] This application also provides a position indication device, please refer to Figure 6 , the position indicating device comprises:

[0166] A trajectory network acquisition module 10 is configured to acquire a trajectory network of a user, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data;

[0167] The position representation generation module 20 is used to embed the edge features of each edge into the corresponding node through a preset position representation model, and aggregate the edge features and the node features to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

[0168] In one embodiment, the position indicating device comprises:

[0169] a trajectory sample acquisition module, configured to acquire a trajectory network sample of the user, wherein the trajectory network sample includes a sample edge and a sample node, the sample edge includes a sample edge feature converted from the time data, and the sample node includes a sample node feature converted from the spatial data;

[0170] A time coding module, configured to encode each of the sample edge features through a time coding layer of a model to be trained to obtain a sample time feature of each of the sample edges;

[0171] A spatiotemporal aggregation module, configured to embed the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the model to be trained, and aggregate the features of the embedded sample nodes to obtain the sample position representation vector of each sample node;

[0172] A loss calculation module, configured to calculate a contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrast loss function;

[0173] A parameter adjustment module is used to adjust the parameters of the spatial graph convolution layer based on the contrast loss value to obtain the position representation model.

[0174] In one embodiment, the spatiotemporal aggregation module includes:

[0175] A time feature embedding submodule, configured to embed the access time feature and the residence time feature into the corresponding sample node;

[0176] a spatiotemporal feature calculation submodule, configured to calculate the spatiotemporal feature of each sample node based on the access time feature, the residence time feature, the sample node feature of each sample node in the previous aggregation layer, and a preset nonlinear function;

[0177] Based on the node spatiotemporal features and the transfer time features, aggregating the node spatiotemporal features of the sample upstream nodes and the sample downstream nodes respectively corresponding to each of the sample nodes to obtain a node aggregation feature of each of the sample nodes;

[0178] A node updating submodule, configured to update the sample node features of each of the sample nodes in the current aggregation layer based on the node aggregation features, the sample node features in the previous aggregation layer, and preset update parameters;

[0179] The position representation determination submodule is configured to determine, if the current aggregation layer is the last aggregation layer, the updated sample node feature as the sample position representation vector.

[0180] In one embodiment, the loss calculation module includes:

[0181] a mean calculation submodule, configured to calculate, based on the sample position representation vector of each sample node, an anchor upstream mean vector corresponding to the anchor upstream node and an anchor downstream mean vector corresponding to the anchor downstream node;

[0182] a representation loss calculation submodule, configured to calculate a node representation loss based on the anchor upstream mean vector, the anchor downstream mean vector, the sample position representation vector of the anchor node, and a preset node representation loss function;

[0183] A node pair generation submodule is used to select nodes from the anchor node, the anchor upstream node, and the anchor downstream node, and to combine the selected nodes in pairs in a random order to obtain a plurality of sequential node pairs;

[0184] A sequence loss calculation submodule, configured to calculate a node sequence loss based on the sequence node pairs and a preset node sequence loss function;

[0185] The total loss calculation submodule is used to calculate the sum of the node representation loss and the node sequence loss based on a preset trade-off parameter to obtain the comparative loss value.

[0186] In one embodiment, the position indicating device comprises:

[0187] An anchor node determination module, configured to determine an anchor node from the trajectory network, wherein the anchor node is a node that multiple trajectories in the trajectory network pass through in common;

[0188] a trajectory segment determination module, configured to determine a plurality of trajectory segments from the trajectory network based on the anchor nodes and a preset trajectory segment length;

[0189] The trajectory subgraph pair determination module is configured to equally divide the plurality of trajectory segments to obtain the trajectory subgraph pairs.

[0190] In one embodiment, the time encoding module includes:

[0191] A time layering submodule, configured to split the user arrival time into layered access times under various time length units;

[0192] A layered coding submodule, configured to encode each layered access time to obtain a feature of each layered access time;

[0193] A hierarchical aggregation submodule, configured to calculate the sum of the access time features of each hierarchical layer to obtain the access time feature;

[0194] The residence time calculation submodule is used to calculate the difference between the user's departure time and the user's arrival time of the same sample node corresponding to the sample edge, and obtain the user's residence time;

[0195] A residence time encoding submodule, configured to encode the user's residence time to obtain the residence time feature;

[0196] A transfer time calculation submodule is used to calculate the difference between the user's departure time at the user's departure node and the user's arrival time at the user's destination node, in two sample nodes corresponding to the sample edge, to obtain the user's transfer time;

[0197] The transfer time encoding submodule is used to encode the user transfer time to obtain the transfer time feature.

[0198] In one embodiment, the position indicating device comprises:

[0199] A service data acquisition module is used to obtain the user's location service data, wherein the location service data includes the time and location of each user's action;

[0200] A time sorting module is used to sort the action time of each user to obtain a user time sorting;

[0201] A time calculation module, configured to use the action locations as nodes of the trajectory network, and determine the user arrival time and user departure time of each node based on the user time sorting, the action time, and the action location;

[0202] An edge feature determination module, configured to determine edge features of the edge between the nodes based on the user arrival time and the user departure time;

[0203] The node initialization module is used to randomly initialize each of the nodes to obtain node characteristics of each of the nodes.

[0204] The location representation device provided in this application, utilizing the location representation method described in the aforementioned embodiments, can address the technical issue of poor location representation accuracy, which in turn impacts subsequent city calculation tasks. Compared to the prior art, the location representation device provided in this application achieves the same beneficial effects as the location representation method described in the aforementioned embodiments. Other technical features of the location representation device are the same as those disclosed in the aforementioned embodiments and are not further detailed here.

[0205] The present application provides a position representation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the position representation method in the above-mentioned embodiment one.

[0206] Reference below Figure 7 , which shows a schematic diagram of the structure of a location display device suitable for implementing the embodiments of the present application. The location display device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, tablet computers, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The position indication device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0207] like Figure 7 As shown, the location display device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the location display device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input device 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output device 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and communication device 1009. The communication device 1009 can allow the position representation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a position representation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0208] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0209] The location representation device provided in this application utilizes the location representation method described in the aforementioned embodiment to address the technical issue of poor location representation accuracy, which in turn impacts subsequent city calculation tasks. Compared to the prior art, the location representation device provided in this application achieves the same beneficial effects as the location representation method described in the aforementioned embodiment. Other technical features of this location representation device are the same as those disclosed in the aforementioned embodiment and are not further detailed here.

[0210] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0211] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0212] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer program) stored thereon, wherein the computer-readable program instructions are used to execute the position representation method in the above-mentioned embodiment.

[0213] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0214] The computer-readable storage medium may be included in the position indicating device, or may exist independently without being incorporated into the position indicating device.

[0215] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a position indicating device, the position indicating device is enabled to execute the position indicating method.

[0216] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone 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 a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0217] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to the various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the prescribed logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the prescribed function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0218] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0219] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned location representation method. This computer-readable storage medium can address the technical issue of poor location representation accuracy, which in turn impacts subsequent city calculation tasks. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the location representation method provided in the aforementioned embodiments and are not further elaborated here.

[0220] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for representing a position, characterized in that: The method includes: Acquire a trajectory network of the user, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data; Through a preset position representation model, the edge features of each edge are embedded into the corresponding node, and the edge features and the node features are aggregated to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

2. The method according to claim 1, wherein Before the step of obtaining the user's trajectory network, the method further includes: Acquire a trajectory network sample of the user, wherein the trajectory network sample includes a sample edge and a sample node, the sample edge includes a sample edge feature converted from the time data, and the sample node includes a sample node feature converted from the spatial data; Encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges; Embedding the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the to-be-trained model, and aggregating the features of the embedded sample nodes to obtain the sample position representation vector of each sample node; Calculating a contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrast loss function; Based on the contrast loss value, the parameters of the spatial graph convolution layer are adjusted to obtain the position representation model.

3. The method according to claim 2, wherein The sample time features include access time features, residence time features, and transfer time features. The spatial graph convolution layer includes multiple aggregation layers. The steps of embedding the sample time features into the corresponding sample nodes through the spatial graph convolution layer of the model to be trained, and aggregating the features of the embedded sample nodes to obtain the sample position representation vector of each sample node include: Embedding the access time feature and the residence time feature into the corresponding sample node; Calculating the node spatiotemporal characteristics of each of the sample nodes based on the access time characteristics, the residence time characteristics, the sample node characteristics of each of the sample nodes in the previous aggregation layer, and a preset nonlinear function; Based on the node spatiotemporal features and the transfer time features, aggregating the node spatiotemporal features of the sample upstream nodes and the sample downstream nodes respectively corresponding to each of the sample nodes to obtain a node aggregation feature of each of the sample nodes; Based on the node aggregation feature, the sample node feature in the previous aggregation layer and the preset update parameter, updating the sample node feature of each sample node in the current aggregation layer; If the current aggregation layer is the last aggregation layer, the updated sample node feature is determined to be the sample position representation vector.

4. The method according to claim 2, wherein: The trajectory subgraph pair includes two trajectory subgraphs, each of the trajectory subgraphs includes an anchor node and an anchor upstream node and an anchor downstream node corresponding to the anchor node, wherein the anchor node is a node commonly passed by each trajectory segment in the trajectory subgraph, and the step of calculating the contrast loss value between the trajectory subgraph pair based on the sample position representation vector and a preset contrast loss function includes: Based on the sample position representation vector of each sample node, respectively calculating the anchor upstream mean vector corresponding to the anchor upstream node and the anchor downstream mean vector corresponding to the anchor downstream node; Calculating a node representation loss based on the anchor upstream mean vector, the anchor downstream mean vector, the sample position representation vector of the anchor node, and a preset node representation loss function; Selecting nodes from the anchor node, the anchor upstream node, and the anchor downstream node, and combining the selected nodes in pairs in a random order to obtain a plurality of sequential node pairs; Calculating a node sequence loss based on the sequential node pairs and a preset node sequence loss function; Based on a preset trade-off parameter, the sum of the node representation loss and the node sequence loss is calculated to obtain the contrast loss value.

5. The method according to claim 2, wherein Before the step of calculating the contrast loss value between the trajectory subgraph pairs based on the sample position representation vector and a preset contrast loss function, the method further includes: Determining an anchor node from the trajectory network, wherein the anchor node is a node that multiple trajectories in the trajectory network pass through; determining a plurality of trajectory segments from the trajectory network based on the anchor nodes and a preset trajectory segment length; The plurality of trajectory segments are equally divided to obtain the trajectory subgraph pairs.

6. The method according to claim 2, wherein: The sample time features include access time features, residence time features, and transfer time features; the sample edge features include user arrival time and user departure time of the sample node corresponding to the sample edge; and the step of encoding each of the sample edge features through the time coding layer of the model to be trained to obtain the sample time features of each of the sample edges includes: Splitting the user arrival time into hierarchical access times under various time length units; Encoding each layer access time to obtain each layer access time feature; Calculating the sum of the access time features of each layer to obtain the access time feature; Calculate the difference between the user's departure time and the user's arrival time at the same sample node corresponding to the sample edge to obtain the user's stay time; Encoding the user's stay time to obtain the stay time feature; Calculate the difference between the user departure time of the user's departure node and the user arrival time of the user's destination node in the two sample nodes corresponding to the sample edge to obtain the user transfer time; The user transfer time is encoded to obtain the transfer time feature.

7. The method according to claim 1, wherein: Before the step of obtaining the user's trajectory network, the method further includes: Obtaining location service data of users, wherein the location service data includes the time and location of each user's movement; Sorting the action time of each user to obtain a user time ranking; Taking the action locations as nodes of the trajectory network, determining the user arrival time and the user departure time of each node based on the user time sorting, the action time, and the action location; Determining edge features of the edges between the nodes based on the user arrival time and the user departure time; Each of the nodes is randomly initialized to obtain node features of each of the nodes.

8. A position indicating device, characterized in that: The device comprises: a trajectory network acquisition module, configured to acquire a user's trajectory network, wherein the trajectory network includes edges and nodes, the edges include edge features corresponding to time data, the nodes include node features corresponding to spatial data, and the user's location service data includes the time data and the spatial data; A position representation generation module is used to embed the edge features of each edge into the corresponding node through a preset position representation model, and aggregate the edge features and the node features to obtain a position representation vector of each node, wherein the position representation model is obtained by comparative learning and training based on the trajectory subgraph pairs corresponding to the trajectory network.

9. A position indicating device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the position representation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the position representation method according to any one of claims 1 to 7 are implemented.