WO2023221495A1 - 一种网页同步方法、装置、存储介质及电子设备 - Google Patents

一种网页同步方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2023221495A1
WO2023221495A1 PCT/CN2022/139967 CN2022139967W WO2023221495A1 WO 2023221495 A1 WO2023221495 A1 WO 2023221495A1 CN 2022139967 W CN2022139967 W CN 2022139967W WO 2023221495 A1 WO2023221495 A1 WO 2023221495A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
status
web page
status data
target
Prior art date
Application number
PCT/CN2022/139967
Other languages
English (en)
French (fr)
Inventor
梁羽平
杨俊拯
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023221495A1 publication Critical patent/WO2023221495A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Definitions

  • the present application relates to the field of computer technology, and in particular to a web page synchronization method, device, storage medium and electronic equipment.
  • the web page synchronization method, device, storage medium and electronic device provided by the embodiments of the present application can synchronize web page data between two electronic devices that open the same target web page.
  • the technical solutions are as follows:
  • an embodiment of the present application provides a web page synchronization method, which is applied to a first terminal.
  • the method includes:
  • Update the target webpage based on the first status data and upload the first status data to a server connected through the first status management plug-in.
  • the server is used to open the target webpage when the second terminal opens the target webpage. , updating the target webpage of the second terminal based on the first status data, where the first terminal and the second terminal log in to the target webpage with the same account.
  • an embodiment of the present application provides a web page synchronization method, which is applied to a server.
  • the method includes:
  • the target webpage of the second terminal is updated based on the first status data, and the first terminal and the second terminal log in to the target webpage with the same account.
  • an embodiment of the present application provides a web page synchronization device, which includes:
  • the first status acquisition module is configured to detect changes in the status of the target web page based on the installed first status management plug-in, and obtain the first status data after the change of the target web page;
  • a first status update module configured to update the target web page based on the first status data, and upload the first status data to a server connected through the first status management plug-in, where the server is configured to When the second terminal opens the target webpage, the target webpage of the second terminal is updated based on the first status data.
  • the first terminal and the second terminal log in to the target webpage with the same account.
  • an embodiment of the present application provides a web page synchronization device, the device includes:
  • the first status receiving module is used to receive the first status data sent by the first terminal.
  • the first status data is the status data after the first status management plug-in installed in the first terminal detects the status change of the target web page. ;
  • a first status synchronization module configured to update the target webpage of the second terminal based on the first status data when the second terminal opens the target webpage, and the first terminal and the second terminal log in to the The account number for the target page is the same.
  • embodiments of the present application provide a computer storage medium that stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above method steps.
  • embodiments of the present application provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the above method steps. .
  • the first terminal and the second terminal open the target webpage with the same account
  • a change in the status of the target webpage is detected based on the first status management plug-in installed in the first terminal
  • Obtain the changed first status data of the target webpage then update the target webpage of the first terminal based on the first status data, and upload the first status data to the server connected through the first status management plug-in, so that the server can
  • the second terminal opens the target web page
  • the target web page of the second terminal is updated based on the first status data; using this application, it does not rely on a specific operating system and does not need to use a specific application programming interface, by monitoring the target web page
  • the status management plug-in of the status when the data of the target webpage of the first terminal changes, sends the status data after the status change to the second terminal to synchronize the webpage status of the target webpage of the second terminal.
  • Web page data is synchronized between electronic devices that open the same target web page.
  • Figure 1 is a system architecture diagram of a web page synchronization method provided by an embodiment of the present application
  • Figure 2 is a schematic flow chart of a web page synchronization method provided by an embodiment of the present application
  • Figure 3 is a schematic flowchart of a web page synchronization method provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of an example of restoring a target web page provided by an embodiment of the present application.
  • Figure 5 is a schematic flowchart of a web page synchronization method provided by an embodiment of the present application.
  • Figure 6 is a schematic flowchart of a web page synchronization method provided by an embodiment of the present application.
  • Figure 7 is a schematic flowchart of a web page synchronization method provided by an embodiment of the present application.
  • Figure 8 is a flow chart of a web page synchronization method provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of an example of a target web page state change provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of an example of a second terminal rendering a target web page provided by an embodiment of the present application
  • Figure 11 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • Figure 13 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • Figure 14 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • Figure 15 shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application.
  • plural means two or more unless otherwise specified.
  • “And/or” describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character “/” generally indicates that the related objects are in an "or” relationship.
  • this application proposes a web page synchronization method.
  • the first terminal and the second terminal open the target web page with the same account, changes in the status of the target web page are detected based on the first status management plug-in installed in the first terminal.
  • the target webpage changes, the first status data of the target webpage is obtained, and then the target webpage of the first terminal is updated based on the first status data, and the first status data is uploaded to the server connected through the first status management plug-in, so that the server
  • the second terminal opens the target web page, the target web page of the second terminal is updated based on the first status data; using this application, it does not rely on a specific operating system and does not need to use a specific application programming interface.
  • the status management plug-in for the target web page status when the data of the target web page of the first terminal changes, sends the status data after the status change to the second terminal to synchronize the web page status of the target web page of the second terminal.
  • Web page data is synchronized between two electronic devices that open the same target web page.
  • Figure 1 is a system architecture diagram of a web page synchronization method provided by an embodiment of the present application.
  • the system architecture diagram includes a first terminal 101, a network 102, a server 103 and a second terminal 104.
  • the interaction between the first terminal 101, the server 103 and the second terminal 104 can be realized through the network 102.
  • the first terminal 101 may be hardware or software.
  • the first terminal When the first terminal is hardware, it may be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop computers, desktop computers, etc.
  • the first terminal When the first terminal is software, it can be installed in the electronic device listed above. It can be implemented as multiple software or software modules (for example, used to provide distributed services), or it can be implemented as a single software or software module. , no specific limitation is made here.
  • the network 102 may include various types of wired communication links or wireless communication links.
  • wired communication links include optical fibers, twisted pairs, or coaxial cables
  • wireless communication links include Bluetooth communication links, Wireless Fidelity (Wireless). -Fidelity, Wi-Fi) communication link or microwave communication link, etc.
  • the server 103 may be a server or server cluster that provides various services, such as a backend management server that provides support for websites browsed by users using the first terminal 101 .
  • the second terminal 104 may be hardware or software.
  • the second terminal When the second terminal is hardware, it may be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop computers, desktop computers, etc.
  • the second terminal When the second terminal is software, it can be installed in the electronic device listed above. It can be implemented as multiple software or software modules (for example, used to provide distributed services), or it can be implemented as a single software or software module. , no specific limitation is made here.
  • the target of the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the target of the first terminal is obtained.
  • the first state data after the web page changes then updates the target web page of the first terminal based on the first state data, and uploads the first state data to the server connected through the first state management plug-in, so that the server can open all the information on the second terminal.
  • the first status data is sent to the second terminal, and the second terminal updates the target web page of the second terminal based on the first status data.
  • the status management plug-in monitors the status of the target web page.
  • the data of the target webpage of the first terminal changes the changed status data is sent to the second terminal to synchronize the webpage status of the target webpage of the second terminal.
  • Web page data is synchronized between electronic devices.
  • FIG. 2 is a schematic flow chart of a web page synchronization method provided by an embodiment of the present application.
  • the web page synchronization method may be applied to a web page synchronization device or an electronic device configured with a web page synchronization device.
  • the specific process of this embodiment will be described below by taking the execution subject as an electronic device as an example.
  • the process shown in Figure 2 will be described in detail below.
  • the web page synchronization method may specifically include the following steps:
  • the first status management plug-in in the first terminal can detect the web page status of the target web page, and when detecting that the web page status of the target web page changes, obtain the first page status of the target web page after the change. status data.
  • the first state management plug-in is written in the state management module of the application.
  • the state management module is used to maintain the mapping relationship between the state data and the page view, and can control the user interface of the application based on the state data. (User Interface, UI) layer updates the page view.
  • the first status management plug-in is a plug-in written into the status management module during application development. It can monitor the page status of the target web page in the application and establish a connection with the server corresponding to the target web page. When When the status of the target web page changes, the first status management plug-in uploads the changed status data to the server.
  • the first status management plug-in in the first terminal monitors the status of the target webpage, and when the user operates certain components in the target webpage and attempts to cause the status of the target webpage to occur
  • the first terminal sends an HTTP request corresponding to the user operation to the server.
  • the server processes the HTTP request sent by the first terminal and returns the processing result to the first terminal.
  • the first terminal generates the changed target web page based on the processing result returned by the server. First status data.
  • S104 Update the target web page based on the first status data, and upload the first status data to the server connected through the first status management plug-in.
  • the server is used to update the second terminal based on the first status data when the second terminal opens the target web page.
  • the target webpage of the first terminal and the second terminal log in to the target webpage with the same account.
  • the UI layer of the first terminal obtains the first status data, and the UI layer calls corresponding components to re-render the page view of the target web page according to the first status data, thereby completing the update of the target web page in the first terminal.
  • the first status management plug-in sends the changed first status data of the target webpage to the server.
  • the server can update the third status data based on the first status data when the second terminal using the same account as the first terminal to log in to the target webpage opens the target webpage.
  • the target page of the second terminal can update the third status data based on the first status data when the second terminal using the same account as the first terminal to log in to the target webpage opens the target webpage.
  • the target page of the second terminal is
  • the server can store the first status data, and after determining that there is a user using the same account as the first terminal to log in to the target webpage
  • the first status data is sent to the second terminal, so that the UI layer of the second terminal re-renders the page view of the target webpage running on the second terminal according to the first status data, completing the control of the second terminal. Landing page updates.
  • the second status management plug-in sends a historical status data query request to the server to query whether there is After querying the historical status data uploaded by the first terminal, the first status data is synchronized to the status management module in the second terminal through the second status management plug-in, so that the UI layer of the second terminal can be configured according to the first status data.
  • One status data re-renders the page view of the target web page running on the second terminal, completing the update of the target web page in the second terminal.
  • the server will actively push the first status data uploaded by the first terminal to the status management module of the second terminal, so that the UI layer of the second terminal can re-render the target running on the second terminal based on the first status data.
  • the page view of the web page completes the update of the target web page in the second terminal.
  • a storage environment for the status data of the target webpage will be established on the server to store the status data of the target webpage uploaded by the terminal.
  • the status data can be isolated through web applications and user accounts.
  • the relationship between the first terminal and the second terminal is not limited to the same account used to log in to the target webpage, but can also be other preset rules set to achieve synchronization of the target webpage between the first terminal and the second terminal. and related relationships, which are not specifically limited in the embodiments of this application.
  • the WIFI network connected to the first terminal and the second terminal may be the same, the device identifiers of the first terminal and the second terminal are associated, the first terminal and the second terminal have established a Bluetooth connection, etc.
  • the second terminal after the first terminal logs in to the target web page, the second terminal establishes a web page synchronization association with the first terminal when logging in to the target web page.
  • the first terminal and the second terminal can realize Web page synchronization between terminals.
  • the web page synchronization association relationship may be that the network IPs used by the first terminal and the second terminal to log in to the target web page are the same, and a certain key used by the first terminal and the second terminal to log in to the target web page is the same, etc.
  • the chess game 6638 can be synchronized between the first terminal and the second terminal, where the game number of the chess game 6638 is the web page synchronization association between the first terminal and the second terminal.
  • the first terminal when the first terminal and the second terminal open the target webpage with the same account, when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal obtains The first state data after the target webpage changes, then updates the target webpage of the first terminal based on the first state data, and uploads the first state data to the server connected through the first state management plug-in, so that the server can
  • the target webpage is opened, the first status data is sent to the second terminal, and the second terminal updates the target webpage of the second terminal based on the first status data without using a specific application programming interface by monitoring the status of the target webpage.
  • the management plug-in when the data of the target webpage of the first terminal changes, sends the changed status data to the second terminal to synchronize the webpage status of the target webpage of the second terminal, and open the same target between the two terminals.
  • Web page data is synchronized between electronic devices on the web page.
  • the first terminal when the first terminal opens the target web page for the first time, the first terminal will directly restore the web page corresponding to the historical status data according to the latest historical status data of the target web page stored in the server.
  • Figure 3 is a schematic flow chart of a web page synchronization method provided by an embodiment of the present application. As shown in Figure 3, the web page synchronization method may include the following steps:
  • the first state management plug-in in the application of the target webpage in the first terminal establishes a connection with the server corresponding to the target webpage.
  • the first terminal queries the server whether there is historical status data corresponding to the target webpage.
  • the historical status data is the status data uploaded to the server by the terminal that last used the same account to log in to the target webpage before exiting the target webpage before the first terminal opened the target webpage, that is, the latest status data stored in the server.
  • the UI layer of a terminal renders the page view of the target webpage running on the first terminal based on the historical status data, so that the target webpage opened on the first terminal is restored to the state before the last time the target webpage was logged in using the same account and exited.
  • the standard opening process of the target webpage is followed, the homepage data of the target webpage is obtained from the server, and the main page of the target webpage is rendered and displayed on the first terminal.
  • Figure 4 is a schematic diagram of an example of restoring a target webpage provided by an embodiment of the present application.
  • the first terminal when the first terminal opens the target webpage as shown in the figure, before the target webpage is fully loaded and displayed, the first terminal will query the server to see whether there is historical status data corresponding to the target webpage. When the corresponding historical status data exists, the home page of the target webpage is rendered and displayed. When the historical status data corresponding to the target webpage exists in the server, the web page 2 of the target webpage corresponding to the historical status data is rendered and displayed.
  • the first terminal when the first terminal opens the target webpage for the first time, it queries the server based on the first status management plug-in whether there is historical status data corresponding to the target webpage. If it exists, the historical status data is synchronized to the first terminal, so that the target webpage in the first terminal can be restored to the display state corresponding to the historical status data, so as to connect the user's last operation progress on the target webpage, prevent the user from restoring the historical progress on the target webpage through repeated operations, and improve the user experience. Operational efficiency on the landing page.
  • FIG. 5 is a schematic flowchart of a web page synchronization method provided by an embodiment of the present application.
  • the web page synchronization method may include the following steps:
  • step S302 please refer to the detailed description of step S102 in another embodiment of the present application, which will not be described again here.
  • S304 Update the target web page based on the first status data, and upload the first status data to the server connected through the first status management plug-in.
  • the server is used to update the second terminal based on the first status data when the second terminal opens the target web page.
  • the target webpage of the first terminal and the second terminal log in to the target webpage with the same account;
  • step S304 please refer to the detailed description of step S104 in another embodiment of the present application, which will not be described again here.
  • the second status data is the status data after the status change of the target web page in the second terminal;
  • the second terminal and the first terminal use the same account to log in to the target webpage. Therefore, when the status of the target webpage of the second terminal changes, the second status management plug-in of the second terminal will change the second status after the status change.
  • the data is sent to the server, and the server pushes the second status data to the first terminal running the target web page. That is, the first terminal receives the second status data sent by the server and saves the second status data to the status management module.
  • the UI layer of the first terminal re-renders the page view of the target webpage running in the first terminal according to the second status data, completing the processing of the first terminal.
  • the update of the target web page in one terminal keeps the target web page in the first terminal and the target web page in the second terminal synchronized.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the target webpage when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server.
  • the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal.
  • the first terminal The webpage status of the target webpage of the terminal is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • FIG. 6 is a schematic flow chart of a web page synchronization method provided by an embodiment of the present application.
  • the web page synchronization method may include the following steps:
  • the S402. Receive the first status data sent by the first terminal.
  • the first status data is the status data after the first status management plug-in installed in the first terminal detects the status change of the target web page;
  • the first state data sent by the first terminal after the state of the target web page changes is received.
  • the server receives the first status data sent by the first terminal
  • the first status is changed through the connection established between the second status management plug-in of the second terminal and the server.
  • the data is pushed to the second terminal, and the first status data is used to instruct the target webpage of the second terminal to be updated, so that after the second terminal receives the first status data pushed by the server, the UI layer of the second terminal can be configured according to the first status data.
  • the status data re-renders the page view of the target web page running on the second terminal, completing the update of the target web page in the second terminal, so that the target web page on the second terminal remains synchronized with the target web page on the first terminal.
  • the server receives the first status data sent by the first terminal, if the target webpage of the second terminal is currently in an unopened state, when the second terminal opens the target webpage, the server receives all the information passed by the second terminal.
  • the server After establishing a connection between the server and the second status management plug-in, the server receives the first status data query request sent by the second terminal based on the installed second status management plug-in, and converts the first status The data is sent to the second status management plug-in of the second terminal, and the first status data is used to instruct the second terminal to update the target web page, so that after the second terminal receives the first status data pushed by the server, the second status data of the second terminal.
  • the UI layer re-renders the page view of the target web page running on the second terminal according to the first status data, and completes the update of the target web page in the second terminal, so that the target web page on the second terminal remains synchronized with the target web page on the first terminal.
  • the first terminal when the first terminal and the second terminal open the target webpage with the same account, when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal obtains The first state data after the target webpage changes, then updates the target webpage of the first terminal based on the first state data, and uploads the first state data to the server connected through the first state management plug-in, so that the server can
  • the target webpage is opened, the first status data is sent to the second terminal, and the second terminal updates the target webpage of the second terminal based on the first status data without using a specific application programming interface by monitoring the status of the target webpage.
  • the management plug-in when the data of the target webpage of the first terminal changes, sends the changed status data to the second terminal to synchronize the webpage status of the target webpage of the second terminal, and open the same target between the two terminals.
  • Web page data is synchronized between electronic devices on the web page.
  • FIG. 7 is a schematic flow chart of a web page synchronization method provided by an embodiment of the present application. Applied to the server, as shown in Figure 7, the web page synchronization method may include the following steps:
  • the first status data is the status data after the first status management plug-in installed in the first terminal detects the status change of the target web page;
  • step S502 please refer to the detailed description of step S402 in another embodiment of the present application, which will not be described again here.
  • step S504 please refer to the detailed description of step S404 in another embodiment of the present application, which will not be described again here.
  • S506 Receive the second status data sent by the second terminal.
  • the second status data is the status data after the second status management plug-in installed in the second terminal detects the status change of the target web page;
  • the second terminal and the first terminal use the same account to log in to the target webpage. Therefore, when the status of the target webpage of the second terminal changes, the second status management plug-in of the second terminal will change the second status after the status change.
  • the data is sent to the server, that is, the server receives the second status data sent by the second terminal.
  • S508 Send the second status data to the first status management plug-in of the first terminal, where the second status data is used to instruct the first terminal to update the target web page.
  • the server pushes the second status data to the first status management plug-in of the first terminal and saves it to In the state management module of the first terminal, the UI layer of the first terminal re-renders the page view of the target web page running on the first terminal according to the second state data, completing the update of the target web page in the first terminal, so that in the first terminal
  • the target web page of the terminal is synchronized with the target web page of the second terminal.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the target webpage when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server.
  • the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal.
  • the first terminal The webpage status of the target webpage of the terminal is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • Figure 8 is a flow chart of a web page synchronization method provided by an embodiment of the present application. As shown in Figure 8, the web page synchronization method may include the following steps:
  • the first status management plug-in in the first terminal establishes a connection with the server, and queries the server to see whether there is historical status data corresponding to the target webpage.
  • the historical status data is in the first terminal.
  • the terminal that last used the same account to log in to the target web page uploads status data to the server before exiting the target web page, that is, the latest status data stored in the server.
  • the first terminal renders and displays the target webpage of the first terminal based on the historical status data
  • the first terminal renders and displays the main page of the target webpage of the first terminal;
  • the first terminal uploads and stores the first status data after the status change to the server;
  • the first status management plug-in in the first terminal monitors the status of the target web page in the first terminal.
  • the changed status is The first state data is uploaded and stored to the server.
  • FIG. 9 is a schematic diagram of an example of a target web page state change provided by an embodiment of the present application.
  • the target web page in the first terminal is initially displayed on the home page.
  • the target web page jumps from the home page to web page 1, and the status of the target web page changes, then the target web page changes.
  • a terminal uploads the first state data corresponding to the changed webpage 1 to the server.
  • step S5 the server determines whether there is a second terminal that uses the same account of the first terminal to log in to the target webpage. If it exists, step S6 is executed. If it does not exist, step S7 is executed;
  • the server pushes the first status data to the second terminal, and the second terminal re-renders and displays the target web page in the second terminal according to the first status data;
  • the first terminal and the second terminal log in to the target webpage with the same account. If the second terminal has opened the target webpage before the first terminal uploads the first status data, the server will push the first status data to the second terminal. , the second terminal re-renders and displays the target web page in the second terminal according to the first status data.
  • FIG. 10 is a schematic diagram of an example of a second terminal rendering a target web page according to an embodiment of the present application.
  • the second terminal before the second terminal receives the first status data, the current target web page is on the main page.
  • the second terminal After receiving the first status data pushed by the server, the second terminal re-renders and displays the second terminal according to the first status data.
  • the target web page of the second terminal jumps from the main page to the web page 1 that is the same as the first terminal.
  • the second terminal re-renders and displays the target web page in the second terminal according to the first status data.
  • steps S7 to S9 please refer to the detailed description of steps S1 to S2.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the second terminal when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server. Pushed to the first terminal, and then the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal. When the data of the target web page of the second terminal changes, the first terminal The webpage status of the terminal's target webpage is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • the web page synchronization device provided by the embodiment of the present application will be introduced in detail below with reference to Figure 11. It should be noted that the web page synchronization device in Figure 11 is used to perform the methods of the embodiments shown in Figures 2, 3 and 5 of the present application. For convenience of explanation, only the parts related to the embodiments of the present application are shown. If specific technical details are not disclosed, please refer to the embodiments shown in Figures 2, 3 and 5 of this application.
  • FIG. 11 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • the web page synchronization device 1 can be implemented as all or part of the terminal device through software, hardware, or a combination of both.
  • the web page synchronization device 1 includes a first status acquisition module 11 and a first status update module 12, specifically including:
  • the first status acquisition module 11 is configured to detect changes in the status of the target web page based on the installed first status management plug-in, and obtain the first status data after the change of the target web page;
  • the first status update module 12 is configured to update the target web page based on the first status data, and upload the first status data to a server connected through the first status management plug-in, where the server is used to When the second terminal opens the target webpage, the target webpage of the second terminal is updated based on the first status data.
  • the first terminal and the second terminal log in to the target webpage with the same account.
  • Figure 12 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • the web page synchronization device also includes a historical status recovery module 13, specifically used for:
  • the homepage data of the target webpage is obtained from the server and displayed.
  • Figure 12 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application. As shown in Figure 12, the web page synchronization device also includes:
  • the second status receiving module 14 is configured to receive the second status data sent by the server, where the second status data is the status data after the status change of the target web page in the second terminal;
  • the second status update module 15 is configured to update the target web page of the first terminal based on the second status data.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the target webpage when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server.
  • the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal.
  • the status data of the first terminal is updated.
  • the webpage status of the target webpage of the terminal is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • the web page synchronization device provided by the embodiment of the present application will be introduced in detail below with reference to Figure 13. It should be noted that the web page synchronization device in Figure 13 is used to execute the methods of the embodiments shown in Figures 6 and 7 of the present application. For ease of explanation, only the parts related to the embodiments of the present application and specific technical details are shown. If it is not disclosed, please refer to the embodiments shown in Figures 6 and 7 of this application.
  • Figure 13 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • the webpage synchronization device 2 can be implemented as all or part of the terminal device through software, hardware, or a combination of both.
  • the web page synchronization device 2 includes a first status receiving module 21 and a first status synchronization module 22, specifically including:
  • the first status receiving module 21 is used to receive the first status data sent by the first terminal.
  • the first status data is the status after the first status management plug-in installed in the first terminal detects the status change of the target web page. data;
  • the first status synchronization module 22 is configured to update the target webpage of the second terminal based on the first status data when the second terminal opens the target webpage.
  • the first terminal and the second terminal are logged in.
  • the account number for the above target page is the same.
  • the first state synchronization module 22 is specifically used for:
  • the first status data is pushed to the second terminal, and the first status data is used to indicate updating the target webpage of the second terminal;
  • the target webpage of the second terminal is currently in an unopened state, when the second terminal opens the target webpage, receive a connection request sent by the second terminal through the installed second state management plug-in;
  • the status data is used to instruct the second terminal to update the target web page.
  • Figure 14 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application.
  • the web page synchronization device also includes a history status sending module 23, specifically used for:
  • the first terminal When the first terminal opens the target web page, receive a connection request sent by the first terminal based on the installed first status management plug-in, and establish a connection with the first status management plug-in;
  • Figure 14 is a schematic structural diagram of a web page synchronization device provided by an embodiment of the present application. As shown in Figure 14, the web page synchronization device also includes:
  • the second status acquisition module 24 is configured to receive second status data sent by the second terminal.
  • the second status data is after the second status management plug-in installed in the second terminal detects a status change of the target web page. status data;
  • the second status synchronization module 25 is used to send the second status data to the first status management plug-in of the first terminal, and the second status is used to instruct the first terminal to respond to the target web page. Make an update.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the target webpage when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server.
  • the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal.
  • the first terminal The webpage status of the target webpage of the terminal is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • the division of the above functional modules is only used as an example. In actual applications, the above function allocation can be completed by different functional modules as needed. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the web page synchronization device and web page synchronization method embodiments provided in the above embodiments belong to the same concept. For details of their implementation, see the method embodiments and will not be described again here.
  • An embodiment of the present application also provides a computer storage medium.
  • the computer storage medium can store multiple instructions.
  • the instructions are suitable to be loaded and executed by the processor as described in the embodiments shown in Figures 1 to 10.
  • This application also provides a computer program product, which stores at least one instruction.
  • the at least one instruction is loaded by the processor and executes the web page synchronization as shown in the above embodiments shown in Figures 1 to 10.
  • FIG. 15 shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application.
  • the electronic device in this application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150.
  • the processor 110, the memory 120, the input device 130 and the output device 140 may be connected through a bus 150.
  • Processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes the terminal by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. 100's of various functions and processing data.
  • the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmab Leogic Array, PLA). implemented in hardware form.
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a modem, etc.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • modem etc.
  • the CPU mainly processes the operating system, user pages and applications; the GPU is responsible for rendering and drawing the display content; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110 and may be implemented solely through a communication chip.
  • the memory 120 may include random access memory (Random Access Memory, RAM) or read-only memory (Read-Only Memory, ROM).
  • RAM Random Access Memory
  • ROM Read-Only Memory
  • the memory 120 includes non-transitory computer-readable storage medium (Non-Transitory Computer-Readable Storage Medium).
  • Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing each of the above method embodiments, etc.
  • the operating system can be an Android system, including a system developed in depth based on the Android system, an IOS system developed by Apple, including a system developed in depth based on the IOS system, or other system.
  • the memory 120 can be divided into operating system space and user space.
  • the operating system runs in the operating system space, and native and third-party applications run in the user space.
  • the operating system allocates corresponding system resources to different third-party applications.
  • different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the Third-party applications have higher requirements for GPU performance.
  • the operating system and third-party applications are independent of each other, and the operating system is often unable to detect the current application scenarios of third-party applications in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenarios of third-party applications.
  • the input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device.
  • the output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 may be co-located, and the input device 130 and the output device 140 may be a touch display screen.
  • the touch display screen can be designed as a full screen, curved screen or special-shaped screen.
  • the touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which are not limited in the embodiments of the present application.
  • the electronic device may include more or fewer components than those shown in the figures, or a combination of certain components. components, or different component arrangements.
  • electronic equipment also includes radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (Wireless Fidelity, WiFi) modules, power supplies, Bluetooth modules and other components, which will not be described again here.
  • the processor 110 can be used to call the web page synchronization program stored in the memory 120 and execute it to implement the web page synchronization method as described in various method embodiments of this application.
  • the first terminal and the second terminal open the target webpage with the same account
  • the first terminal when the status of the target webpage changes based on the first status management plug-in installed in the first terminal, the first terminal The status data is uploaded to the server connected through the first status management plug-in, so that the server sends the first status data to the second terminal when the second terminal opens the target web page, and the second terminal updates the second terminal based on the first status data.
  • the target webpage when the status of the target webpage in the second terminal changes, the second terminal will send the second status data after the status of the target webpage in the second terminal changes to the server, and the server will send the second status data to the server.
  • the first terminal updates the target webpage of the first terminal based on the second status data.
  • the target webpage of the first terminal is When the data of the second terminal changes, the changed status data is sent to the second terminal to synchronously update the web page status of the target web page of the second terminal.
  • the first terminal The webpage status of the target webpage of the terminal is updated synchronously, and webpage data is synchronized between two electronic devices that open the same target webpage.
  • the program can be stored in a computer-readable storage medium.
  • the program can be stored in a computer-readable storage medium.
  • the process may include the processes of the embodiments of each of the above methods.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请公开了一种网页同步方法、装置、存储介质及电子设备,其中,方法包括:基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据,基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同,采用本申请,可以在两个打开相同目标网页的设备之间实现网页数据的同步。

Description

一种网页同步方法、装置、存储介质及电子设备
相关申请的交叉引用
本申请要求于2022年05月20日提交的申请号为202210549144.7的中国新申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及计算机技术领域,尤其涉及一种网页同步方法、装置、存储介质及电子设备。
背景技术
科技正在不断的改善人们的工作和生活,为满足人们工作和生活的需要,各类智能电子设备在人们的工作生活中广泛应用,一个用户拥有多部电子设备的使用权。例如,用户在公司使用台式电脑办公,在家使用笔记本办公,既可以使用手机追剧,也可以使用平板电脑追剧等
在一些场景下,用户在某电子设备上进行某任务而并没有完成时,会有在另一台电子设备中继续之前的任务的需求,以及在两台电子设备之间同步进行某项任务的需求。快速实现两台设备之间的数据同步,是满足此类用户需求的关键。
发明内容
本申请实施例提供的一种网页同步方法、装置、存储介质及电子设备,可以在两个打开相同目标网页的电子设备之间实现网页数据的同步。所述技术方案如下:
第一方面,本申请实施例提供的一种网页同步方法,应用于第一终端,所述方法包括:
基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据;
基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
第二方面,本申请实施例提供的一种网页同步方法,应用于服务器,所述方法包括:
接收第一终端发送的第一状态数据,所述第一状态数据为所述第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
第三方面,本申请实施例提供的一种网页同步装置,所述装置包括:
第一状态获取模块,用于基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据;
第一状态更新模块,用于基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
第四方面,本申请实施例提供的一种网页同步装置,所述装置包括:
第一状态接收模块,用于接收第一终端发送的第一状态数据,所述第一状态数据为所述第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
第一状态同步模块,用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
第五方面,本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行上述的方法步骤。
第六方面,本申请实施例提供一种电子设备,可包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行上述的方法步骤。
在本申请一个或多个实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,获取所述目标网页变化后的第一状态数据,然后基于第一状态数据更新第一终端的目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页;采用本申请,不依赖特定操作系统,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种网页同步方法的系统架构图;
图2为本申请实施例提供的一种网页同步方法的流程示意图;
图3为本申请实施例提供的一种网页同步方法的流程示意图;
图4为本申请实施例提供的一种恢复目标网页的举例示意图;
图5为本申请实施例提供的一种网页同步方法的流程示意图;
图6为本申请实施例提供的一种网页同步方法的流程示意图;
图7为本申请实施例提供的一种网页同步方法的流程示意图;
图8为本申请实施例提供的一种网页同步方法的流程图;
图9为本申请实施例提供的一种目标网页状态变化的举例示意图;
图10为本申请实施例提供的一种第二终端渲染目标网页的举例示意图;
图11为本申请实施例提供的一种网页同步装置的结构示意图;
图12为本申请实施例提供的一种网页同步装置的结构示意图;
图13为本申请实施例提供的一种网页同步装置的结构示意图;
图14为本申请实施例提供的一种网页同步装置的结构示意图;
图15示出了本申请一个示例性实施例提供的电子设备的结构方框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规 定和限定,“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
现有技术中,在鸿蒙操作系统以及IOS操作系统中均存在不同设备间相同应用之间应用数据同步、应用状态同步的解决方案。但是这两种操作系统只能对操作系统的原生应用实现不同设备间相同应用之间的应用数据同步、应用状态同步,无法在实现不同设备的网页之间的数据同步,且依赖于操作系统中特定的应用程序编程接口实现,具有较大的局限性。
基于此,本申请提出了一种网页同步方法,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,获取所述目标网页变化后的第一状态数据,然后基于第一状态数据更新第一终端的目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页;采用本申请,不依赖特定操作系统,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
下面结合具体的实施例进行详细说明。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。附图中所示的流程图仅是示例性说明,不是必须按照所示步骤执行。例如,有的步骤是并列的,在逻辑上并没有严格的先后关系,因此实际执行顺序是可变的。
请参见图1,为本申请实施例提供的一种网页同步方法的系统架构图。如图1所示,所述系统架构图包括第一终端101、网络102、服务器103以及第二终端104。通过网络102可实现第一终端101、服务器103以及第二终端104之间的交互。
第一终端101可以是硬件,也可以是软件。当第一终端为硬件时,可以是各种电子设备,包括但不限于智能手表、智能手机、平板电脑、膝上型便携式计算机和台式计算机等。当第一终端为软件时,可以是安装在上述所列举的电子设备中,其可以实现呈多个软件或软件模块(例如:用来提供分布式服务),也可以实现成单个软件或软件模块,在此不作具体限定。
网络102可以包括各种类型的有线通信链路或无线通信链路,例如:有线通信链路包括光纤、双绞线或同轴电缆,无线通信链路包括蓝牙通信链路、无线保真(Wireless-Fidelity,Wi-Fi)通信链路或微波通信链路等。
服务器103可以是提供各种服务的服务器或服务器集群,例如对用户利用第一终端101所浏览的网站提供支持的后台管理服务器。
第二终端104可以是硬件,也可以是软件。当第二终端为硬件时,可以是各种电子设备,包括但不限于智能手表、智能手机、平板电脑、膝上型便携式计算机和台式计算机等。当第二终端为软件时,可以是安装在上述所列举的电子设备中,其可以实现呈多个软件或 软件模块(例如:用来提供分布式服务),也可以实现成单个软件或软件模块,在此不作具体限定。
一个实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,获取第一终端的目标网页变化后的第一状态数据,然后基于第一状态数据更新第一终端的目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
根据图1所示的系统架构,下面结合具体的实施例进行详细说明。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。附图中所示的流程图仅是示例性说明,不是必须按照所示步骤执行。例如,有的步骤是并列的,在逻辑上并没有严格的先后关系,因此实际执行顺序是可变的。
请参见图2,为本申请实施例提供的一种网页同步方法的流程示意图。在具体的实施例中,所述网页同步方法可以应用于网页同步装置或配置有网页同步装置的电子设备。下面将以执行主体为电子设备为例,说明本实施例的具体流程。下面将针对图2所示的流程进行详细的阐述,所述网页同步方法具体可以包括以下步骤:
S102,基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取目标网页变化后的第一状态数据;
具体的,在第一终端打开目标网页之后,第一终端中的第一状态管理插件可以检测目标网页的网页状态,在检测到目标网页的网页状态发生变化时,获取目标网页变化后的第一状态数据。
在运行目标网页的应用的开发过程中,在应用的状态管理模块中写入第一状态管理插件,状态管理模块用于维护状态数据和页面视图的映射关系,可以根据状态数据控制应用的用户界面(User Interface,UI)层更新页面视图,第一状态管理插件为在应用开发时写入状态管理模块中的插件,可以监控应用中目标网页的页面状态并和目标网页对应的服务器建立连接,当目标网页的状态发生变化时,第一状态管理插件将变化后的状态数据上传至服务器。
一个实施例中,在第一终端打开目标网页之后,第一终端中的第一状态管理插件监控目标网页的状态,在用户对目标网页中的某些组件进行操作并试图引起目标网页的状态发生变化时,第一终端向服务器发送与用户操作对应的HTTP请求,服务器处理第一终端发送的HTTP请求后向第一终端返回处理结果,第一终端根据服务器返回的处理结果生成目标网页变化后的第一状态数据。
S104,基于第一状态数据更新目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,服务器用于在第二终端打开目标网页时,基于第一状态数据更新第二终端的目标网页,第一终端与第二终端登录目标网页的账号相同。
具体的,第一终端的UI层获取第一状态数据,由UI层根据第一状态数据调用相应的组件重新渲染目标网页的页面视图,完成对第一终端中目标网页的更新。同时,第一状态管理插件将目标网页变化后的第一状态数据发送至服务器,服务器可在和第一终端使用相同账号登陆目标网页的第二终端打开目标网页时,基于第一状态数据更新第二终端的目标 网页。
一个实施例中,在第一状态管理插件将目标网页变化后的第一状态数据发送至服务器之后,服务器可将第一状态数据进行存储,并在确定存在和第一终端使用相同账号登陆目标网页的第二终端时,将第一状态数据发送至第二终端,以使第二终端的UI层根据第一状态数据重新渲染运行在第二终端的目标网页的页面视图,完成对第二终端中目标网页的更新。
可选的,若在第一状态管理插件将目标网页变化后的第一状态数据发送至服务器之后,并不存在和第一终端使用相同账号登陆目标网页的第二终端,而在一段时间后,第二终端才打开目标网页,则在第二终端中目标网页对应应用中的第二状态管理插件连接至服务器之后,第二状态管理插件向服务器发送历史状态数据查询请求,以查询服务器中是否存在第一终端上传的历史状态数据,在查询到第一状态数据之后,将第一状态数据通过第二状态管理插件同步至第二终端中的状态管理模块,以使第二终端的UI层根据第一状态数据重新渲染运行在第二终端的目标网页的页面视图,完成对第二终端中目标网页的更新。
可选的,若在第一状态管理插件将目标网页变化后的第一状态数据发送至服务器之后,已经存在和第一终端使用相同账号登陆目标网页的第二终端,且第二终端已连接至服务器一段时间,则由服务器主动将第一终端上传的第一状态数据推送至第二终端的状态管理模块,以使第二终端的UI层根据第一状态数据重新渲染运行在第二终端的目标网页的页面视图,完成对第二终端中目标网页的更新。
需要说明的是,在本申请实施例中,会在服务器建立对目标网页的状态数据的存储环境,用于存储终端上传目标网页的状态数据,状态数据可通过网页应用和用户账号进行数据隔离。
在一个实施例中,第一终端和第二终端之间的关系不仅限于登录目标网页的账号相同,还可以为其他为实现第一终端和第二终端之间目标网页同步而设置的预设规则和关联关系,对此,本申请实施例不做具体限定。例如,可以为第一终端和第二终端所连接的WIFI网络相同、第一终端和第二终端的设备标识相关联、第一终端和第二终端已建立蓝牙连接等。
可选的,在第一终端登录目标网页之后,第二终端在登录目标网页时与第一终端建立网页同步关联关系,这样在第二终端登录目标网页后,即可实现第一终端和第二终端之间的网页同步。网页同步关联关系可以为第一终端和第二终端登录目标网页的网络IP相同、第一终端和第二终端登录目标网页时使用的某种密钥相同等。例如,应用在多人棋局对战场景时,玩家棋手1通过第一终端登录棋局6638,玩家棋手2通过第二终端登录棋局6638,此时,因为玩家棋手1和玩家棋手2登录进相同棋局中,即可在第一终端和第二终端实现棋局6638的同步,其中,棋局6638的棋局编号即为第一终端和第二终端之间的网页同步关联关系。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,获取第一终端的目标网页变化后的第一状态数据,然后基于第一状态数据更新第一终端的目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
在一个实施例中,在第一终端首次打开目标网页时,会根据服务器存储的目标网页最 新的历史状态数据直接在第一终端恢复至历史状态数据对应的网页页面。请参见图3,为本申请实施例提供的一种网页同步方法的流程示意图。如图3所示,所述网页同步方法可以包括以下步骤:
S202,若监测到打开目标网页,则基于第一状态管理插件与服务器建立连接;
具体的,在第一终端首次打开目标网页时,第一终端中目标网页的应用中的第一状态管理插件和目标网页对应的服务器建立连接。
S204,查询服务器中是否存在与目标网页对应的历史状态数据;
具体的,在第一状态管理插件和目标网页对应的服务器建立连接之后,基于该连接,第一终端查询服务器中是否存在与目标网页对应的历史状态数据。
历史状态数据为在第一终端打开目标网页之前,上一次使用相同账号登陆目标网页的终端在退出目标网页之前,上传至服务器的状态数据,也即服务器中存储的最新的状态数据。
S206,若查询到服务器中存在与目标网页对应的历史状态数据,则将历史状态数据同步至第一状态管理插件,基于历史状态数据更新目标网页;
具体的,在第一终端查询到服务器中存储有与目标网页对应的历史状态数据时,将该历史状态数据同步至第一终端的第一状态管理插件,并保存至状态管理模块,以使第一终端的UI层根据历史状态数据渲染运行在第一终端的目标网页的页面视图,使得在第一终端打开的目标网页恢复至上次使用相同账号登陆目标网页退出前的状态。
S208,若查询到服务器中不存在与目标网页对应的历史状态数据,则向服务器获取目标网页的主页数据并显示。
具体的,当服务器中不存在与目标网页对应的历史状态数据,则按照目标网页的标准打开流程,从服务器获取目标网页的主页数据,并在第一终端渲染显示目标网页的主页面。
请参见图4,为本申请实施例提供的一种恢复目标网页的举例示意图。如图4所示,第一终端在打开如图所示的目标网页时,在目标网页未完全加载显示之前,第一终端会查询服务器中是否存在目标网页对应的历史状态数据,在服务器中不存在对应的历史状态数据时,则渲染展示目标网页的主页页面,在服务器中存在目标网页对应的历史状态数据时,则渲染展示历史状态数据对应的目标网页的网页2页面。
在本申请实施例中,在第一终端首次打开目标网页时,基于第一状态管理插件查询服务器中是否存在与目标网页对应的历史状态数据,若存在,则通过将历史状态数据同步至第一终端,以使第一终端中的目标网页恢复至历史状态数据对应的显示状态,以衔接用户上次在目标网页的操作进度,避免用户再经过重复操作来恢复在目标网页的历史进度,提高用户在目标网页的操作效率。
请参见图5,为本申请实施例提供的一种网页同步方法的流程示意图。如图5所示,所述网页同步方法可以包括以下步骤:
S302,基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取目标网页变化后的第一状态数据;
具体的,步骤S302请参见本申请另一实施例中步骤S102中的详细描述,在此不一一赘述。
S304,基于第一状态数据更新目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,服务器用于在第二终端打开目标网页时,基于第一状态数据更新第二终端的目标网页,第一终端与第二终端登录目标网页的账号相同;
具体的,步骤S304请参见本申请另一实施例中步骤S104中的详细描述,在此不一一赘述。
S306,接收服务器发送的第二状态数据,第二状态数据为第二终端中目标网页发生状态变化后的状态数据;
具体的,第二终端和第一终端登录目标网页的账号相同,因此,在第二终端的目标网页的状态发生变化时,第二终端的第二状态管理插件会将状态变化后的第二状态数据发送至服务器,由服务器将第二状态数据推送至正在运行目标网页的第一终端,即第一终端接收服务器发送的第二状态数据,并将第二状态数据保存至状态管理模块。
S308,基于第二状态数据对第一终端的目标网页进行更新。
具体的,在接收服务器发送的第二终端中的目标网页的第二状态数据之后,第一终端的UI层根据第二状态数据重新渲染运行在第一终端的目标网页的页面视图,完成对第一终端中目标网页的更新,使得在第一终端的目标网页与第二终端的目标网页保持同步。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
请参见图6,为本申请实施例提供的一种网页同步方法的流程示意图。应用于服务器,如图6所示,所述网页同步方法可以包括以下步骤:
S402,接收第一终端发送的第一状态数据,第一状态数据为第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
具体的,在第一终端中目标网页的状态发生变化时,接收第一终端发送的目标网页发生状态变化后的第一状态数据。
S404,在第二终端打开目标网页时,基于第一状态数据更新第二终端的目标网页,第一终端与第二终端登录目标网页的账号相同。
可选的,在服务器接收第一终端发送的第一状态数据之后,若第二终端的目标网页当前处于打开状态,则通过第二终端的第二状态管理插件与服务器建立的连接将第一状态数据推送至第二终端,第一状态数据用于指示对第二终端的目标网页进行更新,以使第二终端在接收到服务器推送的第一状态数据之后,第二终端的UI层根据第一状态数据重新渲染运行在第二终端的目标网页的页面视图,完成对第二终端中目标网页的更新,使得在第二终端的目标网页与第一终端的目标网页保持同步。
可选的,在服务器接收第一终端发送的第一状态数据之后,若第二终端的目标网页当前处于未打开状态,则在所述第二终端打开目标网页时,服务器接收第二终端通过所安装的第二状态管理插件发送的连接请求,服务器与第二状态管理插件在建立连接后,接收第二终端基于所安装的第二状态管理插件发送的第一状态数据查询请求,将第一状态数据发送至第二终端的第二状态管理插件,第一状态数据用于指示第二终端对目标网页进行更新,以使第二终端在接收到服务器推送的第一状态数据之后,第二终端的UI层根据第一状态数据重新渲染运行在第二终端的目标网页的页面视图,完成对第二终端中目标网页的更新,使得在第二终端的目标网页与第一终端的目标网页保持同步。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,获取第一终端的目标网页变化后的第一状态数据,然后基于第一状态数据更新第一终端的目标网页,并将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
请参见图7,为本申请实施例提供的一种网页同步方法的流程示意图。应用于服务器,如图7所示,所述网页同步方法可以包括以下步骤:
S502,接收第一终端发送的第一状态数据,第一状态数据为第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
具体的,步骤S502请参见本申请另一实施例中步骤S402中的详细描述,在此不一一赘述。
S504,在第二终端打开目标网页时,基于第一状态数据更新第二终端的目标网页,第一终端与第二终端登录目标网页的账号相同;
具体的,步骤S504请参见本申请另一实施例中步骤S404中的详细描述,在此不一一赘述。
S506,接收第二终端发送的第二状态数据,第二状态数据为第二终端中安装的第二状态管理插件监测到目标网页发生状态变化后的状态数据;
具体的,第二终端和第一终端登录目标网页的账号相同,因此,在第二终端的目标网页的状态发生变化时,第二终端的第二状态管理插件会将状态变化后的第二状态数据发送至服务器,即服务器接收第二终端发送的第二状态数据。
S508,将第二状态数据发送至第一终端的第一状态管理插件,第二状态数据用于指示第一终端对目标网页进行更新。
具体的,在接收第二终端发送的第二状态数据之后,第二终端和第一终端登录目标网页的账号相同,服务器将第二状态数据推送至第一终端的第一状态管理插件并保存至第一终端的状态管理模块中,由第一终端的UI层根据第二状态数据重新渲染运行在第一终端的目标网页的页面视图,完成对第一终端中目标网页的更新,使得在第一终端的目标网页与第二终端的目标网页保持同步。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
请参见图8,为本申请实施例提供的一种网页同步方法的流程图。如图8所示,所述网 页同步方法可以包括以下步骤:
S1,第一终端打开目标网页时,查询服务器中是否存储有目标网页对应的历史状态数据;
具体的,在第一终端打开目标网页时,由第一终端中的第一状态管理插件与服务器建立连接,并查询服务器中是否存在目标网页对应的历史状态数据,历史状态数据为在第一终端打开目标网页之前,上一次使用相同账号登陆目标网页的终端在退出目标网页之前,上传至服务器的状态数据,也即服务器中存储的最新的状态数据。
S2,若服务器中存储有目标网页对应的历史状态数据,则第一终端根据历史状态数据渲染显示第一终端的目标网页;
具体的,若服务器中存储有目标网页对应的历史状态数据,则将该历史状态数据通过第一状态管理插件同步至第一终端,并根据历史状态数据渲染显示第一终端的目标网页。可以一并参见图4。
S3,若服务器中不存在目标网页对应的历史状态数据,则第一终端渲染显示第一终端的目标网页的主页面;
S4,在第一终端中目标网页的状态发生变化时,第一终端将状态变化后的第一状态数据上传存储至服务器;
具体的,在第一终端打开目标网页之后,第一终端中的第一状态管理插件监控第一终端中目标网页的状态,在第一终端中目标网页的状态发生变化时,将状态变化后的第一状态数据上传存储至服务器。
请参见图9,为本申请实施例提供的一种目标网页状态变化的举例示意图。如图9所示,第一终端中目标网页一开始显示在主页页面,响应于用户对目标网页的操作,目标网页从主页页面跳转至网页1页面,目标网页的状态发生了变化,则第一终端将状态发生变化后的网页1页面对应的第一状态数据上传至服务器。
S5,服务器判断是否存在使用第一终端相同账号登录目标网页的第二终端,若存在则执行步骤S6,若不存在,则执行步骤S7;
S6,服务器将第一状态数据推送至第二终端,第二终端根据第一状态数据重新渲染显示第二终端中目标网页;
具体的,第一终端和第二终端登录目标网页的账号相同,若在第一终端上传第一状态数据之前第二终端就已经打开了目标网页,则服务器将第一状态数据推送至第二终端,第二终端根据第一状态数据重新渲染显示第二终端中目标网页。
请参见图10,为本申请实施例提供的一种第二终端渲染目标网页的举例示意图。如图10所示,第二终端在未接收第一状态数据之前,当前目标网页位于主页面,在接收服务器推送的第一状态数据之后,第二终端根据第一状态数据重新渲染显示第二终端中目标网页,第二终端的目标网页由主页面跳转至和第一终端相同的网页1页面。
S7,在第二终端打开目标网页时,第二终端查询服务器是否存储有目标网页对应的历史状态数据;
S8,在查询到服务器中存储的第一终端上传的第一状态数据时,第二终端获取第一状态数据;
S9,第二终端根据第一状态数据重新渲染显示第二终端中目标网页。
步骤S7~S9具体可一并参见步骤S1~S2的详细描述。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页, 同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
下面将结合附图11,对本申请实施例提供的网页同步装置进行详细介绍。需要说明的是,附图11的网页同步装置,用于执行本申请图2、图3和图5所示实施例的方法,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请图2、图3和图5所示的实施例。
请参见图11,为本申请实施例提供的一种网页同步装置的结构示意图。如图11所示,该网页同步装置1可以通过软件、硬件或者两者的结合实现成为终端设备的全部或一部分。根据一些实施例,该网页同步装置1包括,第一状态获取模块11、第一状态更新模块12,具体包括:
第一状态获取模块11,用于基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据;
第一状态更新模块12,用于基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
可选的,请参见图12,为本申请实施例提供的一种网页同步装置的结构示意图。如图12所示,所述网页同步装置,还包括历史状态恢复模块13,具体用于:
若监测到打开目标网页,则基于第一状态管理插件与服务器建立连接;
查询所述服务器中是否存在与所述目标网页对应的历史状态数据;
若查询到所述服务器中存在与所述目标网页对应的历史状态数据,则将所述历史状态数据同步至所述第一状态管理插件,基于所述历史状态数据更新所述目标网页;
若查询到所述服务器中不存在与所述目标网页对应的历史状态数据,则向所述服务器获取所述目标网页的主页数据并显示。
可选的,请参见图12,为本申请实施例提供的一种网页同步装置的结构示意图。如图12所示,所述网页同步装置,还包括:
第二状态接收模块14,用于接收所述服务器发送的第二状态数据,所述第二状态数据为所述第二终端中目标网页发生状态变化后的状态数据;
第二状态更新模块15,用于基于所述第二状态数据对所述第一终端的目标网页进行更新。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时, 将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
下面将结合附图13,对本申请实施例提供的网页同步装置进行详细介绍。需要说明的是,附图13的网页同步装置,用于执行本申请图6、图7所示实施例的方法,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请图6、图7所示的实施例。
请参见图13,为本申请实施例提供的一种网页同步装置的结构示意图。如图13所示,该网页同步装置2可以通过软件、硬件或者两者的结合实现成为终端设备的全部或一部分。根据一些实施例,该网页同步装置2包括,第一状态接收模块21、第一状态同步模块22,具体包括:
第一状态接收模块21,用于接收第一终端发送的第一状态数据,所述第一状态数据为所述第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
第一状态同步模块22,用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
可选的,所述第一状态同步模块22,具体用于:
若第二终端的目标网页当前处于打开状态,则将所述第一状态数据推送至所述第二终端,所述第一状态数据用于指示对所述第二终端的目标网页进行更新;
若第二终端的目标网页当前处于未打开状态,在所述第二终端打开目标网页时,接收所述第二终端通过所安装的第二状态管理插件发送的连接请求;
在建立连接后,接收所述第二终端基于所安装的第二状态管理插件发送的第一状态数据查询请求,将所述第一状态数据发送至所述第二状态管理插件,所述第一状态数据用于指示所述第二终端对目标网页进行更新。
可选的,请参见图14,为本申请实施例提供的一种网页同步装置的结构示意图。如图14所示,所述网页同步装置,还包括历史状态发送模块23,具体用于:
在第一终端打开目标网页时,接收所述第一终端基于所安装的第一状态管理插件发送的连接请求,与所述第一状态管理插件建立连接;
接收所述第一终端基于所述第一状态管理插件发送的历史状态数据查询请求,查询所述目标网页对应的历史状态数据并发送至所述第一状态管理插件,所述历史状态数据用于指示所述第一终端对目标网页进行更新。
可选的,请参见图14,为本申请实施例提供的一种网页同步装置的结构示意图。如图14所示,所述网页同步装置,还包括:
第二状态获取模块24,用于接收所述第二终端发送的第二状态数据,所述第二状态数据为所述第二终端中安装的第二状态管理插件监测到目标网页发生状态变化后的状态数据;
第二状态同步模块25,用于将所述第二状态数据发送至所述第一终端的所述第一状态管理插件,所述第二状态所述用于指示所述第一终端对目标网页进行更新。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然 后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
需要说明的是,上述实施例提供的网页同步装置在执行网页同步方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的网页同步装置与网页同步方法实施例属于同一构思,其体现实现过程详见方法实施例,这里不再赘述。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请实施例还提供的一种计算机存储介质,所述计算机存储介质可以存储有多条指令,所述指令适于由处理器加载并执行如上述图1-图10所示实施例的所述网页同步方法,具体执行过程可以参见图1-图10所示实施例的具体说明,在此不进行赘述。
本申请还提供的一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行如上述图1-图10所示实施例的所述网页同步方法,具体执行过程可以参见图1-图10所示实施例的具体说明,在此不进行赘述。
请参考图15,其示出了本申请一个示例性实施例提供的电子设备的结构方框图。本申请中的电子设备可以包括一个或多个如下部件:处理器110、存储器120、输入装置130、输出装置140和总线150。处理器110、存储器120、输入装置130和输出装置140之间可以通过总线150连接。
处理器110可以包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个电子设备内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行终端100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmab Leogic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户页面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器120包括非瞬时性计算机可读介质(Non-Transitory Computer-Readable Storage Medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统,包括基于Android系统深度开发的系统、苹果公司开发的IOS系统,包括基于IOS系统深度开发的系统或其它系统。
存储器120可分为操作系统空间和用户空间,操作系统即运行于操作系统空间,原生 及第三方应用程序即运行于用户空间。为了保证不同第三方应用程序均能够达到较好的运行效果,操作系统针对不同第三方应用程序为其分配相应的系统资源。然而,同一第三方应用程序中不同应用场景对系统资源的需求也存在差异,比如,在本地资源加载场景下,第三方应用程序对磁盘读取速度的要求较高;在动画渲染场景下,第三方应用程序则对GPU性能的要求较高。而操作系统与第三方应用程序之间相互独立,操作系统往往不能及时感知第三方应用程序当前的应用场景,导致操作系统无法根据第三方应用程序的具体应用场景进行针对性的系统资源适配。
为了使操作系统能够区分第三方应用程序的具体应用场景,需要打通第三方应用程序与操作系统之间的数据通信,使得操作系统能够随时获取第三方应用程序当前的场景信息,进而基于当前场景进行针对性的系统资源适配。
其中,输入装置130用于接收输入的指令或数据,输入装置130包括但不限于键盘、鼠标、摄像头、麦克风或触控设备。输出装置140用于输出指令或数据,输出装置140包括但不限于显示设备和扬声器等。在一个示例中,输入装置130和输出装置140可以合设,输入装置130和输出装置140为触摸显示屏。
所述触摸显示屏可被设计成为全面屏、曲面屏或异型屏。触摸显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备的结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备中还包括射频电路、输入单元、传感器、音频电路、无线保真(Wireless Fidelity,WiFi)模块、电源、蓝牙模块等部件,在此不再赘述。
在图15所示的电子设备中,处理器110可以用于调用存储器120中存储的网页同步程序,并执行以实现如本申请各个方法实施例所述的网页同步方法。
在本申请实施例中,在第一终端和第二终端以相同的账号打开目标网页时,基于第一终端中安装的第一状态管理插件监测到目标网页的状态发生变化时,通过将第一状态数据上传至通过第一状态管理插件连接的服务器,以使服务器在第二终端打开所述目标网页时将第一状态数据发送至第二终端,第二终端基于第一状态数据更新第二终端的目标网页,同样,在第二终端的目标网页的状态发生变化时,第二终端会将第二终端中目标网页的状态发生变化后的第二状态数据发送至服务器,服务器将第二状态数据推送至第一终端,然后第一终端基于第二状态数据更新第一终端的目标网页,不需要使用特定的应用程序编程接口,通过监控目标网页状态的状态管理插件,在第一终端的目标网页的数据发生变化时,将状态变化后的状态数据发送至第二终端,以对第二终端的目标网页的网页状态同步进行更新,在第二终端的目标网页的数据发生变化时,对第一终端的目标网页的网页状态同步进行更新,在两个打开相同目标网页的电子设备之间实现了网页数据的同步。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体或随机存储记忆体等。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (11)

  1. 一种网页同步方法,其特征在于,应用于第一终端,所述方法包括:
    基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据;
    基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所安装的第一状态管理插件监测到目标网页的状态发生变化之前,还包括:
    若监测到打开目标网页,则基于第一状态管理插件与服务器建立连接;
    查询所述服务器中是否存在与所述目标网页对应的历史状态数据;
    若查询到所述服务器中存在与所述目标网页对应的历史状态数据,则将所述历史状态数据同步至所述第一状态管理插件,基于所述历史状态数据更新所述目标网页;
    若查询到所述服务器中不存在与所述目标网页对应的历史状态数据,则向所述服务器获取所述目标网页的主页数据并显示。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    接收所述服务器发送的第二状态数据,所述第二状态数据为所述第二终端中目标网页发生状态变化后的状态数据;
    基于所述第二状态数据对所述第一终端的目标网页进行更新。
  4. 一种网页同步方法,其特征在于,应用于服务器,所述方法包括:
    接收第一终端发送的第一状态数据,所述第一状态数据为所述第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
    在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
  5. 根据权利要求4所述的方法,其特征在于,所述在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,包括:
    若第二终端的目标网页当前处于打开状态,则将所述第一状态数据推送至所述第二终端,所述第一状态数据用于指示对所述第二终端的目标网页进行更新;
    若第二终端的目标网页当前处于未打开状态,在所述第二终端打开目标网页时,接收所述第二终端通过所安装的第二状态管理插件发送的连接请求;
    在建立连接后,接收所述第二终端基于所安装的第二状态管理插件发送的第一状态数据查询请求,将所述第一状态数据发送至所述第二状态管理插件,所述第一状态数据用于指示所述第二终端对目标网页进行更新。
  6. 根据权利要求4所述的方法,其特征在于,所述接收第一终端发送的第一状态数据之前,还包括:
    在第一终端打开目标网页时,接收所述第一终端基于所安装的第一状态管理插件发送的连接请求,与所述第一状态管理插件建立连接;
    接收所述第一终端基于所述第一状态管理插件发送的历史状态数据查询请求,查询所述目标网页对应的历史状态数据并发送至所述第一状态管理插件,所述历史状态数据用于指示所述第一终端对目标网页进行更新。
  7. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    接收所述第二终端发送的第二状态数据,所述第二状态数据为所述第二终端中安装的第二状态管理插件监测到目标网页发生状态变化后的状态数据;
    将所述第二状态数据发送至所述第一终端的所述第一状态管理插件,所述第二状态数据用于指示所述第一终端对目标网页进行更新。
  8. 一种网页同步装置,其特征在于,所述装置包括:
    第一状态获取模块,用于基于所安装的第一状态管理插件监测到目标网页的状态发生变化,获取所述目标网页变化后的第一状态数据;
    第一状态更新模块,用于基于所述第一状态数据更新所述目标网页,并将所述第一状态数据上传至通过所述第一状态管理插件连接的服务器,所述服务器用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
  9. 一种网页同步装置,其特征在于,所述装置包括:
    第一状态接收模块,用于接收第一终端发送的第一状态数据,所述第一状态数据为所述第一终端中安装的第一状态管理插件监测到目标网页发生状态变化后的状态数据;
    第一状态同步模块,用于在第二终端打开所述目标网页时,基于所述第一状态数据更新所述第二终端的目标网页,所述第一终端与所述第二终端登录所述目标网页的账号相同。
  10. 一种存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1~3或4~7中任意一项所述方法的步骤。
  11. 一种电子设备,其特征在于,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1~3或4~7中任意一项所述方法的步骤。
PCT/CN2022/139967 2022-05-20 2022-12-19 一种网页同步方法、装置、存储介质及电子设备 WO2023221495A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210549144.7 2022-05-20
CN202210549144.7A CN114968400A (zh) 2022-05-20 2022-05-20 一种网页同步方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2023221495A1 true WO2023221495A1 (zh) 2023-11-23

Family

ID=82984980

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/139967 WO2023221495A1 (zh) 2022-05-20 2022-12-19 一种网页同步方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN114968400A (zh)
WO (1) WO2023221495A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968400A (zh) * 2022-05-20 2022-08-30 Oppo广东移动通信有限公司 一种网页同步方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765753A (zh) * 2014-01-08 2015-07-08 腾讯科技(深圳)有限公司 浏览网页的方法及装置
CN109302461A (zh) * 2018-09-13 2019-02-01 网易(杭州)网络有限公司 信息展示、处理方法、介质、系统和计算设备
CN109936621A (zh) * 2019-01-28 2019-06-25 平安科技(深圳)有限公司 信息安全的多页面消息推送方法、装置、设备及存储介质
CN110633439A (zh) * 2018-06-06 2019-12-31 阿里巴巴集团控股有限公司 页面的处理方法及系统
CN111028052A (zh) * 2019-11-28 2020-04-17 维沃移动通信有限公司 一种界面操作方法及电子设备
CN114968400A (zh) * 2022-05-20 2022-08-30 Oppo广东移动通信有限公司 一种网页同步方法、装置、存储介质及电子设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488754B (zh) * 2013-09-22 2017-03-29 复旦大学 一种异构文档协作云服务间透明互操作的方法
CN108228022A (zh) * 2016-12-20 2018-06-29 深圳市优朋普乐传媒发展有限公司 一种切换终端设备显示页面的方法及装置
CN108347464A (zh) * 2017-01-23 2018-07-31 国基电子(上海)有限公司 应用程序的运行状态同步方法、系统及电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765753A (zh) * 2014-01-08 2015-07-08 腾讯科技(深圳)有限公司 浏览网页的方法及装置
CN110633439A (zh) * 2018-06-06 2019-12-31 阿里巴巴集团控股有限公司 页面的处理方法及系统
CN109302461A (zh) * 2018-09-13 2019-02-01 网易(杭州)网络有限公司 信息展示、处理方法、介质、系统和计算设备
CN109936621A (zh) * 2019-01-28 2019-06-25 平安科技(深圳)有限公司 信息安全的多页面消息推送方法、装置、设备及存储介质
CN111028052A (zh) * 2019-11-28 2020-04-17 维沃移动通信有限公司 一种界面操作方法及电子设备
CN114968400A (zh) * 2022-05-20 2022-08-30 Oppo广东移动通信有限公司 一种网页同步方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN114968400A (zh) 2022-08-30

Similar Documents

Publication Publication Date Title
US10165391B2 (en) Companion application for activity cooperation
CN113568884B (zh) 一种文件管理方法、装置、电子设备及存储介质
US9203252B2 (en) Redirecting notifications to a wearable computing device
WO2015070816A1 (zh) 应用程序推送方法、装置、设备及系统
CN112260853B (zh) 容灾切换方法、装置、存储介质及电子设备
CN104601205A (zh) 一种内容共享的方法及装置
CN106802762B (zh) 在虚拟会话中同步服务器侧键盘布局与客户端侧布局
WO2019119315A1 (zh) 基于多操作系统的输入处理方法、装置及电子设备
WO2023221495A1 (zh) 一种网页同步方法、装置、存储介质及电子设备
AU2019256257A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
KR20220091441A (ko) 데이터 동기화 방법과 장치, 전자 기기, 저장 매체 및 컴퓨터 프로그램
CN113286349B (zh) 个人热点连接方法、装置、终端及存储介质
CN107798008B (zh) 内容推送系统、方法及装置
CN112966201B (zh) 对象处理方法、装置、电子设备以及存储介质
WO2018000621A1 (zh) 通信数据同步方法及电子设备
CN106507413A (zh) 发送消息的方法、移动终端及播放设备
CN110568976B (zh) 控制应用显示的方法、装置、设备、存储介质
CN111698337A (zh) 建立通信连接的方法、装置及设备
WO2021072760A1 (zh) 触摸屏报点方法、装置、电子设备及存储介质
CN106331821B (zh) 音视频播放系统中的数据同步方法和装置
CN111258810A (zh) 一种切换数据源的实现方法、系统、终端设备和存储介质
CN111176679A (zh) 一种应用程序更新方法和装置
CN111193717A (zh) Ftp黑白名单控制方法、装置及电子设备
CN114125048B (zh) 一种消息推送设置方法、装置、存储介质及电子设备
CN115904514B (zh) 基于三维场景中云渲染像素流实现方法及终端设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22942515

Country of ref document: EP

Kind code of ref document: A1