Movatterモバイル変換


[0]ホーム

URL:


CN111756794A - Data synchronization method and mobile terminal - Google Patents

Data synchronization method and mobile terminal
Download PDF

Info

Publication number
CN111756794A
CN111756794ACN202010373830.4ACN202010373830ACN111756794ACN 111756794 ACN111756794 ACN 111756794ACN 202010373830 ACN202010373830 ACN 202010373830ACN 111756794 ACN111756794 ACN 111756794A
Authority
CN
China
Prior art keywords
data
mobile terminal
cloud server
local database
timestamp
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.)
Withdrawn
Application number
CN202010373830.4A
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.)
Shanghai Minglue Artificial Intelligence Group Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group 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 Shanghai Minglue Artificial Intelligence Group Co LtdfiledCriticalShanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202010373830.4ApriorityCriticalpatent/CN111756794A/en
Publication of CN111756794ApublicationCriticalpatent/CN111756794A/en
Withdrawnlegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

A data synchronization method and a mobile terminal comprise the following steps: the mobile terminal determines first incremental data uploaded to a cloud server according to the timestamp stored in the local database; when a preset condition is met, the mobile terminal sends a synchronization request to a cloud server; the synchronization request is used for instructing the cloud server to save the first incremental data; and when the mobile terminal receives the feedback message of the completion of the operation of the cloud server, acquiring the current timestamp of the cloud server, and updating the timestamp of the local database. The method and the device can realize that the mobile terminal can still input data or check the data in an off-line state.

Description

Data synchronization method and mobile terminal
Technical Field
The present disclosure relates to computer technologies, and in particular, to a data synchronization method and a mobile terminal.
Background
The existing cultivation management software realizes cloud saas, and is provided with a mobile terminal for data inputting and checking, so that the workers in the cultivation farm can conveniently input or check data at any time and any place. However, the positions of many live pig farms are remote, the coverage of 3G or 4G signals cannot be guaranteed, and broadband WIFI is needless to say. It becomes very inconvenient if the mobile terminal has to be networked to complete the data entry or viewing. Therefore, the mobile terminal can still record or check data in the state of being temporarily off-line, and great convenience is brought to the workers in the farm.
Disclosure of Invention
The application provides a data synchronization method and a mobile terminal, and can achieve the purpose that the mobile terminal can still record data or check the data in an off-line state.
The application provides a data synchronization method which comprises the steps that a mobile terminal determines first incremental data uploaded to a cloud server according to a timestamp stored in a local database; when a preset condition is met, the mobile terminal sends a synchronization request to a cloud server; the synchronization request is used for instructing the cloud server to save the first incremental data; and when the mobile terminal receives the feedback message of the completion of the operation of the cloud server, acquiring the current timestamp of the cloud server, and updating the timestamp of the local database. The method and the device can realize that the mobile terminal can still input data or check the data in an off-line state.
Compared with the prior art, the mobile terminal can determine the first incremental data uploaded to the cloud server according to the timestamp stored in the local database, and indicates the cloud server to store the first incremental data for synchronization, so that the mobile terminal can still enter data or check the data in an off-line state.
In an exemplary embodiment, the mobile terminal in the embodiment of the application can acquire the incremental data of the cloud server from the cloud server, so as to realize data synchronization with the cloud server.
In an exemplary embodiment, the cloud server in the embodiment of the application can download data of the mobile terminal to achieve data synchronization, and can send the incremental data of the cloud server to the mobile terminal to achieve synchronization.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. Other advantages of the present application may be realized and attained by the instrumentalities and combinations particularly pointed out in the specification and the drawings.
Drawings
The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.
Fig. 1 is a flow chart of data synchronization of a mobile terminal according to an embodiment of the present application;
fig. 2 is a flow chart of data synchronization of a cloud server according to an embodiment of the present application;
fig. 3 is an interaction diagram of a mobile terminal and a cloud server according to an embodiment of the application;
fig. 4 is a schematic diagram of a mobile terminal device according to an embodiment of the present application.
Detailed Description
The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.
The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive concept as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented alone or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Further, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.
As shown in fig. 1, a data synchronization method according to an embodiment of the present application includes the following operations:
s1, the mobile terminal determines first incremental data uploaded to the cloud server according to the timestamp stored in the local database;
s2, when a preset condition is met, the mobile terminal sends a synchronization request to a cloud server; the synchronization request is used for instructing the cloud server to save the first incremental data;
and S3, after the mobile terminal receives the feedback message of the completion of the operation of the cloud server, acquiring the current timestamp of the cloud server, and updating the timestamp of the local database.
The mobile terminal can acquire the incremental data of the cloud server from the cloud server, and achieves data synchronization with the cloud server.
The pre-stored data in the local database of the mobile terminal is obtained by storing all data acquired by the mobile terminal from the cloud server into the local database when the mobile terminal is communicated with the cloud server;
in an exemplary embodiment, the mobile terminal in the present application may be a mobile phone, a computer, a PAD, a notebook computer, or the like.
In one exemplary embodiment, the predetermined condition may be every time the mobile terminal detects an operation of updating data of the local database; it may also be that, at intervals of a predetermined length of time, that is: periodic synchronization; or may be whenever a predetermined indication is received, such as an indication to download incremental data; in the following description, new data may be written into the synchronization database, and the monitoring program may find that the synchronization database has new data.
According to the method and the device, the mobile terminal can determine the first incremental data uploaded to the cloud server according to the timestamp stored in the local database, and indicates the cloud server to store the first incremental data for synchronization, so that the mobile terminal can still enter data or check the data in an off-line state. In an exemplary embodiment, the operation S1, where the determining, by the mobile terminal, the first incremental data uploaded to the cloud server according to the timestamp stored in the local database includes:
s11, when the mobile terminal detects the operation of updating the pre-stored data in the local database, modifying the time field of the updated data; the time field of each piece of data in the local database is used for recording the last updating time of the piece of data;
s12, comparing the time stamp stored in the local database with the time fields of all the data in the local database;
and S13, determining the data of which the time represented by the time field in the local data is later than the time stamp in the local database as the first incremental data uploaded to the cloud server.
In an exemplary embodiment, the operation of updating the pre-stored data in the local database may be an operation of adding, deleting, modifying, and the like to the data in the local database.
In one exemplary embodiment, the method further comprises the operations of:
s4, after the mobile terminal sends a synchronization request to the cloud server or receives an indication of a user to download incremental data, the mobile terminal sends a timestamp stored in a local database to the cloud server;
s5, when second incremental data exist in the cloud server, downloading the second incremental data from the cloud server, and storing the second incremental data in a local database; the second incremental data is data updated by the cloud server determined by the cloud server according to the received timestamp sent by the mobile terminal;
and S6, acquiring the current time stamp of the cloud server, and updating the time stamp of the local database.
According to the embodiment of the application, the incremental data of the cloud service can be acquired from the cloud server to achieve synchronization with the cloud. Generally, there may be a plurality of terminals connected to the cloud servers, and when data of each cloud server is updated, the data is synchronized to the cloud server. And the data synchronization of a plurality of terminals is realized by synchronizing the newly added data of the cloud server to the terminals.
In an exemplary embodiment, operation S2, when the predetermined condition is satisfied, the mobile terminal sending a synchronization request to the cloud server, before comprising:
s7, the mobile terminal writes the determined first incremental data uploaded to the cloud server into a synchronous database;
and S8, after the synchronization database monitors that the first incremental data is written in, executing the operation that the mobile terminal sends a synchronization request to a cloud server when the predetermined condition is met.
By storing and sending the incremental data in the synchronous database, the embodiment of the application can manage the incremental data and prevent the influence of the repetition or error of the synchronous data on the local database.
In an exemplary embodiment, the obtaining the current timestamp of the cloud server and updating the timestamp of the local database in operation S3 includes:
and S9, deleting the data in the synchronous database which is earlier than the updated time stamp of the local database.
As shown in fig. 2, a data synchronization method according to an embodiment of the present application includes the following operations:
m1, when the cloud server receives a data synchronization request sent by the mobile terminal, downloading first incremental data uploaded by the mobile terminal and storing the first incremental data in a cloud database;
m2, feeding back the operation completion message to the mobile terminal;
m3, acquiring a current system time updating timestamp and sending the current system time updating timestamp to the mobile terminal;
m4, the first incremental data uploaded by the mobile terminal is the data updated by the local database of the mobile terminal determined by the mobile terminal according to the timestamp stored in the local database.
The cloud server can download the incremental data of the mobile terminal from the mobile terminal to achieve data synchronization with the mobile terminal.
In an exemplary embodiment, the operation M2, the feeding back the message of operation completion to the mobile terminal, includes the following operations:
m5, the cloud server determines whether second incremental data exist in the cloud server according to the received timestamp stored in the local database sent by the mobile terminal;
m6, when the second incremental data exists, sending a synchronization request to the mobile terminal; the synchronization request is used for instructing the mobile terminal to save the second incremental data.
In an exemplary embodiment, the operation M5, where the cloud server determines whether the second incremental data exists in the cloud server according to the received timestamp stored in the local database sent by the mobile terminal, includes operations of:
m50, comparing the time stamp stored in the local database with the time fields of all the data in the cloud database;
m51, determining that second incremental data exists in the cloud server if data exists in the cloud database whose time represented by the time field is later than the time stamp in the local database.
According to the embodiment of the application, the incremental data of the cloud can be determined through the timestamp uploaded by the mobile terminal, and the incremental data are synchronously sent to the mobile terminal.
As shown in fig. 3, in an interaction process between the mobile terminal and the cloud server, a local database is first set at the mobile terminal to store data that can be used and checked by a currently logged-in user, and when the user logs in the mobile terminal for the first time, because the local database is not synchronized with the data from the cloud, the data that can be used and checked by the currently logged-in user must be obtained from the cloud database in full under a condition that the user can be connected to a network. And acquiring the time stamp of the cloud server while acquiring the full data, and storing the time stamp into a local database of the mobile terminal. The timestamp is used for judging which data in the cloud database belong to the newly added data.
After the local database of the mobile terminal obtains the data, various operations of the login user at the mobile terminal are based on the local database, so that whether the network connection exists or not does not influence the operation of the mobile terminal. The data viewed by the user are all data in the local database. The addition, deletion and modification of the data are also completed in the local database. The addition, deletion and modification of data are all data updating operations, each piece of data has a field of the latest updating time, and once the data is updated, the field of the latest updating time is modified by using the system time.
The mobile terminal is additionally provided with a synchronous database which is specially used for data synchronization between the mobile terminal and the cloud terminal. Once the local data is updated, the updated data is written into the synchronous database at the same time.
The mobile terminal is locally provided with a program which has two mechanisms for triggering the synchronous request to be sent to the cloud terminal.
1) Mechanism 1: once the data of the synchronous database is updated (added, deleted or changed), the program is triggered to send a synchronous request to the cloud. This mechanism is used to trigger a synchronization request if the mobile can connect to the network.
2) Mechanism 2: every 3 minutes or other time, the program will automatically send a synchronization request to the cloud. This mechanism is used to trigger a synchronization request if the mobile cannot connect to the network.
After the terminal performs the input operation, when the local database is updated; and determining newly added data according to the timestamp stored in the local database, specifically comparing the time recorded by the field of the data with the timestamp, considering the data after the timestamp as newly added data, and considering the data before the timestamp as non-newly added data. And the mobile terminal writes the newly added data into the synchronous database, and the monitoring program starts an uploading process periodically or uploads the locally stored time stamps together after finding that the synchronous database has new data or receiving an indication of a user to download incremental data. When the cloud end has the new data, receiving the new data sent by the cloud end; receiving an operation completion message and a timestamp sent by the cloud end, and updating the locally stored timestamp; and deleting all data in the synchronous database before the updated time stamp.
After receiving the synchronization request, a cloud interface program of the cloud server firstly inquires whether new data exists in a cloud database according to the uploaded time stamp, and if the new data exists, the new data is selected out to be used as incremental data to be synchronized to the terminal. And after the increment query of the cloud is completed, the newly uploaded increment data is written into the cloud database. And finally, acquiring a latest timestamp from the cloud, and transmitting the latest timestamp and the new incremental data of the cloud back to the terminal.
As shown in fig. 4, a mobile terminal according to an embodiment of the present application includes: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising instructions for: the mobile terminal determines first incremental data uploaded to a cloud server according to the timestamp stored in the local database; when a preset condition is met, the mobile terminal sends a synchronization request to a cloud server; the synchronization request is used for instructing the cloud server to save the first incremental data; and when the mobile terminal receives the feedback message of the completion of the operation of the cloud server, acquiring the current timestamp of the cloud server, and updating the timestamp of the local database.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (10)

CN202010373830.4A2020-05-062020-05-06Data synchronization method and mobile terminalWithdrawnCN111756794A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010373830.4ACN111756794A (en)2020-05-062020-05-06Data synchronization method and mobile terminal

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010373830.4ACN111756794A (en)2020-05-062020-05-06Data synchronization method and mobile terminal

Publications (1)

Publication NumberPublication Date
CN111756794Atrue CN111756794A (en)2020-10-09

Family

ID=72673780

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010373830.4AWithdrawnCN111756794A (en)2020-05-062020-05-06Data synchronization method and mobile terminal

Country Status (1)

CountryLink
CN (1)CN111756794A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112783848A (en)*2021-01-202021-05-11杭州数梦工场科技有限公司Data synchronization method and device and electronic equipment
CN112838980A (en)*2020-12-302021-05-25北京奇艺世纪科技有限公司Message processing method, system, device, electronic equipment and storage medium
CN113407635A (en)*2021-07-092021-09-17浙江明度智控科技有限公司Multi-terminal data synchronization method and system for intelligent manufacturing
CN113407555A (en)*2021-07-092021-09-17浙江明度智控科技有限公司Operation data updating method and system of equipment handheld terminal
CN113609218A (en)*2021-07-202021-11-05深圳市爱都科技有限公司Data synchronization method, terminal device and computer-readable storage medium
CN114003661A (en)*2021-11-122022-02-01招商局金融科技有限公司 Offline data entry method, device, electronic device and storage medium
CN115037729A (en)*2022-04-212022-09-09中国建设银行股份有限公司Data aggregation method and device, electronic equipment and computer readable medium
CN115391465A (en)*2022-10-272022-11-25天津睿智诚科技发展有限公司Multi-terminal data synchronization method, system and device based on signal clustering judgment
CN115865528A (en)*2023-02-202023-03-28深圳市英唐数码科技有限公司Multi-device based user profile operation method, system and readable storage medium
CN116069793A (en)*2022-12-232023-05-05中国舰船研究院(中国船舶集团有限公司第七研究院) A collaborative online editing data conflict resolution method, computer and storage medium

Cited By (17)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112838980B (en)*2020-12-302023-06-13北京奇艺世纪科技有限公司Message processing method, system, device, electronic equipment and storage medium
CN112838980A (en)*2020-12-302021-05-25北京奇艺世纪科技有限公司Message processing method, system, device, electronic equipment and storage medium
CN112783848A (en)*2021-01-202021-05-11杭州数梦工场科技有限公司Data synchronization method and device and electronic equipment
CN112783848B (en)*2021-01-202023-12-26杭州数梦工场科技有限公司Data synchronization method and device and electronic equipment
CN113407635A (en)*2021-07-092021-09-17浙江明度智控科技有限公司Multi-terminal data synchronization method and system for intelligent manufacturing
CN113407555A (en)*2021-07-092021-09-17浙江明度智控科技有限公司Operation data updating method and system of equipment handheld terminal
CN113407635B (en)*2021-07-092022-06-03明度智云(浙江)科技有限公司Multi-terminal data synchronization method and system for intelligent manufacturing
CN113407555B (en)*2021-07-092022-08-16明度智云(浙江)科技有限公司Operation data updating method and system of equipment handheld terminal
CN113609218A (en)*2021-07-202021-11-05深圳市爱都科技有限公司Data synchronization method, terminal device and computer-readable storage medium
CN114003661A (en)*2021-11-122022-02-01招商局金融科技有限公司 Offline data entry method, device, electronic device and storage medium
CN114003661B (en)*2021-11-122024-11-15招商局金融科技有限公司 Offline data entry method, device, electronic device and storage medium
CN115037729A (en)*2022-04-212022-09-09中国建设银行股份有限公司Data aggregation method and device, electronic equipment and computer readable medium
CN115037729B (en)*2022-04-212024-05-28中国建设银行股份有限公司Data aggregation method, device, electronic equipment and computer readable medium
CN115391465A (en)*2022-10-272022-11-25天津睿智诚科技发展有限公司Multi-terminal data synchronization method, system and device based on signal clustering judgment
CN116069793A (en)*2022-12-232023-05-05中国舰船研究院(中国船舶集团有限公司第七研究院) A collaborative online editing data conflict resolution method, computer and storage medium
CN115865528B (en)*2023-02-202023-05-12深圳市英唐数码科技有限公司Multi-device-based user profile operation method, system and readable storage medium
CN115865528A (en)*2023-02-202023-03-28深圳市英唐数码科技有限公司Multi-device based user profile operation method, system and readable storage medium

Similar Documents

PublicationPublication DateTitle
CN111756794A (en)Data synchronization method and mobile terminal
US20180367610A1 (en)Data storage method and server applicable to distributed server cluster
CN110417884B (en)Message pushing method, device, equipment and storage medium
EP2086170B1 (en)Method, equipment and system for acquiring and providing CPE function configuration information
US9002787B2 (en)Method and apparatus for tracking device management data changes
US20110295947A1 (en)Communication apparatus and method thereof
KR20080016160A (en) Software management method in terminal through device management server
CN111708836B (en)Cluster management method, device and cluster system
CN103019757A (en)Method, device and system for synchronizing software among multiple clients
CN109788027A (en)Method of data synchronization, device, server and computer storage medium
CN101577646B (en)Alarm synchronizing method based on SNMP
CN110113495A (en)Long-range control method, device, electronic equipment and the system of APP
WO2017162079A1 (en)Data synchronization method and apparatus
CN110781149A (en)Method, device, equipment and storage medium for managing live broadcast room information
CN105450682A (en)Method, device, and system for data synchronous storage and synchronizing data to client
CN112069195A (en)Database-based message transmission method and device, electronic equipment and storage medium
CN110968646B (en)Embedded system database synchronization method, device and storage medium
CN114827127B (en)File management method, system, cloud server and terminal equipment
US8745270B2 (en)Communication device and method of handling large object in device management
CN111596933B (en)File processing method, device, electronic equipment and computer readable storage medium
CN111400327B (en)Data synchronization method and device, electronic equipment and storage medium
CN112865927B (en)Message delivery verification method, device, computer equipment and storage medium
US10877820B1 (en)Application event delivery
CN103701667A (en)Method, device and system for monitoring heartbeat of server
CN113423095A (en)Information interaction method and device and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
WW01Invention patent application withdrawn after publication
WW01Invention patent application withdrawn after publication

Application publication date:20201009


[8]ページ先頭

©2009-2025 Movatter.jp