WebXR-based digital twin extension method for highway scenarios
By building a three-dimensional twin model of multi-source data fusion in the WebXR system and introducing event mapping rules and incremental update mechanisms, the problems of web-side interaction delay and resource update in highway scenarios are solved, and efficient three-dimensional model rendering and real-time interaction are achieved, which is suitable for smart transportation applications.
Patent Information
- Application Number
- CN202510854842.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-06-25
AI Technical Summary
In the highway scenario, existing WebXR systems are difficult to achieve efficient three-dimensional twin models and the web-side interaction adaptation, which has the problems of high interaction delay and low response accuracy. The resource update mechanism lacks incremental support, making it difficult to meet the real-time dynamic response needs.
Build a digital twin extension method based on WebXR, generate a three-dimensional twin model suitable for the web by integrating multi-source data, and introduce event mapping rules and incremental update mechanisms to achieve efficient update of model resources and synchronous rendering of perspectives.
It improves the scalability and rendering efficiency of the three-dimensional model in the web environment, realizes instant response and immersive experience of user interaction, enhances the system's device universality and interactive configuration flexibility, and is suitable for traffic simulation, remote monitoring and XR intelligent command and other scenarios.
Smart Images

Figure CN120353345B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin and virtual reality interaction technology, and in particular to a digital twin extension method based on WebXR in a highway scenario. Background Art
[0002] Against the backdrop of the rapid development of digital and intelligent transportation, achieving immersive visualization and real-time interactive control of highway scenarios on the web has become a key technical issue in the construction of intelligent transportation systems. With the introduction of the digital twin concept and its widespread application in urban governance, infrastructure management, and traffic monitoring, the construction and interaction of three-dimensional twin models have gradually evolved from static presentation to dynamic integration and real-time response. However, existing systems generally rely on high-performance local devices, making it difficult to meet the web's needs for visual reconstruction of multi-dimensional sensory data, real-time event response, and synchronous model updates in resource-constrained environments. This has hindered the promotion and deployment of digital twins in a wider range of transportation scenarios.
[0003] As a cross-platform XR runtime framework for browser environments, WebXR has good compatibility and portability, and has gradually become an important tool for building immersive experiences on the Web. However, in practical applications, there are still many challenges in efficiently integrating heterogeneous perception data, complex three-dimensional models, and the WebXR system to build a scalable XR interaction system with type recognition, event mapping, and incremental resource update capabilities. On the one hand, the existing WebXR system has certain limitations in device adaptation, input parsing, and rendering efficiency, resulting in high interaction latency and low response accuracy. On the other hand, traditional three-dimensional models lack a parsable structure and event binding mechanism, making it difficult to meet the Web's dynamic response requirements for high-frequency data input and control logic changes.
[0004] In addition, in terms of resource scheduling and model update mechanisms, existing solutions mostly adopt overall replacement or manual management strategies, lacking support for incremental updates for dynamic changes in the network environment and evolution of system status, making it difficult to achieve real-time evolution of models and interaction logic without interrupting services.
[0005] Therefore, how to build a digital twin extension method based on WebXR in highway scenarios has become a technical problem that needs to be solved urgently in the current field of smart transportation. Summary of the Invention
[0006] One purpose of the present invention is to propose a digital twin extension method based on WebXR in a highway scenario. The present invention integrates multi-source data such as road structure, traffic status and environmental monitoring, constructs a three-dimensional twin model containing static structures, dynamic objects and time series variables, and generates a multi-layer encapsulation structure suitable for Web-side parsing through formatting processing; dynamically loads device capability parameters in the WebXR running instance, collects and parses user XR input information, and generates model interaction control instructions through the event mapping mechanism; at the same time, supports incremental updates of model resources and synchronous rendering of perspectives to ensure real-time system response and interactive immersion. The present invention has the advantages of accurate model component recognition, flexible interactive control, efficient resource update and strong Web-side adaptability, and is suitable for various smart traffic scenarios such as traffic simulation, remote monitoring and XR intelligent command.
[0007] According to an embodiment of the present invention, a digital twin extension method based on WebXR in a highway scenario includes the following steps:
[0008] S1. Generate a corresponding 3D twin model based on the acquired highway scene structure information, traffic status information, and environmental monitoring data;
[0009] S2. Formatting the three-dimensional twin model and converting it into a web-parsable data structure suitable for a web-side operating environment;
[0010] S3. Initiate a WebXR session on the browser side, build a WebXR runtime instance that can recognize the Web-parseable data structure, and call the XR device capability query interface provided by the browser runtime environment to load input tracking parameters and display configuration parameters that match the terminal type;
[0011] S4. Based on the XR device input data received by the WebXR running instance, the user's spatial positioning information, head posture information, and control input information are collected and packaged into an input event stream in time sequence;
[0012] S5. Parse the spatial positioning information, head posture information, and control input information in the input event stream, and map them into interactive control instructions for the 3D twin model according to predefined event response rules;
[0013] S6. During the running of the WebXR running instance, according to the update instruction from the server, load the corresponding resource file and incrementally replace the three-dimensional twin model;
[0014] S7. Load the updated three-dimensional twin model into the browser graphics rendering engine, which generates a current frame image based on the user's head posture information and spatial positioning information in the WebXR running instance, and outputs the current frame image to the XR display device.
[0015] Optionally, the S1 specifically includes:
[0016] S11. Extract road boundaries, building outlines, and ancillary facilities based on the highway scene structure information and set them as static structures;
[0017] S12. Identify data objects with location and state change attributes based on traffic status information and set them as dynamic objects;
[0018] S13. Extracting data items with time series characteristics based on environmental monitoring data and setting them as time series variables;
[0019] S14, classify and encode the static structure, dynamic object and time series variable according to the preset prefixes "C-", "D-" and "T-" respectively to form a unique identifier of the three-dimensional twin model component with a type identifier;
[0020] S15. Writing the unique identifier of the 3D twin model component as component type information into the attribute field of each component in the 3D twin model to indicate the category to which the 3D twin model component belongs;
[0021] S16. The category to which the three-dimensional twin model component belongs is used to automatically identify different component categories during the Web-side formatting process, and is used as a type basis to participate in the binding of event response rules and the generation of interactive control instructions.
[0022] Optionally, the S2 specifically includes:
[0023] S21. During the formatting process of the 3D twin model, a web-parseable data structure is constructed, and an event mapping rule substructure is embedded in the web-parseable data structure, where the event mapping rule substructure is used to describe the binding relationship between user input and system response;
[0024] S22. The event mapping rule substructure is a JSON format data object with a field hierarchy structure, and is stored in an interaction definition field in a Web-parseable data structure;
[0025] S23, the event mapping rule substructure includes:
[0026] Event ID field, used to identify the unique event number;
[0027] The trigger condition field is used to set the input status that needs to be met for the response event to take effect;
[0028] The response action field is used to specify the specific operation performed by the system after the event is triggered;
[0029] The state transition field is used to indicate the target state that the system needs to enter after the event execution is completed;
[0030] S24. After the WebXR running instance loads the Web-parseable data structure, the event mapping rule substructure is subjected to field parsing, the binding relationship is extracted, and an event trigger mapping table is established.
[0031] Optionally, the web-parsable data structure constructed in S2 includes the following in terms of encapsulation structure and format organization:
[0032] In the process of formatting the 3D twin model, static structures, dynamic objects, and time series variables are encapsulated into different structural formats according to the categories of the 3D twin model components and the uses of the highway scene structure information, traffic status information, and environmental monitoring data. The encapsulation includes: encapsulating static structures into glTF format, encapsulating dynamic objects into JSON format, and encapsulating time series variables into a custom binary format;
[0033] The above encapsulation process sets an encapsulation type identification field in each component encapsulation unit to characterize the category, encapsulation format type and resolvable data indicator of the 3D twin model component;
[0034] All component packaging units are uniformly mounted into an index directory in a Web-resolvable data structure, forming a packaging list structure that can be retrieved and dynamically parsed by type;
[0035] When the WebXR runtime instance is loaded, the corresponding decoder is called according to the package list structure, glTF data is used for graphics rendering, JSON format components are used for event trigger identification and state control, and binary data is used for system variable updates and simulation synchronization processing.
[0036] Optionally, the S3 specifically includes:
[0037] S31. Invoke an XR device capability query interface in a browser environment to obtain feature information of the current XR terminal, where the feature information includes a terminal type identifier, an input interface protocol type, a spatial tracking capability indicator, and display output support parameters.
[0038] S32: searching for a corresponding entry in a preset terminal capability adaptation rule table based on the characteristic information of the current XR terminal, wherein the terminal capability adaptation rule table uses the terminal type identifier as an index primary key and associates the corresponding input tracking parameter set with the display configuration parameter set;
[0039] S33, the input tracking parameter set includes: the number of spatial degrees of freedom, the input event type, the gesture data refresh frequency and the multi-source input synchronization strategy;
[0040] S34, the display configuration parameter set includes: maximum supported resolution, refresh frame rate upper limit, field of view angle parameters and device rendering delay threshold;
[0041] S35. After matching the target entry, the WebXR running instance sets interactive input processing rules according to the input tracking parameter set, wherein the interactive input processing rules include input event parsing format, state update period, and synchronization control strategy, and sets XR view rendering parameters according to the display configuration parameter set, including frame update rate, image resolution, and display output angle.
[0042] S36, the interactive input processing rule is used to establish a mapping relationship between the XR device input and the control instruction generation logic;
[0043] S37. The XR view rendering parameter settings are used to construct the basic display configuration of the WebXR view output, including setting the viewpoint synchronization logic, perspective projection range and refresh rhythm control.
[0044] Optionally, the S4 specifically includes:
[0045] S41. After receiving the user's spatial positioning information, head posture information, and control input information from the XR device, the WebXR running instance encapsulates the information into an input event stream in the order of input collection time.
[0046] S42. The input event stream is composed of multiple input event units, each of which includes the following fields:
[0047] Timestamp field, used to identify the time when the input data was collected;
[0048] Device identification field, used to indicate the XR terminal from which the input data originates;
[0049] Spatial positioning field, used to record three-dimensional position coordinate values;
[0050] The posture information field is used to represent the head orientation data;
[0051] Control operation field, used to indicate input trigger type and parameter value;
[0052] S43, performing time alignment processing on the input event stream according to the system unified time reference during the encapsulation process;
[0053] S44. The encapsulated input event stream can be accessed and parsed by the event parsing mechanism in the WebXR running instance that is the same as the event mapping rule substructure.
[0054] Optionally, the S5 specifically includes:
[0055] S51, the WebXR running instance parses the input event unit in the input event stream and extracts the spatial positioning field, the posture information field, and the control operation field;
[0056] S52: Compare the extracted information with the event identification field in the event mapping rule substructure to preliminarily determine the event response rule entry to be verified;
[0057] S53. Deeply combine the current interaction state parameters of the WebXR running instance as auxiliary conditions for judging the applicability of the event rule, wherein the interaction state parameters include the user's current position, the user's viewing angle state, and the most recent triggering event information;
[0058] S54: Compare the trigger condition fields of each event response rule entry to be verified one by one, comprehensively determine whether the event type, interaction state, and input timing matching requirements are met, and determine the event response rule entry that meets the conditions;
[0059] S55. Construct an interactive control instruction according to the response action field in the selected predefined event response rule. The interactive control instruction includes: a type identifier of the target component, an interactive action type, and required execution parameters.
[0060] Optionally, the interactive control instruction includes a control field for the user's viewing angle state and has the following viewing angle change mechanism:
[0061] When the interactive control instruction is a perspective change instruction, extracting a target perspective control field from the perspective change instruction, wherein the perspective change instruction includes target focus position coordinates, a rotation angle value, and a field of view width setting parameter;
[0062] Calculate the difference between the target view control field and the current user view state of the WebXR running instance, and construct a view transition vector and a rotation transformation matrix to implement a transition path from the current view state to the target state;
[0063] In the process of constructing the perspective transformation path, an interpolation algorithm is applied to smooth the user's viewpoint movement process;
[0064] Applying the perspective transformation path to the virtual camera node in the WebXR running instance to update the 3D scene view in real time by updating the camera's viewing direction, position coordinates, and projection parameters;
[0065] After the perspective update is completed, the WebXR running instance adjusts the subsequent control strategy based on the current user interaction feedback, and records the perspective switching behavior in the interaction event log for behavior chain tracking and immersive control rhythm scheduling.
[0066] Optionally, the S6 specifically includes:
[0067] S61. After receiving the update instruction from the server, the WebXR running instance parses the resource identification field and the resource type field in the update instruction;
[0068] S62, the resource identification field is used to uniquely identify the resource module to be replaced in the Web-resolvable data structure, and the resource type field includes a structure resource type, a behavior resource type, and a script resource type;
[0069] S63. The WebXR running instance locates the resource module to be replaced according to the resource identification field, and loads the corresponding updated resource package content according to the resource type field. The updated resource package content is module-level incremental data, which only includes structural difference data, behavior logic change information, and script function update code segments.
[0070] S64. During the resource replacement process, the WebXR running instance retains the current running state and is embedded in the original running path by mounting the updated resource package, thereby achieving dynamic coverage of the 3D twin model and control logic.
[0071] S65. The incremental update mechanism supports independent replacement of the following three types of resource units:
[0072] Structural resource unit, used to update the model component structure and spatial layout;
[0073] Behavior resource unit, used to update event mapping rules and control response paths;
[0074] Script resource unit, used to update front-end logic functions, rendering scheduling strategies, and input behavior processing codes;
[0075] S66. After the incremental update is completed, the WebXR running instance updates the resource index directory and synchronizes the updated corresponding resource module to the event parsing mechanism and the interactive control instruction generation logic path.
[0076] Optionally, the reference path corresponding to the resource identification field of each resource module in the Web-resolvable data structure includes a two-level structure of a primary path and a backup path, and has the following path scheduling mechanism:
[0077] The WebXR running instance maintains a resource reference path for each resource identification field in the resource index directory. The resource reference path includes a primary path and a backup path. The primary path is the default priority loading path, and the backup path is used for fault-tolerant loading of resources after the primary path fails to load.
[0078] The resource reference path supports a dynamic redefinition mechanism. The WebXR running instance determines whether to switch to the backup path based on the loading status feedback conditions. The status feedback conditions include the main path loading timeout, the main path resource integrity verification failure, the resource package parsing error or verification exception associated with the main path;
[0079] During the path redefinition process, the WebXR instance updates the path priority tag field in the resource index directory, sets the backup path as the current primary path, and records the reason for the switch and status information;
[0080] After the resource reference path is redefined, continue to load the updated resource package content pointed to by the updated path and perform the incremental replacement process;
[0081] The path scheduling mechanism supports hot loading of resources without interrupting the system operation state.
[0082] The beneficial effects of the present invention are:
[0083] (1) The present invention constructs an efficient digital twin modeling mechanism for the Web. By heterogeneously integrating the structural information, traffic status and environmental monitoring data in the highway scene, a classification coding method for static structures, dynamic objects and time series variables is proposed, and a variety of encapsulation formats are used to organize three-dimensional model data. This realizes structured modeling and efficient analysis of different types of data in complex traffic scenes, significantly improving the scalability and rendering efficiency of the three-dimensional model in the Web environment.
[0084] (2) The present invention introduces an event mapping rule substructure, which establishes a binding relationship between user input and system response in Web-parseable data. It can generate and parse input event streams in real time based on the input collection results of XR devices, thereby achieving accurate perception and dynamic interactive response of user perspective, spatial position and operation behavior, effectively improving the interactive fluency, response timeliness and consistency of immersive experience in the WebXR environment.
[0085] (3) The present invention designs a dynamic configuration mechanism for XR terminals based on device capability adaptation rules. During the establishment of a WebXR session, the present invention can intelligently set input parsing and image rendering strategies according to the spatial tracking capabilities and display parameters of the XR device, thereby ensuring a consistent operating experience and high-quality image output on multiple types of terminal devices, thereby enhancing the system's device versatility and interactive configuration flexibility.
[0086] (4) The present invention constructs an incremental update mechanism at the resource module level, which supports dynamic replacement of model structure, behavioral logic and rendering script without interrupting system operation, and ensures the stability of resource scheduling through a dual reference system of main path and backup path, thus achieving significant enhancement of the real-time, continuity and robustness of the digital twin system. It is suitable for traffic visualization application scenarios with frequent changes and high reliability requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0088] Figure 1 This is the overall flow chart of the WebXR-based digital twin extension method for the highway scenario proposed in this invention;
[0089] Figure 2 This is a schematic diagram of the 3D twin model data encapsulation structure of the WebXR-based digital twin extension method for the highway scenario proposed in the present invention;
[0090] Figure 3 This is a flowchart for user input event collection and interactive control instruction generation for the WebXR running instance of the WebXR-based digital twin extension method in the highway scenario proposed by the present invention. DETAILED DESCRIPTION
[0091] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0092] refer to Figure 1-Figure 3 The digital twin extension method based on WebXR in the highway scenario includes the following steps:
[0093] S1. Generate a corresponding 3D twin model based on the acquired highway scene structure information, traffic status information, and environmental monitoring data;
[0094] In this embodiment, S1 specifically includes:
[0095] S11. Extract road boundaries, building outlines, and ancillary facilities based on the highway scene structure information and set them as static structures;
[0096] S12. Identify data objects with location and state change attributes based on traffic status information and set them as dynamic objects;
[0097] S13. Extracting data items with time series characteristics based on environmental monitoring data and setting them as time series variables;
[0098] S14, classify and encode the static structure, dynamic object and time series variable according to the preset prefixes "C-", "D-" and "T-" respectively to form a unique identifier of the three-dimensional twin model component with a type identifier;
[0099] S15. Writing the unique identifier of the 3D twin model component as component type information into the attribute field of each component in the 3D twin model to indicate the category to which the 3D twin model component belongs;
[0100] S16. The category to which the three-dimensional twin model component belongs is used to automatically identify different component categories during the Web-side formatting process, and is used as a type basis to participate in the binding of event response rules and the generation of interactive control instructions.
[0101] This invention achieves standardized modeling of multi-source heterogeneous sensory data by hierarchically abstracting structural information, traffic status, and environmental monitoring data in highway scenarios, defining them as static constructs, dynamic objects, and time-series variables, respectively. Furthermore, a classification and coding mechanism is introduced during the construction of the 3D twin model, enabling standardized modeling of multi-source heterogeneous sensory data. This approach not only improves the structural clarity and type recognition of 3D model components but also provides a basis for automatic component identification and subsequent interaction logic generation during web-based formatting. The use of preset prefixes "C-," "D-," and "T-" to label different component types enables the system to quickly locate, parse, and respond to specific data changes in data encapsulation and runtime instances, significantly improving the accuracy and efficiency of interaction processing. Furthermore, the unique identifier of each model component is embedded in the attribute field, ensuring consistency and traceability of the model during network transmission, incremental updates, and state mapping. Through this mechanism, the invention effectively addresses the challenges of model component identification difficulties, ambiguous data binding, and delayed interaction responses in existing WebXR systems, laying a solid foundation for dynamic modeling and real-time control in highway digital twin scenarios.
[0102] S2. Formatting the three-dimensional twin model and converting it into a web-parsable data structure suitable for a web-side operating environment;
[0103] In this embodiment, S2 specifically includes:
[0104] S21. During the formatting process of the 3D twin model, a web-parseable data structure is constructed, and an event mapping rule substructure is embedded in the web-parseable data structure, where the event mapping rule substructure is used to describe the binding relationship between user input and system response;
[0105] S22. The event mapping rule substructure is a JSON format data object with a field hierarchy structure, and is stored in an interaction definition field in a Web-parseable data structure;
[0106] S23, the event mapping rule substructure includes:
[0107] Event ID field, used to identify the unique event number;
[0108] The trigger condition field is used to set the input status that needs to be met for the response event to take effect;
[0109] The response action field is used to specify the specific operation performed by the system after the event is triggered;
[0110] The state transition field is used to indicate the target state that the system needs to enter after the event execution is completed;
[0111] S24. After the WebXR running instance loads the Web-parseable data structure, the event mapping rule substructure is subjected to field parsing, the binding relationship is extracted, and an event trigger mapping table is established.
[0112] The web-parseable data structure constructed in S2 includes the following in terms of encapsulation structure and format organization:
[0113] In the process of formatting the 3D twin model, static structures, dynamic objects, and time series variables are encapsulated into different structural formats according to the categories of the 3D twin model components and the uses of the highway scene structure information, traffic status information, and environmental monitoring data. The encapsulation includes: encapsulating static structures into glTF format, encapsulating dynamic objects into JSON format, and encapsulating time series variables into a custom binary format;
[0114] The above encapsulation process sets an encapsulation type identification field in each component encapsulation unit to characterize the category, encapsulation format type and resolvable data indicator of the 3D twin model component;
[0115] All component packaging units are uniformly mounted into an index directory in a Web-resolvable data structure, forming a packaging list structure that can be retrieved and dynamically parsed by type;
[0116] When the WebXR runtime instance is loaded, the corresponding decoder is called according to the package list structure, glTF data is used for graphics rendering, JSON format components are used for event trigger identification and state control, and binary data is used for system variable updates and simulation synchronization processing.
[0117] The present invention introduces a Web-parseable data structure with a clear structure and complete functions in the formatting process of the three-dimensional twin model. By embedding the event mapping rule substructure in the model data, it realizes the direct binding between user input and system response, and provides a standard mechanism for instant interaction in the WebXR environment. The event mapping structure adopts the JSON hierarchical format, and clearly defines key fields such as event identification, trigger conditions, response actions and state transfers, so that the system can quickly identify input events and perform corresponding actions at runtime, which greatly improves the maintainability of interaction rules and the certainty of system response. In terms of model encapsulation, by encapsulating static constructs, dynamic objects and time series variables into glTF, JSON and custom binary formats respectively, and adding an encapsulation type identification field in the encapsulation unit, a data list organized by category is formed, which realizes dynamic parsing and precise scheduling of model components. When the system is loaded, a dedicated decoder is called according to the encapsulation list, and rendering, event identification and state synchronization are completed according to the component category, which effectively improves the modularity and operation efficiency of the system. Overall, this method solves the problems in existing technologies such as unclear parsing of complex three-dimensional model structures on the Web side, incomplete event interaction binding, and cumbersome model data updates, providing strong technical support for the efficient parsing, real-time interaction, and scalable deployment of highway digital twin systems.
[0118] S3. Initiate a WebXR session on the browser side, build a WebXR runtime instance that can recognize the Web-parseable data structure, and call the XR device capability query interface provided by the browser runtime environment to load input tracking parameters and display configuration parameters that match the terminal type;
[0119] In this embodiment, S3 specifically includes:
[0120] S31. Invoke an XR device capability query interface in a browser environment to obtain feature information of the current XR terminal, where the feature information includes a terminal type identifier, an input interface protocol type, a spatial tracking capability indicator, and display output support parameters.
[0121] S32: searching for a corresponding entry in a preset terminal capability adaptation rule table based on the characteristic information of the current XR terminal, wherein the terminal capability adaptation rule table uses the terminal type identifier as an index primary key and associates the corresponding input tracking parameter set with the display configuration parameter set;
[0122] S33, the input tracking parameter set includes: the number of spatial degrees of freedom, the input event type, the gesture data refresh frequency and the multi-source input synchronization strategy;
[0123] S34, the display configuration parameter set includes: maximum supported resolution, refresh frame rate upper limit, field of view angle parameters and device rendering delay threshold;
[0124] S35. After matching the target entry, the WebXR running instance sets interactive input processing rules according to the input tracking parameter set, wherein the interactive input processing rules include input event parsing format, state update period, and synchronization control strategy, and sets XR view rendering parameters according to the display configuration parameter set, including frame update rate, image resolution, and display output angle.
[0125] S36, the interactive input processing rule is used to establish a mapping relationship between the XR device input and the control instruction generation logic;
[0126] S37. The XR view rendering parameter settings are used to construct the basic display configuration of the WebXR view output, including setting the viewpoint synchronization logic, perspective projection range and refresh rhythm control.
[0127] This invention introduces a terminal capability adaptation rule table mechanism during the WebXR session initialization phase. By invoking the XR device capability query interface through the browser runtime environment, it accurately identifies parameters such as the current XR terminal's type identifier, input protocol, and spatial tracking characteristics, and then matches the corresponding input tracking parameters and display configuration parameters based on the terminal type. This mechanism effectively implements system adaptive scheduling for different XR device characteristics, ensuring that all types of terminals can obtain a consistent interactive experience and high-quality visual output in the Web-based runtime environment. The input tracking parameter set covers spatial degrees of freedom, event types, and refresh rate strategies, while the display configuration parameters encompass key display performance indicators such as maximum resolution, frame rate cap, and field of view, further ensuring the smoothness of interactive operations and the clarity of image rendering. Based on this, the WebXR runtime instance can automatically configure the XR view rendering parameters and set the input event parsing and synchronization control strategy based on the input tracking parameters, thereby establishing an efficient mapping path between input and response within the system. Furthermore, this mechanism enables the system to perceive changes in terminal capabilities in real time and dynamically adjust image resolution and frame rate control logic, effectively reducing resource utilization and latency risks. This method significantly improves the interactive consistency, response efficiency, and operational stability of the digital twin system in multi-terminal and multi-network environments, providing strong support for immersive traffic simulation and visualization control on the Web.
[0128] S4. Based on the XR device input data received by the WebXR running instance, the user's spatial positioning information, head posture information, and control input information are collected and packaged into an input event stream in time sequence;
[0129] In this embodiment, the S4 specifically includes:
[0130] S41. After receiving the user's spatial positioning information, head posture information, and control input information from the XR device, the WebXR running instance encapsulates the information into an input event stream in the order of input collection time.
[0131] S42. The input event stream is composed of multiple input event units, each of which includes the following fields:
[0132] Timestamp field, used to identify the time when the input data was collected;
[0133] Device identification field, used to indicate the XR terminal from which the input data originates;
[0134] Spatial positioning field, used to record three-dimensional position coordinate values;
[0135] The posture information field is used to represent the head orientation data;
[0136] Control operation field, used to indicate input trigger type and parameter value;
[0137] S43, performing time alignment processing on the input event stream according to the system unified time reference during the encapsulation process;
[0138] S44. The encapsulated input event stream can be accessed and parsed by the event parsing mechanism in the WebXR running instance that is the same as the event mapping rule substructure.
[0139] This invention establishes a complete XR device input data encapsulation mechanism within a WebXR runtime instance. This mechanism constructs a structured input event stream based on the user's spatial location, head posture, and control input information, significantly improving the accuracy and processing efficiency of user behavior information within the system. This input event stream, based on a time series, is sequentially encapsulated into multiple input event units. Each unit includes key fields such as timestamp, device identifier, spatial location, posture information, and control operation, ensuring comprehensive data representation and a rigorous collection sequence. By establishing a unified time reference system, all input events are time-aligned during the encapsulation process, ensuring the temporal consistency of interactive behaviors in subsequent parsing and control logic. Furthermore, the encapsulated event stream is directly connected to the event mapping rule structure, accessed and parsed by the WebXR runtime instance, achieving a seamless transition from "data collection" to "interactive response." This event-driven mechanism enables the system to provide rapid and accurate feedback on user behavior in complex traffic environments, significantly enhancing the immediacy of system response and the immersiveness of interactive control. This mechanism not only solves the problems of fragmented input information processing and missing time dimension in traditional systems, but also provides a solid structural foundation for subsequent multi-source input fusion and behavior chain tracking analysis.
[0140] S5. Parse the spatial positioning information, head posture information, and control input information in the input event stream, and map them into interactive control instructions for the 3D twin model according to predefined event response rules;
[0141] In this embodiment, the S5 specifically includes:
[0142] S51, the WebXR running instance parses the input event unit in the input event stream and extracts the spatial positioning field, the posture information field, and the control operation field;
[0143] S52: Compare the extracted information with the event identification field in the event mapping rule substructure to preliminarily determine the event response rule entry to be verified;
[0144] S53. Deeply combine the current interaction state parameters of the WebXR running instance as auxiliary conditions for judging the applicability of the event rule, wherein the interaction state parameters include the user's current position, the user's viewing angle state, and the most recent triggering event information;
[0145] S54: Compare the trigger condition fields of each event response rule entry to be verified one by one, comprehensively determine whether the event type, interaction state, and input timing matching requirements are met, and determine the event response rule entry that meets the conditions;
[0146] S55. Construct an interactive control instruction according to the response action field in the selected predefined event response rule. The interactive control instruction includes: a type identifier of the target component, an interactive action type, and required execution parameters.
[0147] The interactive control instruction includes a control field for the user's viewing angle state and has the following viewing angle change mechanism:
[0148] When the interactive control instruction is a perspective change instruction, extracting a target perspective control field from the perspective change instruction, wherein the perspective change instruction includes target focus position coordinates, a rotation angle value, and a field of view width setting parameter;
[0149] Calculate the difference between the target view control field and the current user view state of the WebXR running instance, and construct a view transition vector and a rotation transformation matrix to implement a transition path from the current view state to the target state;
[0150] In the process of constructing the perspective transformation path, an interpolation algorithm is applied to smooth the user's viewpoint movement process;
[0151] Applying the perspective transformation path to the virtual camera node in the WebXR running instance to update the 3D scene view in real time by updating the camera's viewing direction, position coordinates, and projection parameters;
[0152] After the perspective update is completed, the WebXR running instance adjusts the subsequent control strategy based on the current user interaction feedback, and records the perspective switching behavior in the interaction event log for behavior chain tracking and immersive control rhythm scheduling.
[0153] By parsing and responding to WebXR input event streams, this paper constructs an efficient and sophisticated interactive control command generation mechanism, significantly improving the interactive response accuracy and immersive experience quality of the 3D twin system. During system operation, the WebXR instance can parse the spatial positioning, posture information, and operation control fields in the input event unit in real time, and perform multi-level comparison and adaptation judgment based on predefined event response rules to dynamically identify the user's current operation intention. At the same time, this mechanism deeply integrates user interaction state parameters such as current position, view state, and historical event information. Through multi-condition matching and temporal relationship reasoning, it can accurately judge high-frequency and complex interactive events. In particular, the present invention further introduces a perspective change mechanism. When the user operation type is identified as perspective adjustment, the system uses the target position, rotation angle, and field of view width parameters set in the perspective control field as the perspective switching instruction input. An interpolation algorithm is used to smoothly generate a transition path and drive the virtual camera node to complete the perspective update. During this process, the system also dynamically adjusts the control strategy based on user interaction feedback and records each perspective change in the interaction event log, providing support for behavior chain tracking and system response rhythm scheduling. This solution effectively avoids problems such as abrupt perspective jumps and discontinuous field of view switching, greatly enhances the coherence, controllability and immersion of three-dimensional scene interaction, and improves the realism and response efficiency of user operations in the digital twin environment.
[0154] S6. During the running of the WebXR running instance, according to the update instruction from the server, load the corresponding resource file and incrementally replace the three-dimensional twin model;
[0155] In this embodiment, S6 specifically includes:
[0156] S61. After receiving the update instruction from the server, the WebXR running instance parses the resource identification field and the resource type field in the update instruction;
[0157] S62, the resource identification field is used to uniquely identify the resource module to be replaced in the Web-resolvable data structure, and the resource type field includes a structure resource type, a behavior resource type, and a script resource type;
[0158] S63. The WebXR running instance locates the resource module to be replaced according to the resource identification field, and loads the corresponding updated resource package content according to the resource type field. The updated resource package content is module-level incremental data, which only includes structural difference data, behavior logic change information, and script function update code segments.
[0159] S64. During the resource replacement process, the WebXR running instance retains the current running state and is embedded in the original running path by mounting the updated resource package, thereby achieving dynamic coverage of the 3D twin model and control logic.
[0160] S65. The incremental update mechanism supports independent replacement of the following three types of resource units:
[0161] Structural resource unit, used to update the model component structure and spatial layout;
[0162] Behavior resource unit, used to update event mapping rules and control response paths;
[0163] Script resource unit, used to update front-end logic functions, rendering scheduling strategies, and input behavior processing codes;
[0164] S66. After the incremental update is completed, the WebXR running instance updates the resource index directory and synchronizes the updated corresponding resource module to the event parsing mechanism and the interactive control instruction generation logic path.
[0165] The reference path corresponding to the resource identification field of each resource module in the Web-resolvable data structure includes a two-level structure of a primary path and a backup path, and has the following path scheduling mechanism:
[0166] The WebXR running instance maintains a resource reference path for each resource identification field in the resource index directory. The resource reference path includes a primary path and a backup path. The primary path is the default priority loading path, and the backup path is used for fault-tolerant loading of resources after the primary path fails to load.
[0167] The resource reference path supports a dynamic redefinition mechanism. The WebXR running instance determines whether to switch to the backup path based on the loading status feedback conditions. The status feedback conditions include the main path loading timeout, the main path resource integrity verification failure, the resource package parsing error or verification exception associated with the main path;
[0168] During the path redefinition process, the WebXR instance updates the path priority tag field in the resource index directory, sets the backup path as the current primary path, and records the reason for the switch and status information;
[0169] After the resource reference path is redefined, continue to load the updated resource package content pointed to by the updated path and perform the incremental replacement process;
[0170] The path scheduling mechanism supports hot loading of resources without interrupting the system operation state.
[0171] The present invention proposes a highly flexible incremental update mechanism for WebXR system resources that supports uninterrupted operation. By parsing the update instructions issued by the server, the system can automatically identify the resource identification field and resource type field, accurately locate the module to be updated, and load structural difference data, logic change information or code patches at the module level, realizing fine-grained replacement of the 3D twin model structure, behavioral response path and rendering control logic. During the update process, the WebXR running instance can embed the running path through resource package mounting without interrupting the existing interactive state, maintaining the continuity of the system state and greatly enhancing the stability and availability of the system in dynamic scenarios. The system adopts an independent replacement strategy for three types of resource units: structure, behavior and script, so that updates at different levels can be triggered on demand, effectively reducing the complexity of resource scheduling and version control. At the same time, the present invention innovatively constructs a resource reference structure consisting of a primary path and a backup path, and introduces a dynamic path redefinition mechanism. When the primary path fails to load or verification is abnormal, the system can automatically switch to the backup path to complete hot loading, ensuring the robustness of the update process and system security. All path scheduling behaviors are recorded in the resource index directory, supporting fault tracing and loading status analysis, and providing key technical guarantees for the digital twin system to achieve stable and efficient resource updates and functional evolution in large-scale traffic simulation or remote monitoring applications.
[0172] S7. Load the updated three-dimensional twin model into the browser graphics rendering engine, which generates a current frame image based on the user's head posture information and spatial positioning information in the WebXR running instance, and outputs the current frame image to the XR display device.
[0173] In the process of implementing the present invention, when the 3D twin model completes resource replacement after receiving the update instruction from the server, the system will load the updated model into the graphics rendering engine on the browser side. The rendering engine is a graphics processing component that supports the WebXR operating environment and can respond to the user's XR interactive behavior in real time. During the rendering process, the system generates real-time images of the 3D scene based on the user's head posture information and spatial positioning information collected in the WebXR running instance, combined with the generation logic of the current frame image, through the viewpoint position, observation direction and perspective projection matrix.
[0174] Specifically, the rendering engine dynamically constructs the observation matrix and field of view cropping parameters, centered around the user's current perspective, to generate a high-quality frame image that incorporates depth perception and spatial consistency. This image is then transmitted to the XR device via the WebXR interface for the final output of immersive graphics. This entire process occurs synchronously within the system's graphics rendering pipeline, with the frame refresh rate automatically aligned with the display parameters supported by the XR device, ensuring highly consistent output content in terms of display clarity, update speed, and interactive feedback.
[0175] By loading a 3D twin model into the browser's graphics rendering engine and generating images based on the user's posture information and spatial positioning of the WebXR running instance, the present invention achieves a complete closed loop from model data to immersive image output. This mechanism effectively integrates the 3D model rendering and XR device output processes, enabling image content to match user interaction behavior and the current viewing angle in real time, greatly enhancing the consistency of visual perception and spatial immersion. Compared to traditional static rendering methods, this solution has significant advantages such as short response time, strong frame synchronization, and accurate rendering images, which can significantly improve the XR visualization experience in rapidly changing scenarios. In particular, in scenarios such as traffic simulation, emergency response, and remote dispatch, which require extremely high image update efficiency, this mechanism can ensure that users always receive visual feedback that is highly consistent with the actual interaction state, improving the overall interaction quality and perceived credibility of the system. In addition, the rendering engine has strong compatibility with XR display devices and supports automatic adaptation of multi-terminal resolutions and refresh rates, further enhancing the scalability and ease of use of the system in multi-platform deployments.
[0176] Example:
[0177] To verify the feasibility of this invention, we applied it to the intelligent highway platform of City G, a pilot city for intelligent transportation in a coastal province in southern China. This platform covers 186 kilometers of expressway within the city and provides 24 / 7 traffic monitoring, early warning response, and dispatch control. City G's traffic information center has long been plagued by inefficient multi-source traffic data processing, slow 3D model interaction, and unstable resource update releases, severely hampering the city's ability to effectively operate and maintain its intelligent transportation system.
[0178] In order to solve these problems, City G decided to introduce the WebXR-based digital twin extension method of the present invention to build a highly adaptable, low-latency, and highly real-time Web-based traffic digital twin system to realize heterogeneous data fusion, three-dimensional dynamic modeling, cross-platform interaction, and an XR immersive visualization command system supported by hot updates.
[0179] During the initial implementation, the system first extracted road boundaries, bridge outlines, toll booth locations, and tunnel layout information from the G City Expressway Structure Database, and then constructed models using the static structural model generation module. Simultaneously, traffic status data from road surveillance cameras, ETC devices, and mobile terminals was integrated to manage vehicle flow, operating speeds, and abnormal events as dynamic objects. Environmental data provided by air quality monitoring stations and meteorological sensors, such as PM2.5 concentration, wind speed and direction, and visibility, was set as time series variables.
[0180] The system uniquely encodes these three types of model components using a three-part prefix of "C-," "D-," and "T-," and writes them into the twin model's attribute fields, ensuring rapid identification and classification during web-based formatting and event mapping. After formatting, the system encapsulates static constructs in glTF format, dynamic objects in JSON format, and time series variables in binary format. A unified encapsulation manifest structure is generated and mounted in a web-resolvable data index directory.
[0181] After a user logs in to the system through a WebXR terminal, the browser launches an XR runtime instance. The system automatically calls the XR device capability interface and identifies the current terminal as an Oculus Quest 2 with 6-degree-of-freedom tracking and 120Hz refresh rate support. Based on the terminal capability adaptation rule table, the system automatically matches spatial positioning parameters, image resolution cap, and synchronization refresh policy, setting XR view rendering parameters and event parsing paths.
[0182] During operation, the system collects the user's spatial position, head posture, and gesture input in real time, generating a time-series input event stream and performing system time alignment. The input event stream is then compared with the field hierarchy structure in the event mapping rules to determine whether the current action matches the established trigger conditions. Interactive control instructions are then generated based on the response action fields. If the user gazes at the area where the highway accident occurred for more than three seconds, the system automatically focuses the view to that location and displays an accident information card on the virtual console.
[0183] The system also supports a dynamic resource update mechanism. During an emergency drill, the traffic management center needs to replace the road control script with the accident simulation model. Simply by issuing a resource update command from the server, the system locates the module to be updated based on the resource identifier and hot-loads the update package. Once the update is complete, the system automatically reconstructs the corresponding model components in the browser rendering engine and synchronizes them to the XR display device, ensuring uninterrupted operation and real-time information updates.
[0184] One quarter after the deployment of the system of the present invention (December 2024 to February 2025), the operating efficiency of the intelligent highway platform in City G was significantly improved. The specific data is shown in Table 1 below:
[0185] Table 1: Comparison of the deployment effects of the WebXR digital twin system on the intelligent highway platform in City G
[0186] ;
[0187] As can be seen from the above table, after deploying the system of the present invention, the intelligent highway platform in City G has achieved significant improvements in multiple key performance indicators. In terms of model loading time, the average loading time of the system has been compressed from nearly 20 seconds to less than 4 seconds, effectively improving the operation and maintenance personnel's ability to quickly perceive the traffic situation in emergency situations. For example, in the early morning of January 6, 2025, due to sudden heavy fog on mountainous roads, visibility dropped sharply. The system pushed real-time weather data and traffic flow status through the server, and successfully completed the foggy visual effect replacement of 4 bridge models in only about 3.5 seconds. The rendering results were stably output to the XR terminal, assisting the monitoring center to make timely closure decisions.
[0188] In terms of user interaction response time, in the past, the system often experienced interaction delays exceeding 800 milliseconds due to lengthy event rule parsing paths, seriously affecting operational consistency. However, this invention reduces the average response time to less than 80 milliseconds by introducing an optimized configuration of event mapping rule substructures and input tracking parameter sets. In an interactive test, an operator clicked on a traffic node to view congestion details using a gesture. The XR device completed data loading and image switching with a delay of only two frames, ensuring the smoothness and immediacy of the immersive experience.
[0189] The ability to update model resources has also been greatly enhanced. The system supports independent incremental hot updates of structural resources, behavioral logic, and script code, avoiding the high cost and risk of replacing the original system as a whole. On the eve of the 2025 Spring Festival return peak, the G City Traffic Information Center adjusted the traffic organization of the "North Ring Interchange" area, involving structural reconstruction of 5 sections, modification of 2 types of rule logic, and real-time script refresh. All changes were pushed to the front end through an incremental package deployment at 3:00 am. The system completed all replacement operations without interrupting service. Operations and maintenance personnel received updated images and interactive functions on the XR device in the first time, ensuring smooth scheduling during the holiday period.
[0190] In addition, the rendering accuracy adaptation rate has been increased from the original 72.3% to 96.5%, which means that most XR terminals can achieve display effects that are highly consistent with the user's real perspective under different operating systems and graphics processing capabilities. The system introduces dynamic field of view adjustment and interpolation smoothing technology. When the user moves quickly or switches perspectives, the XR camera node can automatically adjust the perspective matrix to prevent problems such as image stretching and jitter. For example, in an accident replay on January 12, a traffic engineer continuously switched six camera points in the XR environment for a virtual inspection. The system did not experience frame drops or image distortion, and the display performance was excellent.
[0191] The perspective switching interruption rate has been reduced to less than 1%, thanks to the system's implementation of an interpolation algorithm and smooth rotation matrix calculations when generating perspective transition paths, along with an asynchronous update strategy for pre-buffered frame reads. During traffic drills, when an operator focused on a road section in VR and then quickly switched to an adjacent section, the system smoothly transitioned the visual path and pre-loaded the next perspective resource, preventing screen freezes or loading failures and significantly enhancing the continuity of the visual experience.
[0192] In summary, the field deployment verification of the G City Expressway Traffic Platform shows that the WebXR-based digital twin extension method of the present invention has demonstrated excellent performance in terms of three-dimensional modeling flexibility, real-time interactive response capabilities, system update mechanism, and view rendering consistency. It is particularly suitable for high-demand application scenarios such as traffic scheduling, accident simulation, and remote supervision, and has extremely high engineering practical value and promotion potential.
[0193] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A digital twin extension method based on WebXR in a highway scenario, characterized by: The steps include: S1. Generate a corresponding 3D twin model based on the acquired highway scene structure information, traffic status information, and environmental monitoring data; S2. Formatting the three-dimensional twin model and converting it into a web-parsable data structure suitable for a web-side operating environment; S3. Initiate a WebXR session on the browser side, build a WebXR runtime instance that can recognize the Web-parseable data structure, and call the XR device capability query interface provided by the browser runtime environment to load input tracking parameters and display configuration parameters that match the terminal type; S4. Based on the XR device input data received by the WebXR running instance, the user's spatial positioning information, head posture information, and control input information are collected and packaged into an input event stream in time sequence; S5. Parse the spatial positioning information, head posture information, and control input information in the input event stream, and map them into interactive control instructions for the 3D twin model according to predefined event response rules; S6. During the running of the WebXR running instance, according to the update instruction from the server, load the corresponding resource file and incrementally replace the three-dimensional twin model; S7. Load the updated three-dimensional twin model into the browser graphics rendering engine, which generates a current frame image based on the user's head posture information and spatial positioning information in the WebXR running instance, and outputs the current frame image to the XR display device.
2. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: Said S1 specifically includes: S11. Extract road boundaries, building outlines, and ancillary facilities based on the highway scene structure information and set them as static structures; S12. Identify data objects with location and state change attributes based on traffic status information and set them as dynamic objects; S13. Extracting data items with time series characteristics based on environmental monitoring data and setting them as time series variables; S14, classify and encode the static structure, dynamic object and time series variable according to the preset prefixes "C-", "D-" and "T-" respectively to form a unique identifier of the three-dimensional twin model component with a type identifier; S15. Writing the unique identifier of the 3D twin model component as component type information into the attribute field of each component in the 3D twin model to indicate the category to which the 3D twin model component belongs; S16. The category to which the three-dimensional twin model component belongs is used to automatically identify different component categories during the Web-side formatting process, and is used as a type basis to participate in the binding of event response rules and the generation of interactive control instructions.
3. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The S2 specifically includes: S21. During the formatting process of the 3D twin model, a web-parseable data structure is constructed, and an event mapping rule substructure is embedded in the web-parseable data structure, where the event mapping rule substructure is used to describe the binding relationship between user input and system response; S22. The event mapping rule substructure is a JSON format data object with a field hierarchy structure, and is stored in an interaction definition field in a Web-parseable data structure; S23, the event mapping rule substructure includes: Event ID field, used to identify the unique event number; The trigger condition field is used to set the input status that needs to be met for the response event to take effect; The response action field is used to specify the specific operation performed by the system after the event is triggered; The state transition field is used to indicate the target state that the system needs to enter after the event execution is completed; S24. After the WebXR running instance loads the Web-parseable data structure, the event mapping rule substructure is subjected to field parsing, the binding relationship is extracted, and an event trigger mapping table is established.
4. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The web-parseable data structure constructed in S2 includes the following in terms of encapsulation structure and format organization: In the process of formatting the 3D twin model, static structures, dynamic objects, and time series variables are encapsulated into different structural formats according to the categories of the 3D twin model components and the uses of the highway scene structure information, traffic status information, and environmental monitoring data. The encapsulation includes: encapsulating static structures into glTF format, encapsulating dynamic objects into JSON format, and encapsulating time series variables into a custom binary format; The above encapsulation process sets an encapsulation type identification field in each component encapsulation unit to characterize the category, encapsulation format type and resolvable data indicator of the 3D twin model component; All component packaging units are uniformly mounted into an index directory in a Web-resolvable data structure, forming a packaging list structure that can be retrieved and dynamically parsed by type; When the WebXR runtime instance is loaded, the corresponding decoder is called according to the package list structure, glTF data is used for graphics rendering, JSON format components are used for event trigger identification and state control, and binary data is used for system variable updates and simulation synchronization processing.
5. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The S3 specifically includes: S31. Invoke an XR device capability query interface in a browser environment to obtain feature information of the current XR terminal, where the feature information includes a terminal type identifier, an input interface protocol type, a spatial tracking capability indicator, and display output support parameters. S32: searching for a corresponding entry in a preset terminal capability adaptation rule table based on the characteristic information of the current XR terminal, wherein the terminal capability adaptation rule table uses the terminal type identifier as an index primary key and associates the corresponding input tracking parameter set with the display configuration parameter set; S33, the input tracking parameter set includes: the number of spatial degrees of freedom, the input event type, the gesture data refresh frequency and the multi-source input synchronization strategy; S34, the display configuration parameter set includes: maximum supported resolution, refresh frame rate upper limit, field of view angle parameters and device rendering delay threshold; S35. After matching the target entry, the WebXR running instance sets interactive input processing rules according to the input tracking parameter set, wherein the interactive input processing rules include input event parsing format, state update period, and synchronization control strategy, and sets XR view rendering parameters according to the display configuration parameter set, including frame update rate, image resolution, and display output angle. S36, the interactive input processing rule is used to establish a mapping relationship between the XR device input and the control instruction generation logic; S37. The XR view rendering parameter settings are used to construct the basic display configuration of the WebXR view output, including setting the viewpoint synchronization logic, perspective projection range and refresh rhythm control.
6. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The S4 specifically includes: S41. After receiving the user's spatial positioning information, head posture information, and control input information from the XR device, the WebXR running instance encapsulates the information into an input event stream in the order of input collection time. S42. The input event stream is composed of multiple input event units, each of which includes the following fields: Timestamp field, used to identify the time when the input data was collected; Device identification field, used to indicate the XR terminal from which the input data originates; Spatial positioning field, used to record three-dimensional position coordinate values; The posture information field is used to represent the head orientation data; Control operation field, used to indicate input trigger type and parameter value; S43, performing time alignment processing on the input event stream according to the system unified time reference during the encapsulation process; S44. The encapsulated input event stream can be accessed and parsed by the event parsing mechanism in the WebXR running instance that is the same as the event mapping rule substructure.
7. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The S5 specifically includes: S51, the WebXR running instance parses the input event unit in the input event stream and extracts the spatial positioning field, the posture information field, and the control operation field; S52: Compare the extracted information with the event identification field in the event mapping rule substructure to preliminarily determine the event response rule entry to be verified; S53. Deeply combine the current interaction state parameters of the WebXR running instance as auxiliary conditions for judging the applicability of the event rule, wherein the interaction state parameters include the user's current position, the user's viewing angle state, and the most recent triggering event information; S54: Compare the trigger condition fields of each event response rule entry to be verified one by one, comprehensively determine whether the event type, interaction state, and input timing matching requirements are met, and determine the event response rule entry that meets the conditions; S55. Construct an interactive control instruction according to the response action field in the selected predefined event response rule. The interactive control instruction includes: a type identifier of the target component, an interactive action type, and required execution parameters.
8. The WebXR-based digital twin extension method for highway scenarios according to claim 7 is characterized in that: The interactive control instruction includes a control field for the user's viewing angle state and has the following viewing angle change mechanism: When the interactive control instruction is a perspective change instruction, extracting a target perspective control field from the perspective change instruction, wherein the perspective change instruction includes target focus position coordinates, a rotation angle value, and a field of view width setting parameter; Calculate the difference between the target view control field and the current user view state of the WebXR running instance, and construct a view transition vector and a rotation transformation matrix to implement a transition path from the current view state to the target state; In the process of constructing the perspective transformation path, an interpolation algorithm is applied to smooth the user's viewpoint movement process; Applying the perspective transformation path to the virtual camera node in the WebXR running instance to update the 3D scene view in real time by updating the camera's viewing direction, position coordinates, and projection parameters; After the perspective update is completed, the WebXR running instance adjusts the subsequent control strategy based on the current user interaction feedback, and records the perspective switching behavior in the interaction event log for behavior chain tracking and immersive control rhythm scheduling.
9. The WebXR-based digital twin extension method for highway scenarios according to claim 1 is characterized in that: The S6 specifically includes: S61. After receiving the update instruction from the server, the WebXR running instance parses the resource identification field and the resource type field in the update instruction; S62, the resource identification field is used to uniquely identify the resource module to be replaced in the Web-resolvable data structure, and the resource type field includes a structure resource type, a behavior resource type, and a script resource type; S63. The WebXR running instance locates the resource module to be replaced according to the resource identification field, and loads the corresponding updated resource package content according to the resource type field. The updated resource package content is module-level incremental data, which only includes structural difference data, behavior logic change information, and script function update code segments. S64. During the resource replacement process, the WebXR running instance replaces the resources based on the incremental update mechanism, retains the current running state, and embeds the updated resource package into the original running path by mounting it, thus achieving dynamic coverage of the 3D twin model and control logic. S65. The incremental update mechanism supports independent replacement of the following three types of resource units: Structural resource unit, used to update the model component structure and spatial layout; Behavior resource unit, used to update event mapping rules and control response paths; Script resource unit, used to update front-end logic functions, rendering scheduling strategies, and input behavior processing codes; S66. After the incremental update is completed, the WebXR running instance updates the resource index directory and synchronizes the updated corresponding resource module to the event parsing mechanism and the interactive control instruction generation logic path.
10. The WebXR-based digital twin extension method for highway scenarios according to claim 9 is characterized in that: The reference path corresponding to the resource identification field of each resource module in the Web-resolvable data structure includes a two-level structure of a primary path and a backup path, and has the following path scheduling mechanism: The WebXR running instance maintains a resource reference path for each resource identification field in the resource index directory. The resource reference path includes a primary path and a backup path. The primary path is the default priority loading path, and the backup path is used for fault-tolerant loading of resources after the primary path fails to load. The resource reference path supports a dynamic redefinition mechanism. The WebXR running instance determines whether to switch to the backup path based on the loading status feedback conditions. The status feedback conditions include the main path loading timeout, the main path resource integrity verification failure, the resource package parsing error or verification exception associated with the main path; During the path redefinition process, the WebXR instance updates the path priority tag field in the resource index directory, sets the backup path as the current primary path, and records the reason for the switch and status information; After the resource reference path is redefined, continue to load the updated resource package content pointed to by the updated path and perform the incremental replacement process; The path scheduling mechanism supports hot loading of resources without interrupting the system operation state.
Citation Information
Patent Citations
Digital twin road network automatic generation method, system and device for XR equipment
CN117036651A
Task-driven geodigital twinning scene enhancement visualization method and system
CN117237574A