A browser operation method, browser device, equipment and storage medium

The method addresses data loss in browsers by using a waiting queue to persist data in local cache and IndexedDB, ensuring seamless data storage across browser closures.

CN113987382BActive Publication Date: 2024-12-24CCB FINTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111263680.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2024-12-24
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

Existing browser storage methods like localStorage, sessionStorage, and cookies are inadequate for large data storage, and IndexedDB access can fail due to asynchronous operations, leading to data loss when the browser is closed unexpectedly.

Method used

A method that persists data in a waiting queue before closing the browser, using local cache for synchronous storage and IndexedDB for asynchronous storage, ensuring data is written to IndexedDB upon reopening.

Benefits of technology

Ensures data persistence without user intervention, preventing data loss during abnormal browser closures by combining synchronous local cache with asynchronous IndexedDB operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113987382B_ABST
    Figure CN113987382B_ABST
Patent Text Reader

Abstract

The present invention provides a browser operation method, browser device, equipment and storage medium, the method comprising: receiving an instruction to close the browser; determining whether there is data to be persisted in a waiting queue; if there is data to be persisted in the waiting queue, storing the data to be persisted in the local cache of the browser; receiving an instruction to restart the browser; obtaining the data to be persisted stored in the local cache of the browser; writing the data to be persisted into the waiting queue to persistently store the data to be persisted. The browser operation method of the present invention, by combining the asynchronous characteristics of the index database and the synchronous characteristics of the local cache, can realize the persistence of a large amount of data without the user's perception, and prevents data loss due to abnormal conditions such as browser closing, thereby ensuring a good user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a browser operation method, a browser device, equipment and a storage medium. Background Art

[0002] With the development of Web front-end technology and the popularity of modern browsers, more Web applications have been integrated into daily work and life. When users use browsers, a large amount of front-end data is generated. This front-end data can be stored for a long time through persistence technology, so that the previously saved data can be accessed after the browser is restarted.

[0003] Currently, the commonly used storage methods in browsers include local cache (localStorage), session cache (sessionStorage) and cookies, but their storage size is limited and not suitable for storing large amounts of data. Compared with the above storage methods, Indexed Database (IndexedDB) can provide persistent data storage services, and allows the storage of large amounts of data, provides search interfaces, and creates indexes. It is a common solution for storing large amounts of data.

[0004] However, since IndexedDB access is an asynchronous operation, when the browser is closed, the disk containing the database is accidentally removed, or the database storage permission is lost, which will cause the storage of some unfinished database transactions to fail. To address this problem, the prior art usually adds a beforeunload event to remind the user that if there are transactions that have not been completed when the browser is closed, the user is reminded not to close the browser temporarily. However, this method cannot prevent the user from continuing to close the browser, which will still cause data loss and a bad user experience. Summary of the invention

[0005] In view of the above-mentioned problems in the prior art, the purpose of the present invention is to provide a browser operation method, browser device, equipment and storage medium, which can realize the persistence of a large amount of data without the user's perception and will not cause data loss due to abnormal conditions such as browser closing.

[0006] In order to solve the above problem, the present invention provides a browser operation method, comprising:

[0007] Receive instructions to close the browser;

[0008] Determine whether there is data to be persisted in the waiting queue;

[0009] If there is data to be persisted in the waiting queue, storing the data to be persisted in the local cache of the browser;

[0010] receiving an instruction to restart the browser;

[0011] Obtaining data to be persisted stored in the local cache of the browser;

[0012] The data to be persisted is written into the waiting queue to perform persistent storage on the data to be persisted.

[0013] Furthermore, if there is data to be persisted in the waiting queue, after storing the data to be persisted in the local cache of the browser, the method further includes:

[0014] Determine whether the data to be persisted is successfully stored in the local cache;

[0015] If the data to be persisted is successfully stored in the local cache, the browser is closed in response to the instruction to close the browser.

[0016] Further, the obtaining the data to be persisted stored in the local cache of the browser includes:

[0017] Reading each piece of data stored in the local cache respectively, and determining whether the data has been stored in the index database;

[0018] Data that is not stored in the index database is obtained as data to be persisted that is stored in the local cache.

[0019] Furthermore, the method further comprises:

[0020] Obtaining data to be persisted generated during the operation of the browser;

[0021] The data to be persisted is written into a waiting queue to perform persistent storage on the data to be persisted.

[0022] Furthermore, the method further comprises:

[0023] Reading the data to be persisted from the waiting queue in a preset order, and storing the data to be persisted in an index database;

[0024] Determine whether the data to be persisted is successfully stored in the index database;

[0025] If the data to be persisted is successfully stored in the index database, the data to be persisted is deleted from the waiting queue.

[0026] Another aspect of the present invention provides a browser device, comprising:

[0027] A first receiving module, used for receiving an instruction to close the browser;

[0028] The first judgment module is used to judge whether there is data to be persisted in the waiting queue;

[0029] A first storage module is used to store the data to be persisted in the local cache of the browser when there is data to be persisted in the waiting queue;

[0030] A second receiving module, used for receiving an instruction to restart the browser;

[0031] A first acquisition module, used to acquire the data to be persisted stored in the local cache of the browser;

[0032] The first writing module is used to write the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted.

[0033] Furthermore, the device also includes:

[0034] A second acquisition module is used to acquire the data to be persisted generated during the operation of the browser;

[0035] The second writing module is used to write the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted.

[0036] Furthermore, the device also includes:

[0037] A second storage module is used to read the data to be persisted from the waiting queue in a preset order, and store the data to be persisted in an index database;

[0038] A second judgment module is used to judge whether the data to be persisted is successfully stored in the index database;

[0039] The deleting module is used to delete the data to be persisted from the waiting queue when the data to be persisted is successfully stored in the index database.

[0040] Another aspect of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the browser running method as described above.

[0041] Another aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the browser operation method as described above.

[0042] Due to the above technical solution, the present invention has the following beneficial effects:

[0043] According to the browser operation method of the embodiment of the present invention, by storing the data to be persisted in the waiting queue that has not been successfully persisted in the local cache of the browser before closing the browser, when the browser is started again, the data to be persisted stored in the local cache is written into the waiting queue again, so as to store the data to be persisted in the index database, it is possible to achieve persistence of a large amount of data without the user's perception, and by combining the asynchronous characteristics of the index database and the synchronous characteristics of the local cache, data loss will not be caused by abnormal conditions such as browser closing, thereby ensuring a good user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 is a flow chart of a browser operation method provided by an embodiment of the present invention;

[0046] Figure 2 is a flowchart of a browser operation method provided by another embodiment of the present invention;

[0047] Figure 3 is a flowchart of a browser operation method provided by another embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of the structure of a browser device provided by an embodiment of the present invention;

[0049] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0052] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention and are not used to limit the embodiments of the present invention. First, the embodiments of the present invention explain the following concepts:

[0053] Local Cache (localstorage): localStorage and sessionStorage are collectively referred to as Web Storage, which allow web pages to store data on the browser side. The data saved in sessionStorage is used for a browser session, and when the session ends (usually when the window is closed), the data is cleared; the life cycle of localStorage is permanent, unless the user clears the localStorage information in the user interface provided by the browser, otherwise the information will always exist.

[0054] IndexedDB: IndexedDB is a Web API for storing large data structures in the browser and provides indexing capabilities for high-performance lookups. Like other SQL-based relational database management systems (RDBMS), IndexedDB is a transactional database system. However, it uses JavaScript objects rather than tables with a fixed number of columns to store data.

[0055] IndexedDB has the following features:

[0056] 1. Large storage space: no upper limit on storage, generally not less than 250M;

[0057] 2. Various storage formats: support string storage; support binary storage (ArrayBuffer objects and Blob objects); support JSON key-value pair storage. An object is equivalent to a data table in a relational database, which can be called an object store.

[0058] 3. Asynchronous operation: Better performance. Prevents the web page from slowing down when reading and writing large amounts of data;

[0059] 4. Same-origin restriction: Each database corresponds to a domain name. You can only access the database under your own domain name, and cannot access across domains;

[0060] 5. Support transactions: In a series of operation steps, if one step fails, the entire transaction will be canceled and the database will be rolled back to the state before the transaction occurred. There is no situation where only part of the data is rewritten.

[0061] Persistence: A mechanism for converting data between a persistent state and a transient state, that is, converting transient data (such as data in memory, which cannot be permanently stored) into persistent data (such as data persisted in a database, which can be stored for a long time).

[0062] Reference Manual Attached Figure 1 , which shows a process of a browser operation method provided by an embodiment of the present invention, the method can be applied to the scenario of persistent storage of a large amount of data on the web front end, specifically as follows Figure 1 As shown, the method may include the following steps:

[0063] S110: receiving an instruction to close the browser.

[0064] In the embodiment of the present invention, the browser can be run in an electronic device, and the electronic device can include but is not limited to: various terminal devices such as smart phones, tablet computers, laptop computers, PDAs, desktop computers, and vehicle-mounted terminals. The system of the electronic device refers to an operating system, and can include but is not limited to: Android system, Symbian system, Windows system, IOS (mobile operating system developed by Apple) system, Linux system, etc.

[0065] In the embodiment of the present invention, when the user wants to close the browser, he can click the browser close or exit option in the browser interface to generate an instruction to close the browser. At this time, the electronic device running the browser can receive the instruction to close the browser.

[0066] S120: Determine whether there is data to be persisted in the waiting queue.

[0067] In the embodiment of the present invention, the data to be persisted is the data generated during the operation of the browser and needs to be persistently stored, for example, it may include the user's operation behavior data on the browser, the error information during the operation of the browser, and the performance data of the browser page, etc. The data is persistently stored, that is, the process of storing the data in the database. Specifically, the embodiment of the present invention can use an indexed database (indexedDB) to store a large amount of data generated during the operation of the browser.

[0068] In the embodiment of the present invention, data can be persisted in an asynchronous manner, firstly, the data to be persisted is written into the waiting queue, and then the data in the waiting queue is inserted into the indexedDB one by one, and the data is deleted from the waiting queue after the insertion is successful. Therefore, it is only necessary to determine whether there is still data stored in the waiting queue. When there is still data stored in the waiting queue, it can be determined that there is data to be persisted in the waiting queue. When there is no data stored in the waiting queue, it can be determined that there is no data to be persisted in the waiting queue.

[0069] In an embodiment of the present invention, the waiting queue can be a javascript object stored in the memory, and the waiting queue can adopt a data structure of a two-way data linked list to store data that needs to be persisted during the operation of the browser. Since the storage space of the two-way data linked list itself is not continuous, it is very fast to insert or delete a data in the two-way data linked list, and in the process of persisting a large amount of data, the waiting queue will frequently perform insertion and deletion operations, so the use of a two-way data linked list structure to store the data to be persisted can improve the efficiency of data persistence and browser performance.

[0070] In a possible embodiment, the waiting queue may also adopt an array data structure, which is not limited in the embodiment of the present invention. By adopting an array data structure, a certain data can be quickly found, but when inserting and deleting, in order to maintain the continuity of the memory data, a large amount of data movement work needs to be performed, so the time complexity is O(n).

[0071] In the embodiment of the present invention, the method may further include a process of persisting the data. Specifically, the method may further include a process of writing the data to be persisted into a waiting queue, such as Figure 2 As shown, the process of writing the data to be persisted into the waiting queue may include the following steps:

[0072] S210: Acquire the data to be persisted generated during the operation of the browser;

[0073] S220: Writing the data to be persisted into a waiting queue to perform persistent storage on the data to be persisted.

[0074] Specifically, the method may also include a process of persistently storing the data in the waiting queue, such as Figure 3 As shown, the process of persistently storing the data in the waiting queue may include the following steps:

[0075] S310: Reading the data to be persisted from the waiting queue in a preset order, and storing the data to be persisted in an index database;

[0076] S320: Determine whether the data to be persisted is successfully stored in the index database;

[0077] S330: If the data to be persisted is successfully stored in the index database, the data to be persisted is deleted from the waiting queue.

[0078] Specifically, the data can be persisted in an asynchronous operation mode, that is, the process of writing the data to be persisted into the waiting queue and the process of persistently storing the data in the waiting queue can be performed asynchronously. The asynchronous operation mode can be used to persist data, which can avoid the problem of slowing down the running speed of the web page when persisting a large amount of data, and provide a better user experience.

[0079] Exemplarily, various web front-end applications can be run based on the browser to obtain various types of data generated by users when using the web front-end applications, and written into the waiting queue as data to be persisted. The data in the waiting queue can then be inserted into indexedDB one by one to complete the persistence of the web front-end data.

[0080] Specifically, the preset order can be set according to actual conditions, and the embodiment of the present invention does not limit this. Exemplarily, the data can be read in the order in which they are written into the waiting queue, that is, the data written into the waiting queue first will be read first and stored in the index database.

[0081] S130: If there is data to be persisted in the waiting queue, the data to be persisted is stored in the local cache of the browser.

[0082] In the embodiment of the present invention, due to the asynchronous reading and writing characteristics of indexedDB data, it is impossible to ensure that all data is persisted when the browser is closed. A local cache (localstorage) with synchronization characteristics can be combined to avoid data loss caused by closing the browser. Specifically, if there is still data to be persisted in the waiting queue when the browser's closing instruction is received (that is, there is still data in the waiting queue that has not been written to indexedDB), each data to be persisted in the waiting queue can be synchronously written to localstorage. Since the storage period of data in localstorage is permanent, unless the user manually clears the data, the security and effectiveness of localStorage data can be guaranteed, and these data still exist locally after the browser is closed.

[0083] In a possible embodiment, if there is data to be persisted in the waiting queue, after storing the data to be persisted in the local cache of the browser, the method may further include:

[0084] Determine whether the data to be persisted is successfully stored in the local cache;

[0085] If the data to be persisted is successfully stored in the local cache, the browser is closed in response to the instruction to close the browser.

[0086] Specifically, it is also possible to determine whether each data to be persisted in the waiting queue is written successfully, and after each data to be persisted is written successfully, a close instruction is executed to close the browser. The embodiment of the present invention can effectively ensure the integrity of the data stored in the local cache by closing the browser after each data to be persisted in the waiting queue is successfully stored in the local cache.

[0087] S140: Receive an instruction to restart the browser.

[0088] In the embodiment of the present invention, when the user opens the browser again, the electronic device running the browser can receive an instruction to restart the browser.

[0089] S150: Acquire the data to be persisted stored in the local cache of the browser.

[0090] In the embodiment of the present invention, when the user opens the browser again, it can be detected whether there is data in the local cache of the browser that has not been persisted. If so, it can be persisted again.

[0091] Specifically, obtaining the data to be persisted stored in the local cache of the browser may include:

[0092] Reading each piece of data stored in the local cache respectively, and determining whether the data has been stored in the index database;

[0093] Data that is not stored in the index database is obtained as data to be persisted that is stored in the local cache.

[0094] In practical applications, each data read from the local cache can be compared with the existing data in indexedDB one by one. If the data is not stored in indexedDB, it is used as data to be persisted. If the data is already stored in indexedDB, it is ignored.

[0095] S160: Writing the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted.

[0096] In the embodiment of the present invention, after the data to be persisted is written into the waiting queue, the data in the waiting queue may be inserted into the indexedDB one by one, thereby completing the persistence of the data.

[0097] In summary, according to the browser operation method of an embodiment of the present invention, by storing the data to be persisted in the waiting queue that has not been successfully persisted in the local cache of the browser before closing the browser, when the browser is started again, the data to be persisted stored in the local cache is written into the waiting queue again, so as to store the data to be persisted in the index database. This can achieve persistence of a large amount of data without the user's perception, and by combining the asynchronous characteristics of the index database and the synchronous characteristics of the local cache, data loss will not be caused by abnormal conditions such as browser closing, thereby ensuring a good user experience.

[0098] Reference Manual Attached Figure 4 , which shows the structure of a browser device 400 provided by an embodiment of the present invention. Figure 4 As shown, the apparatus 400 may include:

[0099] A first receiving module 410 is used to receive an instruction to close the browser;

[0100] The first determination module 420 is used to determine whether there is data to be persisted in the waiting queue;

[0101] A first storage module 430 is used to store the data to be persisted in the local cache of the browser when there is data to be persisted in the waiting queue;

[0102] A second receiving module 440 is used to receive an instruction to restart the browser;

[0103] A first acquisition module 450 is used to acquire the data to be persisted stored in the local cache of the browser;

[0104] The first writing module 460 is used to write the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted.

[0105] In a possible embodiment, the device 400 may further include:

[0106] A second acquisition module is used to acquire the data to be persisted generated during the operation of the browser;

[0107] The second writing module is used to write the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted.

[0108] In a possible embodiment, the device 400 may further include:

[0109] A second storage module is used to read the data to be persisted from the waiting queue in a preset order, and store the data to be persisted in an index database;

[0110] A second judgment module is used to judge whether the data to be persisted is successfully stored in the index database;

[0111] The deleting module is used to delete the data to be persisted from the waiting queue when the data to be persisted is successfully stored in the index database.

[0112] In a possible embodiment, the device 400 may further include:

[0113] A third judgment module is used to judge whether the data to be persisted is successfully stored in the local cache;

[0114] The closing module is used to close the browser in response to the instruction to close the browser when the data to be persisted is successfully stored in the local cache.

[0115] It should be noted that the device provided in the above embodiment, when implementing its functions, only uses the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept, and the specific implementation process is detailed in the corresponding method embodiment, which will not be repeated here.

[0116] An embodiment of the present invention further provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the browser running method provided in the above method embodiment.

[0117] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0118] In a specific embodiment, Figure 5 The hardware structure diagram of an electronic device for implementing the browser operation method provided by the embodiment of the present invention is shown. The electronic device may be a computer terminal, a mobile terminal or other device. The electronic device may also participate in forming or include the browser operation device provided by the embodiment of the present invention. Figure 5 As shown, the electronic device 500 may include a memory 510 of one or more computer-readable storage media, a processor 520 of one or more processing cores, an input unit 530, a display unit 540, a radio frequency (RF) circuit 550, a wireless fidelity (WiFi) module 560, and a power supply 570. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device 500, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0119] The memory 510 can be used to store software programs and modules, and the processor 520 executes various functional applications and data processing by running or executing the software programs and modules stored in the memory 510, and calling the data stored in the memory 510. The memory 510 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 510 may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 510 may also include a memory controller to provide the processor 520 with access to the memory 510.

[0120] The processor 520 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 510, and calling data stored in the memory 510, it executes various functions of the electronic device 500 and processes data, thereby monitoring the electronic device 500 as a whole. The processor 520 can be a central processing unit, or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0121] The input unit 530 may be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 530 may include a touch-sensitive surface 531 and other input devices 532. Specifically, the touch-sensitive surface 531 may include but is not limited to a touch pad or a touch screen, and the other input devices 532 may include but are not limited to one or more of a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, etc.

[0122] The display unit 540 may be used to display information input by a user or information provided to a user and various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, videos, and any combination thereof. The display unit 540 may include a display panel 541, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0123] The RF circuit 550 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 520 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 550 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 550 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0124] WiFi is a short-range wireless transmission technology. The electronic device 500 can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 560. It provides users with wireless broadband Internet access. Figure 5 A WiFi module 560 is shown, but it is understandable that it is not an essential component of the electronic device 500 and can be omitted as needed without changing the essence of the invention.

[0125] The electronic device 500 also includes a power supply 570 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 520 through a power management system, so that the power management system can manage charging, discharging, power consumption management and other functions. The power supply 570 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0126] It should be noted that, although not shown, the electronic device 500 may also include a Bluetooth module, etc., which will not be described in detail here.

[0127] An embodiment of the present invention also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a browser operation method. The at least one instruction or the at least one program is loaded and executed by the processor to implement the browser operation method provided by the above method embodiment.

[0128] Optionally, in an embodiment of the present invention, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0129] An embodiment of the present invention further provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the browser operation method provided in the above-mentioned various optional implementation examples.

[0130] It should be noted that the sequence of the embodiments of the present invention described above is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0131] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0132] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0133] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A browser operation method, characterized in that: include: Receive instructions to close the browser; Determine whether there is data to be persisted in the waiting queue; If there is data to be persisted in the waiting queue, storing the data to be persisted in the local cache of the browser; receiving an instruction to restart the browser; Obtaining data to be persisted stored in the local cache of the browser; Writing the data to be persisted into the waiting queue to perform persistent storage on the data to be persisted; The method further comprises: Obtaining data to be persisted generated during the operation of the browser; Writing the data to be persisted into a waiting queue to perform persistent storage on the data to be persisted; as well as, Reading the data to be persisted from the waiting queue in a preset order, and storing the data to be persisted in an index database; Determine whether the data to be persisted is successfully stored in the index database; If the data to be persisted is successfully stored in the index database, the data to be persisted is deleted from the waiting queue.

2. The method according to claim 1, characterized in that If there is data to be persisted in the waiting queue, after storing the data to be persisted in the local cache of the browser, the method further includes: Determine whether the data to be persisted is successfully stored in the local cache; If the data to be persisted is successfully stored in the local cache, the browser is closed in response to the instruction to close the browser.

3. The method according to claim 1, characterized in that: The obtaining of the data to be persisted stored in the local cache of the browser includes: Reading each piece of data stored in the local cache respectively, and determining whether the data has been stored in the index database; Data that is not stored in the index database is obtained as data to be persisted that is stored in the local cache.

4. A browser device, characterized in that: include: A first receiving module, used for receiving an instruction to close the browser; The first judgment module is used to judge whether there is data to be persisted in the waiting queue; A first storage module is used to store the data to be persisted in the local cache of the browser when there is data to be persisted in the waiting queue; A second receiving module, used for receiving an instruction to restart the browser; A first acquisition module, used to acquire the data to be persisted stored in the local cache of the browser; A first writing module, used for writing the data to be persisted into the waiting queue, so as to perform persistent storage on the data to be persisted; The device also includes: A second acquisition module is used to acquire the data to be persisted generated during the operation of the browser; A second writing module, used for writing the data to be persisted into a waiting queue, so as to perform persistent storage on the data to be persisted; A second storage module is used to read the data to be persisted from the waiting queue in a preset order, and store the data to be persisted in an index database; A second judgment module is used to judge whether the data to be persisted is successfully stored in the index database; The deleting module is used to delete the data to be persisted from the waiting queue when the data to be persisted is successfully stored in the index database.

5. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the browser operation method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the browser operation method according to any one of claims 1 to 3.