CN111881150A - Web application program offline data processing method and device - Google Patents

Web application program offline data processing method and device Download PDF

Info

Publication number
CN111881150A
CN111881150A CN202011011999.1A CN202011011999A CN111881150A CN 111881150 A CN111881150 A CN 111881150A CN 202011011999 A CN202011011999 A CN 202011011999A CN 111881150 A CN111881150 A CN 111881150A
Authority
CN
China
Prior art keywords
data
target
local database
target server
server
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011011999.1A
Other languages
Chinese (zh)
Inventor
郑灿城
刘晓生
刘双
罗真
杨振豪
邓柳瑶
刘健昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Internet Works Online Technology Co ltd
Original Assignee
Shenzhen Internet Works Online Technology Co ltd
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 Shenzhen Internet Works Online Technology Co ltd filed Critical Shenzhen Internet Works Online Technology Co ltd
Priority to CN202011011999.1A priority Critical patent/CN111881150A/en
Publication of CN111881150A publication Critical patent/CN111881150A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2372Updates performed during offline database operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a method and a device for processing web application program offline data, wherein the method comprises the following steps: when a target web application program and a background script are initialized at a target operation terminal, acquiring target editing data obtained after a user edits an editable file of a target application page; storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time; if so, updating the data of the local database and the target server according to a preset rule after the network connection between the local database and the target server is recovered; the application page of the embodiment of the invention can be used off line from the target server, can reliably store the data in the local database even when the network is interrupted, and synchronously updates the data of the local database and the data of the target server through the background script when the network is recovered.

Description

Web application program offline data processing method and device
Technical Field
The invention relates to the technical field of web application programs, in particular to a method and a device for processing offline data of a web application program.
Background
The web application is one form of application program (application) and can be directly accessed through a web browser, so that the application has some remarkable advantages, such as cross-platform, installation-free, update-timely and the like, but has some disadvantages, namely high dependence on a network, and difficulty in guaranteeing availability and operation sustainability in the case of offline equipment. At present, most of web applications have high dependence on a network, each data operation needs to download or upload data from a server, and poor network state or offline state can cause operation interruption or abnormal use. Therefore, it is important to ensure offline use of the web application and to ensure that the user's operation is not interrupted. Currently, local storage (localStorage) of a browser is commonly used to implement offline storage of data. Data is typically downloaded from a server and stored in local storage and updated with each download, with the data in the local storage being read directly for presentation to the user when the device is offline. Local storage (localStorage) is a commonly used web application storage medium, and has solved the problem that web applications cannot store application data locally, but nowadays, the functions of application programs are becoming rich, and the data structures thereof are becoming complex. Due to some disadvantages of local storage, such as small storage upper limit (usually upper limit of 2.5M-10M), blocking of reading and writing, weak data structuring, inability to provide complex retrieval, inability to provide transaction (transaction) support, etc., the storage requirements of modern partial web applications have not been met. In addition, due to the particularity of the web application, after the user closes the application page, the life cycle of the web application is also ended, and the corresponding operations, including the data synchronization, are also interrupted.
Disclosure of Invention
Therefore, in order to solve the above problems, it is necessary to provide a method and an apparatus for processing offline data of a web application, so as to reliably save the data to a local database even when a network is interrupted, and to synchronously update the data of the local database and the data of a target server through a background script when the network is restored.
The first technical scheme of the embodiment of the invention is as follows:
a method of processing web application offline data, comprising: when a target web application program and a background script are initialized at a target operation terminal, acquiring target editing data obtained after a user edits an editable file of a target application page; storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time; if so, updating the data of the local database and the target server according to a preset rule after network connection between the local database and the target server is recovered; the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
The second technical scheme of the embodiment of the invention is as follows:
a web application offline data processing apparatus, comprising: the data acquisition module is used for acquiring target editing data obtained after a user edits an editable file of a target application page after a target web application program and a background script are initialized at a target operation terminal; the network judgment module is used for storing the target editing data to a local database in real time and judging whether the network connection between the local database and a target server is interrupted or not in real time; the data updating module is used for updating the data of the local database and the target server according to a preset rule after the network connection between the local database and the target server is recovered when the network connection between the local database and the target server is interrupted; the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
The third technical scheme of the embodiment of the invention is as follows:
a computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
when a target web application program and a background script are initialized at a target operation terminal, acquiring target editing data obtained after a user edits an editable file of a target application page; storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time; if so, updating the data of the local database and the target server according to a preset rule after network connection between the local database and the target server is recovered; the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
The fourth technical scheme of the embodiment of the invention is as follows:
a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
when a target web application program and a background script are initialized at a target operation terminal, acquiring target editing data obtained after a user edits an editable file of a target application page; storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time; if so, updating the data of the local database and the target server according to a preset rule after network connection between the local database and the target server is recovered; the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
The embodiment of the invention has the following beneficial effects:
after a target web application program and a background script are initialized at a target operation terminal, target editing data obtained by editing an editable file of a target application page by a user are acquired, then the target editing data are stored in a local database in real time, whether network connection between the local database and a target server is interrupted or not is judged in real time, if yes, after the network connection between the local database and the target server is recovered, the data of the local database and the data of the target server are updated according to preset rules, the data can be reliably stored in the local database even when the network is interrupted, and the purpose of synchronously updating the data of the local database and the data of the target server through the background script when the network is recovered is achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a flow diagram illustrating an implementation of one embodiment of a method for processing offline data of a web application;
FIG. 2 is a flow diagram illustrating another implementation of an embodiment of a method for processing offline data of a web application in accordance with the present disclosure;
FIG. 3 is a block diagram of an embodiment of an apparatus for processing offline data of a web application in an embodiment;
FIG. 4 is a block diagram illustrating an embodiment of a computer device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The Web application program is an application program which can be accessed through Web, and the greatest advantage is that a user can easily access the application program, and the user only needs to have a browser and does not need to install other software. Data generated by web applications is often only stored on the server side. The data is directly accessed and operated by the server when the user checks, adds and deletes the data every time, the advantage is that the latest data can be read every time, the data consistency can be ensured when the data is used on different terminal devices, and the data is not easy to lose when the data is stored in the server. The disadvantage is that when the network is disconnected, the server cannot be connected, and the user cannot browse and operate data, so that the Web application program cannot be normally used.
Fig. 1 is a flowchart illustrating an implementation of a method for processing offline data of a web application in an embodiment, and referring to fig. 1, the method for processing offline data of a web application in the embodiment includes the following steps:
step S101: and when the target web application program and the background script are initialized at the target operation terminal, acquiring target editing data obtained after the user edits the editable file of the target application page.
The target operation terminal can be selected as a computer or a mobile phone terminal, and the number of the target operation terminals can be selected as a plurality of target operation terminals, and is not limited to one target operation terminal.
Step S102: and storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time.
The target server can be communicated with a plurality of target operation terminals at the same time, and each target operation terminal can download data from the target server and store the data in the local database.
Step S103: and if the network connection between the local database and the target server is interrupted, updating the data of the local database and the data of the target server according to a preset rule after the network connection between the local database and the target server is recovered. And if the network connection between the local database and the target server is not interrupted, directly updating the data of the local database and the data of the target server according to the preset rule.
The target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
In the embodiment of the present invention, optionally, there is no limitation on a preset rule, and as long as a rule or a method capable of updating the data of the local database and the target server is not limited.
As shown in fig. 2, in another embodiment, a method for processing web application offline data is provided, and referring to fig. 2, the method may be applied to both a terminal and a server, and this embodiment is exemplified by being applied to a terminal, where the method for processing web application offline data specifically includes the following steps:
step S201: and when the target web application program and the background script are initialized at the target operation terminal, acquiring target editing data obtained after the user edits the editable file of the target application page.
The target operation terminal can be selected as a computer or a mobile phone terminal, and the number of the target operation terminals can be selected as a plurality of target operation terminals, and is not limited to one target operation terminal.
Step S202: and storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time.
The target server can be communicated with a plurality of target operation terminals at the same time, and each target operation terminal can download data from the target server and store the data in the local database. And if the network connection between the local database and the target server is not interrupted, directly updating the data of the local database and the data of the target server according to the preset rule.
Step 203: after the network connection between the local database and the target server is recovered, respectively acquiring first data and second data of the local database and the target server, namely acquiring all respective data of the local database and the target server, and comparing the first data with the second data.
Step 204: and sending third data unique to the local database relative to the target server for storage, acquiring fourth data unique to the target server relative to the local database, and saving the fourth data to the local database, namely, enabling the data of the local database and the data of the target server to be consistent.
Step 205: and acquiring fifth data with the same data ID in the local database and the target server, and respectively acquiring first updating time and second updating time of the fifth data in the local database and the target server. Wherein, the update time of the fifth data of the local database and the target server are different, uniform update time is required, and the last update time is taken as the uniform update time.
Step 206: and taking the first update time or the second update time with the later update time of the first update time and the second update time as the latest update time of the fifth data, namely taking the latest update time as the update time of the fifth data in the local database and the target server. And taking the fifth data corresponding to the latest updating time as updating content, and updating the content corresponding to the fifth data in the local database and the target server.
Step 207: and acquiring and deleting sixth data which are provided with the deleted identifier and have no server ID identifier in the local database.
Step 208: and acquiring seventh data with the server ID identification and the deleted identification, and synchronously deleting the seventh data stored in the local database and the target server. The deleted identifier on the sixth data is marked by a user, and the data corresponding to the server ID identifier is downloaded to the local database through the target server.
Step 209: and acquiring and deleting eighth data which is stored in the local database, carries the server ID identification and does not exist on the target server.
In this embodiment, optionally, the target operation terminals include at least one, and after one of the target operation terminals deletes the ninth data of the target server, if the local databases corresponding to the other target operation terminals include the ninth data, the ninth data is deleted synchronously, so that the local databases of the target operation terminals are the same as the data of the target server. And if the local database has the server ID identification but cannot find corresponding data in the server data, indicating that the data are deleted in other target operation terminals, synchronously deleting the data.
Currently, common web applications include efficient todo, Tencent documents, documentary cloud notes, tick lists, Trello boards, and Microsoft todo, which have the following problems:
1. high-efficiency todo: the method can not perform any operation, such as adding and deleting tasks and notes, completing task marks and the like; 2. tencent documents: documents or folders cannot be created, edited and deleted, but the documents in the editing process can be continuously edited and stored, and can be automatically stored in a server after being networked. The Tencent document is subjected to data synchronization, and the synchronization is unidirectional, namely only uploading; 3. there is a cloud note: the operation such as adding, deleting, editing and the like of notes and folders cannot be carried out; 4. click list: except that the list cannot be added, other functions such as list deletion, task addition, task deletion and task completion can be normally used, and bidirectional data synchronization operation can be performed during networking, namely local offline data are uploaded and the latest data of the server side are downloaded; 5. trello billboard: the operation such as adding, deleting, editing and the like of lists and cards cannot be carried out; 6. microsoft todo: basically all operations are not interrupted, list addition and deletion and task completion, addition and deletion can be normally operated, and data bidirectional synchronization operation can be performed during networking.
In this embodiment, specifically, the method for processing the offline data of the web application includes the following specific implementation steps:
step 300: loading static resources such as a target operation terminal (target operation terminal)/page view, scripts and the like;
step 301: registering a background script with the browser by the page script, if the background script exists, using a default mechanism of the browser, if the versions are consistent, ignoring the background script, and if the versions are newer, updating the background script;
step 302: the background script establishes a local database, if the local database exists, a browser default mechanism is used, if the versions are consistent, the versions are ignored, and if the versions are newer, the versions are updated;
step 303: starting to acquire data of a local database and a target server in parallel;
step 303-1: reading user data in a local database through a local database operation module;
step 303-2: acquiring user data of a target server through an HTTP request module;
step 304: analyzing user data of a local database and a target server through a data analysis module;
step 305: starting to process data in parallel;
step 305-1: screening data which does not exist in a local database in the user data of the target server;
step 305-1-1: newly adding data to the local database through the local database operation module;
step 305-2: screening out data with server ID identification in user data in a local database;
step 305-2-1: screening data which do not exist in the target server;
step 305-2-1-1: deleting corresponding data in the local database through the local database operation module;
step 305-2-2: screening out the data with the deleted identifier;
step 305-2-2-1: submitting the data with the server ID identification to a target server through an HTTP request module;
step 305-2-2-2: after receiving the HTTP request, the target server deletes the data and updates a local database;
step 305-2-2-3: the target server returns a corresponding server ID through HTTP response;
step 305-2-2-4: after receiving the returned ID of the server, deleting corresponding data in the local database;
step 305-2-3: screening out the data which does not have the deleted identification and exists in the target server;
step 305-2-3-1: comparing the last update time with the data of the target server;
step 305-2-3-2: submitting newer data of a local database to a server through an HTTP request module;
step 305-2-3-3: updating the updated data of the target server to a local database through a local database operation module;
step 305-3: screening data without server ID identification in the user data of the local database;
step 305-3-1: directly deleting the data with the deleted identifier through a local database operation module;
step 305-3-2: other data are submitted to a target server through an HTTP request module;
step 305-3-3: after receiving the HTTP request, the target server performs new processing on the data and inserts the data into a local database;
step 305-3-4: the target server returns a corresponding server ID through HTTP response;
step 305-3-4: screening data which do not exist in the target server;
step 305-3-5: after receiving the returned ID of the server, updating corresponding data in the local database;
step 306: sending a message to the target operation terminal through the message broadcasting module to inform the target operation terminal to reload data and render a page;
in addition, after step 301, the background service is ready, and meanwhile, message pushing of the target operation terminal starts to be monitored;
after receiving the message push of the target operation terminal, starting step 310;
step 310: triggering a synchronous checking mechanism;
step 311: the delay interceptor is used for intercepting a plurality of triggers of a synchronous checking mechanism, and the plurality of triggers can reset the delay interceptor within a certain time (actual requirement setting) so as to cancel the last trigger;
step 312: starting to acquire the last updating time of the data;
step 312-1: reading the last update time of the local data through a local database operation module;
step 312-2, obtaining the last update time of the target server data through the HTTP request module;
step 313: comparing whether the last updating time is consistent or not, if not, starting to execute the step 203-2, otherwise, not operating;
additionally, after step 302, the background service and local database are ready, beginning with step 320;
step 320: the target operation terminal reads local user data through a local database operation module and renders a page;
after the step, the target operation terminal is initialized, and starts to monitor the message broadcast of the ServiceWorker, and the user can operate the target operation terminal,
step 321 is started after receiving the ServiceWorker message broadcast;
step 321: reading local user data again through the local database operation module and rendering a page;
step 322, the user changes the data by the operation of the target operation terminal;
step 322: the target operation terminal updates corresponding local data through a local database operation module;
step 323: and the target operation terminal pushes the message to the background script through a message pushing method.
As shown in fig. 3, in another embodiment, a processing apparatus for web application offline data is provided, and as can be obtained with reference to fig. 3, the processing apparatus 100 for web application offline data specifically includes:
and the data acquisition module 10 is configured to acquire target editing data obtained by editing the editable file of the target application page by the user after the target web application program and the background script are initialized at the target operation terminal. The target operation terminal can be selected as a computer or a mobile phone terminal, and the number of the target operation terminals can be selected as a plurality of target operation terminals, and is not limited to one target operation terminal.
And a network determining module 20, configured to store the target editing data in a local database in real time, and determine whether a network connection between the local database and the target server is interrupted in real time. The target server can be communicated with a plurality of target operation terminals at the same time, and each target operation terminal can download data from the target server and store the data in the local database.
And the data updating module 30 is configured to, when the network connection between the local database and the target server is interrupted, update the data of the local database and the data of the target server according to a preset rule after the network connection between the local database and the target server is restored. And if the network connection between the local database and the target server is not interrupted, directly updating the data of the local database and the data of the target server according to the preset rule.
The target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
FIG. 4 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be a terminal, and may also be a server. As shown in fig. 4, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the age identification method. The internal memory may also have a computer program stored therein, which when executed by the processor, causes the processor to perform the age identification method. Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In another embodiment, a computer device is presented, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
and when the target web application program and the background script are initialized at the target operation terminal, acquiring target editing data obtained after the user edits the editable file of the target application page.
And storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time.
And if the network connection between the local database and the target server is interrupted, updating the data of the local database and the data of the target server according to a preset rule after the network connection between the local database and the target server is recovered.
The target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
In another embodiment, a computer-readable storage medium is proposed, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of:
and when the target web application program and the background script are initialized at the target operation terminal, acquiring target editing data obtained after the user edits the editable file of the target application page.
And storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time.
And if the network connection between the local database and the target server is interrupted, updating the data of the local database and the data of the target server according to a preset rule after the network connection between the local database and the target server is recovered.
The target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
According to the method and the device, the target editing data obtained after the user edits the editable file of the target application page is obtained, then the target editing data is stored in the local database in real time, whether the network connection between the local database and the target server is interrupted or not is judged in real time, if yes, after the network connection between the local database and the target server is recovered, the data of the local database and the target server are updated according to the preset rules, the data can be reliably stored in the local database even if the network is interrupted, and the purpose of synchronously updating the data of the local database and the data of the target server through the background script during network recovery is achieved. In addition, complex data operation and network request are carried out in the background script, so that the performance influence on the target application page is reduced, and when the same browser opens a plurality of application pages, the background script is shared, so that repeated network requests and resource occupation are reduced.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for processing offline data of a web application is characterized by comprising the following steps:
when a target web application program and a background script are initialized at a target operation terminal, acquiring target editing data obtained after a user edits an editable file of a target application page;
storing the target editing data to a local database in real time, and judging whether the network connection between the local database and a target server is interrupted or not in real time;
if so, updating the data of the local database and the target server according to a preset rule after network connection between the local database and the target server is recovered;
the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
2. The method for processing the offline data of the web application according to claim 1, wherein if the network connection between the local database and the target server is not interrupted, the data of the local database and the data of the target server are directly updated according to the preset rule.
3. The method for processing the offline data of the web application according to claim 1 or 2, wherein the updating the data of the local database and the target server according to the preset rule comprises:
respectively acquiring first data and second data of the local database and the target server, and comparing the first data with the second data;
and sending third data unique to the local database relative to the target server for storage, acquiring fourth data unique to the target server relative to the local database, and storing the fourth data in the local database.
4. The method for processing offline data of web applications as recited in claim 3, wherein said sending third data unique to said local database with respect to said target server for storage, and obtaining fourth data unique to said target server with respect to said local database, and saving said fourth data to said local database, comprises:
acquiring fifth data with the same data ID in the local database and the target server, and respectively acquiring first updating time and second updating time of the fifth data in the local database and the target server;
setting the first update time or the second update time, which is later in update time, of the first update time and the second update time as a latest update time of the fifth data;
and taking the fifth data corresponding to the latest updating time as updating content, and updating the content corresponding to the fifth data in the local database and the target server at the same time.
5. The method for processing the offline data of the web application according to claim 3, wherein the updating the data of the local database and the target server according to the preset rule further comprises:
acquiring and deleting sixth data which are provided with deleted identifiers and have no server ID identifiers in the local database;
acquiring seventh data with the server ID identification and the deleted identification, and synchronously deleting the seventh data stored in the local database and the target server;
the deleted identifier on the sixth data is marked by a user, and the data corresponding to the server ID identifier is downloaded to the local database through the target server.
6. The method for processing the offline data of the web application according to claim 5, wherein the updating the data of the local database and the target server according to the preset rule further comprises:
and acquiring and deleting eighth data which is stored in the local database, carries the server ID identification and does not exist on the target server.
7. The method for processing the offline data of the web application according to claim 1, wherein the target operation terminals include at least one, and when one of the target operation terminals deletes ninth data of the target server, if the local databases corresponding to other target operation terminals contain the ninth data, the ninth data is synchronously deleted.
8. An apparatus for processing offline data of a web application, comprising:
the data acquisition module is used for acquiring target editing data obtained after a user edits an editable file of a target application page after a target web application program and a background script are initialized at a target operation terminal;
the network judgment module is used for storing the target editing data to a local database in real time and judging whether the network connection between the local database and the target server is interrupted or not in real time;
the data updating module is used for updating the data of the local database and the target server according to a preset rule after the network connection between the local database and the target server is recovered when the network connection between the local database and the target server is interrupted;
the target application page is a webpage corresponding to the target web application program, the local database of the target operation terminal and the target server need to be in network communication with each other through the background script, and the local database and the target application page can be in off-line communication through the page script.
9. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method of processing web application offline data according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of processing web application offline data of any of claims 1 to 7.
CN202011011999.1A 2020-09-24 2020-09-24 Web application program offline data processing method and device Pending CN111881150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011011999.1A CN111881150A (en) 2020-09-24 2020-09-24 Web application program offline data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011011999.1A CN111881150A (en) 2020-09-24 2020-09-24 Web application program offline data processing method and device

Publications (1)

Publication Number Publication Date
CN111881150A true CN111881150A (en) 2020-11-03

Family

ID=73199149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011011999.1A Pending CN111881150A (en) 2020-09-24 2020-09-24 Web application program offline data processing method and device

Country Status (1)

Country Link
CN (1) CN111881150A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112929423A (en) * 2021-01-25 2021-06-08 上海契云科技有限公司 Method and device for data packaging of terminal equipment
CN113407635A (en) * 2021-07-09 2021-09-17 浙江明度智控科技有限公司 Multi-terminal data synchronization method and system for intelligent manufacturing
CN114611079A (en) * 2022-02-18 2022-06-10 广州市玄武无线科技股份有限公司 Mobile terminal login method, device, equipment and storage medium
CN115296858A (en) * 2022-07-12 2022-11-04 南京赛宁信息技术有限公司 Local storage method and system for active defense gateway topology editor
CN116663504A (en) * 2023-07-28 2023-08-29 北京尽微致广信息技术有限公司 Collaborative file editing method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090198702A1 (en) * 2008-02-06 2009-08-06 Microsoft Corporation Synchronization infrastructure for networked devices, applications and services in a loosely coupled multi-master synchronization environment
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
CN103916482A (en) * 2014-04-21 2014-07-09 合肥盈云信息科技有限公司 Data synchronous transmission method based on sqlite
CN106055634A (en) * 2016-05-27 2016-10-26 浪潮通用软件有限公司 Method for synchronizing WebSQL (Web structured query language) based on HTML5 and server-side database
CN110971655A (en) * 2018-10-01 2020-04-07 甲骨文国际公司 Offline client playback and synchronization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090198702A1 (en) * 2008-02-06 2009-08-06 Microsoft Corporation Synchronization infrastructure for networked devices, applications and services in a loosely coupled multi-master synchronization environment
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
CN103916482A (en) * 2014-04-21 2014-07-09 合肥盈云信息科技有限公司 Data synchronous transmission method based on sqlite
CN106055634A (en) * 2016-05-27 2016-10-26 浪潮通用软件有限公司 Method for synchronizing WebSQL (Web structured query language) based on HTML5 and server-side database
CN110971655A (en) * 2018-10-01 2020-04-07 甲骨文国际公司 Offline client playback and synchronization

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王翠萍: "《移动Web开发从入门到精通》", 31 August 2016 *
黄福玉,翟云: "《移动政务》", 28 February 2017 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112929423A (en) * 2021-01-25 2021-06-08 上海契云科技有限公司 Method and device for data packaging of terminal equipment
CN113407635A (en) * 2021-07-09 2021-09-17 浙江明度智控科技有限公司 Multi-terminal data synchronization method and system for intelligent manufacturing
CN113407635B (en) * 2021-07-09 2022-06-03 明度智云(浙江)科技有限公司 Multi-terminal data synchronization method and system for intelligent manufacturing
CN114611079A (en) * 2022-02-18 2022-06-10 广州市玄武无线科技股份有限公司 Mobile terminal login method, device, equipment and storage medium
CN115296858A (en) * 2022-07-12 2022-11-04 南京赛宁信息技术有限公司 Local storage method and system for active defense gateway topology editor
CN115296858B (en) * 2022-07-12 2023-08-25 南京赛宁信息技术有限公司 Active defense gateway topology editor local storage method and system
CN116663504A (en) * 2023-07-28 2023-08-29 北京尽微致广信息技术有限公司 Collaborative file editing method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN111881150A (en) Web application program offline data processing method and device
CN110263275B (en) Method and device for accessing webpage, mobile terminal and storage medium
US10713034B2 (en) Updating web resources
US20130311985A1 (en) Updating Web Resources
CN109634925A (en) Resource file downloading method, device, computer equipment and storage medium
CN106462430B (en) Application upgrade package obtaining method and device
CN108920691B (en) Front-end static resource management method and device, computer equipment and storage medium
CN106951284B (en) User interface upgrading method and device based on android system application and intelligent terminal
CN112181532B (en) Page resource loading method and device, electronic equipment and readable storage medium
CN113094076A (en) Version iteration method, device, equipment and medium based on version control
CN112612982A (en) Webpage preloading method and device and computer equipment
US10938773B2 (en) Method and apparatus for synchronizing contact information and medium
CN111736876A (en) Client update control method, device, storage medium and server
CN109408471B (en) Compressed packet decompression method and device based on matching tree and storage medium
CN112395337B (en) Data export method and device
CN112463808A (en) Data processing method and device of target cluster and server
CN107908634B (en) Cache control method of browser and mobile terminal
CN113535206B (en) Multi-version code upgrading method and system
CN112433779B (en) Application site preloading method, device and storage medium based on ERP system
CN114745146B (en) Jump interception method, apparatus, readable storage medium and device
CN108228213A (en) A kind of application automatic update method, system, smart machine and storage medium
CN114443166A (en) Shared file processing method, device and medium
CN114968963A (en) File overwriting method and device and electronic equipment
CN108509478B (en) Splitting and calling method of rule engine file, electronic device and storage medium
CN113645289A (en) Quota data request method, sending method, client, server and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201103

RJ01 Rejection of invention patent application after publication