Resident trajectory activity semantic inference method, system, equipment and medium
By identifying unique and high-frequency POI types in the region and reorganizing the trajectory data, combined with the inference ability of the large language model, the problem of inferring active semantics from the original trajectory data is solved, achieving higher accuracy and operation simplicity.
Patent Information
- Application Number
- CN202411892913.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art is difficult to effectively infer meaningful activity semantics from raw trajectory data, especially when dealing with complex and diverse human behaviors, existing methods are susceptible to noise data and require high-quality labeled data.
By obtaining user trajectory and POI data, dividing the region into grid structure areas, identifying the most unique and high-frequency POI types in each region as key geographical information, reorganizing the trajectory data into a stop point sequence, and constructing LLM prompts for trajectory activity semantic inference, and using a large language model to infer the activity semantics of residents' trajectory.
The key geographical features of each region are effectively identified, providing high-quality context information for large language models, and improving the accuracy and operation simplicity of semantic inference of trajectory activities.
Smart Images

Figure CN119808950A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of big data technology and relates to a method, system, device and medium for semantic inference of resident trajectory activities. Background Art
[0002] Residents' trajectory data plays a vital role in many fields such as traffic planning, urban management, and location-based services (LBS). Trajectory data is usually obtained through devices such as GPS devices, smartphones, and sensors, recording residents' location information, activity paths, etc. With the popularization of smart devices and the advancement of data collection technology, it has become easier to obtain trajectory data, especially raw location data collected by smartphones and various sensor devices. However, although trajectory data provides valuable information for analyzing residents' behavior, optimizing urban management, and providing personalized services, how to infer meaningful activity semantics from these raw trajectory data remains a technical challenge. Trajectory data itself usually lacks clear activity labels or semantics. The raw data is mostly a series of locations and timestamps, which cannot directly reflect the specific activities performed by individuals (such as "going to work", "shopping", "exercise", etc.). Therefore, inferring activity semantics from these raw trajectory data has become a hot topic in recent years.
[0003] Although there are many methods to try to solve the problem of trajectory activity inference, the existing technology still has significant defects and shortcomings, which are specifically reflected in the following aspects:
[0004] Inference methods based on rule assumptions: There are some existing rule-based trajectory inference methods, which usually rely on simplified behavioral assumptions. For example, activities are classified according to residence time, displacement distance, trajectory continuity, etc. These methods often assume that human behavior is predictable and that the performance of each activity has a consistent pattern. However, in reality, human behavior is diverse and complex. Methods that rely on simplified assumptions cannot cover all possible activity types and are easily disturbed by noisy data, resulting in inaccurate inference results.
[0005] Data-driven methods: In recent years, data-driven models (such as machine learning methods) have been proposed for trajectory activity inference. These methods try to learn activity patterns from raw trajectories by training on large amounts of data. Although this approach improves the inference accuracy to a certain extent, there are still several problems: First, supervised / semi-supervised learning methods usually require labeled data, and high-quality labeled data is expensive to obtain and the labeling process is cumbersome. Second, unsupervised learning methods require manual labeling of the corresponding activity type based on the patterns inferred by the model, and it is usually difficult to distinguish non-commuting activities. Summary of the invention
[0006] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, system, device and medium for inferring activity semantics of residents' trajectories, which can effectively infer activity semantics from original trajectory data.
[0007] To achieve the above object, the present invention discloses a method for semantic inference of resident trajectory activities, comprising:
[0008] Obtain user trajectory and Point-Of-Interest (POI) data in the user's area and perform preprocessing;
[0009] Divide the region into several areas, identify the most unique POI type and high-frequency POI type in each area as key geographic information;
[0010] Reorganizing the user trajectory format into a sequence of stay points in combination with the key geographic information;
[0011] Construct LLM hints for semantic inference of trajectory activities;
[0012] According to the LLM hint for trajectory activity semantic inference, the activity semantics of the resident trajectory is inferred using LLM.
[0013] The further improvement of the resident trajectory activity semantic inference method of the present invention is:
[0014] Furthermore, the operation process of dividing the region into several areas is as follows:
[0015] Divide the user's area into several grid-structured areas;
[0016] Map the longitude and latitude of the user's trajectory to the corresponding area;
[0017] Assign a region ID to each stop point in the user's trajectory.
[0018] Furthermore, the process of identifying the most unique POI type and the high-frequency POI type in each area is as follows:
[0019] Based on the keyword extraction and recognition method in text mining and the grouping high-frequency sampling strategy, the most unique POI types and high-frequency POI types in each area are identified.
[0020] Furthermore, each stop point in the stop point sequence is composed of a day of the week, an area ID, an arrival time, a departure time, a stay time, a moving step length, N high-frequency POI types, and a most unique POI type.
[0021] Furthermore, the process of constructing LLM hints for trajectory activity semantic inference is as follows:
[0022] Based on the step-by-step prompt strategy, an LLM prompt for trajectory activity semantic inference is constructed.
[0023] Furthermore, the LLM model includes but is not limited to: GPT-4o and Llama3-8B.
[0024] The present invention discloses a resident trajectory activity semantic inference system, comprising:
[0025] The acquisition module is used to obtain the user's trajectory and POI data in the user's area;
[0026] an identification module, for dividing the region into a number of areas, identifying the most unique POI type and the most frequent POI type in each area as key geographic information;
[0027] A reorganization module, used to reorganize the user trajectory format into a sequence of stay points in combination with the key geographic information;
[0028] A building module for constructing LLM hints for trajectory activity semantic inference;
[0029] The inference module is used to infer the activity semantics of the resident trajectory using the LLM model according to the LLM prompt for trajectory activity semantic inference.
[0030] The further improvement of the resident trajectory activity semantic inference system of the present invention is:
[0031] Furthermore, the process of identifying the most unique POI type and the high-frequency POI type in each area is as follows:
[0032] Based on the keyword extraction and recognition method in text mining and the grouping high-frequency sampling strategy, the most unique POI types and high-frequency POI types in each area are identified.
[0033] The present invention discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for semantic inference of resident trajectory activities are implemented.
[0034] The present invention discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for semantic inference of resident trajectory activities are implemented.
[0035] The present invention has the following beneficial effects:
[0036] The method, system, device and medium for inferring the activity semantics of residents' trajectories of the present invention identify unique and high-frequency POI types in each area during specific operation to describe the key geographical features of the area, and provide high-quality and useful contextual geographical information for the Large Language Model (LLM), so that the LLM model can better understand the trajectory and accurately infer the activity semantics, thereby effectively inferring the activity semantics from the original trajectory data, with simple operation and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0038] Figure 1 is a flow chart of the method of the present invention;
[0039] Figure 2 Schematic diagram for identifying key geographic features of the region based on POI;
[0040] Figure 3 Flowchart designed for LLM prompts;
[0041] Figure 4 This is a schematic diagram of the trajectory format after reorganization;
[0042] Figure 5 An example diagram of trajectory semantic inference results. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0045] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0046] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0047] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0048] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0050] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0051] Embodiment 1
[0052] refer to Figure 1 The method for semantic inference of residents' trajectory activities of the present invention comprises the following steps:
[0053] 1) Obtain trajectory and POI data and perform preprocessing;
[0054] The present invention selects Shenzhen, China as the study area and uses travel survey data in Shenzhen to verify the framework. The present invention divides the study area into a 1 km grid structure, maps the longitude and latitude of each trajectory of the residents to the corresponding grid unit, and assigns a regional ID to each stay point. Refer to Table 1, which shows an example of a trajectory with three stay points, where the activity type is used as a verification label and the remaining data points constitute the original trajectory.
[0055] Table 1
[0056]
[0057] The present invention uses Shenzhen POI data collected from the open API of Amap. Amap divides POI data into 13 main categories, 153 subcategories, and 488 detailed categories. In the experiment of the present invention, 153 subcategories, namely "POI types" in the present invention, are used, and they are reorganized into 10 functional groups according to the urban functions they represent, as shown in Table 2.
[0058] Table 2
[0059]
[0060] 2) Identification of key regional geographic features based on POI;
[0061] See also Figure 2 ,The present invention discloses a unique-high-frequency POI sampling method for identifying the most unique and high-frequency POI types in each region to represent the key geographical features of the region.
[0062] This paper adopts the classic method of keyword extraction in text mining, namely Term Frequency-Inverse Document Frequency (TF-IDF), to identify the unique POI types in each region. In this case, TF-IDF quantifies the importance of POI types in a specific region relative to their popularity in all regions. This method highlights POI types that are high in a specific region and rare globally, effectively capturing the uniqueness and uniqueness of each region. Specifically, the TF-IDF vector is calculated for a given region r. in, Indicates the TF-IDF value corresponding to the i-th POI type, It can be expressed as:
[0063]
[0064] Among them, n i is the number of POIs in the region, N is the total number of POIs in the region, R is the total number of regions, and q is the number of regions containing the POI. For any given region, the present invention takes the POI type with the largest TF-IDF value in the region as the most unique functional feature of the region, that is, the most unique POI type in region r for:
[0065]
[0066] In addition, it is also important to consider the POI types with a high proportion in the region to fully grasp the functional characteristics of the region. If we only rely on high-frequency POI types, we may not be able to fully capture the diverse functions of the region. Therefore, the present invention designs a grouped high-frequency sampling strategy. Specifically, we first calculate the relative frequency of POI types in region r, that is, the term frequency (TF) in TF-IDF, that is:
[0067]
[0068] in, Represents the frequency of the i-th POI type.
[0069] According to the role of POI types in human activities (e.g. education, leisure), POI types are divided into M different functional groups G r , for each functional group, according to F r The total sampling ratio is calculated by the aggregate frequency in the calculation to ensure that POI types with relatively high occurrence frequencies have a higher probability of being selected while maintaining diversity. The processing flow is expressed as:
[0070]
[0071]
[0072] in, represents the sampling ratio assigned to the kth functional group, is the total frequency of PO I types in functional group k, is the POI frequency vector of functional group k after softmax normalization. Then, all functional groups are sampled according to the normalized weights and sampling ratios:
[0073]
[0074] Wherein, K is the total number of POI types sampled with high frequency, which is set to 10 in the present invention. The Sampling(·) function performs proportional sampling from the POI types in each functional group. represents one or more high-frequency POI types in functional group i, Represents the set of POI types extracted by high-frequency sampling. Finally, the results are combined to obtain a more comprehensive regional POI category representation, namely:
[0075]
[0076] in, A set of POI types that are uniquely and frequently sampled for region r. This set covers the most unique and most frequent POI types, ensuring that regional characteristics are fully reflected and providing a richer geographical context.
[0077] 3) Reorganization of trajectory format with enhanced key geographic features;
[0078] The present invention discloses a method for reorganizing the trajectory format by combining the identified geographic information to help LLM understand the geospatial semantics behind the trajectory and infer the activity semantics of the trajectory. Specifically, each trajectory format is reorganized into a sequence of stay points ( Figure 4 ), where each stop point consists of the following attributes:
[0079] Day of the week (e.g., Monday);
[0080] Region ID (e.g., "1123");
[0081] Arrival time (e.g., 7:39);
[0082] Departure time (e.g., 8:05);
[0083] Duration of stay (e.g., 21 min);
[0084] Moving step length (i.e. the distance between the current stop point and the previous stop point);
[0085] Geographic information (i.e., 10 high-frequency POI types and 1 unique POI type identified).
[0086] In addition to geographic information, other attributes can be derived from the original trajectory. These spatial, temporal and semantic information can help LLM understand the individual's activity behavior and perform activity reasoning.
[0087] 4) Design of LLM prompts for semantic inference of trajectory activities;
[0088] Inspired by various prompting techniques, such as Chain-Of-Thought (COT), the present invention discloses a step-by-step prompting strategy to guide LLM to analyze trajectory data and perform logical activity reasoning, see 3, which specifically includes the following steps:
[0089] 41) Clarify your goals.
[0090] The present invention defines the main task of the model as:<trajectory_informatio> ) Infer activity semantics. This task consists of two parts, namely inferring the activity order and providing a reasonable explanation. By specifying these task instructions, the model is guided to focus on activity inference rather than simple data extraction. The specific process is as follows:
[0091] 42) Describe the data format. To ensure that the LLM (large language model) understands the structure and information of the given trajectory data, the present invention introduces the form of the trajectory and explains the specific meaning of each component (i.e., each attribute of the stop point);
[0092] 43) Guide model thinking: When inferring activity semantics, LLM not only has to process trajectory data, but also perform sequential logic analysis to identify individual activity patterns. To achieve this, the present invention provides a step-by-step strategy to decompose the task into multiple sub-steps to guide LLM to complete the reasoning process. Specifically, before performing activity semantic reasoning, first guide LLM to perform a preliminary analysis of the given trajectory data to ensure that subsequent reasoning has a comprehensive background. Then, guide LLM to perform two specific tasks in sequence, namely, inferring the activity semantics of a given trajectory and generating a trajectory description. The trajectory description provides an explanation for the reasoning results. For each task, the prompt will emphasize the key information of LLM to support the generation of a coherent activity sequence and logical description during the reasoning process;
[0093] 44) Declare the output process: In order to ensure the consistent format of the reasoning results, the present invention declares a fixed output structure in the prompt, so that LLM can generate an ordered activity sequence and organizational trajectory description, and can also minimize the differences between different LLM outputs;
[0094] 45) Provide input data. Finally, the present invention provides the required data for LLM, including<activity_type> and<trajectory_information> .<activity_type> Specifying activity types and providing corresponding explanations for classifications provides explicit guidance to the model to improve inference accuracy.
[0095] 5) Activity semantic inference based on LLM;
[0096] The present invention adopts two LLMs, GPT-4o and Llama3-8B, as the reasoning models of this study. GPT-4o is regarded as one of the most powerful large-scale language models currently, with advanced reasoning capabilities and excellent performance in zero-sample and few-sample tasks. At the same time, in order to reduce the cost of use, the present invention also selects the open source model Llama3-8B and deploys it locally, and adopts the LoRA strategy in the parameter efficient fine-tuning (PEFT) method, and uses real data to fine-tune it to improve its performance in activity semantic reasoning (the fine-tuned model is denoted as Llama3-8B-F).
[0097] Confirmatory experiments
[0098] In order to verify the performance of the proposed framework in activity reasoning, four representative methods were selected as comparison methods:
[0099] Input-Output Hidden Markov Model (IO-HMM): An extension of the Hidden Markov Model (HMM) that incorporates the influence of external input features when modeling the output state.
[0100] XGBoost: A gradient boosting decision tree algorithm widely used for classification tasks due to its computational efficiency and strong performance on structured data.
[0101] Naive Bayes Classifier (NBC): A probabilistic model based on Bayes' theorem that assumes that features are independent. Although this independence assumption may be limited in practical applications, it has the advantages of simple calculation and fast training speed, and is particularly suitable for preliminary classification and fast decision-making.
[0102] Support Vector Machine (SVM): SVM is a classification algorithm that maximizes the inter-class margin to identify the best hyperplane in the feature space to effectively separate different sample classes.
[0103] To evaluate the performance of activity reasoning, the present invention uses 6 evaluation metrics:
[0104] Accuracy: It measures the proportion of activity types that are correctly inferred.
[0105] Precision: It measures the proportion of positive instances that are predicted correctly.
[0106] Recall: It measures the ratio of the number of correctly identified positive examples to the total number of actual positive examples.
[0107] F1-Score: It is the harmonic mean of precision and recall, providing a balanced evaluation in classification tasks.
[0108] Bilingual Evaluation Understudy (BLEU): It evaluates the similarity between the individual activity sequences inferred by the model and the true sequences.
[0109] ActDis: It evaluates the similarity between the activity type duration distribution inferred by the model and the actual distribution from an aggregate perspective.
[0110] Referring to Table 3, bold: best effect; underline: second best effect. The experimental results of the present invention show that both GPT-4o and fine-tuned Llama3-8B (i.e., Llama3-8B-F) show superior performance relative to the comparison model. At the same time, the fine-tuned Llama3-8B has the best effect overall.
[0111] Table 3
[0112]
[0113] Embodiment 2
[0114] The resident trajectory activity semantic inference system of the present invention comprises:
[0115] The acquisition module is used to obtain the user's trajectory and POI data in the user's area;
[0116] an identification module, for dividing the region into a number of areas, identifying the most unique POI type and the most frequent POI type in each area as key geographic information;
[0117] A reorganization module, used to reorganize the user trajectory format into a sequence of stay points in combination with the key geographic information;
[0118] A building module for constructing LLM hints for trajectory activity semantic inference;
[0119] The inference module is used to infer the activity semantics of the resident trajectory using the LLM model according to the LLM prompt for trajectory activity semantic inference.
[0120] In this embodiment, the process of identifying the most unique POI type and the most frequent POI type in each area is as follows:
[0121] Based on the keyword extraction and recognition method in text mining and the grouping high-frequency sampling strategy, the most unique POI types and high-frequency POI types in each area are identified.
[0122] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0123] Embodiment 3
[0124] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for inferring the activity semantics of residents' trajectories are implemented, for example, including: obtaining user trajectories and POI data of the area where the user is located; dividing the area into several regions, identifying the most unique POI type and high-frequency POI type in each region as key geographic information; reorganizing the user trajectory format into a sequence of stay points according to the key geographic information; constructing an LLM prompt for trajectory activity semantic inference; and inferring the activity semantics of residents' trajectories using the LLM model according to the LLM prompt for trajectory activity semantic inference. The memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc. The processor, the network interface, and the memory are interconnected through an internal bus, which may be an industrial standard architecture bus, a peripheral component interconnect standard bus, an extended industrial standard architecture bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include memory and nonvolatile memory and provides instructions and data to the processor.
[0125] Embodiment 4
[0126] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for inferring the activity semantics of residents' trajectories are implemented, for example, including: obtaining user trajectories and POI data of the area where the user is located; dividing the area into several regions, identifying the most unique POI type and high-frequency POI type in each region as key geographic information; reorganizing the user trajectory format into a sequence of stay points according to the key geographic information; constructing LLM prompts for trajectory activity semantic inference; and using LLM to infer the activity semantics of residents' trajectories according to the LLM prompts for trajectory activity semantic inference. Specifically, the computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.
[0127] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0128] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0131] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and disclosure of the invention. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0132] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0133] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for semantic inference of resident trajectory activities, characterized in that: include: Obtain user trajectory and Point-Of-Interest (POI) data in the user's area and perform preprocessing; Divide the region into several areas, identify the most unique POI type and high-frequency POI type in each area as key geographic information; Reorganizing the user trajectory format into a sequence of stay points in combination with the key geographic information; Construct LLM hints for semantic inference of trajectory activities; According to the LLM hint for trajectory activity semantic inference, the activity semantics of the resident trajectory is inferred using LLM.
2. The method for semantic inference of resident trajectory activities according to claim 1 is characterized in that: The operation process of dividing the region into several areas is as follows: Divide the user's area into several grid-structured areas; Map the longitude and latitude of the user's trajectory to the corresponding area; Assign a region ID to each stop point in the user's trajectory.
3. The method for semantic inference of resident trajectory activities according to claim 1 is characterized in that: The process of identifying the most unique POI type and the most frequent POI type in each area is as follows: Based on the keyword extraction and recognition method in text mining and the grouping high-frequency sampling strategy, the most unique POI types and high-frequency POI types in each area are identified.
4. The method for semantic inference of resident trajectory activities according to claim 1 is characterized in that: Each stop point in the stop point sequence is composed of a day of the week, an area ID, an arrival time, a departure time, a stay time, a moving step length, N high-frequency POI types and a most unique POI type.
5. The method for semantic inference of resident trajectory activities according to claim 1 is characterized in that: The process of constructing LLM hints for trajectory activity semantic inference is as follows: Based on the step-by-step prompt strategy, an LLM prompt for trajectory activity semantic inference is constructed.
6. The method for semantic inference of resident trajectory activities according to claim 1, characterized in that: The LLM models include but are not limited to: GPT-4o and Llama3-8B.
7. A resident trajectory activity semantic inference system, characterized in that: include: The acquisition module is used to obtain the user's trajectory and POI data in the user's area; an identification module, for dividing the region into a number of areas, identifying the most unique POI type and the most frequent POI type in each area as key geographic information; A reorganization module, used to reorganize the user trajectory format into a sequence of stay points in combination with the key geographic information; A building module for constructing LLM hints for trajectory activity semantic inference; The inference module is used to infer the activity semantics of the resident trajectory using the LLM according to the LLM prompt for trajectory activity semantic inference.
8. The resident trajectory activity semantic inference system according to claim 7 is characterized in that: The process of identifying the most unique POI type and the most frequent POI type in each area is as follows: Based on the keyword extraction and recognition method in text mining and the grouping high-frequency sampling strategy, the most unique POI types and high-frequency POI types in each area are identified.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the resident trajectory activity semantic inference method as described in any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the resident trajectory activity semantic inference method as described in any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Federal learning-based trajectory data preparation method
CN121009585A
A trajectory data preparation method based on federated learning
CN121009585B
Hierarchical zero sample trajectory prediction method based on large language model
CN121365120A
Large model-based resident leisure activity mode identification method and system
CN121561205A