A method, apparatus, device, medium, and product for restoring map sessions.
By capturing and storing map session state data in real time, and gradually reconstructing the map view and layer state, the problem of lost operation context and data timeliness in map session recovery in existing technologies is solved, and accurate recovery of map session state and business integrity are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 广东省土地调查规划院
- Filing Date
- 2026-05-12
- Publication Date
- 2026-07-17
Smart Images

Figure CN122195732B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information system technology, and in particular to a map session recovery method, apparatus, device, medium and product. Background Technology
[0002] In professional Geographic Information System (GIS) applications such as land surveys, urban planning, and environmental monitoring, users often need to perform complex spatial analyses involving multiple steps and layers based on maps. These analysis tasks are often time-consuming and may be interrupted due to terminal failures, network outages, or deliberate pauses. To ensure work continuity and avoid repetitive work, there is an urgent need for a technology that can completely preserve the user's work site and accurately restore it at any subsequent time—that is, map session recovery technology.
[0003] Currently, existing technologies for restoring map sessions typically involve saving and restoring key map parameters, such as recording and restoring the map's center point coordinates, zoom level, and the list of loaded layers. However, this method has a core flaw: it can only restore a static, outcome-based map view, failing to restore the complete sequence of user actions (i.e., the action chain) that led to that view's state, as well as the dynamic business data associated with those actions. This results in the restored scenario losing its original analytical logic and business data connections, leading to a significant deviation from the user's actual working environment before the interruption. Summary of the Invention
[0004] This invention provides a map session recovery method, apparatus, device, and medium that can solve the technical problem that existing map session recovery technologies cannot reproduce the complete user operation sequence and the dynamic business data associated with the operation process, resulting in the loss of the original operation context and data timeliness in the recovered analysis scenario.
[0005] In a first aspect, embodiments of the present invention provide a map session recovery method, including:
[0006] During the user's interaction with the current map session, session state data is captured in real time to generate a session state snapshot package for the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream;
[0007] The session state snapshot package is associated with a pre-generated session identifier, and the session state snapshot package is stored in an independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session;
[0008] When a session recovery instruction for the current map session is received, the corresponding session state snapshot package is loaded from the corresponding independent storage area according to the session identifier of the current map session. Based on the session state snapshot package, the map view and layer state are gradually reconstructed and associated with the corresponding business data to realize the recovery of the current map session.
[0009] This invention continuously records the user's state during interaction to ensure the integrity and timeliness of the data source. User operation data (including basic map data, layer operation data, and operation event streams) is used to restore the basic map view, layer configuration, and operation sequence. Business data indexes are used to lightweightly associate external dynamic business data. Service configuration data is used for subsequent compatibility adaptation. These three elements together constitute the "full-dimensional" data foundation required for recovery. A unique session identifier enables physical isolation and logical addressing of session data, supporting parallel management of multiple sessions and avoiding data confusion. "Gradual reconstruction" rather than a one-time loading ensures the logic and accuracy of the recovery process. Association with business data guarantees the business integrity and real-time performance of the recovery scenario. This invention addresses the problem that existing map session recovery technologies cannot reproduce the complete user operation sequence and the associated dynamic business data during the operation, leading to the loss of the original operation context and data timeliness in the post-recovery analysis scenario, thus improving the accuracy of map session state recovery.
[0010] In some preferred embodiments of the first aspect, the step of progressively reconstructing the map view and layer states based on the session state snapshot package and associating them with corresponding business data to restore the current map session specifically involves:
[0011] The first session interface is formed based on the base map data using a preset map rendering engine; wherein, the base map data includes a map spatial reference system, base view data, and base layer data.
[0012] Based on the layer operation data, on the first session interface, the layer state and rendering style of each layer are configured sequentially according to the operation order of the operation event flow to form the second session interface;
[0013] If the business data index of the current map session is not empty, then the business data is loaded according to the business data index, and the business data is associated with the second session interface to realize the restoration of the current map session.
[0014] This invention prioritizes restoring the basic map framework (base map, spatial reference, view extent), enabling users to receive visual feedback in a shorter time and improving the smoothness of the restoration experience. By replaying the operation event flow, it strictly restores the layer visibility, overlay order, transparency, and rendering style according to the original operation sequence, accurately restoring the user's operation logic and layer configuration, achieving "operation chain-level" restoration. By dynamically fetching the latest business data only when needed, it avoids invalid loading, ensuring the timeliness of the data and its accurate binding with the map scene.
[0015] In some preferred embodiments of the first aspect, generating the first session interface based on the base map data using a preset map rendering engine specifically involves:
[0016] The map rendering engine's interface is called to initialize the map container, and the corresponding layer is loaded into the map container according to the basic layer data;
[0017] Based on the basic view data and the map spatial reference system, the view of the map container after loading the layer is adjusted to the corresponding position and zoom level to form the first session interface.
[0018] This invention provides a visual platform for subsequent recovery by creating a map rendering environment and loading the core base map; it also accurately locates the map view to the historical position and zoom level, restoring the map scene before the user's interruption.
[0019] In some preferred embodiments of the first aspect, business data is loaded according to the business data index, and the business data is associated with the second session interface to restore the current map session, specifically as follows:
[0020] Based on the business data index, obtain the corresponding business data identifier and the spatial coordinates associated with the business data;
[0021] Based on the business data identifier, a data acquisition request is sent to the corresponding business data server.
[0022] When business data is received from the business data server, it is rendered and associated with the corresponding position in the second session interface according to the spatial coordinates.
[0023] This invention embodiment actively retrieves the latest version of business data (such as evidence photos and annotation information) by sending a data acquisition request to the server, ensuring the real-time nature of the data; and accurately "mounts" the acquired business data to the corresponding location on the map, achieving deep integration of business data and spatial scene.
[0024] In some preferred embodiments of the first aspect, before progressively reconstructing the map view and layer states based on the session state snapshot package and associating them with corresponding business data to restore the current map session, the method further includes:
[0025] Read service configuration data from the session state snapshot package and compare the service configuration data with the real-time configuration data of the current server.
[0026] When a configuration item with a discrepancy is identified, the corresponding adaptation plugin for that configuration item is invoked. The adaptation plugin is then used to convert the format of the data in the session state snapshot package that depends on the corresponding service, so as to adapt it to the current server.
[0027] This invention identifies compatibility risks by automatically detecting changes in server-side configurations (such as version, layer structure, and field definitions); and automatically converts historical data formats to be compatible with the current service environment for specific types of configuration differences (such as version upgrades and layer renaming) through a plug-in architecture.
[0028] Among the preferred options in the first aspect are:
[0029] When a session switching instruction is received, a preset context switcher references a pre-built state instance of the target map session based on the session identifier of the target map session to switch to the target map session.
[0030] This invention enables rapid overall switching of complete application states (map views, layers, tool states, etc.) between different sessions by utilizing session isolation storage and pre-built state instances, with the switching process transparent to the user.
[0031] Secondly, embodiments of the present invention provide a map session recovery device, including a state snapshot acquisition module, an independent storage module, and a map session recovery module, wherein...
[0032] The state snapshot acquisition module is used to capture session state data in real time during the user's interaction with the current map session, so as to generate a session state snapshot package of the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream;
[0033] The independent storage module is used to associate the session state snapshot package with a pre-generated session identifier and store the session state snapshot package in an independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session;
[0034] The map session recovery module is used to load the corresponding session state snapshot package from the corresponding independent storage area according to the session identifier of the current map session when it receives the session recovery instruction of the current map session. Based on the session state snapshot package, the map view and layer state are gradually reconstructed and associated with the corresponding business data to realize the recovery of the current map session.
[0035] This invention utilizes a state snapshot acquisition module to continuously record the state during user interaction, ensuring the integrity and timeliness of the data source for recovery. User operation data (including basic map data, layer operation data, and operation event streams) is used to reconstruct the basic map view, layer configuration, and operation sequence. Business data indexes are used for lightweight association with external dynamic business data. Service configuration data is used for subsequent compatibility adaptation. These three elements together constitute the "full-dimensional" data foundation required for recovery. An independent storage module uses a unique session identifier to achieve physical isolation and logical addressing of session data, supporting parallel management of multiple sessions and avoiding data confusion. The map session recovery module performs "gradual reconstruction" rather than a one-time loading, ensuring the logic and accuracy of the recovery process. By associating with business data, it guarantees the business integrity and real-time performance of the recovery scenario.
[0036] Thirdly, embodiments of the present invention provide a terminal device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0037] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the map session recovery method as described in any of the above.
[0038] Fourthly, embodiments of the present invention provide a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device or apparatus containing the computer-readable storage medium to perform the map session recovery method as described in any of the preceding claims.
[0039] Fifthly, embodiments of the present invention provide a computer program product, including a computer program or instructions, wherein the computer program or instructions execute the map session recovery method as described in any of the preceding claims.
[0040] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of a map session recovery method provided in an embodiment of the present invention;
[0042] Figure 2 This is a structural diagram of a map session recovery device provided in an embodiment of the present invention. Detailed Implementation
[0043] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] Example 1:
[0045] like Figure 1 As shown, a map session recovery method provided by an embodiment of the present invention includes the following steps:
[0046] S101, during the interaction between the user and the current map session, session state data is captured in real time to generate a session state snapshot package of the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream;
[0047] In one specific embodiment, session state data is captured in real time to generate a session state snapshot package of the current map session, including:
[0048] (1) Structured record of map view status:
[0049] Theme Map: The system identifier for the current theme map.
[0050] Viewport parameters: Center point coordinates: expressed in latitude and longitude; Zoom level: numerical value indicating the degree of map zoom; Map rotation angle: expressed in degrees; Field of view: a rectangular area expressed in latitude and longitude coordinates (e.g., "minLat:39.80, minLng:116.30, maxLat:40.00, maxLng:116.50").
[0051] Layer Status Tree: Records the following information for all layers in a tree structure: Layer Name: The display name of the layer; Layer Identifier: The system's unique identifier for the layer; Layer Type: Records the corresponding type of the layer, such as raster layer, vector layer, annotation layer, evidence photo layer, and other layer types; Visibility Status: A Boolean value indicating whether the layer is displayed; Overlay Order: A numerical value indicating the layer's overlay level in the view; Transparency: A numerical range (e.g., 0 - 1) indicating the layer's transparency; Rendering Style: For vector layers, records style information such as color, outline width, and annotation rules; Timeline Status: Such as the current display year or time point for multi-temporal images.
[0052] (2) Abstract recording of user interaction operation event flow:
[0053] The concept of Operation Event Stream is introduced to record key user intents in the form of events, rather than simply storing the state results after the operation, thus enabling complete backtracking of the operation context. Each operation event is an independent JSON object containing the following fields:
[0054] eventId: A unique identifier for the operation event;
[0055] eventType: The type of operation event, such as "LAYER_VISIBILITY_CHANGE" (layer visibility change), "MAP_ZOOM" (map zoom), "MAP_PAN" (map pan), etc.;
[0056] target: The target of the operation, such as layer name, map, etc.;
[0057] `eventParams`: Parameters for operation events. For layer visibility changes, the value is a boolean (e.g., `true`); for map zooming, the value is the zoom level (e.g., `13`); for label creation, the value is the label's coordinates (e.g., "lat:39.91, lng:116.41"), content (e.g., "abnormal farmland area"), and style (e.g., color #FF0000); for business data, it stores the corresponding unique ID (e.g., "data_001"), etc.
[0058] timestamp: The timestamp at which the operation occurred;
[0059] preStateId: The snapshot ID of the state before the operation (used to trace back the state changes before and after the operation).
[0060] The operation event stream uses the session ID as the association key and stores the operation event objects in the namespace corresponding to the session in ascending order of timestamp, forming a complete operation event stream for that session. At the same time, an index is created for the operation event stream (with eventType and timestamp as index fields) to support fast querying of events by event type and time range.
[0061] (3) Indexed storage of business data associations:
[0062] For business data associated with map sessions (such as annotation information, evidence photos, search results, question-and-answer records, and spatial analysis reports), an indexed storage strategy is adopted, storing only the data index rather than the data itself to ensure data timeliness and storage efficiency, and avoid data redundancy. Specifically:
[0063] Labeling information: Stores the unique label ID (e.g., “anno_001”), the associated spatial feature ID (e.g., “feature_005”), display configuration (e.g., color #FF0000, font size 12px, label type “point label”), and creation time (e.g., “2024-05-20 14:38:20”).
[0064] Evidence photos: storage file ID (e.g., "photo_003") or access URL (e.g., "http: / / gis-server / photos / 202405 / photo_003.jpg"), anchor point coordinates on the map (e.g., "lat:39.92, lng:116.42"), photo shooting time (e.g., "2024-05-19 10:20:30"), and photographer (e.g., "user_456").
[0065] Search results: Stores the search task ID (e.g., "search_002"), search keywords (e.g., "Region A Farmland"), number of search results (e.g., 50), a list of unique IDs for the search result data (e.g., "[data_001, data_002,..., data_050]"), and search time (e.g., "2024-05-20 14:40:15").
[0066] During recovery, the system dynamically requests the latest data from the server based on these indexes to ensure the timeliness of the data (e.g., if the evidence photo is updated, the latest version can be obtained through the file ID), while reducing the front-end storage footprint (the size of the index data is only 5%-10% of the original data).
[0067] (4) Snapshot of theme service configuration:
[0068] To address compatibility issues in restoring historical sessions caused by changes in server-side configuration (such as map service version upgrades, layer structure adjustments, and field name modifications), map service configuration snapshots that the session depends on are recorded synchronously when saving map state snapshots.
[0069] Service configuration snapshot definition: A service configuration snapshot includes serviceSnapshotId (a unique snapshot identifier), serviceList (a list of all map services that the session depends on), and snapshotTimestamp (a snapshot generation timestamp). Each service configuration in serviceList includes serviceId (a unique service identifier), serviceType (service type, such as WMS or WMTS), serviceUrl (service endpoint address), serviceVersion (service version number), layerConfig (layer configuration, such as a list of layer names and layer field definitions), and serviceFingerprint (service configuration hash value, used to detect service configuration changes).
[0070] Snapshot association and update: Service configuration snapshots are bound to view state snapshots (each state snapshot is associated with a serviceSnapshotId); when the configuration of the map service that the session depends on changes (detected by comparing serviceFingerprint), the system automatically generates a new service configuration snapshot and associates it with subsequent state snapshots to ensure that each state snapshot has a corresponding service configuration record.
[0071] S102, associate the session state snapshot package with the pre-generated session identifier, and store the session state snapshot package in the independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session;
[0072] In one specific embodiment, a unique identifier is assigned to each newly created session, using a combined encoding method of "user identifier + session sequence + timestamp" to ensure that data from different sessions is physically isolated and to avoid cross-session data confusion. Simultaneously, a lightweight metadata object (SessMeta) is maintained for each session, containing a unique session identifier, session name (editable by the user), creation time, last operation time, and session status (active / dormant / archived).
[0073] In one specific implementation, the browser's IndexedDB or localStorage is used to create a separate database or storage namespace for each session ID. All session state data (including map view state, operation event streams, business data indexes, etc.) is stored with the session ID as a prefix or key. For example, an object storage space named after the session ID is created in IndexedDB to store relevant data, achieving physical data isolation and avoiding cross-session data pollution. In front-end state management (such as Vuex, Pinia, or Redux Toolkit), a separate state tree is maintained for each session.
[0074] S103, when a session recovery instruction for the current map session is received, the corresponding session state snapshot package is loaded from the corresponding independent storage area according to the session identifier of the current map session, so as to gradually reconstruct the map view and layer state according to the session state snapshot package and associate it with the corresponding business data to realize the recovery of the current map session.
[0075] Preferably, before performing session recovery, the system will perform a session state snapshot package integrity check: The system reads the corresponding state snapshot package (including ViewState object, operation event stream index, service configuration snapshot, and data index list) from the browser storage (IndexedDB / localStorage) based on the session ID; it checks the "structural integrity" (e.g., whether ViewState is missing required fields such as spatialReference, and whether the service configuration snapshot is associated with a valid serviceFingerprint) and "data consistency" (e.g., whether the preStateId of the operation event stream points to the historical state in the snapshot package); if the snapshot is corrupted (e.g., missing structure, hash verification failure), the system generates a "snapshot corruption report", prompting the user that "the current session snapshot is unavailable, you can try loading a historical backup snapshot", and provides a list of backup snapshots (sorted based on snapshot generation time).
[0076] In this embodiment, before gradually reconstructing the map view and layer state based on the session state snapshot package and associating them with the corresponding business data to restore the current map session, the method further includes: reading service configuration data from the session state snapshot package and comparing the service configuration data with the real-time configuration data of the current server; when a configuration item with a difference between the previous and current configuration items is identified, calling the adaptation plugin corresponding to the configuration item, so as to convert the format of the data in the session state snapshot package that depends on the corresponding service through the adaptation plugin, so as to adapt to the current server.
[0077] In one specific embodiment, service configuration change detection is performed as follows: The serviceList (containing the serviceUrl, serviceVersion, layerConfig, and serviceFingerprint of each dependent service) of the "service configuration snapshot" in the snapshot package is retrieved; the system sends a "configuration verification request" to the server to obtain the real-time configuration of the current online service (including the latest serviceFingerprint, layer list, and field definitions); differences are identified through "fingerprint comparison + field-by-field verification". If the serviceFingerprint is consistent, it is determined that the service configuration has not changed, and the system directly enters the "state loading" stage; if the serviceFingerprint is inconsistent, the difference type is further analyzed, such as "service version upgrade" (e.g., WMS from 1.1.0 → 1.3.0), "layer change" (e.g., the old layer old_land is deleted / new_land is added), and "field modification" (e.g., the land_area field is renamed to area), and the difference results are stored in the "change list".
[0078] In one specific embodiment, if a service configuration difference is detected, the historical session state is "converted to a format compatible with the current service" through a plug-in adaptation engine to avoid recovery failures caused by configuration changes. The adaptation engine architecture adopts a "core scheduling + plug-in extension" model: the core scheduling module is responsible for parsing the "change list" and matching corresponding adaptation plug-ins; the plug-in module provides specific adaptation logic for different difference types (supporting dynamic addition of plug-ins, such as no need to modify the core code when adding WMTS service adaptation later). The service configuration adaptation strategy is shown in the table below:
[0079] Table 1. Example of Service Configuration Adaptation Strategy
[0080]
[0081] In this embodiment, the step of progressively reconstructing the map view and layer states based on the session state snapshot package and associating them with corresponding business data to restore the current map session specifically involves: forming a first session interface based on the basic map data using a preset map rendering engine; wherein the basic map data includes a map spatial reference system, basic view data, and basic layer data; configuring the layer state and rendering style of each layer sequentially on the first session interface according to the operation sequence of the operation event flow based on the layer operation data to form a second session interface; if the business data index of the current map session is not empty, loading the business data according to the business data index and associating the business data with the second session interface to restore the current map session.
[0082] In this embodiment, generating the first session interface based on the basic map data using a preset map rendering engine specifically involves: calling the interface of the map rendering engine to initialize the map container, and loading the corresponding layer into the map container according to the basic layer data; adjusting the view of the map container after loading the layer to the corresponding position and zoom level according to the basic view data and the map spatial reference system to form the first session interface.
[0083] In this embodiment, business data is loaded according to the business data index, and the business data is associated with the second session interface to restore the current map session. Specifically, the process involves: obtaining the corresponding business data identifier and the spatial coordinates associated with the business data according to the business data index; sending a data acquisition request to the corresponding business data server according to the business data identifier; and rendering and associating the business data at the corresponding position on the second session interface according to the spatial coordinates when the business data returned by the business data server is received.
[0084] In one specific embodiment, the step of progressively reconstructing the map view and layer states based on the session state snapshot package and associating them with corresponding business data to restore the current map session specifically involves:
[0085] (1) Loading priority definition: The system will restore content according to "user perceived priority" to ensure that users can quickly see the core interface:
[0086] P0 (highest priority): Map base view (spatialReference, viewportParams), core base layer (such as raster layer);
[0087] P1 (High Priority): The visibility, stacking order, and transparency of business layers (such as administrative division vector layers and thematic annotation layers);
[0088] P2 (Medium Priority): Rendering style of business layers (such as vector layer colors, annotation fonts);
[0089] P3 (low priority): Related business data (such as evidence photos, search results, and question and answer records).
[0090] (2) Priority loading process: First, load P0 content: synchronously set the map spatial reference system, adjust the viewport to the historical position (such as center point [116.40,39.90], zoom level 12), load the basic terrain layer, and ensure that the user sees the "familiar map interface" within 1-2 seconds; load P1 and P2 content in parallel: asynchronously restore the visibility of business layers (such as displaying the "farmland red line layer" and hiding the "temporary building layer"), and apply rendering styles (such as setting the "land type patch layer" to blue and 1px wide); lazy load P3 content: only load when the user triggers the "related data display conditions" (such as zooming to the area where the evidence photo is located → loading the corresponding photo, clicking the "search history" button → loading past search results), to avoid interface lag caused by loading a large amount of data at once; display the "loading" placeholder when loading, and display the "data loading failed, click to retry" prompt when loading fails.
[0091] (3) Operation event flow association: While loading the state, the system loads the operation event flow index into memory and associates it with the current state (such as marking "the current state corresponds to the result after the 12th operation event"), providing a basis for subsequent "backtracking of historical operations".
[0092] In this embodiment, it further includes: when a session switching instruction is received, a preset context switcher references a pre-built state instance of the target map session based on the session identifier of the target map session to switch to the target map session.
[0093] In one specific embodiment, when a user switches sessions, the system uses a context switcher to replace the entire application state (including map view, layer state, tool state, etc.) with a snapshot of the target session's state. Specifically, an independent state instance is created for each session in the state management library, and a seamless switch is achieved by modifying the current state reference to the target session's state instance.
[0094] Preferably, after the map session is restored, a restoration integrity check and user feedback are performed:
[0095] First, the system iterates through all items to be restored and categorizes them by "restore result": Successful items: content that is restored directly without adaptation or restored to normal after adaptation (such as basic views, adapted administrative division layers); Adapted items: content that is restored to normal after being processed by the adaptation engine (such as renamed layers, service requests after version upgrades); Items to be intervened: content that cannot be automatically restored (such as deleted layers without replacements, fields with missing mapping rules, unusable evidence photos).
[0096] Finally, after the recovery is complete, a "Recovery Report" pop-up window will appear in the lower right corner of the map interface (users can close / collapse it) to output the session recovery report.
[0097] This invention continuously records the user's state during interaction to ensure the integrity and timeliness of the data source. User operation data (including basic map data, layer operation data, and operation event streams) is used to restore the basic map view, layer configuration, and operation sequence. Business data indexes are used to lightweightly associate external dynamic business data. Service configuration data is used for subsequent compatibility adaptation. These three elements together constitute the "full-dimensional" data foundation required for recovery. A unique session identifier enables physical isolation and logical addressing of session data, supporting parallel management of multiple sessions and avoiding data confusion. "Gradual reconstruction" rather than a one-time loading ensures the logic and accuracy of the recovery process. Association with business data guarantees the business integrity and real-time performance of the recovery scenario. This invention addresses the problem that existing map session recovery technologies cannot reproduce the complete user operation sequence and the associated dynamic business data during the operation, leading to the loss of the original operation context and data timeliness in the post-recovery analysis scenario, thus improving the accuracy of map session state recovery.
[0098] Example 2:
[0099] like Figure 2 As shown, this embodiment provides a map session recovery device, including a state snapshot acquisition module 201, an independent storage module 202, and a map session recovery module 203, wherein...
[0100] The state snapshot acquisition module 201 is used to capture session state data in real time during the interaction between the user and the current map session, so as to generate a session state snapshot package of the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream;
[0101] The independent storage module 202 is used to associate the session state snapshot package with a pre-generated session identifier and store the session state snapshot package in the independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session;
[0102] The map session recovery module 203 is used to load the corresponding session state snapshot package from the corresponding independent storage area according to the session identifier of the current map session when it receives the session recovery instruction of the current map session, so as to gradually reconstruct the map view and layer state according to the session state snapshot package and associate it with the corresponding business data to realize the recovery of the current map session.
[0103] In this embodiment, the map session recovery module 203 reconstructs the map view and layer states step by step according to the session state snapshot package, and associates them with the corresponding business data to realize the recovery of the current map session. Specifically, the map session recovery module 203 forms a first session interface based on the basic map data through a preset map rendering engine; wherein, the basic map data includes a map spatial reference system, basic view data, and basic layer data; according to the layer operation data, on the first session interface, the layer state and rendering style of each layer are configured sequentially according to the operation order of the operation event flow to form a second session interface; if the business data index of the current map session is not empty, the business data is loaded according to the business data index, and the business data is associated with the second session interface to realize the recovery of the current map session.
[0104] In this embodiment, the map session recovery module 203 generates a first session interface based on the basic map data using a preset map rendering engine. Specifically, the map session recovery module 203 calls the interface of the map rendering engine to initialize the map container and loads the corresponding layer into the map container according to the basic layer data. Based on the basic view data and the map spatial reference system, the view of the map container after loading the layer is adjusted to the corresponding position and zoom level to form the first session interface.
[0105] In this embodiment, the map session recovery module 203 loads business data according to the business data index and associates the business data with the second session interface to restore the current map session. Specifically, the map session recovery module 203 obtains the corresponding business data identifier and the spatial coordinates associated with the business data according to the business data index; sends a data acquisition request to the corresponding business data server according to the business data identifier; and when it receives the business data returned by the business data server, it renders and associates the data at the corresponding position on the second session interface according to the spatial coordinates.
[0106] For a more detailed explanation of the working principle and procedures of this embodiment, please refer to the relevant description in Embodiment 1.
[0107] This invention utilizes a state snapshot acquisition module 201 to continuously record the state during user interaction, ensuring the integrity and timeliness of the data source for recovery. User operation data (including basic map data, layer operation data, and operation event streams) is used to reconstruct the basic map view, layer configuration, and operation sequence. Business data indexes are used for lightweight association with external dynamic business data. Service configuration data is used for subsequent compatibility adaptation. These three elements together constitute the "full-dimensional" data foundation required for recovery. An independent storage module 202 uses a unique session identifier to achieve physical isolation and logical addressing of session data, supporting parallel management of multiple sessions and avoiding data confusion. The map session recovery module 203 performs "gradual reconstruction" rather than a one-time loading, ensuring the logic and accuracy of the recovery process. By associating with business data, it guarantees the business integrity and real-time performance of the recovery scenario.
[0108] Example 3:
[0109] This embodiment provides a terminal device, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0110] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the map session recovery method as described in any of the above.
[0111] Example 4:
[0112] This invention provides a computer-readable storage medium including a stored computer program, wherein the computer program, when running, controls the device or apparatus containing the computer-readable storage medium to perform the map session recovery method as described above.
[0113] Example 5:
[0114] This invention provides a computer program product, including a computer program or instructions, wherein the computer program or instructions execute the map session recovery method as described in any of the above embodiments.
[0115] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0116] 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 descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that 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 for those skilled in the art.
Claims
1. A map session recovery method, characterized in that, include: During the user's interaction with the current map session, session state data is captured in real time to generate a session state snapshot package for the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream; The session state snapshot package is associated with a pre-generated session identifier, and the session state snapshot package is stored in an independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session; When a session recovery instruction for the current map session is received, the corresponding session state snapshot package is loaded from the corresponding independent storage area according to the session identifier of the current map session. Based on the session state snapshot package, the map view and layer state are gradually reconstructed and associated with the corresponding business data to realize the recovery of the current map session. Specifically, based on the session state snapshot package, the map view and layer states are gradually reconstructed and associated with the corresponding business data to restore the current map session. This involves: using a preset map rendering engine, a first session interface is formed based on the basic map data; the basic map data includes a map spatial reference system, basic view data, and basic layer data; based on the layer operation data, on the first session interface, the layer state and rendering style of each layer are configured sequentially according to the operation sequence of the operation event flow to form a second session interface; if the business data index of the current map session is not empty, the business data is loaded according to the business data index, and the business data is associated with the second session interface to restore the current map session. Specifically, generating the first session interface based on the basic map data using a preset map rendering engine involves: calling the interface of the map rendering engine to initialize the map container, and loading the corresponding layer into the map container according to the basic layer data; adjusting the view of the map container after loading the layer to the corresponding position and zoom level according to the basic view data and the map spatial reference system to form the first session interface.
2. The map session recovery method as described in claim 1, characterized in that, Based on the business data index, business data is loaded and associated with the second session interface to restore the current map session, specifically as follows: Based on the business data index, obtain the corresponding business data identifier and the spatial coordinates associated with the business data; Based on the business data identifier, a data acquisition request is sent to the corresponding business data server. When business data is received from the business data server, it is rendered and associated with the corresponding position in the second session interface according to the spatial coordinates.
3. The map session recovery method as described in claim 2, characterized in that, Before reconstructing the map view and layer states step by step based on the session state snapshot package and associating them with the corresponding business data to restore the current map session, the process also includes: Read service configuration data from the session state snapshot package and compare the service configuration data with the real-time configuration data of the current server. When a configuration item with a discrepancy is identified, the corresponding adaptation plugin for that configuration item is invoked. The adaptation plugin is then used to convert the format of the data in the session state snapshot package that depends on the corresponding service, so as to adapt it to the current server.
4. The map session recovery method as described in claim 1, characterized in that, Also includes: When a session switching instruction is received, a preset context switcher references a pre-built state instance of the target map session based on the session identifier of the target map session to switch to the target map session.
5. A map session recovery device, characterized in that, It includes a status snapshot acquisition module, an independent storage module, and a map session recovery module, among which, The state snapshot acquisition module is used to capture session state data in real time during the user's interaction with the current map session, so as to generate a session state snapshot package of the current map session; wherein, the session state snapshot package includes user operation data, business data index and service configuration data; the user operation data includes basic map data, layer operation data and operation event stream; The independent storage module is used to associate the session state snapshot package with a pre-generated session identifier and store the session state snapshot package in an independent storage area corresponding to the session identifier; wherein, the session identifier uniquely corresponds to the current map session; The map session recovery module is used to load the corresponding session state snapshot package from the corresponding independent storage area according to the session identifier of the current map session when it receives the session recovery instruction of the current map session, so as to gradually reconstruct the map view and layer state according to the session state snapshot package and associate it with the corresponding business data to realize the recovery of the current map session. Specifically, based on the session state snapshot package, the map view and layer states are gradually reconstructed and associated with the corresponding business data to restore the current map session. This involves: using a preset map rendering engine, a first session interface is formed based on the basic map data; the basic map data includes a map spatial reference system, basic view data, and basic layer data; based on the layer operation data, on the first session interface, the layer state and rendering style of each layer are configured sequentially according to the operation sequence of the operation event flow to form a second session interface; if the business data index of the current map session is not empty, the business data is loaded according to the business data index, and the business data is associated with the second session interface to restore the current map session. Specifically, generating the first session interface based on the basic map data using a preset map rendering engine involves: calling the interface of the map rendering engine to initialize the map container, and loading the corresponding layer into the map container according to the basic layer data; adjusting the view of the map container after loading the layer to the corresponding position and zoom level according to the basic view data and the map spatial reference system to form the first session interface.
6. A terminal device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the map session recovery method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device or apparatus containing the computer-readable storage medium to perform the map session recovery method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions execute the map session recovery method as described in any one of claims 1 to 4.