CN110557441B - Data interaction method and system for client and server in online and offline states - Google Patents
Data interaction method and system for client and server in online and offline states Download PDFInfo
- Publication number
- CN110557441B CN110557441B CN201910742273.6A CN201910742273A CN110557441B CN 110557441 B CN110557441 B CN 110557441B CN 201910742273 A CN201910742273 A CN 201910742273A CN 110557441 B CN110557441 B CN 110557441B
- Authority
- CN
- China
- Prior art keywords
- data
- client
- server
- uploaded
- version number
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/54—Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a data interaction method for a client and a server in an online and offline state, which comprises the following steps: storing the data to the local and initiating a request to a server; or combining the data generated by the last off-network operation with the data of the on-network operation and uploading the data to the server; the server side returns the version difference data to the client side; generating dynamic codes used for generating version differences at the server side; the server side generates a uniform version number for all the uploaded data; the client records the version number and changes the identification into the uploaded version number; the client sends the version number stored in the client and the data to be uploaded to the server through a request; the server side searches data larger than the submitted version number in the data source and generates a new version number as response data of the server side; the client stores the version number in a data source of the client, processes the response synchronous data and stores the processed synchronous data to the local, and sets the uploading identifier of the uploaded data as uploaded.
Description
Technical Field
The invention relates to the field of data communication, in particular to a method and a system for data interaction between a client and a server in a network and off-network state.
Background
Data interaction of like products in the current market under an off-network state is more in a synchronization mode of actively initiating a data uploading request by a user, and data sharing and data query accuracy among multiple users are influenced because the user actively clicks an uploading button to upload data in the user data synchronization. If the user a does not click the upload button in the online state after entering data in the offline state, the user B cannot check the data generated by the user a before the user a clicks the upload button.
Data generated by existing similar products in an off-network mode are synchronized by manually clicking corresponding function buttons, the data synchronization timeliness is poor due to the manually initiated synchronization mode, and the problem that accuracy cannot be timely provided for shared data when a set of data is used by multiple people is solved.
Disclosure of Invention
The technical problem to be solved by the invention is that when data synchronization is carried out on data interaction of a client in an off-network or on-network state, manual synchronization is not needed, and synchronous data interaction can be automatically carried out only when the client is accessed to a network, so that the timeliness of data synchronization and the accuracy of data sharing by multiple persons at the same time are ensured.
The invention provides a data interaction method for a client and a server under the online and offline states, which solves the technical problems and comprises the following steps:
when data is generated on the network, the client stores the data to the local, and initiates a request to the server to obtain the version difference data returned by the server and stores the version difference data in the local; when the data is generated in an off-network mode, the client stores the generated data to the local, and when the client is in an on-network state, the data generated in the off-network mode last time and the data operated in the on-network mode are combined and uploaded to the server;
when the client is on the network, the server receives the data synchronously sent by the client and returns the version difference data to the client;
generating dynamic codes used for generating version differences at the server side;
when the client uploads data once, the server generates a uniform version number for all the data uploaded this time and sends the uniform version number to the client through a response;
the client records the version number at a corresponding position of a client data source, and changes the identification of the uploaded data of the client into the uploaded data;
when the client uploads the data later, the version number stored in the client and the data to be uploaded need to be delivered to the server through a request;
if the client is a new installation, the uploaded version number is 0, and after the server receives the request, the server searches data larger than the submitted version number in the data source and generates a new version number as response data of the server;
after the data is responded to the client, the client stores the version number in a data source of the client, processes the responded synchronous data and stores the processed synchronous data to the local, and the uploading identifier of the uploaded data is set as uploaded.
And further, when data is generated in an off-network mode, the client automatically obtains the data which are not uploaded, inquires whether the data are uploaded in a database of the server or not, and uploads the data which are not uploaded to the server.
Further, the method for generating the dynamic code at the server according to the difference data is specifically a mode of millisecond number + short number sequence or a mode of service starting times + long number sequence.
The invention has the beneficial effects that:
1) in the data interaction system of the client and the server in the online and offline states, the client stores data to the local and initiates a request to the server to obtain version difference data returned by the server and stores the version difference data in the local when the data is generated in the network; the online channel for data generation is ensured; in addition, when the data is generated in an off-network mode, the generated data is stored to the local, and when the client side is in an on-network state, the data generated in the off-network mode last time and the data operated in the on-network mode this time are combined and uploaded to the server side; ensuring the off-network channel of data generation.
2) In the data interaction system with the client and the server in the online and offline states, the server is used for receiving data synchronously sent by the client and returning version difference data to the client when the client is online; and generating dynamic codes used for generating the version difference at the server side. By the server, differential synchronization is clearer, the version number created by the server is used for controlling the data which needs to be synchronized and shared by each client, and the problem that the communication process is too slow due to a large amount of data generated by all data during single interaction is solved.
3) Because the client automatically obtains the data which is not uploaded through the client and then uploads the data to the server, or the service of the client automatically obtains the data which is not uploaded and uploads the data to the server, the synchronization of the data version is realized more quickly.
Drawings
Fig. 1 is a schematic structural diagram of a data interaction system between a client and a server in an online and offline state according to an embodiment of the present invention.
Fig. 2 is a sequence diagram of the interaction in fig. 1.
Fig. 3 is a schematic diagram of an embodiment of synchronization to a server by a client in fig. 1.
Fig. 4 is a flowchart illustrating a method for automatically acquiring data that is not uploaded in fig. 3.
Fig. 5 is a schematic diagram of a method for generating client-side and server-side version difference data in fig. 1.
Fig. 6 is a schematic diagram of the internal structure of the client in fig. 1.
Fig. 7 is a schematic diagram of the internal structure of the server in fig. 1.
Fig. 8 is a schematic flow chart of a data interaction method between a client and a server in an online and offline state according to an embodiment of the present invention.
Fig. 9 is a schematic flow chart of a data interaction method in a network and off-network state in combination with a server and a client in a preferred embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a data interaction system between a client and a server in an online and offline state in a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
Fig. 1 is a schematic structural diagram of a data interaction system between a client and a server in an online and offline state according to an embodiment of the present invention.
In this embodiment, the server 100 and the client 101 are included, where the server 100 is configured as one server to establish interaction with the client 101, where the interaction includes synchronization of data versions, sharing of data, and query of data. It will be understood by those skilled in the art that the client 101 may comprise a plurality of access ports for providing users with different needs to synchronize with the server data.
Fig. 2 is a sequence diagram of the interaction in fig. 1.
In this embodiment, the server 100 and the client 101 are included, and the time sequence interaction is performed according to the following steps:
the data interaction system of the client and the server in the online and offline states comprises:
at least one client 101, configured to store data to a local location when the data is generated on the network, and initiate a request to the server to obtain version difference data returned by the server, and store the version difference data locally;
when the data is generated in an off-network mode, storing the generated data to the local, and when the client is in an on-network state, combining the data generated in the off-network mode last time with the data operated in the on-network mode and uploading the data to the server;
a server 100, configured to receive data synchronously sent by a client and return version difference data to the client when the client is on the internet; and generating dynamic codes used for generating the version difference at the server side.
In the client 101, the operation is step S101, when data is generated on the network, the data is stored locally, which is shown as the case that the mobile phone is on the network, the computer is on the network, and other terminals are on the network, that is, the communication network is accessed. When data is generated on the network, the data needs to be stored locally.
And initiating a request to the server 100 to obtain the version difference data returned by the server, storing the version difference data locally, performing matching comparison on the uploaded data according to the version difference of the data to obtain the version difference data, and then storing the data obtained from the server 100 in the client 101 to finish the data synchronization during the online process.
Then, step S102 is performed in the client 101, when data is generated off-network, the generated data is stored locally, and when the client is in the on-network state, the data generated last time off-network and the data of the current on-network operation are merged and uploaded to the server. The data generated by the client 101 for the off-network is stored locally, and the client 101 is waited to access the network again. Once the client 101 is detected to be in the network state, the local data generated and stored in the last offline operation and the data generated in the current online operation are merged and then uploaded to the server 100, so that rapid and automatic data synchronization is realized.
In the server 100, performing step S103, when the client is on the network, receiving data synchronously sent by the client and returning version difference data to the client; and generating dynamic codes used for generating the version difference at the server side. When the client is on the network, the server 100 receives the data synchronously sent by the client 101, and then returns the version difference data to the client, and the sequence generated in the server 100 is an incremental number, so that the server 100 can be ensured to judge easily. For example, a millisecond + short digit sequence may be used.
Fig. 3 is a schematic diagram of an embodiment of synchronization to a server by a client in fig. 1.
In this embodiment, the step of performing synchronization is to automatically obtain the data that is not uploaded through the service in the client 101 and upload the data to the server 100. Under the Android environment, Service is generally used to perform some time-consuming operations, or perform operations in the background that do not provide a user interaction interface, such as: and (5) downloading and uploading. Initiating Service may include two ways, e.g., initiating Service by calling the startService () method anywhere in the same application, and then the system will call back onCreate () and onStart () methods of the Service class. The Service started in the above manner will run in the background until a context. Alternatively, such as the bindService () method, binds this Service to the client class that called the Service, and if this client class is called to be destroyed, the Service will also be destroyed.
In addition, the iOS environment is background transfer service, such as background transfer service (background transfer service) in the iOS7 multitasking. The function of the processing module with the function is provided by various systems, belongs to a system packaging method, and can be used by developers only through interfaces.
Or, in the client 101, the user triggers data update at the client through manual operation, for example, after the user a enters data in an off-network state, the user B does not click an upload button in the on-network state, and then the user B cannot check the data generated by the user a before the user a clicks the upload button, and needs to synchronize the data through manual operation or Service of the client.
Fig. 4 is a flowchart illustrating a method for automatically acquiring data that is not uploaded in fig. 3.
When the data is generated in the off-network mode, the generated data is stored to the local, and when the client is in the on-network state, the data generated in the off-network mode last time and the data operated in the on-network mode are combined and uploaded to the server. In this embodiment, the method for automatically obtaining the data that is not uploaded specifically includes:
step S201, when a client uploads data once, a server generates a uniform version number for all data uploaded this time and sends the uniform version number to the client through a response; and managing the unified version number for the single uploading of the client.
Step S202, the client records the version number at the corresponding position of the client data source, and changes the identification of the uploaded data of the client into the uploaded data, and the first single uploading is finished. In this embodiment, the client data source may be a table of the database.
Step S203, when the client uploads the data again, the version number stored in the client and the data to be uploaded need to be delivered to the server through a request; the version number stored in the client is not updated, so that the version number and the data to be uploaded need to be delivered to the server for processing in a request mode.
Step S204, if the client is a new installation, the uploaded version number is 0, and after the server receives the request, the server searches data larger than the submitted version number in the data source and generates a new version number as response data of the server; and judging the version number in the step S203, wherein the data larger than the submitted version number at this time, that is, the new version number updated later, is used as the response data of the server.
After the data response to the client in step S205, the client stores the version number in the data source of the client, and stores the processed synchronous data to the local, and sets the upload identifier of the uploaded data as uploaded. And storing the new version number at the client, storing the data responding to synchronization of the server to the local, and setting the uploading identifier of the uploaded data as uploaded.
Fig. 5 is a schematic diagram of a method for generating client-side and server-side version difference data in fig. 1.
In this embodiment, the method for generating the version difference data between the server 100 and the client 101 specifically includes:
in the server 100, the operation S401 is performed to create a data version number at the server, and obtain version difference data according to the data version number corresponding to the difference data.
Or, in the server 100, the operation step S402 is performed to synchronize or share data of each client according to the version difference data.
Fig. 6 is a schematic diagram of the internal structure of the client in fig. 1.
Preferably, the client includes a client interaction data processing module 1011, a Service automatic processing module 1012, and an online determination module 1013.
The client interactive data processing module 1011 is used for packaging interactive data and then sending the interactive data to the server; the client interactive data processing module 1011 is further configured to receive the on-network or off-network status determination condition in the on-network determining module 1013. And sends the interactive data to the web determination module 1013.
A Service automatic processing module 1012, wherein the Service automatic processing module 1012 is used to automatically obtain data when the client is in a network state, and is connected to the client interactive data processing module for data synchronization. In the Android environment, Service is generally used to perform some time-consuming operations, or perform operations in the background that do not provide a user interaction interface, such as: and (5) downloading and uploading. In addition, the iOS environment is background transfer service, such as background transfer service (background transfer service) in the iOS7 multitasking. The function of the processing module with the function is provided by various systems, belongs to a system packaging method, and can be used by developers only through interfaces. Therefore, faster synchronization is realized, and manual synchronization is not needed to be carried out every time by a user.
The online determination module 1013 is configured to confirm a network state of the client when performing data interaction. When the on-network determining module 1013 detects that the client is on the network, the on-network state information is sent to the client interactive data processing module 1011, and since the client interactive data processing module 1011 is connected to a server interactive data processing module in the server, the data can be packaged and sent. When the on-network determining module 1013 detects that the client is off-network, the on-network status information is sent to the client interactive data processing module 1011, and the data generated by off-network is directly stored locally by the client. In the network determining module 1013, when entering the client interactive data processing module 1011 in any way, the network state needs to be determined and confirmed by the module.
The client 101 also comprises a corresponding data function in which a user manually operates the client, so as to generate data changes of off-network or on-network.
Fig. 7 is a schematic diagram of the internal structure of the server in fig. 1.
As a preferred embodiment in this embodiment, the server 100 includes a server interaction data processing module 1001, a data processing module 1002, and a dynamic code generation module 1003.
A server interaction data processing module 1001, where the server interaction data processing module 1001 is used to receive data sent by the client and return the data to the client; and is also connected with a client interaction data processing module 1011 in the client for data interaction.
The data processing module 1002, the data processing module 1002 is configured to process data obtained in the server interaction data processing module; specifically, the processing mode of the interactive data is determined according to the language and the requirement, such as the processing of fields, the processing of query calls of data, and the like.
And the dynamic code generation module 1003 is configured to obtain a dynamic code, confirm a version number for the data uploaded this time according to the dynamic code, and send the version number to the client of the data uploaded this time. As a preferred method in this embodiment, the method for generating the dynamic code at the server according to the difference data specifically includes that the dynamic code is a version number, and when the server generates the dynamic code, it is required to ensure that the sequence is increased in number, which ensures that the server is easier to determine. The dynamic code can be generated in various ways, such as a way of milliseconds plus a short digital sequence or; the number of service starts + the long number sequence, etc.
In this embodiment, the server 100 further includes a database or a file 1004, and when data is generated off-network, the client automatically obtains data that is not uploaded, and queries whether to upload the data in the database of the server, and uploads the data that is not uploaded to the server.
Fig. 8 is a schematic flow chart of a data interaction method between a client and a server in an online and offline state according to an embodiment of the present invention.
Step S501, begin
Step S502 triggers data updating, and judges the online state of the client according to a system API provided in the operating system; for example, an API interface for communicating SGIP, an API interface for mobile short messages; and judging the on-network state of the client.
Step S503, when the data is generated off-network, the difference data is marked as not uploaded and then stored to the local client; because the client cannot synchronize with the server when the client is off-line, the data with the difference needs to be marked as not uploaded and stored to the local client.
Step S504, when the data is generated in the network, the difference data is sent to the server for interaction, the dynamic code is generated in the server according to the difference data, and the client accesses the network, namely after the network, and when the data is generated in the network, the client sends the difference data to the server for interaction. The method for checking the difference data requires a dynamic code, i.e., a data version number, generated at the server according to the difference data.
Whether the dynamic code generated in step S505 is larger than the dynamic code is generally, the dynamic codes are arranged in descending order.
Step S506, taking out the data larger than the dynamic code according to the dynamic code, and returning the data larger than the dynamic code to the client through the server; in step S505, the data greater than the dynamic code, that is, the data with a higher version number, is extracted from the dynamic code and updated, and the data greater than the dynamic code is returned to the client through the server.
Step S507 stores the data greater than the dynamic code and the difference data not uploaded in the local database of the client, and identifies the data as uploaded. And storing the data larger than the dynamic code and the difference data which are not uploaded in the local data, realizing the synchronization from the server side to the client side, and identifying the data as uploaded.
Fig. 9 is a schematic flow chart of a data interaction method in a network and off-network state in combination with a server and a client in a preferred embodiment of the present invention.
Step S601 is triggered manually, and the user manually operates the corresponding data function in the client, thereby generating an off-network or on-network data change.
Step S602 generates data, which has two channels, on-grid generation and off-grid generation.
Step S603, the client determines the module on the internet, if yes, the process goes to step S613, otherwise, the process goes to step S604; for example, the online determination module 1013 is configured to confirm the network status of the client when performing data interaction. When the on-network determining module 1013 detects that the client is on the network, the on-network state information is sent to the client interactive data processing module 1011, and since the client interactive data processing module 1011 is connected to a server interactive data processing module in the server, the data can be packaged and sent. When the on-network determining module 1013 detects that the client is off-network, the on-network status information is sent to the client interactive data processing module 1011, and the data generated by off-network is directly stored locally by the client. In the network determining module 1013, when entering the client interactive data processing module 1011 in any way, the network state needs to be determined and confirmed by the module.
Step S604, calling a client data interaction module to send data to the server, storing the data to the local when the data is generated on the network, initiating a request to the server, obtaining version difference data returned by the server, and storing the version difference data locally;
step S605, the server data interaction module receives data, the data interaction module is a server interaction data processing module 1001,
step S606 stores the data to the server database,
step S607 is that the server side dynamic code generation module, for example, the dynamic code generation module 1003 is configured to obtain the dynamic code, confirm the version number for the data uploaded this time according to the dynamic code, and issue the version number to the client side of the data uploaded this time. As a preferred method in this embodiment, the method for generating the dynamic code at the server according to the difference data specifically includes that the dynamic code is a version number, and when the server generates the dynamic code, it is required to ensure that the sequence is increased in number, which ensures that the server is easier to determine. The dynamic code can be generated in various ways, such as a way of milliseconds plus a short digital sequence or; the number of service starts + the long number sequence, etc.
Step S608 obtains the dynamic code of the uplink of the client and fetches the data larger than the dynamic code,
step S609 summarizes the data extracted before and the data generated by dynamic encoding,
step S610 delivers data to the server-side data interaction module to initiate response,
step S611 the client data interaction module receives the response,
step S612, storing the server return data and the local generation data in a local database and marking the server return data and the local generation data as uploaded and stored data; entering step S616;
if not, go to step S613 to mark the data as not uploaded and store the data;
step S614 is an automatic client Service triggering module, for example, a Service automatic processing module 1012, where the Service automatic processing module 1012 is used to automatically obtain data when the client is in the network state, and is connected to the client interactive data processing module for data synchronization. In the Android environment, Service is generally used to perform some time-consuming operations, or perform operations in the background that do not provide a user interaction interface, such as: and (5) downloading and uploading. In addition, the iOS environment is background transfer service, such as background transfer service (background transfer service) in the iOS7 multitasking. The function of the processing module with the function is provided by various systems, belongs to a system packaging method, and can be used by developers only through interfaces. Therefore, faster synchronization is realized, and manual synchronization is not needed to be carried out every time by a user.
Step S615 queries data that is not uploaded from the database, i.e., data that is not marked as uploaded.
Step S616, the client data source, and the step S616 the client data source proceeds to step S604.
Because there are two ways in which data is generated, on-grid generation and off-grid generation. When the network is generated, a request is directly sent to the server side except for the local storage, and the version difference data returned by the server side is obtained and stored in the local storage unit. When the client is in the network state, the data generated by the last off-network operation can be combined with the data generated by the current on-network operation to be uploaded together, or the data which is not uploaded is automatically obtained through the service of the client to be uploaded to the server.
Fig. 10 is a schematic structural diagram of a data interaction system between a client and a server in an online and offline state in a preferred embodiment of the present invention.
The server 100 includes a server interaction data processing module 1001, a data processing module 1002, and a dynamic code generation module 1003.
A server interaction data processing module 1001, where the server interaction data processing module 1001 is used to receive data sent by the client and return the data to the client; and is also connected with a client interaction data processing module 1011 in the client for data interaction.
The data processing module 1002, the data processing module 1002 is configured to process data obtained in the server interaction data processing module;
and the dynamic code generation module 1003 is configured to obtain a dynamic code, confirm a version number for the data uploaded this time according to the dynamic code, and send the version number to the client of the data uploaded this time. As a preferred method in this embodiment, the method for generating the dynamic code at the server according to the difference data specifically includes that the dynamic code is a version number, and when the server generates the dynamic code, it is required to ensure that the sequence is increased in number, which ensures that the server is easier to determine. The dynamic code can be generated in various ways, such as a way of milliseconds plus a short digital sequence or; the number of service starts + the long number sequence, etc. The method is mainly used for obtaining the dynamic codes, confirming the version number of the uploaded data, and issuing the version number to the client side of the uploaded data.
Data interaction is realized through the server interaction data processing module 1001 and the client interaction data processing module 1011 of the client.
The client includes a client interaction data processing module 1011, a Service automatic processing module 1012, and an online determination module 1013.
The client interactive data processing module 1011 is used for packaging interactive data and then sending the interactive data to the server; the client interactive data processing module 1011 is further configured to receive the on-network or off-network status determination condition in the on-network determining module 1013. And sends the interactive data to the web determination module 1013.
A Service automatic processing module 1012, wherein the Service automatic processing module 1012 is used to automatically obtain data when the client is in a network state, and is connected to the client interactive data processing module for data synchronization. In the Android environment, Service is generally used to perform some time-consuming operations, or perform operations in the background that do not provide a user interaction interface, such as: and (5) downloading and uploading. In addition, the iOS environment is background transfer service, such as background transfer service (background transfer service) in the iOS7 multitasking. The function of the processing module with the function is provided by various systems, belongs to a system packaging method, and can be used by developers only through interfaces. Therefore, faster synchronization is realized, and manual synchronization is not needed to be carried out every time by a user.
The online determination module 1013 is configured to confirm a network state of the client when performing data interaction. When the on-network determining module 1013 detects that the client is on the network, the on-network state information is sent to the client interactive data processing module 1011, and since the client interactive data processing module 1011 is connected to a server interactive data processing module in the server, the data can be packaged and sent. When the on-network determining module 1013 detects that the client is off-network, the on-network status information is sent to the client interactive data processing module 1011, and the data generated by off-network is directly stored locally by the client. In the network determining module 1013, when entering the client interactive data processing module 1011 in any way, the network state needs to be determined and confirmed by the module.
Those of ordinary skill in the art will understand that: the present invention is not limited to the above embodiments, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (3)
1. A data interaction method between a client and a server in online and offline states is characterized by comprising the following steps:
when data is generated on the network, the client stores the data to the local, and initiates a request to the server to obtain the version difference data returned by the server and stores the version difference data in the local; when the data is generated in an off-network mode, the client stores the generated data to the local, and when the client is in an on-network state, the data generated in the off-network mode last time and the data operated in the on-network mode are combined and uploaded to the server;
when the client is on the network, the server receives the data synchronously sent by the client and returns the version difference data to the client, wherein the version difference data is obtained by matching and comparing the uploaded data;
generating a dynamic code for generating a version difference at the server, confirming a version number for the data uploaded this time according to the dynamic code, and issuing the version number to the client of the data uploaded this time;
when the client uploads data once, the server generates a uniform version number for all the data uploaded this time and sends the uniform version number to the client through a response; the version number created by the server is used for controlling the data which needs to be synchronized at each client, so that the problem that the communication process is too slow due to a large amount of data generated by all data during single interaction is solved;
the client records the version number at a corresponding position of a client data source, and changes the identification of the uploaded data of the client into the uploaded data;
when the client uploads the data later, the version number stored in the client and the data to be uploaded need to be delivered to the server through a request;
if the client is a new installation, the uploaded version number is 0, and after the server receives the request, the server searches data larger than the submitted version number in the data source and generates a new version number as response data of the server;
after the data is responded to the client, the client stores the version number in a data source of the client, processes the responded synchronous data and stores the processed synchronous data to the local, and the uploading identifier of the uploaded data is set as uploaded.
2. The data interaction method according to claim 1, wherein when data is generated off-network, the client automatically obtains the data which is not uploaded, inquires whether the data is uploaded in the database of the server, and uploads the data which is not uploaded to the server.
3. The data interaction method according to claim 1, wherein the method for generating the dynamic code at the server according to the difference data is specifically a mode of millisecond number + short number sequence or a mode of service startup number + long number sequence.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910742273.6A CN110557441B (en) | 2016-03-01 | 2016-03-01 | Data interaction method and system for client and server in online and offline states |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610115320.0A CN105791401B (en) | 2016-03-01 | 2016-03-01 | Client and server-side data interactive method, system under net and off-network state |
CN201910742273.6A CN110557441B (en) | 2016-03-01 | 2016-03-01 | Data interaction method and system for client and server in online and offline states |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610115320.0A Division CN105791401B (en) | 2016-03-01 | 2016-03-01 | Client and server-side data interactive method, system under net and off-network state |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110557441A CN110557441A (en) | 2019-12-10 |
CN110557441B true CN110557441B (en) | 2022-02-22 |
Family
ID=56386802
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610115320.0A Active CN105791401B (en) | 2016-03-01 | 2016-03-01 | Client and server-side data interactive method, system under net and off-network state |
CN201910742274.0A Pending CN110572437A (en) | 2016-03-01 | 2016-03-01 | Data interaction method and system for client and server in online and offline states |
CN201910742273.6A Active CN110557441B (en) | 2016-03-01 | 2016-03-01 | Data interaction method and system for client and server in online and offline states |
Family Applications Before (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610115320.0A Active CN105791401B (en) | 2016-03-01 | 2016-03-01 | Client and server-side data interactive method, system under net and off-network state |
CN201910742274.0A Pending CN110572437A (en) | 2016-03-01 | 2016-03-01 | Data interaction method and system for client and server in online and offline states |
Country Status (1)
Country | Link |
---|---|
CN (3) | CN105791401B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106355358A (en) * | 2016-10-21 | 2017-01-25 | 用友网络科技股份有限公司 | Data manipulation method with double modes in mobile ERP system and ERP system |
CN109361767B (en) * | 2018-12-06 | 2021-11-02 | 思必驰科技股份有限公司 | Processing method for optimizing client data display error, server and client |
CN111769800B (en) * | 2020-03-19 | 2021-09-28 | 尚特杰电力科技有限公司 | Data processing mechanism of photovoltaic power station data acquisition unit under off-grid state |
CN111857603B (en) * | 2020-07-31 | 2022-12-02 | 重庆紫光华山智安科技有限公司 | Data processing method and related device |
CN112681405A (en) * | 2020-12-15 | 2021-04-20 | 广东广建项目管理有限公司 | Automatic deformation monitoring system of foundation ditch |
CN112905553A (en) * | 2021-02-07 | 2021-06-04 | 全链通有限公司 | Data sharing method, device and system based on block chain |
CN113762890A (en) * | 2021-08-17 | 2021-12-07 | 广州快批信息科技有限公司 | Goods offline checking method and device based on PDA local storage |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1852137A (en) * | 2005-07-20 | 2006-10-25 | 华为技术有限公司 | Method for realizing synchronization of client end data and server end data |
CN101064630A (en) * | 2006-04-24 | 2007-10-31 | 华为技术有限公司 | Data synchronization method and system |
CN102457499A (en) * | 2010-10-26 | 2012-05-16 | 腾讯科技(深圳)有限公司 | Offline working method for client, and offline working client |
CN103634445A (en) * | 2013-11-19 | 2014-03-12 | 广州云宏信息科技有限公司 | Caller identification method and device |
CN103716364A (en) * | 2012-06-27 | 2014-04-09 | 卓普网盘股份有限公司 | Determining a preferred modified version from among multiple modified versions for synchronized files |
CN104488248A (en) * | 2014-04-15 | 2015-04-01 | 华为技术有限公司 | File synchronization method, server and terminal |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6912591B2 (en) * | 2001-05-02 | 2005-06-28 | Science Application International Corporation | System and method for patch enabled data transmissions |
US7337239B2 (en) * | 2002-11-19 | 2008-02-26 | Microsoft Corporation | Atomic message division |
WO2006053019A2 (en) * | 2004-11-08 | 2006-05-18 | Sharpcast, Inc. | Method and apparatus for a file sharing and synchronization system |
CN101127960B (en) * | 2007-09-20 | 2011-05-11 | 中兴通讯股份有限公司 | A system and method for differential update of electronic service guidance |
US7991740B2 (en) * | 2008-03-04 | 2011-08-02 | Apple Inc. | Synchronization server process |
JP2011257959A (en) * | 2010-06-08 | 2011-12-22 | Toshiba Corp | Difference retrieval system |
CN102571935B (en) * | 2011-12-23 | 2015-11-25 | 华为技术有限公司 | A kind of method of transfer of data, client, server and system |
CN103002010B (en) * | 2012-10-29 | 2016-09-28 | 北京奇虎科技有限公司 | A kind of data-updating method based on incremental data, device and system |
CN103095843B (en) * | 2013-01-28 | 2018-01-30 | 刘海峰 | A kind of data back up method and client based on version vector |
CN103916482B (en) * | 2014-04-21 | 2017-02-08 | 合肥盈云信息科技有限公司 | Data synchronous transmission method based on sqlite |
CN103997525B (en) * | 2014-05-21 | 2017-10-20 | 北京天禾元创软件股份有限公司 | A kind of Distributed Data Synchronization method and system |
-
2016
- 2016-03-01 CN CN201610115320.0A patent/CN105791401B/en active Active
- 2016-03-01 CN CN201910742274.0A patent/CN110572437A/en active Pending
- 2016-03-01 CN CN201910742273.6A patent/CN110557441B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1852137A (en) * | 2005-07-20 | 2006-10-25 | 华为技术有限公司 | Method for realizing synchronization of client end data and server end data |
CN101064630A (en) * | 2006-04-24 | 2007-10-31 | 华为技术有限公司 | Data synchronization method and system |
CN102457499A (en) * | 2010-10-26 | 2012-05-16 | 腾讯科技(深圳)有限公司 | Offline working method for client, and offline working client |
CN103716364A (en) * | 2012-06-27 | 2014-04-09 | 卓普网盘股份有限公司 | Determining a preferred modified version from among multiple modified versions for synchronized files |
CN103634445A (en) * | 2013-11-19 | 2014-03-12 | 广州云宏信息科技有限公司 | Caller identification method and device |
CN104488248A (en) * | 2014-04-15 | 2015-04-01 | 华为技术有限公司 | File synchronization method, server and terminal |
Also Published As
Publication number | Publication date |
---|---|
CN105791401B (en) | 2019-09-20 |
CN105791401A (en) | 2016-07-20 |
CN110557441A (en) | 2019-12-10 |
CN110572437A (en) | 2019-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110557441B (en) | Data interaction method and system for client and server in online and offline states | |
WO2018219178A1 (en) | Data synchronization method and apparatus, server, and storage medium | |
CN101426017B (en) | Address book processing method and system | |
CN101427556B (en) | Accessing a calendar server to facilitate initiation of a scheduled call | |
US8751442B2 (en) | Synchronization associated duplicate data resolution | |
CN109246220B (en) | Message pushing system and method | |
US20140089436A1 (en) | Method and system for delivering reminder information | |
EP2656251B1 (en) | Generating maps of private spaces using mobile computing device sensors | |
US10877960B2 (en) | Normalizing user identification across disparate systems | |
CN109067896B (en) | Interaction method, interaction device, computer equipment and storage medium | |
CN108076081B (en) | Method, device and system for synchronizing service data | |
CN111880858A (en) | Document processing and instant messaging method, device, electronic equipment and storage medium | |
EP2075975A1 (en) | Relay server and relay communication system | |
CN111314221A (en) | Service processing method, device, equipment and computer readable storage medium | |
JP2016212656A (en) | Information processor, terminal, system having information processor and terminal, and information processing method and program | |
CN114691779A (en) | Data synchronization method and system, computer readable storage medium | |
WO2013119456A1 (en) | Retrieving availability information from published calendars | |
CN110661851A (en) | Data exchange method and device | |
CN106028311A (en) | Terminal register method and device | |
CN106533718B (en) | Data processing method and device | |
JP2019533254A (en) | Information acquisition | |
CN110851458A (en) | Resource acquisition method, device, system and storage medium | |
US11336615B2 (en) | Global load balancing achieved by using distributed DNS reflection | |
US20160036766A1 (en) | Method and system for synchronizing program masks | |
CN111726417B (en) | Delay control method, device, server and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |