A scenic spot interpretation text generation method and system based on knowledge fusion and user portrait

By leveraging local sensor and dataset processing technologies, combined with structured graphs and unstructured mappings, the problem of synchronizing the narration pace with visitor behavior in intelligent tour guide systems was solved. This enabled efficient and accurate generation of narration content and response to security incidents on edge devices, meeting both hardware and security requirements.

CN122262249APending Publication Date: 2026-06-23CHENGDU WUYI YIXING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610671078.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-15
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing intelligent tour guide technologies have significant technical deficiencies in terms of synchronizing the pace of explanation with the pace of visitor behavior, the factual accuracy of large models with a small number of parameters, constraints of edge hardware resources, and hard decision-making switching in the event of emergencies in public places. This results in asynchronous explanation content and untimely response to safety incidents.

Method used

By acquiring a dataset containing target attraction identifiers and continuous spatiotemporal sequences of tourists based on local sensors, and combining structured graph path traversal and unstructured vector space mapping, a fusion contextual prompt column is generated. Hardware security gating and finite state machines are introduced to ensure real-time synchronization of the narration content and generation of evacuation routes in the event of a safety incident.

Benefits of technology

It achieves real-time synchronization between the narration content and visitor behavior, ensuring the accuracy of the narration content and rapid response in the event of a security incident, reducing the computing power and power consumption burden of edge devices, and meeting the hardware and security requirements of public place tour guide systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122262249A_ABST
    Figure CN122262249A_ABST
Patent Text Reader

Abstract

The application discloses a scenic spot explanation text generation method and system based on knowledge fusion and user portrait, and belongs to the field of intelligent guide, the method comprises the following steps: obtaining a first data set based on a local sensor; processing the first data set, locally and in parallel, performing structured graph path traversal and unstructured vector space mapping for the target scenic spot identifier, generating a second data set as a fusion context prompt list; inputting the second data set into a local large model, and outputting a streaming explanation text according to real-time kinematic parameters analyzed from the continuous space-time sequence of the tourists. The application solves the pain point of repeated resetting of explanation logic caused by position jumping in scenic spot guide explanation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent tour guides, and in particular to a method and system for generating scenic area explanation text based on knowledge fusion and user profiling. Background Technology

[0002] With the rapid development of the cultural tourism industry and the increasing maturity of big data model technology, AI-based intelligent tour guide systems for scenic spots are gradually replacing traditional human guides and fixed audio players, becoming an important means for tourists to acquire knowledge about scenic spots and understand their cultural connotations.

[0003] However, existing intelligent tour guide technologies, whether traditional geofence-triggered, cloud-based large-scale model real-time generation, or edge-side small-scale model combined with vector retrieval, all have significant technical shortcomings in four dimensions: synchronization of the narration rhythm with the rhythm of tourist behavior, factual accuracy of large models with a small number of parameters, intelligent degradation under edge hardware resource constraints, and hard decision switching in the event of public emergencies. There is an urgent need for a complete technical solution that can provide adaptive narration content with controllable factual accuracy under edge deployment conditions, and can switch to reliable hard decision output with the highest priority in the event of a safety incident. Summary of the Invention

[0004] One of the objectives of this invention is to provide a method for generating scenic area explanation text based on knowledge fusion and user profiling, in order to solve the asynchronous problems in the existing technology where the rhythm of explanation text generation is decoupled from the rhythm of tourists' physical tour, resulting in the explanation continuing even after the person has left or having nothing to say while the person is staying.

[0005] This invention is achieved through the following technical solution: a method for generating scenic spot explanation text based on knowledge fusion and user profiling, comprising the following steps: S100, acquiring a first dataset based on local sensors, the first dataset containing target scenic spot identifiers and a continuous spatiotemporal sequence of tourists, the continuous spatiotemporal sequence of tourists including multiple timestamps and physical location coordinates under each timestamp; S200, processing the first dataset, performing structured graph path traversal and unstructured vector space mapping for the target scenic spot identifiers in parallel locally, extracting entity relationship subgraphs and travelogue text vector blocks respectively, and concatenating the entity relationship subgraphs and the travelogue text vector blocks according to a preset formatted marking template to generate a second dataset as a fusion context prompt column; S300. Input the second dataset into the local large model, and execute a preset deterministic dynamic truncation and extension control logic in the streaming generation stage of the local large model based on the real-time kinematic parameters parsed from the continuous spatiotemporal sequence of the tourists, and output streaming explanatory text; wherein, the deterministic dynamic truncation and extension control logic includes: mapping the real-time kinematic parameters to a current state identifier among multiple mutually exclusive state identifiers, and deriving a mask matrix and a word length limit based on the current state identifier, wherein the mask matrix is ​​used to apply retention or masking operations to the structured components and unstructured components in the fusion context prompt column, and the word length limit is used to constrain the maximum number of output words allowed to be generated by the local large model in a single decoding.

[0006] Furthermore, the step of acquiring the first dataset based on local sensors specifically includes: the tourist terminal independently acquiring the first dataset through its built-in Bluetooth radio frequency module; or, the scenic area edge server communicating with the tourist terminal sending the first dataset; or, the tourist terminal and the scenic area edge server collaboratively acquiring the first dataset and then caching the first dataset in the tourist terminal's local shared memory.

[0007] Furthermore, the step of acquiring the first dataset based on local sensors also includes parsing physical positioning coordinates, specifically including: receiving broadcast packets emitted by Bluetooth beacons deployed within the scenic area; extracting original RSSI samples from the broadcast packets; and maintaining an original RSSI sample set consisting of multiple original RSSI samples within a sliding time window; removing the maximum and minimum value samples from the original RSSI sample set, and then calculating the arithmetic mean of the remaining samples to obtain a truncated mean; based on the truncated mean and a preset logarithmic distance path loss model, resolving the truncated mean to obtain the physical distance from the tourist terminal to the corresponding Bluetooth beacon; after obtaining the physical distances corresponding to at least three Bluetooth beacons, performing multi-point positioning operations to minimize the sum of squares of the residuals corresponding to each physical distance, and writing the two-dimensional coordinates corresponding to the minimum value as the physical positioning coordinates under the current timestamp into the first dataset.

[0008] Furthermore, the preset logarithmic distance path loss model uses the reference signal strength and the environmental path loss index as model parameters; the reference signal strength is the reference RSSI value measured at a distance of one meter from the Bluetooth beacon; the environmental path loss index is calibrated based on on-site measurements at the scenic area.

[0009] Furthermore, the real-time kinematic parameters include at least: instantaneous movement speed and cumulative dwell time; wherein, the instantaneous movement speed is obtained by dividing the Euclidean distance offset between physical positioning coordinates at adjacent timestamps in the first dataset by the sampling period; the cumulative dwell time is obtained by integrating the instantaneous movement speed with a preset quasi-stationary speed threshold in the time domain.

[0010] Furthermore, before performing the parallel extraction of the structured graph path traversal and the unstructured vector space mapping, S200 further includes: reading the remaining capacity of the currently available random access memory and the remaining capacity of the video memory of the local device through a system kernel call, and comparing them with a preset safety level to form a hardware safety gating scalar, wherein the hardware safety gating scalar has a value of 0 or 1; when the hardware safety gating scalar indicates that the remaining capacity is higher than the preset safety level, the unstructured vector space mapping is allowed to participate in the generation of the second dataset; when the hardware safety gating scalar indicates that the remaining capacity is lower than the preset safety level, the unstructured vector space mapping is suspended, only the structured graph path traversal is retained, and the second dataset containing only the structured components is generated based on the output result of the structured graph path traversal.

[0011] Furthermore, before performing the unstructured vector space mapping, S200 further includes: based on the physical location coordinates under the current timestamp in the first dataset, selecting the geographic grid identifier corresponding to the geographic grid nearest to the physical location coordinates from the geographic grid set pre-divided in the scenic area as a spatial gating condition; the unstructured vector space mapping is only performed in the memory partition that matches the spatial gating condition.

[0012] Furthermore, the method for selecting the nearest neighbor geographic grid specifically includes: for each geographic grid in the geographic grid set, calculating the Euclidean distance between its geometric center and the physical location coordinates; and selecting the geographic grid with the minimum Euclidean distance as the nearest neighbor geographic grid.

[0013] Further, step S200 includes the following sub-steps: S210, extracting the core entity from the target attraction identifier, and retrieving all neighbor triples centered on the core entity and within a distance of no more than one hop in the locally deployed scenic area structured knowledge graph to generate the entity relation subgraph; S220, using the target attraction identifier as the query keyword, encoding it into a query vector via a text encoder, and extracting several travelogue text vector blocks whose cosine similarity is greater than a preset lower similarity threshold from the locally deployed unstructured travelogue document vector library, using the cosine similarity between the query vector and the embedding representation of each document in the unstructured travelogue document vector library as a metric; S230, parsing the entity relation subgraph into a triple sequence, and appending the triple sequence as the fact constraint header to the travelogue text vector blocks, and encapsulating it according to the preset formatted tag template to generate the second dataset.

[0014] Furthermore, each travelogue text vector block in the unstructured travelogue document vector library is appended with a geographic grid identifier to which the scenic spot described in its content belongs during the offline pre-compilation stage, and the unstructured travelogue document vector library is organized into an inverted index structure using the geographic grid identifier as the key, the inverted index structure corresponding to the partitioning of the memory.

[0015] Furthermore, the plurality of mutually exclusive state identifiers include at least: normal state, condensed state, extended state, and alarm state; the operation of mapping the real-time kinematic parameters to a current state identifier among the plurality of mutually exclusive state identifiers is determined according to the following priority order: First, if the local crowd density is greater than a preset congestion threshold, the current state identifier is determined to be the alarm state; the local crowd density is an estimated value of the number of concurrently connected devices belonging to the same geographic grid within a preset radius centered on the physical location coordinates at the current timestamp; second, if the previous determination fails and the instantaneous movement speed is greater than a preset movement speed threshold, the current state identifier is determined to be the condensed state; third, if the first two determinations fail and the cumulative dwell time is greater than a preset dwell threshold, the current state identifier is determined to be the extended state; when all three determinations fail, the current state identifier is determined to be the normal state.

[0016] Furthermore, when the current state is identified as the condensed state, the deterministic dynamic truncation and extension control logic executes a key information condensation mechanism. The key information condensation mechanism specifically includes: intercepting and modifying the control instruction stream injected into the local large model; configuring the mask matrix to: retain the structured components in the fusion context prompt column; perform zeroing masking on the unstructured components; and configuring the upper limit of the word length to a preset word length to truncate the generation of background extension content, and outputting an abridged explanatory text containing only the factual information corresponding to the structured components.

[0017] Furthermore, when the current state is identified as the extended state, the deterministic dynamic truncation and extension control logic executes an elastic text extension mechanism. The elastic text extension mechanism specifically includes: locking the target scenic spot identifier corresponding to the physical location coordinates under the current timestamp, initiating a second-order depth traversal request to the locally deployed scenic area structured knowledge graph, extracting peripheral nodes and their connection triples that are two hops away from the core entity on the graph and whose node labels belong to a preset anecdote category, forming a set of second-order anecdote triples, converting the set of second-order anecdote triples into an incremental text queue, dynamically appending it to the fusion context prompt column according to the timestamp order, releasing the upper limit of the word length with the remaining available video memory capacity of the local device as a hard upper bound, so that the local large model maintains a streaming generation state until the incremental text queue is exhausted.

[0018] Furthermore, when the current state is identified as the normal state, the mask matrix preserves both the structured and unstructured components, and the upper limit of the lexical length is a default value between the preset lexical length and the upper limit of release after the second-order depth traversal of the scenic area structured knowledge graph.

[0019] Furthermore, when the current state is identified as the alarm state, the method further includes: executing disaster recovery and obstacle avoidance logic, which specifically includes: sending an interrupt signal to the decoding loop of the local large model through a decoding suspension operator to forcibly terminate the currently generated word stream and release the video memory and computing power occupied by the local large model; using the physical location coordinates under the current timestamp as the source point, the pre-marked set of emergency exit nodes as the target point set, and the weighted adjacency matrix of the scenic area path network as the graph structure, executing Dijkstra's shortest path algorithm to solve the evacuation path between the emergency exit nodes that have the minimum path cost from the physical location coordinates to the emergency exit node set; converting the evacuation path into a structured direction indicator and inserting the direction indicator into the streaming output queue corresponding to the streaming explanation text, and presenting it to the tourists.

[0020] Furthermore, the non-zero elements of the weighted adjacency matrix encode the physical distance, passage width, and passage restriction attributes between adjacent nodes; the set of emergency exit nodes is calibrated and fixed in the local device during the scenic area planning and design phase, and remains static during the operation of the method, without changing with the content of the streaming narration text or the behavior of the tourists.

[0021] Another aspect of the present invention provides a scenic spot explanation text generation system based on knowledge fusion and user profiling, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements any of the scenic spot explanation text generation methods based on knowledge fusion and user profiling as described above.

[0022] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0023] 1. This invention acquires a first dataset containing target attraction identifiers and continuous spatiotemporal sequences of tourists based on local sensors, and parses real-time kinematic parameters such as instantaneous movement speed and cumulative dwell time based on physical positioning coordinates under adjacent timestamps. It accurately reduces the complex two-dimensional motion trajectory in the physical world to several decisive scalars. By binding the mask matrix and the upper limit of word length in the autoregressive decoding process to the actual behavior state of tourists in real time, it breaks the design assumption of two parallel lines between the explanation rhythm and the tour rhythm in traditional tour guides, and solves the pain point of repeated resetting of explanation logic caused by location jumps.

[0024] 2. This invention employs a dual-track architecture that combines structured graph path traversal with unstructured vector space mapping, merging and generating context. Each triple retrieved by the structured path has a clear subject-verb-object structure, serving as an anchor point in the downstream autoregressive generation process to ensure the accuracy of the dates, people, and event relationships involved in the output text. The travelogue text blocks retrieved by the unstructured path serve as soft descriptive material, giving the explanatory text a literary feel. The parallel rather than serial design of the two prevents the factual misalignment problem that easily occurs when a large model with a small number of parameters relies solely on vector retrieval. At the same time, the preset formatted tag template informs the large model that the priority of factual triples is higher than that of the reference text, achieving a good balance between factual accuracy and content richness in the generated results.

[0025] 3. This invention introduces a hardware-safe gating scalar. By reading the remaining capacity of the currently available random access memory and video memory of the local device and comparing it with a preset safety threshold, a binary scalar with a value of 0 or 1 is used as a hard multiplier to directly act on the output of the unstructured path, preventing process crashes caused by memory overflow. In addition, this invention pre-divides the physical plane of the scenic area into several geographic grids and uses the geographic grid identifier as the key to organize the unstructured travelogue document vector library into an inverted index structure. This allows the downstream unstructured vector space mapping process to perform dot product operations only within the memory partition matching the current location, greatly reducing the search space and significantly reducing the computing power and power consumption burden of edge devices.

[0026] 4. This invention incorporates local crowd density as a dimension of real-time kinematic parameters into a finite state machine, and ensures that the alarm state unconditionally preempts control of all other states by determining the order of priority. Once the local crowd density exceeds the preset congestion threshold, the system immediately sends an interrupt signal to the decoding loop of the local large model through the decoding suspension operator, forcibly terminating the ongoing lexical generation process and releasing the memory and computing power it occupies. Instead, it calls the classic Dijkstra shortest path algorithm, based on the weighted adjacency matrix of the scenic area path network and the pre-defined set of emergency exit nodes, to solve for an evacuation path from the current location to the nearest reachable exit. The natural language generation result is directly inserted into the streaming output queue in a structured directional indication form, thereby meeting the hard constraints of personal safety in public place guide systems. Attached Figure Description

[0027] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0028] Figure 1 This is a flowchart of the method provided in Embodiment 1 of the present invention.

[0029] Figure 2 This is a comparison chart showing the denoising effect of the truncated mean filter provided in Embodiment 1 of the present invention on Bluetooth RSSI signals.

[0030] Figure 3 This is a schematic diagram of the cumulative distribution function of positioning error under different RSSI preprocessing strategies provided in Embodiment 1 of the present invention.

[0031] Figure 4 The time-series curves of two kinematic parameters provided in Embodiment 1 of the present invention are shown.

[0032] Figure 5 This is a schematic diagram illustrating the effect of hardware gating on suppressing the risk of memory overflow in edge devices, as provided in Embodiment 1 of the present invention.

[0033] Figure 6 This is a schematic diagram illustrating the effect of dual-track extraction and context fusion on suppressing large-model illusions, as provided in Embodiment 1 of the present invention.

[0034] Figure 7 This is a schematic diagram illustrating the combined effect of the similarity lower limit threshold provided in Embodiment 1 of the present invention on the recall quantity and semantic quality.

[0035] Figure 8 This is a schematic diagram of the state switching trajectory and drive signal provided in Embodiment 1 of the present invention.

[0036] Figure 9 The diagram shows the effect of real-time decision execution and evacuation path solving provided in Embodiment 1 of the present invention. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0038] This embodiment discloses a method for generating scenic area explanation text based on knowledge fusion and user profiling. Figure 1 The overall method flowchart of this embodiment is shown. As can be seen from the figure, this embodiment includes the following steps:

[0039] Step 1: Obtain the first dataset containing target attraction identifiers and continuous spatiotemporal sequences of tourists based on local sensors.

[0040] Local sensors refer to hardware units deployed on the tourist terminal side or the local area of ​​the scenic spot to directly sense the physical space and wireless environment where the tourist is located. For example, local sensors can be Bluetooth radio frequency modules, inertial measurement units (IMUs), magnetometers built into the terminal, Bluetooth Low Energy (BLE) beacon arrays, RFID readers, UWB base stations deployed in the scenic spot, or vision-based indoor positioning cameras, etc.

[0041] A target attraction identifier is an identifier used to uniquely identify a specific tourist object within a scenic area (such as a palace, a stone tablet, or a display item). For example, a target attraction identifier can be a pre-assigned attraction number, an attraction entity implicitly pointed to by a nearest neighbor beacon group, or a semantic label returned by a visual recognition module after identifying a characteristic building or sign.

[0042] A continuous spatiotemporal sequence of tourists refers to a sequence of timestamps and physical location coordinates recorded at a fixed or quasi-fixed sampling period over a continuous observation period. Each record describes the exact spatial location of a tourist on a two-dimensional plane of the scenic area at a certain moment. This sequence can be regarded as the spatiotemporal reference for all downstream kinematic reasoning, state machine switching, and generation rhythm control.

[0043] The first dataset refers to an atomic-level input set constructed using target attraction identifiers as semantic anchors and continuous spatiotemporal sequences of tourists as physical anchors. It contains not only discrete semantic information such as which attraction a tourist is currently near, but also information about the tourist's past... The continuous physical information of the trajectory taken within the time window enables downstream modules to both trigger knowledge retrieval based on semantic anchors and analyze the motion state based on physical anchors.

[0044] In this embodiment, the first dataset is obtained independently by the tourist terminal itself via the Bluetooth radio frequency module, or it can be sent by the scenic area's local edge server that communicates with it, or it can be obtained by both and then cached in the terminal's local shared memory.

[0045] In this embodiment, in order to stably resolve the original radio frequency signal into accurate physical location coordinates that can be used downstream in an indoor radio environment with significant multipath fading and burst interference characteristics, the specific operation of acquiring the first dataset based on the local sensor in step 1 may further include:

[0046] It receives broadcast packets from Bluetooth beacons deployed within the scenic area, extracts the Signal Strength Indicator (RSSI) value from the broadcast packets, and records the data within a specified length. Maintain a set of original RSSI samples within the sliding time window;

[0047] For the original RSSI samples within the sliding time window, the two endpoints of the maximum and minimum value samples are removed, and the arithmetic mean of the remaining samples is calculated. The truncated mean method simultaneously suppresses high-frequency jitter caused by occlusion, reflection and changes in device orientation, as well as abnormal spikes caused by occasional interference.

[0048] Based on the truncated mean and the preset logarithmic distance path loss formula, the smoothed RSSI is inversely solved to obtain the physical distance from the tourist terminal to the corresponding beacon. After obtaining the distance estimates of at least three beacons, a set of two-dimensional coordinates is solved by least squares so that the sum of squares of the distance residuals reaches a minimum value. This set of two-dimensional coordinates is then written into the first dataset as the tourist's exact physical location coordinates at the current moment.

[0049] The sliding time window refers to a time interval with a fixed length and a starting point that advances with the system time, during which original RSSI samples are continuously accumulated.

[0050] The truncated mean is a statistical measure obtained by removing the two endpoint samples (maximum and minimum values, which are most likely contributed by anomalies) from a set of samples before calculating the arithmetic mean of the remaining samples. Its physical meaning is to give the main distribution of the signal the maximum weight, while excluding extreme samples that are most likely to come from multipath superposition or instantaneous occlusion, thereby ensuring that the RSSI estimate sent to the next level of positioning operator is a stable representative value within the entire window.

[0051] The logarithmic distance path loss formula is an empirical formula used to describe the energy attenuation of radio signals in free space. Its core idea is that the energy attenuation of a radio signal decreases linearly with the logarithm of the propagation distance, using a reference strength measured 1 meter from the beacon. For reference, an environmental path loss index is introduced. To characterize the different signal attenuation caused by different interior materials (concrete, glass curtain walls, metal display cases, etc.).

[0052] For example, in this embodiment, the smoothed RSSI, the physical distance from the endpoint to the beacon, and the absolute coordinates of the tourist on the two-dimensional plane of the scenic area can be calculated by the following formula:

[0053]

[0054]

[0055] in, Sliding time window The set of raw RSSI samples received internally; This represents the total number of samples within the window. , The largest and smallest RSSI samples within the window are respectively identified and removed as suspicious outliers. RSSI is the truncated mean after removing extreme values. The reference RSSI is located 1 meter from the beacon. It is the environmental path loss index, which can be calibrated based on on-site measurements; For the estimated distance from the tourist terminal to a single beacon; for The absolute coordinates of the visitor on the two-dimensional plane of the scenic area at any given time. It should be noted that multi-point positioning here refers to solving a set of coordinates using the least squares method after obtaining distance estimates from at least three beacons. The process of minimizing the sum of squared residuals for each distance is a well-established practice in industry and will not be elaborated upon here. Figure 2 The diagram shows a comparison of the denoising effects of the truncated mean filter on Bluetooth RSSI signals in this embodiment. Figure 2 The X-axis represents the RSSI sampling sequence number, and the Y-axis represents the RSSI value (dBm). The figure simultaneously plots four curves: the original RSSI (including multipath jitter and occasional spikes), the simple moving average, the truncated mean, and the true trend line. The difference lies in the fact that the original curve has abnormal spikes on the order of ±15dBm, and the simple mean is still dragged down by the spikes, resulting in a shift, while the truncated mean perfectly matches the true trend. It can be seen that the truncated mean operator, which removes the maximum / minimum samples and then calculates the arithmetic mean, has a natural robustness to multipath superposition and instantaneous occlusion in a physical sense, providing a stable RSSI estimate for subsequent path loss localization. Figure 3 This embodiment illustrates a schematic diagram of the cumulative distribution function of positioning error under different RSSI preprocessing strategies. Figure 3 In the diagram, the X-axis represents the final planar positioning error (meters), and the Y-axis represents the cumulative probability. The three curves correspond to the original RSSI single-point positioning, simple mean + path loss, and truncated mean + path loss, respectively. The difference lies in the fact that the CDF curve of this scheme reaches a cumulative probability of approximately 85% (sub-meter level) at 1 meter, while the original scheme only reaches approximately 25% at the same error. It can be seen that the physical positioning coordinates output to the downstream kinematics inference module in this embodiment have a sub-meter level accuracy guarantee, which eliminates the asynchronous pain point of repeated reset of explanation logic caused by position jumps.

[0056] In this embodiment, in order to further extract high-order semantic signals that can directly drive the state switching of downstream large models from the original physical quantity of position, step 1 also includes the operation of deriving two kinematic parameters based on the first dataset:

[0057] Based on the physical location coordinates of adjacent timestamps in the first dataset, the Euclidean distance offset between the two is calculated and divided by the sampling period to obtain the instantaneous movement speed of the tourist.

[0058] Based on the instantaneous moving speed and the preset quasi-stationary speed threshold, the event with a speed less than the quasi-stationary speed threshold is accumulated and integrated in the time domain, thereby analyzing the cumulative dwell time of the tourist under the current target attraction sign.

[0059] Instantaneous movement speed is used to characterize whether a tourist is moving quickly or browsing slowly. Its physical significance lies in accurately reducing the two-dimensional trajectory to a decisive scalar, thereby shielding the complexity of the trajectory shape itself.

[0060] Cumulative dwell time is used to characterize the cumulative time that tourists stop to look at a certain attraction carefully. Its physical meaning is to transform discrete stop-start events into a continuously increasing scalar pointer, which is used to trigger downstream elastic extension mechanisms.

[0061] For example, in this embodiment, the instantaneous velocity and dwell time can be calculated using the following formula:

[0062]

[0063]

[0064] in, The time interval between two positioning operations; It is the Euclidean norm; To determine the speed threshold for a tourist to be in a quasi-stationary state, an empirical value slightly higher than the positioning noise level is generally used. This is an indicator function; it takes the value 1 if the condition inside the parentheses is true, and 0 otherwise. The moment when a tourist first enters the current target attraction's identification radius; Instantaneous movement speed; To accumulate dwell time. It is understandable that the above two equations precisely reduce the complex two-dimensional trajectory to two decisive scalars—velocity. Duration of stay In subsequent steps, these two will directly serve as conditional branch pointers for the large model's state machine, thereby hard-triggering the actual tour rhythm of the physical world onto the explanation rhythm of the large model. This solves the asynchronous pain points in traditional guided tours, such as repeated resets of explanation logic caused by location jumps and the explanation continuing even after the person has left. Figure 4 The time-series curves of two kinematic parameters in this embodiment are shown. Figure 4 It contains two subplots, and the two subplots share the same X-axis representing time (seconds); Figure 4 (a) The Y-axis represents instantaneous velocity. , Figure 4 (b) The Y-axis represents the cumulative dwell time. The speed threshold is marked with a dashed line in the figure. With residency threshold The condensed state trigger range and the extended state trigger range are marked with color blocks; and It exhibits clear mutually exclusive characteristics, during periods of rapid movement. Reset to zero, and the dwell time Approaching the quasi-static threshold It can be seen that the pair of derived kinematic scalars, instantaneous velocity and cumulative dwell time, can accurately reduce the complex two-dimensional trajectory to two decisive branch pointers, providing unambiguous hard trigger signals for subsequent state machine switching.

[0065] Step 2: Process the first dataset by performing structured graph path traversal and unstructured vector space mapping for target attraction identifiers locally in parallel. Extract subgraphs and text blocks containing exact topological relationships and high-dimensional text features, and concatenate them to generate the second dataset as a fusion contextual cue column.

[0066] The structured graph path traversal refers to the process of expanding a path along the edges of a pre-constructed directed graph database, with entities as nodes and attribute relationships as edges, centered on a core entity, and collecting the (head entity, relationship, tail entity) triples encountered along the way. Each collected triple has a clear subject-verb-object structure, thus serving as a hard fact anchor in the downstream large model generation process, ensuring that the dates, people, and event relationships involved in the output text are not misplaced.

[0067] Unstructured vector space mapping refers to the process of mapping a piece of natural language text (such as travelogues, research articles, or literary descriptions) to a high-dimensional dense vector space through a pre-trained text encoder, and then recalling several semantically closest text vector blocks from the neighborhood of the query vector using cosine similarity or dot product as a metric. Its core value lies in the fact that each recalled text block carries rich contextual and literary descriptions, which can serve as soft description material in the downstream large-scale model generation process, giving the explanatory text a warm and narrative feel.

[0068] The second dataset refers to a unified context tensor formed by fusing the triple sequences retrieved from the structured pathway and the text vector blocks retrieved from the unstructured pathway after their respective prompt word formatting processes, using string or vector sequence concatenation. This tensor serves as the prompt word input for the subsequent autoregressive decoding process of the local large-scale model. It is important to note that the purpose of the second dataset is to provide immutable factual anchors through the structured pathway and contextualized soft descriptions through the unstructured pathway; these two approaches operate in parallel rather than sequentially, thus eliminating the factual illusion problems such as misattribution of persons and misplacement of dates that are prone to occur in small-parameter local large-scale models relying solely on vector retrieval.

[0069] In this embodiment, to ensure the stable generation of the second dataset despite the limited memory and computing power of edge devices, while maintaining both factual accuracy and rich description, step 2 further includes hardware-linked monitoring logic and dual-track retrieval logic under spatial constraints.

[0070] Before performing parallel extraction of structured graph path traversal and unstructured vector space mapping, the system kernel calls to read the currently available random access memory (RAM) and remaining video memory capacity of the local device, and compares them with a preset safety watermark to form a hardware safety gating scalar.

[0071] When the hardware security gating scalar indicates that the remaining capacity is higher than the safety waterline, unstructured paths are allowed to participate in subsequent fusion; when the hardware security gating scalar indicates that the remaining capacity is lower than the safety waterline, the vector space mapping calculation of unstructured paths is deterministically suspended, and only the graph path traversal operation of structured paths is retained, thereby generating a second dataset containing only the graph structure context, preventing process crashes caused by system memory overflow.

[0072] Meanwhile, before performing unstructured vector space mapping, based on the current physical location coordinates in the first dataset, the geographic grid IDs that are closest to the coordinates in several fixed-size geographic grids pre-divided into the physical plane of the scenic area are extracted as spatial gating conditions to limit the range of vector retrieval. The dot product operation is only performed in the memory partition that matches the grid ID to reduce the search space.

[0073] Among them, the hardware security gating scalar refers to a binary scalar with a value of only 0 or 1. It embeds the discrete judgment result of whether available hardware resources are above the safety threshold into downstream mathematical calculations through an indicator function. Understandably, as a hard multiplier directly acting on the output tensor of the unstructured path, it can automatically preserve the structured path (fact anchor) and close the vector path (soft description) without any additional decision logic once memory is low, thus ensuring that the basic navigation does not crash through mathematical degradation.

[0074] A geographic grid refers to the physical division of the entire scenic area into several sub-regions according to a preset fixed size. During the offline pre-compilation stage, each travelogue text vector block is forcibly appended with the geographic grid ID to which the described attractions belong. This grid ID is then used as the key to organize the vector library into an inverted index structure, allowing the downstream retrieval process to retrieve the data during the offline sharding stage. The global search volume has been reduced to Local search volume.

[0075] For example, in this embodiment, hardware gating and spatial grid affiliation can be calculated using the following formula:

[0076]

[0077]

[0078] in, for The available video memory / memory capacity reported by the operating system at any given time; A safety waterline set based on experience, used to reserve resources for other necessary processes in the system; It is a hardware security gating scalar. When it is set to 1, it allows unstructured retrieval paths to participate in subsequent fusion. When it is set to 0, it mathematically sets the path to zero. A set of geographical grids that divide the entire scenic area; For the first One grid; For grid The geometric center; The function outputs the ID of the grid to which the current position belongs. Figure 5 This diagram illustrates the effect of hardware gating in suppressing the risk of memory overflow in edge devices in this embodiment. Figure 5 In the figure, the X-axis represents the system running time (seconds) and the Y-axis represents the video memory / RAM usage (MB). The figure shows two curves: one for ungated dual-track parallelism and the other for Ω(t) gating. It can be seen that the hardware-safe gating scalar implemented in the form of an indicator function acts as a hard multiplier directly on the unstructured path tensor, and can automatically close the vector path and retain the fact anchor path under extreme memory conditions.

[0079] In this embodiment, the dual-track parallel extraction and context fusion in this step can be further broken down into the following sub-steps:

[0080] Sub-step 2.1: Extract the core entity from the target attraction identifier, and in the locally deployed scenic area structured knowledge graph, retrieve all neighbor triples centered on the core entity and within a distance of no more than one hop, generating an entity relationship subgraph containing multiple attributes such as people, era, and architectural style.

[0081] Among them, the core entity refers to the unique entity node corresponding to the target attraction identifier at the semantic level of the graph, such as a specific palace node, a specific historical figure node, or a specific exhibit node.

[0082] An entity relation subgraph is a local subgraph centered on a core entity and radiating outwards to neighboring nodes within a one-hop radius, along with their connecting edges. Each edge in this subgraph strictly corresponds to a pre-fixed objective fact in the knowledge graph, and thus can be used as an inviolable fact constraint in the downstream generation stage.

[0083] Sub-step 2.2: Using the target attraction identifier as the query keyword, after encoding it into a query vector by the text encoder, perform dot product operation only on the memory partition matched by the current geographic grid in the locally deployed unstructured travelogue document vector library, and extract the Top-N travelogue text vector blocks with a cosine similarity value greater than the preset threshold.

[0084] Among them, the travelogue text vector block refers to the dense vector obtained by mapping the natural language texts such as manually selected and copyright-compliant travelogues, research, and tour guide explanations through a pre-trained encoder. It is stored in the vector library as a triple of (vector representation, original text, geographic grid ID).

[0085] The preset threshold is a similarity lower limit parameter between 0 and 1, used to filter low-quality recalls that are too semantically distant. If the value is too high, it will result in a scarcity of usable materials, and if the value is too low, it will introduce a large amount of irrelevant content. Therefore, it needs to be calibrated by on-site measurement based on the distribution characteristics of the specific vector library.

[0086] Sub-step 2.3: Parse the entity relation subgraph into a sequence of triples, and attach the sequence of triples as the fact constraint header to the travelogue text vector block. Then, encapsulate and generate the second dataset according to the preset formatted tag template.

[0087] Among them, the formatted tag template refers to a set of pre-agreed text tag systems used to inform the local large model that the following content is a fact triple, the following content is a reference travelogue, and please give priority to the fact triple. Its typical implementation can be a wrapper tag such as <fact>...< / fact> <reference>...< / reference>, or it can be a segmentation of system instructions and user instructions distinguished by role.

[0088] For example, in this embodiment, dual-track extraction and context fusion can be represented as follows:

[0089]

[0090]

[0091]

[0092] in, A directed graph describing the knowledge of the entire scenic area; As the core entity; This is an attribute relationship; It is the tail node; The shortest jump distance on the graph; It is a set of first-order neighbor triples; This is a subset of vectors belonging to the current geographic grid. This is a query vector generated jointly by the current attraction identifier and its motion status; For the first in the vector library Embedded representation of a document; This is the lower limit threshold for similarity. Encoding functions for formatting sequences of triples or vector sequences into cue word fragments; , The cue word formatting weight matrices are for the structured and unstructured pathways, respectively, used to control the relative proportion and order of the two information streams in the final cue words; in this embodiment, It is borrowed as a formatting operator for the weight matrix on the encoded sequence. It is then borrowed as the concatenation operator for two formatted sequences; This is the final output fusion context tensor, which is the vectorized representation of the second dataset. Figure 6 The diagram illustrates the effect of dual-track extraction and context fusion on suppressing large-model hallucinations in this embodiment. Figure 6 In the diagram, the X-axis represents five typical types of illusionary errors (misattribution of persons, misplacement of dates, confusion of architectural styles, incorrect relationship of events, and misplacement of place names / allusions), and the Y-axis represents the factual error rate (%). It can be seen that the set of first-order neighbor triplets... Provided immutable fact anchors and unstructured pathways The provided contextualized soft descriptions are both through After splicing, the main cause of the illusion of a large local model with a small number of parameters can be cut off at the mathematical level. Figure 7 This diagram illustrates the combined impact of the similarity lower limit threshold on recall quantity and semantic quality in this embodiment. Figure 7 In the diagram, the X-axis represents the lower similarity threshold, the left Y-axis represents the Top-N recall, and the right Y-axis represents the average semantic relevance. It can be seen that the recall decreases exponentially with increasing θ, while the semantic relevance first increases and then decreases. The two form an optimal balance point within the recommendation range. The lower similarity threshold, as a lower similarity filter, has clear engineering adjustability. If the value is too low, it will introduce a lot of semantic noise; if the value is too high, it will result in sparse available materials.

[0093] It should be noted that the design intent of this approach is to create structured pathways. It provides immutable fact anchors, ensuring the absolute accuracy of the dates, figures, and event relationships involved in the generated content; unstructured pathways. This provides contextualized and literary descriptions; the two are through The hard gating achieves degradation, preserving at least the fact anchor even under extreme memory conditions, thus cutting off the main cause of the illusion at the fundamental level.

[0094] Step 3: By inputting the second dataset into the local large model and calculating the real-time kinematic parameters based on the continuous spatiotemporal sequence of tourists, the preset deterministic dynamic truncation and extension control logic is executed in the streaming generation stage of the local large model to output streaming narration text that matches the pace of tourists' movement.

[0095] Among them, the local large model refers to an autoregressive language model deployed locally on the tourist terminal or the edge server of the scenic area, where all weights and inference calculations are completed locally, and no user data is transmitted to the external cloud during the inference process. Under the traditional working paradigm, the autoregressive generation process of this large model can be formalized as follows: Its generation length and content detail are determined solely by the prompt words and sampling hyperparameters, without being aware of any changes in the physical world.

[0096] Real-time kinematic parameters refer to the instantaneous velocity obtained in step 1. Cumulative length of stay And the local pedestrian density estimated by the number of concurrently connected devices within a radius of the current location, which is further introduced in this step. These three types of parameters constitute a three-dimensional physical state vector at the mathematical level, which is used as the input to the state machine described below.

[0097] Deterministic dynamic truncation and extension control logic refers to a finite state machine external to the local large model decoding loop. It maps real-time kinematic parameters to several mutually exclusive discrete states, applies a mask to the second dataset through the state vector, and dynamically adjusts the upper limit of the decoding length, thereby accurately translating the rhythm of physical behavior into a controlled operator of the generation rhythm. There is an inherent mismatch between the free generation of traditional large models at the pure text level and real-world scenarios where users may accelerate, pause, or encounter congestion at any time. This step breaks down this mismatch using hard logic.

[0098] In this embodiment, in order to achieve precise alignment of the physical rhythm and the generated rhythm, the specific operations of executing the deterministic dynamic truncation and extension control logic in this step include the following sub-steps:

[0099] Sub-step 3.1: Based on the physical location coordinates of adjacent timestamps in the first dataset, calculate the Euclidean distance offset between them, and analyze the tourist's current moving speed in conjunction with the sampling period. At the same time, accumulate the integral in the time domain for the event that the speed is less than the quasi-stationary threshold, and analyze the tourist's current dwell time under the current target attraction identifier, which serves as the two control signals driving the following state switching.

[0100] Sub-step 3.2: Compare the current movement speed with the preset speed threshold. If the current movement speed is greater than the speed threshold, trigger the key information condensation mechanism.

[0101] Sub-step 3.3: Compare the current dwell time with the preset dwell threshold. If the current dwell time is greater than the dwell threshold, the elastic text extension mechanism is triggered.

[0102] Furthermore, in order to ensure that the alarm state can always preempt control of all other states to meet the hard constraints of personal safety in public place tour guide systems, the state machine is implemented by determining the order of priority rather than by arbitrary Boolean combinations. That is: first, check if the crowding level has exceeded the red line. If it has, enter the alarm state unconditionally; second, check if the tourists are moving quickly. If so, enter the condensed state; third, check if the tourists are staying for a long time. If so, enter the extended state; if none of the above conditions are met, the system returns to normal.

[0103] For example, in this embodiment, the transition function of the spacetime state machine can be calculated by the following formula:

[0104]

[0105] in, With the current position as the center and radius... The number of concurrent devices within the same grid within the range is used to approximate the population density in the current area; The threshold for disaster preparedness in scenic areas; To determine the speed threshold for rapid crossing; To determine the time threshold for long-term residence; , , , These are state identifiers for four mutually exclusive states: alarm state, condensed state, extended state, and normal state. for The state identifier vector at each time step is used to generate the corresponding mask matrix and its upper length limit in the next step.

[0106] After determining the current state, the word selection process in a single decoding step is no longer an unconstrained autoregressive process, but rather a mask matrix derived from the state vector. With dynamic token capacity function Simultaneous constraints. Specifically, the mask matrix is ​​used to fuse the context according to the state. Different retention / masking strategies are applied to the structured and unstructured components, while the token capacity function specifies the maximum number of tokens allowed to be generated in the decoding loop.

[0107] For example, in this embodiment, the state-constrained generation control operator can be represented by the following equation:

[0108]

[0109] in, This is a bitwise multiplication of the Hadamard product, used to selectively preserve or clear fragments of the fusion context in the feature dimension of the mask matrix. For the first The selected token; The upper limit of the decoding length is determined by the current state.

[0110] The specific operation of the key information condensation mechanism (corresponding to sub-step 3.2) is as follows:

[0111] In this embodiment, when the state machine determines that it has entered the condensed state... At that time, the key information condensation mechanism operates as follows: it intercepts and modifies the control command flow injected into the local large model, retaining only the structured triplet components from the second dataset at the mask matrix level, while setting the unstructured vector block components to zero, forcing the local large model to parse text only for structured triplet sequences; simultaneously, it sets the maximum output token length parameter of the local large model to a preset minimum value. This effectively prevents the generation of any background extension content, outputting only a concise explanatory text containing the year and building name.

[0112] That is, the masking strategy and length strategy in the condensed state are:

[0113]

[0114] in, A vector of the same dimension as the structured component, representing complete preservation; A zero vector of the same dimension as the unstructured component represents complete masking. This is the transpose symbol for a matrix; A deliberately small token limit (e.g., tens of tokens) is used to force the narration to converge into a single core message. This mechanism aims to completely solve the asynchronous problem of fast movement but long playback. When tourists have moved on to the next attraction but the previous narration has not yet ended, the system can decisively cut off redundant background expansion and only broadcast the most essential factual information to the tourists: which dynasty and which building this is.

[0115] The specific operation of the flexible text extension mechanism (corresponding to sub-step 3.3) is as follows:

[0116] In this embodiment, when the state machine determines that it is entering the extended state... The specific operation of the elastic text extension mechanism is as follows: lock the target scenic spot identifier corresponding to the current physical location coordinates, initiate a second-order depth traversal request to the local structured knowledge graph, extract the peripheral nodes and their connection triples that are 2 away from the current core entity on the graph and whose node labels belong to the anecdotes or background stories category; convert the peripheral nodes into an incremental text queue, and dynamically push them into the context input window of the local large model in the order of timestamps; at the same time, release the upper limit of the decoding length to infinity (with the available video memory of the system as the hard upper limit), so that the local large model maintains the streaming generation state until the incremental text queue is exhausted.

[0117] That is, the masking strategy and length strategy in the extended state are:

[0118]

[0119]

[0120] in, It is a set of second-order anecdotal triples; , These are first-order neighbor nodes and second-order neighbor nodes, respectively; for and The connection relationship between them; A function to return the topic tag of a node; This is an append-concatenation operator for the context sequence. The physical significance of this mechanism lies in solving the problem of having nothing to say when tourists stop at a certain attraction. When tourists stop at a certain attraction, the system can actively dig out relevant allusions, legends, and historical events from the depth of the map, making the explanation more and more interesting and extensible.

[0121] Regarding the default strategy under normal circumstances:

[0122] In this embodiment, when the state machine returns to normal... At that time, the mask matrix maintains a balanced preservation of both structured and unstructured components. Use default empirical values ​​(usually between condensed state) With extended state A moderate value (between two ranges) ensures the system operates at a standard narration pace most of the time. Through the aforementioned state-based masking and length-based joint control, the autoregressive generation process of the local large model is stably anchored to the actual visitor behavior, neither rushing ahead nor dragging on. Figure 8 This diagram illustrates the state transition trajectory and drive signals of the spatiotemporal state machine in this embodiment. Figure 8 It contains three sub-graphs. Figure 8 (a) is The time series curve, Figure 8 (b) The time series curve, Figure 8 (c) The time series curves are shown, with red dashed lines used to mark the threshold lines of each subplot; it can be seen that the color bands of the states are strictly driven by the transfer functions determined by priority.

[0123] Step 4: In the four branches of the spacetime state machine, for the alarm state... Execute disaster recovery and obstacle avoidance logic, suspend the current decoding loop of the local large model, and directly output the emergency evacuation path through the deterministic graph algorithm.

[0124] The disaster recovery and obstacle avoidance logic refers to a real-time decision-making and execution model that is independent of the text generation path and prioritizes physical safety above all else. This model doesn't address what to say, but rather whether to continue speaking and what to output at that moment. Its purpose is that once the state machine enters an alarm state, any ongoing autoregressive decoding process becomes worthless, and the system should immediately release the computing power and memory occupied by the local large model, instead calling a deterministic, auditable graph algorithm to directly output evacuation instructions.

[0125] In this embodiment, the specific operations of the disaster recovery and obstacle avoidance logic include:

[0126] During step 3, the radius of the tourist's current location coordinates is obtained simultaneously. The number of concurrently connected devices within the same geographic grid and within a given area is used as the local population density. The estimated value;

[0127] If the number of concurrent connected devices exceeds the preset congestion threshold If the deterministic dynamic truncation and extension control logic unconditionally suspends the task of generating the explanatory text for the current attraction, that is, it sends an interrupt signal to the decoding loop of the local large model, forcibly terminates the currently generated token stream, and immediately releases the video memory and computing power it occupies.

[0128] Then, based on the tourist's current physical location coordinates Using the source point as a pre-defined set of emergency exit nodes. Given the set of target points, the weighted adjacency matrix of the scenic area path network is used. Given a graph structure, Dijkstra's shortest path algorithm is used to find a path from the current position to the nearest reachable exit node. The optimal evacuation route is determined and presented to visitors in the form of structured directional instructions (e.g., please go 30 meters north and turn left into the west corridor), rather than natural language generated results, and is directly forced into the streaming output queue.

[0129] The weighted adjacency matrix is ​​a square matrix used to describe the topology of the scenic area's path network. Its non-zero elements simultaneously encode information such as the physical distance between adjacent nodes, the passage width, and whether the path is restricted. This allows the path cost to reflect not only how far you go, but also whether the path is passable and how fast you can travel.

[0130] The emergency exit node set refers to the set of node numbers of all legal emergency exits that have been marked and fixed in the system during the planning and design phase of the scenic area. Its members remain static during system operation and do not change with the content of the explanation or user behavior, so as to ensure the auditability of emergency decision-making results.

[0131] Dijkstra's shortest path algorithm is a classic single-source shortest path algorithm. The input consists of a source node, a target node set, and a weighted adjacency matrix. The output is an optimal path consisting of a sequence of nodes. Its mathematical determinism, convergence, and reproducibility have been fully verified in academia and industry.

[0132] For example, in this embodiment, the real-time decision execution operator in the alarm state can be represented by the following formula:

[0133]

[0134]

[0135]

[0136] in, This is a forced suspension operator for the autoregressive decoding process of a local large model. When its input parameter is in an alarm state, the current decoding loop is terminated immediately. This refers to the collection of all designated emergency exit points within the scenic area. From Selected from the current position The exit node with the minimum path cost between them; This is a weighted adjacency matrix for the scenic area's path network; This is a classic single-source shortest path algorithm; In the weighted adjacency matrix Below is a function to calculate the path cost between two nodes; for The system output is constantly and forcibly presented to visitors.

[0137] It should be noted that the fundamental difference between this step and the previous three steps lies in its requirement for interpretability and determinism, which is far higher than the requirement for content richness: the evacuation path must be an auditable, reproducible, and deterministic output that does not depend on any probabilistic sampling process. Therefore, any form of large model generation call is deliberately avoided here; at the same time, it is executed at the alarm state entry point. In terms of operation, the system implements hard preemption of all ongoing non-critical tasks (including explanation generation, vector retrieval, graph traversal, etc.) based on security priority, ensuring that the computing power, video memory and power consumption of edge devices in emergency scenarios are concentrated on shortest path solving and path presentation. Figure 9 The diagram illustrates the real-time decision-making and evacuation path solving results under alarm conditions in this embodiment. Figure 9 Divided into two subgraphs, Figure 9 (a) is the histogram of StopLLM response delay (cloud solution ≈ 850ms vs this solution ≈ 45ms, and the red line for personal safety response is marked with a green dashed line at 100ms). Figure 9 (b) shows the combined cost of evacuation paths for three strategies: random exit, Euclidean nearest neighbor exit, and Dijkstra (this scheme) under four different pedestrian flow scenarios (small / medium / large / extreme congestion). It can be seen that the response delay of this scheme is far below the 100ms safety threshold, and Dijkstra's advantage is more significant when the pedestrian flow is more crowded (the cost in the extreme congestion scenario is only about 43% of that of the random strategy).

[0138] By cascading the physical perception model of step 1, the dual-track fusion context model of step 2, and the state machine-driven generation model of step 3 with the real-time decision execution model of this step, the entire system can provide explanations that are precisely synchronized with the rhythm of tourists' behavior and have controllable factual accuracy in normal tour scenarios. At the same time, it can switch to reliable hard decision output with the highest priority in the event of a sudden safety incident, forming a complete technical closed loop that conforms to the large model generation paradigm and adheres to the scientific principles of public place safety.

[0139] Furthermore, it is particularly important to emphasize that the technical solution involved in this application strictly complies with relevant laws and regulations in all stages of data collection, processing, and output. The operation of acquiring the first dataset containing target attraction identifiers and continuous spatiotemporal sequences of tourists based on local sensors in this solution relies on Bluetooth beacon RSSI signals, local IMU readings, etc., which are all non-sensitive physical sensing data that do not involve biometric identification, facial images, or identity verification information. This solution does not call upon camera devices to collect tourists' facial features at any stage, nor does it perform any form of identity verification on tourists. Before tourists use this system, the system clearly explains to tourists the type of data collected (Bluetooth signal strength, relative physical coordinates, dwell time), purpose of use (only for generating explanatory text matching the tourist's pace of movement), storage scope (only cached on the local device or at the edge of the scenic area), and retention period (cleared according to a preset cycle after the visit) through an explicit informed consent interface on the tourist's terminal. The data collection process can only be initiated after obtaining the tourist's individual consent, strictly adhering to the informed consent principle and the principle of minimum necessity.

[0140] Example 2

[0141] This embodiment discloses a scenic area explanation text generation system based on knowledge fusion and user profiling. The system can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet, smart wearable device, vehicle-mounted terminal, AR / VR all-in-one device, portable guide terminal supporting Bluetooth and local reasoning capabilities, laptop, or personal computer. The server can be a single server, a server cluster consisting of multiple servers, or an edge server deployed in a local data center within the scenic area. When the electronic device is running, it can perform the explanation text generation method described in Embodiment 1 of this application.

[0142] In some embodiments, the scenic area explanation text generation system based on knowledge fusion and user profiling can also be integrated into multiple electronic devices. For example, the system can be divided into two parts: front-end acquisition and presentation and local reasoning and retrieval, which are respectively integrated into the tourist handheld terminal and the scenic area local edge server, and the explanation text generation method in Embodiment 1 of this application is completed through local area network collaboration.

[0143] In some embodiments, the server can also be implemented as a terminal, that is, the entire system's structured graph, vector library and local large model are all deployed to a single portable terminal, which can independently generate and output explanatory text in a completely offline working condition.

[0144] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating scenic area explanation text based on knowledge fusion and user profiling, characterized in that, The method for generating the scenic area explanation text includes: S100: Acquire the first dataset based on local sensors. The first dataset contains target attraction identifiers and a continuous spatiotemporal sequence of tourists, wherein the continuous spatiotemporal sequence of tourists includes multiple timestamps and physical location coordinates under each timestamp; S200. Process the first dataset, and perform structured graph path traversal and unstructured vector space mapping for the target scenic spot identifier in parallel on the local machine. Extract entity relationship subgraphs and travelogue text vector blocks respectively, and concatenate the entity relationship subgraphs and travelogue text vector blocks according to the preset formatted markup template to generate a second dataset as a fusion context prompt column. S300. Input the second dataset into the local large model, and execute the preset deterministic dynamic truncation and extension control logic in the streaming generation stage of the local large model based on the real-time kinematic parameters parsed from the continuous spatiotemporal sequence of tourists, and output streaming narration text. The deterministic dynamic truncation and extension control logic includes: The real-time kinematic parameters are mapped to a current state identifier among multiple mutually exclusive state identifiers, and Based on the current state identifier derived mask matrix and the upper limit of word length, The mask matrix is ​​used to apply preservation or masking operations to the structured and unstructured components in the fusion context hint column. The upper limit of the word length is used to constrain the maximum number of output words that the local large model is allowed to produce in a single decoding.

2. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 1, characterized in that, The step of acquiring the first dataset based on local sensors specifically includes: The first dataset is acquired independently by the tourist terminal via its built-in Bluetooth radio frequency module; or, The first dataset is sent by a scenic area edge server that is communicatively connected to the tourist terminal; or, After the tourist terminal and the scenic area edge server jointly obtain the first dataset, the first dataset is cached in the local shared memory of the tourist terminal.

3. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 1, characterized in that, The real-time kinematic parameters include at least: instantaneous velocity and cumulative dwell time; wherein, The instantaneous movement speed is obtained by dividing the Euclidean distance offset between the physical positioning coordinates under adjacent timestamps in the first dataset by the sampling period. The cumulative dwell time is obtained by cumulatively integrating the instantaneous moving speed with a preset quasi-stationary speed threshold in the time domain.

4. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 1, characterized in that, Before performing the parallel extraction of the structured graph path traversal and the unstructured vector space mapping, S200 further includes: The system kernel calls to read the remaining capacity of the currently available random access memory and video memory of the local device, and compares them with a preset safety water level to form a hardware safety gating scalar, the value of which is 0 or 1; When the hardware security gating scalar indicates that the remaining capacity is higher than the preset security level, the unstructured vector space mapping is allowed to participate in the generation of the second dataset; When the hardware security gating scalar indicates that the remaining capacity is below the preset safety level, the unstructured vector space mapping is suspended, and only the structured graph path traversal is retained. The second dataset, containing only the structured components, is generated based on the output of the structured graph path traversal.

5. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 4, characterized in that, S200 includes the following sub-steps: S210. Extract the core entity from the target scenic spot identifier, and in the locally deployed scenic spot structured knowledge graph, retrieve all neighbor triples centered on the core entity and within a distance of no more than one hop, and generate the entity relationship subgraph; S220. Using the target scenic spot identifier as the query keyword, after encoding it into a query vector by a text encoder, in the locally deployed unstructured travelogue document vector library, using the cosine similarity between the query vector and the embedding representation of each document in the unstructured travelogue document vector library as a metric, extract several travelogue text vector blocks whose cosine similarity is greater than a preset similarity lower limit threshold. S230. The entity relation subgraph is parsed into a sequence of triples, and the sequence of triples is used as the fact constraint header and appended to the travelogue text vector block. The second dataset is generated by encapsulating the data according to the preset formatted tag template.

6. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 1, characterized in that, The plurality of mutually exclusive state identifiers include at least: Normal state, condensed state, extended state, and alarm state; The operation of mapping the real-time kinematic parameters to a current state identifier among multiple mutually exclusive state identifiers is determined according to the following priority order: First, if the local crowd density is greater than the preset congestion threshold, the current status is identified as the alarm state; the local crowd density is an estimated value of the number of concurrently connected devices belonging to the same geographic grid within a preset radius centered on the physical location coordinates at the current timestamp. Secondly, if the previous determination fails and the instantaneous movement speed is greater than the preset movement speed threshold, then the current state identifier is determined to be the condensed state. Furthermore, if the first two determinations fail and the cumulative dwell time exceeds the preset dwell threshold, then the current state identifier is determined as the extended state. If none of the above three criteria are met, the current state identifier is determined as the normal state.

7. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 6, characterized in that, When the current state is identified as the condensed state, the deterministic dynamic truncation and extension control logic executes a key information condensation mechanism, which specifically includes: Intercept and modify the control command stream injected into the local large model. The mask matrix is ​​configured to: retain the structured components in the fusion context hint column, and perform zero-masking on the unstructured components. The upper limit of the word length is configured to a preset word length to truncate the generation of background extension content and output a concise explanatory text containing only the factual information corresponding to the structured components.

8. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 6, characterized in that, When the current state is identified as the extended state, the deterministic dynamic truncation and extension control logic executes the elastic text extension mechanism, which specifically includes: The system locks the target attraction identifier corresponding to the physical location coordinates under the current timestamp, initiates a second-order depth-first traversal request to the locally deployed scenic area structured knowledge graph, extracts peripheral nodes that are two hops away from the core entity on the graph and whose node labels belong to a preset anecdote category, and their connecting triples, forming a set of second-order anecdote triples. The set of second-order anecdotal triples is transformed into an incremental text queue, which is then dynamically appended to the fusion context hint column in timestamp order. The upper limit of the word length is released with the remaining available video memory of the local device as a hard upper limit, so that the local large model can maintain the streaming generation state until the incremental text queue is exhausted.

9. The method for generating scenic area explanation text based on knowledge fusion and user profiling according to claim 6, characterized in that, When the current state is identified as the normal state, the mask matrix retains both the structured components and the unstructured components, and the upper limit of the word length is a default value between the preset word length and the upper limit of release after the second-order depth traversal of the scenic area structured knowledge graph. When the current state is identified as the alarm state, the method further includes: executing disaster recovery and obstacle avoidance logic, wherein the disaster recovery and obstacle avoidance logic specifically includes: By sending an interrupt signal to the decoding loop of the local large model through the decoding suspension operator, the currently generated word stream is forcibly terminated, and the video memory and computing power occupied by the local large model are released. Using the physical location coordinates under the current timestamp as the source point, the pre-marked set of emergency exit nodes as the target point set, and the weighted adjacency matrix of the scenic area path network as the graph structure, the Dijkstra shortest path algorithm is executed to solve the evacuation path between the emergency exit nodes that have the minimum path cost from the physical location coordinates to the emergency exit node set. The evacuation route is converted into a structured directional indicator, which is then inserted into the streaming output queue corresponding to the streaming narration text and presented to the visitor.

10. A scenic area explanation text generation system based on knowledge fusion and user profiling, characterized in that, The scenic area explanation text generation system includes: processor; The memory stores a computer program, which, when executed by a processor, implements the method for generating scenic area explanation text based on knowledge fusion and user profiling as described in any one of claims 1 to 9.