Dynamic prompt word generation method and apparatus, network device, and storage medium

By matching and fusing user data with spatiotemporal awareness maps, dynamic prompts are generated, which solves the problem of spatiotemporal constraints not being captured in existing technologies and improves the accuracy and experience of user queries.

CN122432272APending Publication Date: 2026-07-21CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-03-03
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, question-answering methods fail to effectively capture the spatiotemporal constraints in user intent, resulting in large errors in the prompts generated in location-related queries and a poor user experience.

Method used

By matching user data with spatiotemporal awareness maps, target nodes are generated, target spatiotemporal awareness maps are determined and keywords are integrated to generate dynamic prompts and capture user intent under spatiotemporal constraints.

Benefits of technology

It improves the accuracy and experience of user queries, reduces the deviation between generated results and user needs, and achieves accurate recommendations in the spatiotemporal dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432272A_ABST
    Figure CN122432272A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a dynamic prompt word generation method and device, network equipment and storage medium, relating to the technical field of artificial intelligence, which comprises: matching a user and nodes in a space-time perception graph according to user data to obtain target nodes matched with the user; determining a target space-time perception graph according to the user data and the target nodes; fusing the target space-time perception graph with the keyword to obtain a space-time semantic context; and generating a dynamic prompt word corresponding to the data query according to the keyword and the space-time semantic context. Through the user data and the space-time perception graph, the user's intention under the space-time constraint can be captured, thereby solving the problem in the prior art that only the discipline classification and multi-modal data mapping are used to generate the result, and the key dimensions such as time, space and relative distance are not jointly modeled, resulting in the model being unable to capture the space-time constraint in the user's intention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, specifically to a method, apparatus, network device, and storage medium for generating dynamic prompt words. Background Technology

[0002] Existing question-answering methods generate results solely through subject classification and multimodal data mapping, failing to jointly model key dimensions such as time, space, and relative distance. This results in the model's inability to capture the spatiotemporal constraints of the user's intent. In location-related question answering, the lack of spatial correlation leads to significant discrepancies between the generated prompts and the user's query location, resulting in a poor user experience. Summary of the Invention

[0003] At least one embodiment of this application provides a dynamic prompt word generation method, apparatus, network device, and storage medium to solve the problem in the prior art that the results are generated only through subject classification and multimodal data mapping, without joint modeling of key dimensions such as time, space, and relative distance, resulting in the model being unable to capture the spatiotemporal constraints in the user's intent.

[0004] To solve the above-mentioned technical problems, this application is implemented as follows:

[0005] In a first aspect, embodiments of this application provide a method for generating dynamic prompt words, including:

[0006] The user is matched with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user; the user data includes keywords, location information, and time information when the user performs a data query; the spatiotemporal perception map is determined based on the spatial characteristics, temporal characteristics, and attribute characteristics of multiple sets of data.

[0007] Based on the user data and the target node, a target spatiotemporal awareness map is determined; the target spatiotemporal awareness map includes the target node and the target edge weights between the user and the target node; the target edge weights are used to indicate the association strength between the user and the target node;

[0008] The spatiotemporal perception map of the target is fused with the keywords to obtain a spatiotemporal semantic context;

[0009] Based on the keywords and the spatiotemporal semantic context, dynamic prompt words corresponding to the data query are generated.

[0010] Optionally, matching the user with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user includes:

[0011] Based on the keywords and location information in the user data, calculate the similarity between the user and the nodes in the spatiotemporal perception map;

[0012] Nodes with a similarity greater than a preset threshold are identified as target nodes.

[0013] Optionally, determining the target spatiotemporal awareness map based on the user data and the target node includes:

[0014] Based on the location information and time information, calculate the first edge weights of the user data and the target node with respect to spatial and temporal features;

[0015] Based on the keywords, calculate the second-side weights of the user data and the attribute features of the target node;

[0016] The larger of the first edge weight and the second edge weight is determined as the target edge weight.

[0017] Optionally, the target spatiotemporal perception map is fused with the keywords to obtain a spatiotemporal semantic context, including:

[0018] The target node is transformed by a multi-layer graph neural network to obtain the hidden vector representation of the target node;

[0019] The keywords are transformed into vectors to obtain the keyword vectors corresponding to the keywords.

[0020] The spatiotemporal semantic context is obtained by concatenating and aggregating the keyword vector and the hidden vector representation of the target node using a feedforward neural network.

[0021] Optionally, based on the keywords and the spatiotemporal semantic context, dynamic prompts corresponding to the data query are generated, including:

[0022] Calculate the intent probability corresponding to the keyword based on the spatiotemporal semantic context and the sudden event.

[0023] Generate a sequence of prompt words based on the stated intent probability;

[0024] The dynamic prompt words are determined based on the keywords and the prompt word sequence.

[0025] Optionally, the dynamic prompt words are determined based on the keywords and the prompt word sequence, including:

[0026] The vector corresponding to each prompt word in the prompt word sequence is concatenated with the vector corresponding to the keyword to obtain the prompt word vector;

[0027] The dynamic prompt words are obtained by processing the prompt word vectors using a large language model.

[0028] Optionally, the spatiotemporal perception map determined based on the spatial, temporal, and attribute features of multiple sets of data includes:

[0029] The nodes of the spatiotemporal perception map are determined based on the spatial, temporal, and attribute features of multiple sets of data; the attribute features include the type of entity or event corresponding to the data.

[0030] Calculate the edge weight between every two nodes; the edge weight is used to characterize the temporal and spatial correlation strength between the nodes;

[0031] The spatiotemporal perception graph is determined based on the nodes and the edge weights.

[0032] Optionally, nodes of the spatiotemporal perception map are determined based on the spatial, temporal, and attribute characteristics of multiple sets of data, including:

[0033] The target string is determined based on the spatial features, temporal features, and attribute features corresponding to each set of data;

[0034] Perform a hash calculation on the target string to obtain the node identifier of the node corresponding to each group of data;

[0035] The nodes of the spatiotemporal perception map are determined based on the node identifier and feature vector; the feature vector includes the temporal feature, the spatial feature, and the attribute feature corresponding to the node.

[0036] Optionally, calculating the edge weight between every two said nodes includes:

[0037] The temporal and spatial relationships between each pair of nodes are calculated using a spatiotemporal Gaussian kernel function to obtain the edge weights between each pair of nodes;

[0038] The smaller the temporal and spatial distances between the nodes, the larger the edge weights, and the sum of the edge weights between all nodes is 1.

[0039] Secondly, embodiments of this application provide a dynamic prompt word generation device, including:

[0040] The matching module is used to match users with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user; the user data includes keywords, location information, and time information when the user performs a data query; the spatiotemporal perception map is determined based on the spatial characteristics, temporal characteristics, and attribute characteristics of multiple sets of data;

[0041] The determination module is used to determine a target spatiotemporal awareness map based on the user data and the target node; the target spatiotemporal awareness map includes the target node and the target edge weights between the user and the target node; the target edge weights are used to indicate the association strength between the user and the target node;

[0042] The fusion module is used to fuse the target spatiotemporal perception map with the keywords to obtain a spatiotemporal semantic context;

[0043] The generation module is used to generate dynamic prompt words corresponding to the data query based on the keywords and the spatiotemporal semantic context.

[0044] Thirdly, embodiments of this application provide a network device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the first aspect.

[0045] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0046] Fifthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the method described in the first aspect.

[0047] Compared with existing technologies, the dynamic prompt word generation method, apparatus, network device, and storage medium provided in this application embodiment match user data including location and time information with the spatiotemporal perception map to obtain target nodes that match the user's data query; then, the target spatiotemporal perception map is determined by the target edge weights between the user data and the target nodes; the spatiotemporal semantic context is determined by fusing the keywords with the target spatiotemporal perception nodes; finally, dynamic prompt words corresponding to the data query are generated based on the keywords and the spatiotemporal semantic context. The dynamic prompt word generation method of this application embodiment, through the user data and the spatiotemporal perception map, can capture the user's intent under spatiotemporal constraints, thereby solving the problem in existing technologies where results are generated only through subject classification and multimodal data mapping, without joint modeling of key dimensions such as time, space, and relative distance, resulting in the model's inability to capture the spatiotemporal constraints in the user's intent. Attached Figure Description

[0048] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0049] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application;

[0050] Figure 2 This is a flowchart of the dynamic prompt word generation method according to an embodiment of this application;

[0051] Figure 3 This is a schematic diagram illustrating cross-level spatiotemporal dependencies in the aggregation of multi-layer GNNs according to an embodiment of this application;

[0052] Figure 4 This is an example schematic diagram of the dynamic prompt word generation method according to an embodiment of this application;

[0053] Figure 5 This is a schematic diagram illustrating the application of the dynamic prompt word generation method of this application to a large language model;

[0054] Figure 6 This is a schematic diagram of the structure of the dynamic prompt word generation device according to an embodiment of this application.

[0055] Figure 7 This is a schematic diagram of the structure of a network device according to an embodiment of this application. Detailed Implementation

[0056] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, without limiting the number of objects; for example, the first object can be one or more. Furthermore, "or" in this application indicates at least one of the connected objects. For example, "A or B" covers three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. The character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0057] The term "instruction" in this application can be either a direct instruction (or explicit instruction) or an indirect instruction (or implicit instruction). A direct instruction can be understood as one in which the sender explicitly informs the receiver of specific information, the operation to be performed, or the requested result, etc.; an indirect instruction can be understood as one in which the receiver determines the corresponding information based on the instruction sent by the sender, or makes a judgment and determines the operation to be performed or the requested result, etc., based on the judgment result.

[0058] It is worth noting that the technologies described in this application are not limited to Long Term Evolution (LTE) / LTE-Advanced (LTE-A) systems, but can also be used in other wireless communication systems, such as Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), Orthogonal Frequency Division Multiple Access (OFDMA), Single-carrier Frequency-Division Multiple Access (SC-FDMA), or other systems. The terms "system" and "network" in this application are often used interchangeably, and the described technologies can be used in the systems and radio technologies mentioned above, as well as in other systems and radio technologies. The following description describes New Radio (NR) systems for illustrative purposes, and the term NR is used in most of the following description; however, these technologies can also be applied to systems other than NR systems, such as 6th Generation (6G) communication systems.

[0059] Figure 1This diagram illustrates a block diagram of a wireless communication system applicable to embodiments of this application. The wireless communication system includes a terminal 11 and a network device 12. The terminal 11 can be a mobile phone, tablet computer, laptop computer, notebook computer, personal digital assistant (PDA), handheld computer, netbook, ultra-mobile personal computer (UMPC), mobile internet device (MID), augmented reality (AR), virtual reality (VR) device, robot, wearable device, flight vehicle, vehicle user equipment (VUE), shipboard equipment, pedestrian user equipment (PUE), smart home (home devices with wireless communication capabilities, such as refrigerators, televisions, washing machines, or furniture), game console, personal computer (PC), ATM, or self-service machine, etc. Wearable devices include: smartwatches, smart bracelets, smart headphones, smart glasses, smart jewelry (smart bracelets, smart chains, smart rings, smart necklaces, smart anklets, smart anklets, etc.), smart wristbands, smart clothing, etc. Among these, in-vehicle devices can also be referred to as in-vehicle terminals, in-vehicle controllers, in-vehicle modules, in-vehicle components, in-vehicle chips, or in-vehicle units, etc. It should be noted that the specific type of terminal 11 is not limited in this application embodiment. Network device 12 may include access network devices or core network devices, wherein access network devices may also be referred to as Radio Access Network (RAN) devices, radio access network functions, or radio access network units. Access network devices may include base stations, Wireless Local Area Network (WLAN) access points (APs), or Wireless Fidelity (WiFi) nodes, etc.In this context, a base station may be referred to as a Node B (NB), an Evolved Node B (eNB), a Next Generation Node B (gNB), a New Radio Node B (NR Node B), an Access Point, a Relay Base Station (RBS), a Serving Base Station (SBS), a Base Transceiver Station (BTS), a Radio Base Station, a Radio Transceiver, a Basic Service Set (BSS), an Extended Service Set (ESS), a Home Node B (HNB), a Home Evolved Node B, a Transmission Reception Point (TRP), or any other suitable term in the relevant field, as long as the same technical effect is achieved. The base station is not limited to any specific technical terminology. It should be noted that in this application embodiment, only a base station in an NR system is used as an example for introduction, and the specific type of base station is not limited.

[0060] Core network equipment may include, but is not limited to, at least one of the following: core network node, core network function, Mobility Management Entity (MME), Access and Mobility Management Function (AMF), Session Management Function (SMF), User Plane Function (UPF), Policy Control Function (PCF), Policy and Charging Rules Function (PCRF), Edge Application Server Discovery Function (EASDF), Unified Data Management (UDM), Unified Data Repository (UDR), Home Subscriber Server (HSS), Centralized network configuration (CNC), Network Repository Function (NRF), Network Exposure Function (NEF), Local NEF (or L-NEF), Binding Support Function (BSF), and Application Function. Function (AF), etc. It should be noted that the embodiments of this application only use the core network equipment in the NR system as an example for introduction, and do not limit the specific type of core network equipment.

[0061] To enable those skilled in the art to better understand the embodiments of this application, the following description is provided first:

[0062] Graph Neural Networks (GNNs) are used to process graph-structured data. They update node representations by aggregating information about neighboring nodes and are widely used in social networks, recommender systems, and other fields.

[0063] Spatiotemporal sequence modeling: Using recurrent neural networks (RNN), long short-term memory networks, or Transformers to model spatiotemporal sequence data (such as movement trajectories and time series) and extract spatiotemporal dependencies.

[0064] Dynamic prompting technology: By generating context-sensitive prompts, it guides large language models (LLMs) to complete tasks more accurately, such as few-shot learning and text generation.

[0065] Knowledge graphs store relationships between entities in a structured form and are often used to enhance the semantic understanding capabilities of models, such as point of interest (POI) graphs and traffic network graphs.

[0066] These technologies provide the theoretical foundation for the construction of the spatiotemporal awareness map, the generation of dynamic prompt words, and the fusion of external knowledge in this proposal.

[0067] In existing technologies, a subject identification model dynamically calls a large domain model, combined with a multimodal data visualization component to generate interdisciplinary question-and-answer results. However, because it does not consider the spatiotemporal dimension, this approach fails to accurately capture the spatiotemporal constraints of user intent when dealing with spatiotemporally related questions such as "recommend nearby weekend activities" (e.g., "recommend coffee shops near the weekend" requires both the time condition "weekend" and the space condition "nearby"), leading to recommendations that deviate from actual needs.

[0068] As described in the background section, the existing technology generates results solely through subject classification and multimodal data mapping, without jointly modeling key dimensions such as time, space, and relative distance, resulting in the model's inability to capture the spatiotemporal constraints in the user's intent. To address this issue, this application provides a dynamic prompt word generation method, which can reduce or avoid the occurrence of the above situations and improve the user experience.

[0069] This application provides a method and apparatus for generating dynamic prompt words. The method and apparatus are based on the same concept, and since they solve problems in similar principles, their implementations can be mutually referenced; repeated details will not be repeated.

[0070] like Figure 2 As shown in the embodiment of this application, a dynamic prompt word generation method includes the following steps:

[0071] Step 201: Match the user with nodes in the spatiotemporal perception map based on the user data to obtain the target node that matches the user; the user data includes the keywords, location information and time information of the user when querying data; the spatiotemporal perception map is determined based on the spatial features, temporal features and attribute features of multiple sets of data;

[0072] Step 202: Determine a target spatiotemporal awareness map based on the user data and the target node; the target spatiotemporal awareness map includes the target node and the target edge weights between the user and the target node; the target edge weights are used to indicate the association strength between the user and the target node;

[0073] Step 203: Fuse the target spatiotemporal perception map with the keywords to obtain the spatiotemporal semantic context;

[0074] Step 204: Generate dynamic prompt words corresponding to the data query based on the keywords and the spatiotemporal semantic context.

[0075] The dynamic prompt word generation method provided in this application embodiment matches user data including location and time information with the spatiotemporal awareness map to obtain target nodes that match the user's data query; then, it determines the target spatiotemporal awareness map by using the target edge weights between the user data and the target node; furthermore, it determines the spatiotemporal semantic context by fusing the keywords with the target spatiotemporal awareness nodes; finally, it generates dynamic prompt words corresponding to the data query based on the keywords and the spatiotemporal semantic context. This dynamic prompt word generation method, through the user data and the spatiotemporal awareness map, can capture the user's intent under spatiotemporal constraints, thereby solving the problem in the prior art where results are generated only through subject classification and multimodal data mapping, without joint modeling of key dimensions such as time, space, and relative distance, resulting in the model's inability to capture the spatiotemporal constraints in the user's intent.

[0076] It should be noted that the spatiotemporal perception graph is pre-constructed and includes nodes, edges (connections between nodes), and edge weights used to indicate the strength of the association between two nodes.

[0077] Optionally, the spatiotemporal perception map is determined based on the spatial, temporal, and attribute features of multiple sets of data, including:

[0078] The nodes of the spatiotemporal perception map are determined based on the spatial, temporal, and attribute features of multiple sets of data; the attribute features include the type of entity or event corresponding to the data.

[0079] Calculate the edge weight between every two nodes; the edge weight is used to characterize the temporal and spatial correlation strength between the nodes;

[0080] The spatiotemporal perception graph is determined based on the nodes and the edge weights.

[0081] Optionally, the time feature is a timestamp (Unix timestamp).

[0082] The spatial feature is the location coordinates (longitude and latitude).

[0083] Optionally, nodes of the spatiotemporal perception map are determined based on the spatial, temporal, and attribute characteristics of multiple sets of data, including:

[0084] The target string is determined based on the spatial features, temporal features, and attribute features corresponding to each set of data;

[0085] Perform a hash calculation on the target string to obtain the node identifier of the node corresponding to each group of data;

[0086] The nodes of the spatiotemporal perception map are determined based on the node identifier and feature vector; the feature vector includes the temporal feature, the spatial feature, and the attribute feature corresponding to the node.

[0087] Optionally, the target string is obtained by concatenating the spatial, temporal, and attribute features.

[0088] In this embodiment of the application, the time feature is: ; Indicates the first One data set;

[0089] The spatial features are ;in, For the first Longitude information for each data set; For the first The dimensional information of each data set.

[0090] Specifically, the spatial, temporal, and attribute features are concatenated in the following manner:

[0091]

[0092] in, For the target string, .

[0093] Optionally, the string can be hashed using a hash function to generate the node's identifier.

[0094] Optionally, create nodes And the feature vector of the node:

[0095]

[0096] in, It is the distance feature vector; For node identification;

[0097] This is a time feature vector;

[0098] For attribute feature vectors; This is an attribute encoding function.

[0099] Optionally, calculating the edge weight between every two said nodes includes:

[0100] The temporal and spatial relationships between each pair of nodes are calculated using a spatiotemporal Gaussian kernel function to obtain the edge weights between each pair of nodes;

[0101] The smaller the temporal and spatial distances between the nodes, the larger the edge weights, and the sum of the edge weights between all nodes is 1.

[0102] Specifically, the spatiotemporal Gaussian kernel function is:

[0103]

[0104] in, For nodes With nodes The edge weights between;

[0105] and It is the distance feature vector;

[0106] and This is a time feature vector;

[0107] α is the normalization factor, ensuring that all The sum is 1;

[0108] This is a spatial attenuation parameter (default: 3 km, adjustable) used to control spatial sensitivity: it controls the strength of location association (e.g., if adjusted to 1 km, only neighboring nodes are strongly associated).

[0109] This is the time decay parameter (default: 2 hours, adjustable), used to control time sensitivity: if adjusted to 4 hours, the time constraint is relaxed.

[0110] The solution in this embodiment of the application, through the spatiotemporal Gaussian kernel function... and The regulation and control of time sensitivity and space sensitivity can solve the problem of inefficiency in implicit derivation.

[0111] The prompt word generation method in this application replaces the implicit derivation of traditional text parsing by quantifying the distance, time, and correlation strength through the spatiotemporal Gaussian kernel function.

[0112] Specifically, taking coffee shops and subway stations as examples, the spatiotemporal correlation between the two is shown below:

[0113] ;

[0114] For example, the coffee shop is 300 meters away from the subway station (i.e., ),set up ,but:

[0115] ;

[0116] If the distance increases to 800 meters, then:

[0117] ;

[0118] Therefore, the closer the distance, the higher the spatial weight, which directly reflects "walkable accessibility".

[0119] If the user queries during weekday morning rush hour (8:00 AM), and the coffee shop's opening hours are 7:30 AM (a time difference of 0.5 hours), then... For 1 hour:

[0120]

[0121] If the coffee shop opens at 9:00 AM (1 hour time difference):

[0122]

[0123] Therefore, the higher the overlap of time windows, the greater the time weight, which represents "time period adaptability".

[0124] The spatiotemporal knowledge graph is created based on the nodes created and the calculated edge weights between the nodes.

[0125] Optionally, matching the user with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user includes:

[0126] Based on the keywords and location information in the user data, calculate the similarity between the user and the nodes in the spatiotemporal perception map;

[0127] Nodes with a similarity greater than a preset threshold are identified as target nodes.

[0128] It should be noted that the user's location information is obtained through the user's corresponding terminal.

[0129] Optionally, determining the target spatiotemporal awareness map based on the user data and the target node includes:

[0130] Based on the location information and time information, calculate the first edge weights of the user data and the target node with respect to spatial and temporal features;

[0131] Based on the keywords, calculate the second-side weights of the user data and the attribute features of the target node;

[0132] The larger of the first edge weight and the second edge weight is determined as the target edge weight.

[0133] Optionally, after determining the target node, a first edge weight is added to the target edge between the user data and the target node, and attribute features (e.g., "belongs to _business district") are labeled on the target edge.

[0134] In this embodiment of the application, the conflict handling principle is as follows:

[0135] When the first edge weight and the edge weight in the spatiotemporal knowledge graph coexist, the larger one is selected as the final target edge weight.

[0136] In this embodiment of the application, the target spatiotemporal perception map is: ;

[0137] in, The set of nodes in the target spatiotemporal perception map. It is a set of weighted edges.

[0138] Optionally, the target spatiotemporal perception map is fused with the keywords to obtain a spatiotemporal semantic context, including:

[0139] The target node is transformed by a multi-layer graph neural network to obtain the hidden vector representation of the target node;

[0140] The keywords are transformed into vectors to obtain the keyword vectors corresponding to the keywords.

[0141] The spatiotemporal semantic context is obtained by concatenating and aggregating the vectors corresponding to the keywords and the hidden vector representations of the target nodes using a feedforward neural network.

[0142] In this embodiment of the application, the hidden vector of the target node is represented as follows:

[0143]

[0144] in, For node i at the th Hidden representation of layers, For the neighbors of node i, For activation functions (such as ReLU). For the first Layer-learnable weight matrix, This is a bias term.

[0145] For example, in the travel recommendation scenario, as shown in Table 1, the dynamic prompt word generation method of this application reduces the reasoning of spatiotemporal relationships in the prior art to 0.8 seconds.

[0146] Table 1. Comparison of the spatiotemporal relationship between the dynamic prompt word generation method of this application and existing technologies.

[0147]

[0148] like Figure 3 As shown, the dynamic prompt word generation method of this application aggregates cross-level spatiotemporal dependencies (such as "attraction-subway station-business district") through multi-layer GNN: directly establishes the cross-level spatiotemporal link "attraction A→business district D" (traditional sequence models require a redundant path A→B→C→D).

[0149] In existing technologies, traditional sequence models have limitations: RNN / LSTM and other technologies can only process linear time-series data (A→B→C) and cannot capture network dependencies.

[0150] Vectorized user queries Then, all node representations are aggregated to generate a spatiotemporal semantic context vector C:

[0151]

[0152] Where N: total number of nodes in the graph, L: number of layers in the graph neural network. Feedforward neural network; The structure of the L-layer graph neural network in the feedforward neural network is the same as that for determining the hidden vector representation.

[0153] Optionally, based on the keywords and the spatiotemporal semantic context, dynamic prompts corresponding to the data query are generated, including:

[0154] Calculate the intent probability corresponding to the keyword based on the spatiotemporal semantic context and the sudden event.

[0155] Generate a sequence of prompt words based on the stated intent probability;

[0156] The dynamic prompt words are determined based on the keywords and the prompt word sequence.

[0157] Optionally, the calculation of the intent probability corresponding to the keyword includes:

[0158] ;

[0159] in, Intent when given context c The probability, K: the total number of preset intent categories (e.g., "recommendation", "prediction", "navigation"), The original score given context c. For bias terms; For the category of intention, This is a bias term.

[0160] For example, such as Figure 4 As shown, this is a user's query for "driving directions from Wangjing SOHO to Beijing Capital International Airport".

[0161] Emergency: Real-time traffic API reports "Temporary traffic control on the Beigao Bridge section of Jingmi Road (13:00-15:00)," dynamic response process:

[0162] The spacetime graph is dynamically updated:

[0163] Add control event nodes The spatial coordinates are located at Beigaoqiao (116.52°E, 40.00°N).

[0164] The edge weights are calculated using the spatiotemporal Gaussian kernel function:

[0165] Related road segment weight w control → Jingmi Road ↑ (a road between A and location B) (From 2 hours to 4 hours, expanding the time-related impact range);

[0166] Alternative route weighting: Airport Expressway → Detour ↑80%;

[0167] Next, the probability of the stated intent is calculated:

[0168] Injecting the control event feature into the global context C → P("Control evasion" | C) = 0.93 (the probability of the original route intention is reduced to 0.05);

[0169] Output prompt word sequence:

[0170] [Current Restriction] Avoid the Beigaoqiao section of road (temporary traffic control from 13:00 to 15:00);

[0171] [Alternative Solution] Take the airport expressway as an alternative, which is expected to add 8 minutes.

[0172] [Navigation Instructions] Turn right at Wangjing Bridge onto the Airport Expressway;

[0173] Unpredictability is reflected in the fact that the prompts include non-pre-stored information such as real-time generated control times, detour coordinates, and time consumption increments.

[0174] Optionally, a Transformer encoder can be used to generate a sequence of cue words, for example:

[0175] ;

[0176] Top-K sampling was used to select the K most relevant cue words, ensuring both relevance and diversity. : The (t+1)th prompt word to be generated. The first t prompt word sequences that have been generated.

[0177] For example, a user queries "the fastest driving route from Guomao to Zhongguancun".

[0178] The procedure for this proposal is as follows:

[0179] Extract the starting point coordinates (116.46°E, 39.91°N) and the ending point coordinates (116.31°E, 39.98°N).

[0180] Generate prompt words:

[0181] [Spatial Constraints] Starting point (116.46, 39.91) → Ending point (116.31, 39.98);

[0182] [Time Window] Current time 17:30 (evening rush hour);

[0183] [Dynamic Strategy] Avoid the East Third Ring Road (congestion index 0.95) and take the North Fourth Ring Road instead;

[0184] As shown in Table 2, the input for this application is the same as that for the prior art, which is the user's query content;

[0185] The output of existing technologies is a "recommended route from [starting point] to [end point]", but due to the lack of coordinate location information, the recommended route deviates greatly from the actual needs (e.g., "Zhongguancun" may refer to multiple positioning points, misleading people to Haidian Huangzhuang instead of the core area of ​​Zhongguancun); this application can achieve positioning accuracy within 100 meters through spatiotemporal kernel functions.

[0186] Table 2 Comparison of Output Accuracy between this Application and Existing Technologies

[0187]

[0188] The dynamic prompt word generation method of this application can avoid the ambiguity of traditional text parsing and directly drive the navigation engine to calculate the accurate path (error < 50 meters).

[0189] like Figure 5 As shown, the method in this application embodiment further includes:

[0190] The dynamic prompts are concatenated with the data query to obtain the target vector;

[0191] The target vector is input into a large language model to obtain spatiotemporal perception results.

[0192] Optionally, the large language model is:

[0193]

[0194] in, This is a vector concatenation operation; query is the user's original input text. This is the promote structure of the large language model.

[0195] In this embodiment of the application, the input to the prompt word generation method is changed from semantics in the prior art to machine instructions:

[0196] For example, in the application scenario of emergency fire rescue dispatch:

[0197] User input: "A fire has broken out near the east gate of xx park, requiring emergency evacuation."

[0198] This proposal's LLM input:

[0199] {

[0200] "type": "disaster_response",

[0201] "coordinates": [116.48, 39.93], / / Coordinates of the east gate of xx park (WGS-84)

[0202] "radius": 500, / / Radius of influence (meters)

[0203] "real_time_data": {

[0204] "wind_speed": 8.2, / / Real-time wind speed (m / s)

[0205] "crowd_density": 4.5 / / people / square meter

[0206] }

[0207] }

[0208] The method in this application transforms the input from natural language text into structured machine instructions, directly driving the GIS system to draw evacuation routes; (for example, in the prior art, the input is an abstract text vector [0.7, 0, 0.6]).

[0209] The method in this embodiment of the application uses the prompt phrase: Trigger the traffic signal control system.

[0210] [Signal Control] Green light wave activated from Chaoyang North Road to Liangmaqiao Road;

[0211] [Evacuation Route] Dongzhimen North Street (116.47, 39.94) - (116.49, 39.95) will be closed.

[0212] Real-time invocation of the physics engine:

[0213] Geographic Information System: Calculating the optimal evacuation route (avoiding congestion points)

[0214] Crowd simulation engine: Predicts the direction of pedestrian flow within a 500m range.

[0215] Therefore, a comparison between the prior art and the solution of this application is shown in Table 3:

[0216] Table 3 Comparison of the dynamic prompt word generation method of this application with existing technologies

[0217]

[0218] The advantages of the dynamic prompt word generation method in this application embodiment compared with the prior art are shown in Table 4:

[0219] Table 4. Comparison of the improvement of the dynamic prompt word generation method in this application with existing technologies.

[0220]

[0221] The various methods of the embodiments of this application have been described above. Apparatus for implementing the above methods will now be provided.

[0222] like Figure 6 As shown in the figure, this application embodiment also provides a dynamic prompt word generation device 600, including:

[0223] The matching module 601 is used to match users with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user; the user data includes keywords, location information, and time information when the user performs a data query; the spatiotemporal perception map is determined based on the spatial characteristics, temporal characteristics, and attribute characteristics of multiple sets of data.

[0224] The determining module 602 is used to determine a target spatiotemporal perception map based on the user data and the target node; the target spatiotemporal perception map includes the target node and the target edge weights between the user and the target node; the target edge weights are used to indicate the association strength between the user and the target node;

[0225] The fusion module 603 is used to fuse the target spatiotemporal perception map with the keywords to obtain a spatiotemporal semantic context;

[0226] The generation module 604 is used to generate dynamic prompt words corresponding to the data query based on the keywords and the spatiotemporal semantic context.

[0227] The dynamic prompt word generation device provided in this application embodiment matches user data including location and time information with the spatiotemporal perception map to obtain a target node that matches the user's data query; then, it determines the target spatiotemporal perception map by the target edge weight between the user data and the target node; then, it determines the spatiotemporal semantic context by fusing the keyword with the target spatiotemporal perception node; finally, it generates a dynamic prompt word corresponding to the data query based on the keyword and the spatiotemporal semantic context. The dynamic prompt word generation method of this application embodiment, through the user data and the spatiotemporal perception map, can capture the user's intention under spatiotemporal constraints, thereby solving the problem in the prior art that the results are generated only through subject classification and multimodal data mapping, without joint modeling of key dimensions such as time, space and relative distance, resulting in the model being unable to capture the spatiotemporal constraints in the user's intention.

[0228] One embodiment of the network device in this application, such as Figure 7 As shown, it includes a transceiver 710, a processor 700, a memory 720, and a program or instructions stored in the memory 720 and executable on the processor 700; when the processor 700 executes the program or instructions, it implements the various processes of the above-described dynamic prompt word generation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0229] The transceiver 710 is used to receive and send data under the control of the processor 700.

[0230] Among them, Figure 7In this context, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 700) and memory (memory 720). The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 710 may be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 700 is responsible for managing the bus architecture and general processing, and the memory 720 may store data used by the processor 700 during operation.

[0231] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described dynamic prompt generation method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0232] This application also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, they implement the various processes of the above-described dynamic prompt word generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0233] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security and network security.

[0234] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0235] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0236] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A dynamic prompt word generation method, characterized in that, include: The user is matched with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user; the user data includes keywords, location information, and time information when the user performs a data query; the spatiotemporal perception map is determined based on the spatial characteristics, temporal characteristics, and attribute characteristics of multiple sets of data. Based on the user data and the target node, a target spatiotemporal awareness graph is determined; the target spatiotemporal awareness graph includes the target node and the target edge weights between the user and the target node; The target edge weight is used to indicate the strength of the association between the user and the target node; The spatiotemporal perception map of the target is fused with the keywords to obtain a spatiotemporal semantic context; Based on the keywords and the spatiotemporal semantic context, dynamic prompt words corresponding to the data query are generated.

2. The method of claim 1, wherein, Matching the user with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user includes: Based on the keywords and location information in the user data, calculate the similarity between the user and the nodes in the spatiotemporal perception map; Nodes with a similarity greater than a preset threshold are identified as target nodes.

3. The method of claim 1, wherein, Based on the user data and the target node, a target spatiotemporal awareness map is determined, including: Based on the location information and time information, calculate the first edge weights of the user data and the target node with respect to spatial and temporal features; Based on the keywords, calculate the second-side weights of the user data and the attribute features of the target node; The larger of the first edge weight and the second edge weight is determined as the target edge weight.

4. The method of claim 1, wherein, The spatiotemporal perception map of the target is fused with the keywords to obtain a spatiotemporal semantic context, including: The target node is transformed by a multi-layer graph neural network to obtain the hidden vector representation of the target node; The keywords are transformed into vectors to obtain the keyword vectors corresponding to the keywords. The spatiotemporal semantic context is obtained by concatenating and aggregating the keyword vector and the hidden vector representation of the target node using a feedforward neural network.

5. The method of claim 1, wherein, Based on the keywords and the spatiotemporal semantic context, dynamic prompt words corresponding to the data query are generated, including: Calculate the intent probability corresponding to the keyword based on the spatiotemporal semantic context and the sudden event. Generate a sequence of prompt words based on the stated intent probability; The dynamic prompt words are determined based on the keywords and the prompt word sequence.

6. The method of claim 5, wherein, The dynamic prompt words are determined based on the keywords and the prompt word sequence, including: The vector corresponding to each prompt word in the prompt word sequence is concatenated with the vector corresponding to the keyword to obtain the prompt word vector; The dynamic prompt words are obtained by processing the prompt word vectors using a large language model.

7. The method according to claim 1, characterized in that, The spatiotemporal perception map, determined based on the spatial, temporal, and attribute characteristics of multiple sets of data, includes: The nodes of the spatiotemporal perception map are determined based on the spatial, temporal, and attribute features of multiple sets of data; the attribute features include the type of entity or event corresponding to the data. Calculate the edge weight between every two nodes; the edge weight is used to characterize the temporal and spatial correlation strength between the nodes; The spatiotemporal perception graph is determined based on the nodes and the edge weights.

8. The method according to claim 7, characterized in that, Based on the spatial, temporal, and attribute characteristics of multiple sets of data, the nodes of the spatiotemporal perception map are determined, including: The target string is determined based on the spatial features, temporal features, and attribute features corresponding to each set of data; Perform a hash calculation on the target string to obtain the node identifier of the node corresponding to each group of data; The nodes of the spatiotemporal perception map are determined based on the node identifier and feature vector; the feature vector includes the temporal feature, the spatial feature, and the attribute feature corresponding to the node.

9. The method according to claim 7, characterized in that, Calculating the edge weight between every two nodes includes: The temporal and spatial relationships between each pair of nodes are calculated using a spatiotemporal Gaussian kernel function to obtain the edge weights between each pair of nodes; The smaller the temporal and spatial distances between the nodes, the larger the edge weights, and the sum of the edge weights between all nodes is 1.

10. A dynamic prompt word generation device, characterized in that, include: The matching module is used to match users with nodes in the spatiotemporal perception map based on user data to obtain target nodes that match the user; the user data includes keywords, location information, and time information when the user performs a data query; the spatiotemporal perception map is determined based on the spatial characteristics, temporal characteristics, and attribute characteristics of multiple sets of data; The determination module is used to determine a target spatiotemporal awareness map based on the user data and the target node; the target spatiotemporal awareness map includes the target node and the target edge weights between the user and the target node; The target edge weight is used to indicate the strength of the association between the user and the target node; The fusion module is used to fuse the target spatiotemporal perception map with the keywords to obtain a spatiotemporal semantic context; The generation module is used to generate dynamic prompt words corresponding to the data query based on the keywords and the spatiotemporal semantic context.

11. A network device, characterized in that, include: Transceiver, processor, memory, and programs or instructions stored in the memory and executable on the processor; When the processor executes the program or instructions, it implements the steps of the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 9.