Browser session state storage method, browser session state recovery method, browser session state storage equipment, browser session state recovery equipment and medium

By installing a session state management plugin in the browser, the system automatically queries and serializes the state data of user content pages, generates a standard data file, and restores it in the target browser. This solves the problem of incomplete browser access state and enables convenient session state management across devices.

CN120994468APending Publication Date: 2025-11-21SHANGHAI DAJIAYING INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511110315.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing browsers, under cross-terminal and cross-platform collaborative working modes, the saving and restoration of browser access states suffers from incomplete content saving and significant functional limitations, making it difficult to meet the personalized and convenient needs for saving and restoring browser content.

Method used

By installing a session state management plugin in the browser, the system automatically queries and serializes the URL of the currently opened user content page, obtains cookie data, local storage data, and session storage data, generates a standard data file, and restores it in the target browser, achieving one-click restoration of the browser state.

Benefits of technology

It enables complete saving and restoration of browser session state, reduces the tedious operations of repeated login and data input, provides a more comprehensive and convenient browser state management solution, and supports session state migration across devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994468A_ABST
    Figure CN120994468A_ABST
Patent Text Reader

Abstract

The invention discloses a browser session state storage and recovery method and device and a medium, and relates to the field of computers.The browser session state storage method comprises the steps that in response to a selection instruction for a session state storage function in a session state management plug-in, URLs of all user content pages currently opened in a first browser are inquired and obtained; obtaining current session state data of each URL by calling a state information obtaining interface provided by a first browser; and after serializing the session state data of each URL into standard data in a target data format, generating each standard data into a target data file, and carrying out file storage on the target data file. According to the technical scheme provided by the embodiment of the invention, the capability of keeping consistent browsing experience of the user at different times and among different devices can be remarkably improved, the trouble of repeated login and data input is reduced, and a more complete browsing state management solution is provided for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, device, and medium for saving and restoring browser session state. Background Technology

[0002] With the popularization of cross-terminal and cross-platform collaborative work modes, browsers have gradually become the core carrier of digital processes, which has made it increasingly difficult to save and restore the browser access state in complex application scenarios.

[0003] Most mainstream browsers have built-in bookmark and history features. The bookmark feature allows users to manually save webpage URLs (Uniform Resource Locators) for later access, while the history feature automatically records the URLs of webpages visited by the user and the time of access, making it convenient to look up later.

[0004] In the process of realizing this invention, the inventors discovered that although the prior art provides the saving and restoration of browser history in some aspects, it has obvious shortcomings in practical applications. These shortcomings are mainly manifested in insufficient integrity of the saved content and significant functional limitations, making it difficult to meet people's growing demand for personalized and convenient browser content saving and restoration. Summary of the Invention

[0005] This invention provides a method, device, and medium for saving and restoring browser session state, enabling one-click saving and restoration of complete session data across all pages opened by the browser.

[0006] According to one aspect of the present invention, a method for saving browser session state is provided, which is executed by a session state management plugin installed as an extension in a first browser. The session state management plugin is built based on a standard browser development framework. The method includes:

[0007] In response to the selection command for the session state saving function in the session state management plugin, query and retrieve the URLs of all currently open user content pages in the first browser;

[0008] By calling the status information retrieval interface provided by the first browser, the current session status data of each URL is obtained. The session status data includes Cookies data, local storage data, and session storage data.

[0009] After serializing the session state data of each URL into standard data in the target data format, each standard data is generated into a target data file, and the target data file is stored.

[0010] In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

[0011] According to another aspect of the present invention, a method for restoring browser session state is also provided, executed by a session state management plugin extended and installed in a second browser. This session state management plugin is built based on a standard browser development framework. The method includes:

[0012] In response to the selection command for the session state recovery function in the session state management plugin, the target data file is obtained through at least one human-computer interaction operation;

[0013] The target data file includes the URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes cookie data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0014] By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, so as to restore all user content pages at once.

[0015] According to another aspect of the present invention, a device for saving browser session state is provided, configured in a session state management plugin extended and installed in a first browser. The session state management plugin is built based on a standard browser development framework. The device includes:

[0016] The page URL collection module is used to query and obtain the URLs of all user content pages currently open in the first browser in response to the selection instruction of the session state management plugin's session state saving function;

[0017] The state data extraction module is used to obtain the current session state data of each URL by calling the state information acquisition interface provided by the first browser. The session state data includes Cookies data, local storage data and session storage data.

[0018] The data standardization and encapsulation module is used to serialize the session state data of each URL into standard data in the target data format, generate the standard data into a target data file, and store the target data file.

[0019] In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

[0020] According to another aspect of the present invention, a browser session state recovery device is provided, configured in a session state management plugin extended and installed in a second browser. The session state management plugin is built based on a standard browser development framework. The device includes:

[0021] The target data acquisition module is used to acquire the target data file in response to the selection command of the session state recovery function in the session state management plugin through at least one human-computer interaction operation;

[0022] The target data file includes the URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes cookie data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0023] The data recovery module is used to restore the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser, so as to restore all user content pages at once.

[0024] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0025] At least one processor; and

[0026] A memory communicatively connected to the at least one processor; wherein,

[0027] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform a method for saving or restoring browser session state as described in any embodiment of the present invention.

[0028] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement a method for saving or restoring a browser session state as described in any embodiment of the present invention.

[0029] According to another aspect of the present invention, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the steps of the method as described in any embodiment of the present invention.

[0030] The technical solution of this invention, when the user selects the session state saving function, automatically queries the URLs of all currently opened user content pages by the session state management plugin installed in the first browser, obtains the current session state data of each URL by calling the state information acquisition interface provided by the first browser, and serializes this data into a target data file in a standard format for storage. When the user selects the session state recovery function for the target data file in the second browser using the same plugin, all previously saved user content pages can be completely restored in the second browser at once based on the saved session state data of each page. This novel method of saving and restoring browser session state successfully solves the problems of incomplete session state saving, loss of login state, and difficulty in cross-device migration existing in the prior art. It significantly simplifies the user process through one-click operation, not only avoiding the tedious operation of repeated login and data re-entry, but also providing users with a more comprehensive and convenient browser state management solution.

[0031] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a flowchart of a method for saving browser session state according to Embodiment 1 of the present invention;

[0034] Figure 2 This is a flowchart of a browser session state recovery method provided according to Embodiment 2 of the present invention;

[0035] Figure 3 This is a flowchart of another browser session state recovery method provided according to Embodiment 3 of the present invention;

[0036] Figure 4 This is a schematic diagram of a browser session state saving device according to Embodiment 4 of the present invention;

[0037] Figure 5 This is a schematic diagram of a browser session state recovery device according to Embodiment 5 of the present invention;

[0038] Figure 6 This is a schematic diagram of the structure of an electronic device that implements a method for saving and restoring browser session state according to an embodiment of the present invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] Example 1

[0042] Figure 1 This is a flowchart of a method for saving browser session state according to Embodiment 1 of the present invention. This embodiment can be applied to the situation of saving all session state data of each user content page currently displayed in a browser in a file format, including but not limited to: session migration when changing devices, state recovery after browser crash, etc. This method can be executed by a browser session state saving device, which can be implemented in hardware and / or software, and can generally be configured in a session state management plugin that is pre-installed in the browser.

[0043] Correspondingly, such as Figure 1 As shown, the method includes:

[0044] S110. In response to the selection instruction for the session state saving function in the session state management plugin, query and obtain the URLs of all currently open user content pages in the first browser.

[0045] In this context, a session state management plugin can be understood as a small functional extension module (i.e., a "plugin") installed in a browser. It adds new functionality to the browser while maintaining its original architecture. During browser operation, such plugins can securely access specific functions and user data without modifying the browser's core code. In this embodiment, to ensure the universality and compatibility of the session state management plugin, it can be built based on a standard browser development framework.

[0046] A URL can be understood as an address identifier for a standard resource on the Internet, typically represented as a webpage link starting with "http: / / " or "https: / / ". Each URL uniquely corresponds to a network resource, such as a webpage, an image, or an API interface. In this solution, URLs are used to identify the webpages currently open by the user, so that the session state management plugin can accurately track and manage the state data of each page. The primary browser in this solution can be understood as the browser initially used by the user that requires session state saving.

[0047] User content pages correspond to special function pages used to access browser internal configuration or modulation information. They can be understood as pages that users choose to open and view to achieve specific user functions. Generally, the prefix information in the URL can be used to identify whether the currently opened page in the browser is a special function page.

[0048] In a specific example, if the primary browser is Chrome, then pages in the format "chrome: / / XXXX" are special function pages. Furthermore, all pages except for those with special functions can be considered user content pages.

[0049] Understandably, when a user is using the current browser (i.e., the "first browser"), if they need to save the entire webpage state of all open user content pages, they can trigger the save command through the session state management plugin in the browser extension bar of the first browser. For example, by clicking the "One-Click Save" button on the human-computer interaction interface that pops up by the session state management plugin, a selection command for the session state saving function in the session state management plugin is triggered. At this time, the session state management plugin will respond immediately and automatically collect the URL information of all currently open user content pages.

[0050] S120. By calling the status information retrieval interface provided by the first browser, obtain the current session status data for each URL. The session status data includes Cookies data, local storage data, and session storage data.

[0051] The state information acquisition interface can be understood as a set of standard methods provided by the browser to plugins or applications to securely read the state information of currently or previously opened web pages in the browser, ensuring the security and standardization of data access.

[0052] In this embodiment, after the session state management plugin obtains the URLs of each user's content page, it retrieves all session state data from each user's content page through the standard interface provided by the first browser. This session state data is divided into three categories: Cookies data, local storage data (also known as localStorage data), and session storage data (also known as sessionStorage data).

[0053] Cookies are small text files stored in a user's browser by a website to record basic information such as website login status and user preferences. Local storage data is larger amounts of data that a website can keep locally for a long time, such as user configurations or cached content. This type of data is persistent and will remain locally unless actively cleared. Session storage data is temporary data that is only valid during the current browsing session and disappears when the tab is closed; it is suitable for storing temporary interactive data. It is understandable that when a user accesses various user content pages through a primary browser, that primary browser will store the Cookies, local storage data, and session storage data corresponding to each URL in different data formats, explicitly or implicitly, in different file directories. The session state management plugin cannot directly locate and access this private data; however, it can obtain this data by authorizing the use of the state information retrieval interface provided by the primary browser.

[0054] Specifically, three different types of session state data corresponding to each URL can be obtained through three different types of state information acquisition interfaces. Considering that all of the above session state data involve user privacy, user privacy authorization must be obtained first during the installation of the session state management plugin. Only after the user's privacy authorization is fully approved can the session state management plugin allow the above state information acquisition interfaces to be called when the user triggers the session state saving function selection command. S130, After serializing the session state data of each URL into standard data of the target data format, each standard data is generated into a target data file, and the target data file is stored.

[0055] In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

[0056] In this embodiment, the collected session state data from each URL is serialized and converted into a unified target data format, typically JSON. Then, the converted data (i.e., standard data) in the target data format can be stored as a target data file.

[0057] With the above settings, the target data file can be exported and stored outside the first browser via cloud storage or other external storage media. When the user needs to continue accessing the current webpage state of the first browser on another device or at another time, they can directly restore all session state data based on the target data file. This setting enhances the user's control over their browsing data, allowing them to decide when to save, export, import, and restore browsing state data.

[0058] Furthermore, when a user performs a restore operation in a second browser, the session state management plugin reads and parses this standardized target data file. Based on the URLs recorded in the target data file and the session state data associated with each URL, the plugin automatically reconstructs a complete browsing environment for each user's content page—not only accurately restoring the page content but also recovering all details, including login status, unsubmitted form data, and page scroll position, achieving true "one-click restore."

[0059] The technical solution of this invention, when the user selects the session state saving function, automatically queries the URLs of all currently opened user content pages by the session state management plugin installed in the first browser, obtains the current session state data of each URL by calling the state information acquisition interface provided by the first browser, and serializes this data into a target data file in a standard format for storage. This implementation method achieves the saving of the complete session state in the browser, including cookies, localStorage, and sessionStorage data, ensuring that the user can restore to the exact same browsing state. In addition, this method of saving complete session state data allows the user to restore the previous session state without logging in again. Furthermore, this file storage method of session state data can effectively realize the cross-device migration of the user's session state by combining data export and import mechanisms, enabling the user to restore the exact same browsing experience on different devices.

[0060] Based on the above embodiments, obtaining the current session state data for each URL by calling the state information acquisition interface provided by the first browser may include:

[0061] Obtain the kernel identifier of the first browser, and based on the pre-maintained mapping relationship between browser kernels and browser information acquisition interfaces, identify at least one target status information acquisition interface that matches the kernel identifier of the first browser.

[0062] For each URL, call the respective target status information retrieval interface to obtain the current session status data for each URL;

[0063] Correspondingly, while generating the target data file from the various standard data, it can also include...

[0064] Add the kernel identifier of the first browser to the target data file.

[0065] In this embodiment of the invention, the browser's kernel identifier can be understood as metadata used to uniquely identify the browser's rendering engine and script execution environment. Examples include Blink or WebKit. Generally, browsers with different kernels often differ in the standards they support, the interface implementation methods they use, and the names of the interfaces used to implement the same functions. Therefore, before calling the state information retrieval interface provided by the first browser, it is necessary to first obtain the kernel identifier of the first browser.

[0066] During the installation of the session state management plugin, the kernel identifier of the first browser can be obtained and stored through multiple rounds of communication with the first browser. Alternatively, the kernel identifier of the first browser can be obtained by calling the standardized API provided by the first browser. This embodiment does not limit this.

[0067] In this embodiment, the mapping relationship between the browser kernel and the browser information acquisition interface can be pre-stored in the session state management plugin. After obtaining the kernel identifier of the first browser, at least one target state information acquisition interface matching the kernel identifier of the first browser can be determined by querying the above mapping relationship.

[0068] Furthermore, when generating standardized data files, in addition to encapsulating the webpage URL and its corresponding session data, the engine identifier of the first browser is also written to the file as metadata. This "tags" this part of the stored data, ensuring that when the second browser recovers the data, it can intelligently identify the data source characteristics and perform adaptive parsing for data format differences between different engines. This avoids data compatibility issues caused by browser engine differences, thereby ensuring the integrity and accuracy of cross-browser session migration.

[0069] Optionally, after retrieving the URLs of all currently open user content pages in the first browser, the query may also include:

[0070] Retrieve the page handles of all currently open user content pages in the first browser;

[0071] The backend iterates through each page handle and performs a screenshot operation on each user content page opened in the backend to obtain a page screenshot corresponding to each user content page.

[0072] Accordingly, before serializing the session state data of each URL into standard data of the target data format, it may also include:

[0073] Based on the mapping relationship between page handles and URLs, screenshots of each page will be added to the session state data of each URL.

[0074] In this embodiment of the invention, a page handle can be understood as a unique internal identifier assigned by the browser to each tab. It differs from the user-visible webpage title or URL; rather, it is a technical identifier used by the browser's underlying system for precise tracking and management of pages. For example, when a user opens multiple identical e-commerce website tabs simultaneously, although their URLs may be exactly the same, each tab has an independent page handle, enabling the system to distinguish session data for different pages. During the process of saving session data, the plugin queries and records the page handle corresponding to each opened content page.

[0075] Furthermore, after recording all page handles, an ordered list of pages is generated based on these handles. Then, the browser's screenshot function API is automatically invoked to generate a visual snapshot for each tab, ensuring that the complete page state is captured, including dynamically loaded content and the current scroll position. A one-to-one correspondence is established between the generated screenshot and its corresponding webpage URL and complete session state data (including cookies, local storage, and session storage).

[0076] Before transforming the data, a complete page data mapping relationship is established. Based on the pre-recorded correspondence between page handles and URLs, screenshots of each webpage are embedded into the corresponding session state data. This step is like adding a cover photo to each archive file. Through the unique identifier of the page handle, the generated page snapshot can be accurately bound to the corresponding URL's cookies, local storage, and other data, forming a composite data file containing visual evidence and structured data.

[0077] Example 2

[0078] Figure 2This is a flowchart of a browser session state recovery method provided in Embodiment 2 of the present invention. This embodiment is applicable to situations where a target file obtained by saving all session state data of each user content page is used to completely restore the session states saved in each user content page in a new browser. This includes, but is not limited to, browser state recovery needs such as session reconstruction after device failure and work environment migration. This method can be executed by a browser session state recovery device, which can be implemented in hardware and / or software and is generally configured in a session state management plugin that is pre-installed in the browser.

[0079] Correspondingly, such as Figure 2 As shown, the method includes:

[0080] S210, In response to the selection instruction for the session state recovery function in the session state management plugin, the target data file is obtained through at least one human-computer interaction operation.

[0081] The target data file includes the URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes cookie data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0082] Specifically, when a user activates the session state recovery function in a second browser using the session state management plugin, a user-friendly interface guides them to select a previously saved session data file (i.e., the target data file). This target data file can be understood as a multi-dimensional "browser session mirror," completely preserving all the user's browsing content from the first browser: it not only records the precise address (URL) of each user content page but also includes all state information of these pages when they were initially saved, including cookies to maintain login status, local storage data to store user preferences, and session storage data to record temporary operation states. This data was initially generated by the user on the first browser using the same session state management plugin's session state saving function.

[0083] S220. By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, so as to restore all user content pages at once.

[0084] In this embodiment of the invention, when the session state recovery process is initiated, the target data file is first parsed to identify all URLs that need to be recovered, as well as the session state data corresponding to each URL. Then, through the state information recovery interface provided by the second browser, this session state data is restored to the second browser in sequence.

[0085] In this process, restoring the session state data of each URL in the target data file to the second browser can be understood as explicitly or implicitly storing the cookie data, local storage data, and session storage data of each URL in a set file directory according to a preset data format.

[0086] The technical solution of this invention, in response to the selection instruction of the session state recovery function in the session state management plugin, obtains the target data file through at least one human-computer interaction operation; by calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, thereby restoring all user content pages at once. This technical means enables users to maintain a consistent browsing experience across different times and devices, reducing the hassle of repeated logins and data input. Moreover, based on multi-dimensional recovery protection, it can efficiently and accurately restore the original browser's pages while ensuring data security, providing users with a more complete browsing state management solution.

[0087] Based on the above embodiments, the target data file also includes page screenshots corresponding to each URL;

[0088] Accordingly, after restoring the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser, the process also includes:

[0089] Retrieve the page handles of all currently open user content pages in the second browser;

[0090] The backend iterates through each page handle and performs a screenshot operation on each user content page opened in the backend, obtaining a comparison screenshot corresponding to each user content page;

[0091] Calculate the similarity between the screenshots and comparison screenshots corresponding to the same user content page, and record the target user content pages whose similarity calculation results are less than the preset similarity threshold.

[0092] When the currently active note page in the second browser is the target user's content page, the differences between the screenshot and the comparison screenshot corresponding to the target user's content page will be marked and displayed on the target user's content page.

[0093] Generally, the page screenshots stored in the target data file represent the original visual state captured when the session is saved, essentially serving as a "reference image" for each saved user content page. In other words, the page screenshots in the target data file represent the final state of each user content page that the user wants to recover. By calculating the similarity between these page screenshots and the screenshots ultimately recovered by the session state management plugin in the second browser, unrecovered content can be annotated to assist users in manually recovering the parts that the session state management plugin could not.

[0094] Furthermore, a list of page handles for all recovered pages in the second browser is obtained. By iterating through these page handles, screenshots are taken of each page in the background, generating comparison screenshots of the current state. This operation runs entirely in the background and does not interfere with the user's foreground operations. The newly generated comparison screenshots will form a comparison group with the original page screenshots saved in the target data file, providing a benchmark for subsequent verification of recovery quality.

[0095] Furthermore, an image comparison algorithm is used to calculate the similarity score for each set of screenshots. A preset similarity threshold serves as the critical value for judging the quality of restoration. This threshold is a balance point determined through extensive experiments, capable of capturing significant differences without being overly sensitive to normal dynamic content changes. When the similarity score of a page falls below the threshold, it will be marked, and its specific difference characteristics will be recorded.

[0096] Optionally, when a user switches to a marked abnormal page, an automatic annotation mode will be activated. By comparing the original screenshot with the comparison screenshot, the difference area can be accurately located, and these differences can be highlighted on the page in a non-intrusive way, such as using a semi-transparent red border to mark the changed content block.

[0097] Optionally, a quick operation panel can be provided at the edge of the page, offering users flexible processing options. When users find discrepancies in the page restoration, they can choose different processing methods according to their actual needs. If the difference is significant, they can choose "View Original Screenshot" or "Reload This Area." If the difference does not affect the user experience, they can choose the "Ignore Difference" button to continue browsing.

[0098] With the above settings, even in special scenarios where the user content page cannot be fully recovered using session state data from each URL, the key information in the user content page can be completely saved and efficiently provided to the user for comparison and viewing, further improving the versatility and success rate of the browser session state recovery solution.

[0099] Example 3

[0100] Figure 3 This is a flowchart of another browser session state recovery method provided in Embodiment 3 of the present invention. This embodiment is based on and optimized from the above embodiments. In this embodiment, the operation of "restoring the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser, so as to restore all user content pages at once" is specifically refined.

[0101] Correspondingly, such as Figure 3 As shown, the method includes:

[0102] S310, in response to the selection instruction for the session state recovery function in the session state management plugin, acquire the target data file through at least one human-computer interaction operation.

[0103] The target data file includes the Uniform Resource Locator (URL) of each user content page to be saved, the session state data corresponding to each URL, and the kernel identifier of the first browser. The session state data includes Cookies data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0104] S320. Extract the kernel identifier of the first browser from the target data file, and check whether the kernel identifier of the second browser is consistent with the kernel identifier of the first browser. If yes, execute S330; otherwise, execute S340.

[0105] S330. Based on the pre-maintained mapping relationship between browser kernels and browser information recovery interfaces, identify at least one target state information recovery interface that matches the kernel identifier of the second browser, and execute S350.

[0106] Specifically, when the kernel identifier of the second browser matches that of the first browser, it indicates that the session state data of each URL stored by calling the state information retrieval interface provided by the first browser can be correctly identified by the second browser. At this point, by simply calling the appropriate target state information recovery interface in the second browser, the aforementioned session state data can be restored to the second browser environment, thereby achieving a complete recovery of each user content page.

[0107] In a specific example, the session state management plugin pre-maintains a mapping relationship between browser kernels and browser information recovery interfaces. This mapping relationship records the browser information recovery interfaces corresponding to AAA, including: Cookies data recovery interface: Interface BBB, Local storage data recovery interface: Interface CCC, and Session storage data recovery interface: Interface CCC. Assuming the second browser's kernel identifier is AAA, querying this mapping relationship can retrieve the interfaces corresponding to AAA, that is, the target state information recovery interfaces.

[0108] S340: Call the pre-trained state data format conversion model to convert the session state data of each URL adapted to the first browser into the session state data of each URL adapted to the second browser, and return to execute S330.

[0109] When the kernel identifier of the first browser is found to be inconsistent with that of the second browser, such as when migrating from Google Chrome (Chromium kernel) to Firefox (GeCko kernel), an automatic data conversion process will be initiated.

[0110] Specifically, the session state management plugin parses the specific kernel versions and configuration characteristics of both browsers, precisely locating the required sub-model within a pre-trained state data format conversion model. This state data format conversion model can be understood as a modular conversion library containing dedicated converters for various browser kernel combinations, much like a multilingual translation center with a dedicated translation team for different "language pairs." The state data format conversion model automatically loads the corresponding dedicated conversion sub-model based on the identified kernel combination (e.g., "Chromium → GeCko"). This sub-model is a deep learning-based specific converter, specifically trained to handle data format conversions for that particular kernel combination (e.g., Google Chrome to Firefox). It understands the subtle differences in data storage between the two kernels, and each sub-model is trained on a large number of cross-browser data samples, exhibiting excellent performance in its specific browser conversion.

[0111] During the conversion execution phase, the state data format conversion model processes three core data categories one by one: first, it reconstructs the security tags of cookies; then, it converts the data serialization format of locally stored data; and finally, it adapts the temporary storage architecture for session storage data. Through the conversion by the state data format conversion model, the session state data of each URL adapted to the first browser has been completely converted to the session state data of each URL adapted to the second browser.

[0112] S350. For each URL, call the respective target state information recovery interface to restore the session state data of each URL to the second browser.

[0113] In this embodiment, an independent recovery transaction is created for each URL, and the recovery interface matching the second browser is called sequentially according to the original opening order to inject data step by step: first, cookies are restored and security tags are retained, then the locally stored structured data is restored, and finally the temporary state of the session storage data is restored.

[0114] The technical solution of this invention, by responding to the command of the recovery function, obtains the target data file saved by the session state management plugin in the first browser, and automatically handles data compatibility issues between different browsers using a preset data type conversion model, ensuring that the target data can be successfully transmitted to the second browser. This technical means allows users to maintain a consistent browsing experience across different times and devices, reducing the hassle of repeated logins and data input. Moreover, based on multi-dimensional recovery protection, it can efficiently and accurately restore the original browser's pages while ensuring data security, providing users with a more complete browsing state management solution.

[0115] Based on the above embodiments, for each URL, the target state information recovery interface is called respectively to restore the session state data of each URL to the second browser. Specifically, it may include: in the target data file, obtaining a URL as the current processing URL in sequence, and obtaining the current Cookies data, current local storage data and current session storage data of the current processing URL.

[0116] Based on the current Cookies data, the target state information recovery interface is called to restore the Cookies data of the current user content page corresponding to the currently processed URL in the second browser.

[0117] Create a new tab in the second browser and trigger the loading of the currently processed URL in the new tab;

[0118] If a change is detected in the URL loaded in the new tab during page loading, the operation of triggering the loading of the currently processed URL in the new tab will be executed again.

[0119] After listening to the tab loading completion event, based on the current local storage data and the current session storage data, the matching target state information recovery interface is called to restore the local storage data and session storage data of the current user content page in the second browser;

[0120] After restoring the local storage data and session storage data, the target state information recovery interface is called again based on the current Cookies data to perform a second recovery of the Cookies data for the current user content page.

[0121] After completing the second recovery of the cookie data, check again whether the complete URL loaded in the new tab is the URL being processed.

[0122] If not, the operation of loading the currently processed URL will be executed again in a new tab.

[0123] Generally, the process involves extracting the URLs to be recovered and their associated session state data, including cookies, local storage, and session storage, from the target data file. This step is equivalent to creating a complete recovery profile for each webpage, where cookies store authentication information, local storage records user personalization settings, and session storage maintains temporary interaction states. The system creates a recovery queue according to the original browsing order to ensure that the tab opening order is consistent with user habits.

[0124] Furthermore, during the recovery process, the second browser first restores the Cookies data to ensure basic identity authentication is ready. Then, it creates a new tab in the second browser, loads the target URL, and monitors the loading status in real time. If any anomalies are detected, such as an unexpected URL modification, the original URL will be reloaded. After the page is fully loaded, the second browser will sequentially restore local storage and session storage data.

[0125] Considering that some websites may update cookies after the page loads, a cookie data recovery operation will be performed again. To avoid this, the cookie data recovery operation will be performed again after all session state data has been recovered to ensure that the cookie data before and after the recovery is unchanged.

[0126] After the second cookie data recovery is completed, a final URL verification will be performed. This involves data checking and screenshot comparison to confirm whether the complete URL recovered in the new tab is the same as the currently processed URL. If the detection does not meet expectations, the operation of loading the currently processed URL in the new tab will be performed again, and the page obtained this time will be used as the final version.

[0127] In summary, through multiple studies, the inventors discovered that, considering the different redirection mechanisms of various websites, in order to ensure the correct recovery of each user's content page in the second browser to the greatest extent possible, two cookie data recovery operations and two page redirection detection operations (that is, checking whether the complete URL loaded in the new tab is the currently processed URL) were performed, specifically:

[0128] The first cookie data recovery operation (pre-setting) is performed before the tab is created, with the aim of attempting to pre-set cookies so that the necessary cookie data may already be available when the page loads. The second cookie data recovery operation is performed after the page has fully loaded, to ensure that the cookie data has indeed been set correctly, as some websites may clear or modify cookie data during the loading process.

[0129] The first redirection detection is performed synchronously during page loading to handle possible initial redirects; the second is triggered by the page load completion event to capture subsequent navigation or redirects that may occur after page load. This redundant design is to enhance reliability and ensure that the state can be correctly restored at different page load stages.

[0130] Finally, the following beneficial effects brought about by the various embodiments of the present invention through their innovative technical solutions are summarized as follows:

[0131] 1. Fully preserve user browsing state to improve user experience.

[0132] By simultaneously saving cookies, localStorage, and sessionStorage data, the embodiments of this invention can completely preserve the user's browsing state, eliminating the need for users to log in again or re-enter data when resuming a session, significantly improving the user experience. This complete data collection mechanism ensures the lossless preservation of user state, reducing the time cost of repetitive user operations compared to existing technologies that only save URL addresses.

[0133] 2. Intelligent prevention of login redirection, improving recovery success rate.

[0134] By implementing a URL address checking and correction mechanism, the embodiments of this invention can intelligently detect and prevent pages from being redirected to the login page, significantly improving the success rate of state recovery. This intelligent protection mechanism solves the problem in the prior art where even after cookie data is recovered, users are often redirected to the login page, thus improving system reliability.

[0135] 3. Multi-stage cookie settings enhance compatibility.

[0136] By setting cookie data in two phases—before and after page loading—this invention significantly enhances compatibility with various websites and adapts to the different cookie processing mechanisms of various websites. This multi-phase strategy solves the problem of different websites having different requirements for cookie timing, and improves the versatility of browser session state restoration methods.

[0137] 4. File-based data export and import enables cross-device migration.

[0138] By serializing state data into a JSON file and supporting import, this invention enables cross-device migration of browsing state, meeting users' need for a consistent browsing experience across different devices. This file-based migration mechanism overcomes the limitations of existing browser synchronization functions, allowing users to independently control the timing and scope of data migration.

[0139] 5. Batch processing of multiple tabs improves operational efficiency.

[0140] By processing the states of multiple tabs at once, this embodiment of the invention significantly improves operational efficiency and reduces the workload of manually saving and restoring each page. This batch processing mechanism reduces the operation time for multiple tabs from O(n) to nearly O(1), significantly improving user efficiency.

[0141] 6. Non-intrusive implementation, enhancing security and compatibility.

[0142] By adopting a non-intrusive implementation method, this invention achieves state management without modifying the original website code, enhancing security and compatibility. This non-intrusive implementation avoids interference with the original website functionality, reduces security risks, and improves compatibility with various types of websites.

[0143] 7. A simple user interface lowers the barrier to entry.

[0144] By designing a simple and clear user interface, this invention lowers the barrier to entry for users, enabling users of varying technical skills to use it easily. This concise interface design hides complex technical implementations behind simple operations, significantly improving user-friendliness.

[0145] 8. Navigation event listening mechanism to improve recovery stability

[0146] By monitoring webpage navigation events, this invention maintains control over the state during page navigation or redirection, improving the stability of the recovery process. This navigation monitoring mechanism solves the problem of state loss during page loading in existing technologies, ensuring the integrity of the recovery process.

[0147] In summary, the embodiments of the present invention comprehensively improve the integrity, reliability, efficiency, and user-friendliness of browser state management through a series of innovative technical solutions, providing users with an unprecedented guarantee of continuous browsing experience.

[0148] Example 4

[0149] Figure 4 This is a schematic diagram of a browser session state saving device provided in Embodiment 4 of the present invention. Figure 4 As shown, the device includes:

[0150] The page URL collection module 410 is used to query and obtain the URLs of all user content pages currently open in the first browser in response to the selection instruction of the session state management plugin for the session state saving function;

[0151] The state data extraction module 420 is used to obtain the current session state data of each URL by calling the state information acquisition interface provided by the first browser. The session state data includes Cookies data, local storage data and session storage data.

[0152] The data standardization and encapsulation module 430 is used to serialize the session state data of each URL into standard data in the target data format, generate the standard data into a target data file, and store the target data file.

[0153] In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

[0154] The technical solution of this invention, when the user selects the session state saving function, automatically queries the URLs of all currently opened user content pages by the session state management plugin installed in the first browser, obtains the current session state data of each URL by calling the state information acquisition interface provided by the first browser, and serializes this data into a target data file in a standard format for storage. This implementation method achieves the saving of the complete session state in the browser, including cookies, localStorage, and sessionStorage data, ensuring that the user can restore to the exact same browsing state. In addition, this method of saving complete session state data allows the user to restore the previous session state without logging in again. Furthermore, this file storage method of session state data can effectively realize the cross-device migration of the user's session state by combining data export and import mechanisms, enabling the user to restore the exact same browsing experience on different devices.

[0155] Based on the above embodiments, the state data extraction module 420 is specifically used for:

[0156] Obtain the kernel identifier of the first browser, and based on the pre-maintained mapping relationship between browser kernels and browser information acquisition interfaces, identify at least one target status information acquisition interface that matches the kernel identifier of the first browser.

[0157] For each URL, call the respective target status information retrieval interface to obtain the current session status data for each URL;

[0158] Furthermore, based on the above embodiments, the browser session state saving device may further include:

[0159] The kernel identifier module is used to add the kernel identifier of the first browser to the target data file while generating the target data file from various standard data.

[0160] Furthermore, based on the above embodiments, the browser session state saving device may further include:

[0161] The query handle module is used to retrieve the page handles of all currently open user content pages in the first browser after retrieving the URLs of all currently open user content pages in the first browser.

[0162] The screenshot module is used to traverse each page handle in the background and perform a screenshot operation on each user content page opened in the background to obtain a page screenshot corresponding to each user content page.

[0163] The screenshot addition module is used to add screenshots of each page to the session state data of each URL before serializing the session state data of each URL into standard data of the target data format, based on the mapping relationship between the page handle and the URL.

[0164] The browser session state saving device provided in this embodiment of the invention can execute the browser session state saving method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0165] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0166] Example 5

[0167] Figure 5 This is a schematic diagram of a browser session state recovery device provided in Embodiment 5 of the present invention. Figure 5 As shown, the device includes:

[0168] The target data acquisition module 510 is used to acquire the target data file through at least one human-computer interaction operation in response to the selection instruction of the session state recovery function in the session state management plugin.

[0169] The target data file includes the URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes cookie data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0170] The data recovery module 520 is used to restore the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser, so as to restore all user content pages at once.

[0171] The technical solution of this invention obtains the target data file by responding to the selection instruction for the session state recovery function in the session state management plugin and through at least one human-computer interaction operation;

[0172] By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser. This technique allows users to restore all user content pages at once, enabling them to maintain a consistent browsing experience across different times and devices. It reduces the hassle of repeated logins and data input. Moreover, based on multi-dimensional recovery protection, it can efficiently and accurately restore the original browser's pages while ensuring data security, providing users with a more complete browsing state management solution.

[0173] Based on the above embodiments, the target data file may also include the kernel identifier of the first browser;

[0174] Accordingly, based on the above embodiments, the data recovery module 520 is specifically used for:

[0175] Extract the kernel identifier of the first browser from the target data file, and check whether the kernel identifier of the second browser is consistent with the kernel identifier of the first browser;

[0176] If so, then based on the pre-maintained mapping relationship between browser kernels and browser information recovery interfaces, identify at least one target state information recovery interface that matches the kernel identifier of the second browser.

[0177] For each URL, the respective target state information recovery interface is called to restore the session state data of each URL to the second browser.

[0178] Furthermore, based on the above embodiments, the data recovery module 520 may further include:

[0179] The conversion model unit is used to detect whether the kernel identifier of the second browser is consistent with the kernel identifier of the first browser. If the kernel identifier of the second browser is inconsistent with the kernel identifier of the first browser, it calls the pre-trained state data format conversion model to convert the session state data of each URL adapted to the first browser into the session state data of each URL adapted to the second browser.

[0180] The recovery interface unit is used to identify at least one target state information recovery interface that matches the kernel identifier of the second browser, based on the pre-maintained mapping relationship between browser kernels and browser information recovery interfaces.

[0181] The data recovery unit is used to call the respective target state information recovery interface for each URL to restore the session state data of each URL to the second browser.

[0182] Based on the above embodiments, the data recovery unit is specifically used for:

[0183] In the target data file, obtain one URL at a time as the current processing URL, and obtain the current Cookies data, current local storage data, and current session storage data of the current processing URL;

[0184] Based on the current Cookies data, the target state information recovery interface is called to restore the Cookies data of the current user content page corresponding to the currently processed URL in the second browser.

[0185] Create a new tab in the second browser and trigger the loading of the currently processed URL in the new tab;

[0186] If a change is detected in the URL loaded in the new tab during page loading, the operation of triggering the loading of the currently processed URL in the new tab will be executed again.

[0187] After listening to the tab loading completion event, based on the current local storage data and the current session storage data, the matching target state information recovery interface is called to restore the local storage data and session storage data of the current user content page in the second browser;

[0188] After restoring the local storage data and session storage data, the target state information recovery interface is called again based on the current Cookies data to perform a second recovery of the Cookies data for the current user content page.

[0189] After completing the second recovery of the cookie data, check again whether the complete URL loaded in the new tab is the URL being processed.

[0190] If not, the operation of loading the currently processed URL will be executed again in a new tab.

[0191] Based on the above embodiments, the target data file may also include page screenshots corresponding to each URL;

[0192] Accordingly, based on the above embodiments, the browser session state restoration device may further include:

[0193] The page handle module is used to query and obtain the page handles of all currently open user content pages in the second browser after restoring the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser.

[0194] The comparison screenshot module is used to traverse each page handle in the background and perform a screenshot operation on each user content page opened in the background to obtain a comparison screenshot corresponding to each user content page.

[0195] The similarity calculation module is used to calculate the similarity between the screenshots and comparison screenshots corresponding to the same user's content page, and to record the target user's content page whose similarity calculation result is less than the preset similarity threshold.

[0196] The annotation display module is used to annotate and display the differences between the current active note page in the second browser and the corresponding page screenshot and comparison screenshot on the target user content page.

[0197] The browser session state recovery device provided in this embodiment of the invention can execute the browser session state recovery method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0198] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0199] Example 6

[0200] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0201] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0202] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0203] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for saving browser session state, i.e.:

[0204] In response to the selection command for the session state saving function in the session state management plugin, query and retrieve the Uniform Resource Locator URLs of all currently open user content pages in the first browser;

[0205] By calling the status information retrieval interface provided by the first browser, the current session status data of each URL is obtained. The session status data includes Cookies data, local storage data, and session storage data.

[0206] After serializing the session state data of each URL into standard data in the target data format, each standard data is generated into a target data file, and the target data file is stored.

[0207] In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

[0208] Alternatively, for example, a method for restoring browser session state, namely:

[0209] In response to the selection command for the session state recovery function in the session state management plugin, the target data file is obtained through at least one human-computer interaction operation;

[0210] The target data file includes the Uniform Resource Locator URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes Cookies data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser.

[0211] By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, so as to restore all user content pages at once.

[0212] In some embodiments, a method for saving and restoring browser session state may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for saving and restoring browser session state described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a method for saving and restoring browser session state by any other suitable means (e.g., by means of firmware).

[0213] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0214] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0215] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0216] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0217] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0218] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0219] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0220] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for saving browser session state, characterized in that, The method, executed by a session state management plugin installed as an extension in the first browser and built upon a standard browser development framework, includes: In response to the selection command for the session state saving function in the session state management plugin, query and retrieve the Uniform Resource Locator URLs of all currently open user content pages in the first browser; By calling the status information retrieval interface provided by the first browser, the current session status data of each URL is obtained. The session status data includes Cookies data, local storage data, and session storage data. After serializing the session state data of each URL into standard data in the target data format, each standard data is generated into a target data file, and the target data file is stored. In this process, once the session state recovery function in the session state management plugin installed on the second browser is enabled, all user content pages are restored in one go in the second browser according to the session state data saved in real time for each user content page.

2. The method according to claim 1, characterized in that, By calling the status information retrieval interface provided by the first browser, the current session state data for each URL is obtained, including: Obtain the kernel identifier of the first browser, and based on the pre-maintained mapping relationship between browser kernels and browser information acquisition interfaces, identify at least one target status information acquisition interface that matches the kernel identifier of the first browser. For each URL, call the respective target status information retrieval interface to obtain the current session status data for each URL; In addition to generating target data files from various standard data, it also includes Add the kernel identifier of the first browser to the target data file.

3. The method according to claim 1, characterized in that, After retrieving the URLs of all currently open user content pages in the first browser, the query also includes: Retrieve the page handles of all currently open user content pages in the first browser; The backend iterates through each page handle and performs a screenshot operation on each user content page opened in the backend to obtain a page screenshot corresponding to each user content page. Before serializing the session state data from each URL into standard data in the target data format, the following steps are also included: Based on the mapping relationship between page handles and URLs, screenshots of each page will be added to the session state data of each URL.

4. A method for restoring browser session state, characterized in that, The method, executed by a session state management plugin installed as an extension in a second browser and built upon a standard browser development framework, includes: In response to the selection command for the session state recovery function in the session state management plugin, the target data file is obtained through at least one human-computer interaction operation; The target data file includes the Uniform Resource Locator URLs of each user content page that need to be saved, as well as the session state data corresponding to each URL. The session state data includes Cookies data, local storage data, and session storage data. The target data file is generated and saved based on the session state saving function in the session state management plugin installed on the first browser. By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, so as to restore all user content pages at once.

5. The method according to claim 4, characterized in that, The target data file also includes the kernel identifier of the first browser; By calling the state information recovery interface provided by the second browser, the session state data of each URL in the target data file is restored to the second browser, including: Extract the kernel identifier of the first browser from the target data file, and check whether the kernel identifier of the second browser is consistent with the kernel identifier of the first browser; If so, then based on the pre-maintained mapping relationship between browser kernels and browser information recovery interfaces, identify at least one target state information recovery interface that matches the kernel identifier of the second browser. For each URL, the respective target state information recovery interface is called to restore the session state data of each URL to the second browser.

6. The method according to claim 5, characterized in that, After checking whether the kernel identifier of the second browser matches that of the first browser, the process also includes: If not, the pre-trained state data format conversion model is invoked to convert the session state data of each URL adapted to the first browser into the session state data of each URL adapted to the second browser. Based on the pre-maintained mapping relationship between browser kernels and browser information recovery interfaces, identify at least one target state information recovery interface that matches the kernel identifier of the second browser. For each URL, the respective target state information recovery interface is called to restore the session state data of each URL to the second browser.

7. The method according to claim 5 or 6, characterized in that, For each URL, the respective target state information recovery interface is called to restore the session state data of each URL to the second browser, specifically including: In the target data file, obtain one URL at a time as the current processing URL, and obtain the current Cookies data, current local storage data, and current session storage data of the current processing URL; Based on the current Cookies data, the matching target state information recovery interface is called to restore the Cookies data of the current user content page corresponding to the currently processed URL in the second browser; Create a new tab in the second browser and trigger the loading of the currently processed URL in the new tab; If a change is detected in the URL loaded in the new tab during page loading, the operation of triggering the loading of the currently processed URL in the new tab will be executed again. After listening to the tab loading completion event, based on the current local storage data and the current session storage data, the matching target state information recovery interface is called to restore the local storage data and session storage data of the current user content page in the second browser; After restoring the local storage data and session storage data, the target state information recovery interface is called again based on the current Cookies data to perform a second recovery of the Cookies data for the current user content page. After completing the second recovery of the cookie data, check again whether the complete URL loaded in the new tab is the URL being processed. If not, the operation of loading the currently processed URL will be executed again in a new tab.

8. The method according to claim 4, characterized in that, The target data file also includes screenshots of the pages corresponding to each URL; After restoring the session state data of each URL in the target data file to the second browser by calling the state information recovery interface provided by the second browser, the process also includes: Retrieve the page handles of all currently open user content pages in the second browser; The backend iterates through each page handle and performs a screenshot operation on each user content page opened in the backend, obtaining a comparison screenshot corresponding to each user content page; Calculate the similarity between the screenshots and comparison screenshots corresponding to the same user content page, and record the target user content pages whose similarity calculation results are less than the preset similarity threshold. When the currently active note page in the second browser is the target user's content page, the differences between the page screenshot and the comparison screenshot corresponding to the target user's content page will be marked and displayed on the target user's content page.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a browser session state saving method according to any one of claims 1-3, or a browser session state restoration method according to any one of claims 4-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement a method for saving a browser session state according to any one of claims 1-3, or a method for restoring a browser session state according to any one of claims 4-8.