[go: up one dir, main page]

CN111259022B - Information synchronization method, synchronization system, computer equipment and medium - Google Patents

Information synchronization method, synchronization system, computer equipment and medium Download PDF

Info

Publication number
CN111259022B
CN111259022B CN202010032343.1A CN202010032343A CN111259022B CN 111259022 B CN111259022 B CN 111259022B CN 202010032343 A CN202010032343 A CN 202010032343A CN 111259022 B CN111259022 B CN 111259022B
Authority
CN
China
Prior art keywords
information
signature
server
mobile terminal
terminal
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
Application number
CN202010032343.1A
Other languages
Chinese (zh)
Other versions
CN111259022A (en
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.)
BOE Technology Group Co Ltd
Ordos Yuansheng Optoelectronics Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Ordos Yuansheng Optoelectronics 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 BOE Technology Group Co Ltd, Ordos Yuansheng Optoelectronics Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202010032343.1A priority Critical patent/CN111259022B/en
Publication of CN111259022A publication Critical patent/CN111259022A/en
Application granted granted Critical
Publication of CN111259022B publication Critical patent/CN111259022B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明公开了一种移动终端与服务器之间的信息同步方法、信息同步系统、计算机可读存储介质和计算机设备,所述信息同步方法包括:所述移动终端在离线状态下更新终端数据库的信息,并在离线状态转为在线状态时向服务器发送离线数据同步请求以获取服务签名并更新终端数据库,同时将所述更新的信息发送至服务器以同步服务器数据库的信息。本发明提供的实施例能够解决现有技术中因网络环境束缚导致的移动终端和服务器数据库的数据同步问题,实现多移动终端与服务器的实时同步问题,有效提高信息管理的效率。

The present invention discloses an information synchronization method between a mobile terminal and a server, an information synchronization system, a computer-readable storage medium and a computer device, wherein the information synchronization method comprises: the mobile terminal updates the information of the terminal database in an offline state, and sends an offline data synchronization request to the server to obtain a service signature and update the terminal database when the offline state is converted to an online state, and at the same time sends the updated information to the server to synchronize the information of the server database. The embodiments provided by the present invention can solve the data synchronization problem between the mobile terminal and the server database caused by the constraints of the network environment in the prior art, realize the real-time synchronization problem between multiple mobile terminals and the server, and effectively improve the efficiency of information management.

Description

一种信息同步方法、同步系统、计算机设备和介质Information synchronization method, synchronization system, computer equipment and medium

技术领域Technical Field

本发明涉及仓库管理领域,特别是涉及一种移动终端与服务器之间的信息同步方法、信息同步系统、计算机可读存储介质和计算机设备。The present invention relates to the field of warehouse management, and in particular to an information synchronization method between a mobile terminal and a server, an information synchronization system, a computer-readable storage medium and a computer device.

背景技术Background technique

随着移动互联网技术的兴起,企业内部应用由原有PC端向移动终端转移,使用移动终端可以大大提高企业信息化程度、智能制造程度,移动终端开发涉及算法较多,通过优良和高效的算法可以有效解决业务中的需求。With the rise of mobile Internet technology, internal enterprise applications have shifted from the original PC to mobile terminals. The use of mobile terminals can greatly improve the degree of enterprise informatization and intelligent manufacturing. Mobile terminal development involves many algorithms, and excellent and efficient algorithms can effectively solve business needs.

当前多终端数据同步一般直接访问服务器端数据库,移动终端本地不存储数据,在无网络环境下移动终端无法使用,不能满足制造企业网络覆盖不全面的问题。现有多终端数据同步方法一般采用全部更新的方式,不能部分更新,导致数据同步时间慢,效率低下,特别是当前大数据时代的到来,数据量巨大,全部更新时间耗时长,不仅影响用户体验,更影响设备性能。At present, multi-terminal data synchronization generally directly accesses the server-side database. The mobile terminal does not store data locally. The mobile terminal cannot be used in an environment without a network, which cannot meet the problem of incomplete network coverage of manufacturing enterprises. The existing multi-terminal data synchronization method generally adopts the method of full update, and cannot partially update, resulting in slow data synchronization time and low efficiency. Especially in the current era of big data, the amount of data is huge, and the full update time is long, which not only affects the user experience, but also affects the performance of the equipment.

发明内容Summary of the invention

为了解决上述问题至少之一,本发明第一个实施例提供一种移动终端与服务器之间的信息同步方法,应用于移动终端,包括:In order to solve at least one of the above problems, a first embodiment of the present invention provides an information synchronization method between a mobile terminal and a server, which is applied to the mobile terminal and includes:

判断所述移动终端为离线状态时:When it is determined that the mobile terminal is in an offline state:

若信息更新则更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;If the information is updated, the information in the terminal database is updated, each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal;

判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:When it is determined that the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature:

向服务器发送离线数据同步请求,使得所述服务器生成服务签名并回传所述移动终端;Sending an offline data synchronization request to a server, so that the server generates a service signature and transmits it back to the mobile terminal;

根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器,使得所述服务器根据接收的信息更新服务器数据库。The signature of each offline updated information in the terminal database is updated according to the service signature, and each information with the updated service signature is sent to the server, so that the server updates the server database according to the received information.

进一步的,还包括:Furthermore, it also includes:

接收所述服务器广播的同步请求,查询是否存在签名为终端签名的信息;Receiving the synchronization request broadcast by the server, and querying whether there is information that the signature is the signature of the terminal;

若存在则:If it exists:

向所述服务器发送离线数据同步请求,使得所述服务器生成服务签名并回传至所述移动终端,Send an offline data synchronization request to the server, so that the server generates a service signature and transmits it back to the mobile terminal,

根据所述服务签名更新所述终端数据库中签名为终端签名的信息的签名,并将各所述更新的信息发送至所述服务器,使得所述服务器将各所述更新的信息更新至所述服务器数据库。The signature of the information signed as the terminal signature in the terminal database is updated according to the service signature, and each updated information is sent to the server, so that the server updates each updated information to the server database.

进一步的,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。Furthermore, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

进一步的,还包括:Furthermore, it also includes:

判断所述移动终端为在线状态时:When it is determined that the mobile terminal is in an online state:

若信息更新则更新所述终端数据库的信息并向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据,使得所述服务器生成服务签名并回传所述移动终端,并使得所述服务器将该信息的名称、数据和所述服务签名更新至所述服务器数据库;If the information is updated, the information in the terminal database is updated and an online data update request is sent to the server, wherein the online data update request includes the name and data of the updated information, so that the server generates a service signature and transmits it back to the mobile terminal, and the server updates the name, data and service signature of the information to the server database;

根据所述服务签名更新终端数据库中对应的信息的签名。The signature of the corresponding information in the terminal database is updated according to the service signature.

进一步的,还包括:Furthermore, it also includes:

判断所述移动终端启动时或响应于外部操作同步时:Determine when the mobile terminal is started or synchronized in response to an external operation:

向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名,使得所述服务器根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端;Sending an online data synchronization request to the server, the online data synchronization request including the name and signature of each information in the terminal database of the mobile terminal, so that the server queries the server database according to the name and signature of each information and encapsulates each information other than the name and signature into a synchronization data packet to send to the mobile terminal;

接收所述同步数据包并将其中的各信息更新至所述终端数据库。The synchronization data packet is received and each information therein is updated to the terminal database.

本发明第二个实施例提供一种移动终端与服务器之间的信息同步方法,应用于服务器,包括:A second embodiment of the present invention provides a method for synchronizing information between a mobile terminal and a server, which is applied to the server and includes:

接收移动终端发送的离线数据同步请求,生成服务签名并发送至所述移动终端,使得所述移动终端将所述服务签名更新至终端数据库中离线更新的信息,所述信息包括名称、数据和签名;Receiving an offline data synchronization request sent by a mobile terminal, generating a service signature and sending it to the mobile terminal, so that the mobile terminal updates the service signature to offline updated information in a terminal database, the information including a name, data and a signature;

接收所述移动终端发送的所述更新了服务签名的信息,根据所述信息更新服务器数据库。The information of the updated service signature sent by the mobile terminal is received, and the server database is updated according to the information.

进一步的,还包括:Furthermore, it also includes:

定时广播离线同步请求;Regularly broadcast offline synchronization requests;

接收所述移动终端发送的离线数据同步请求,生成服务签名发送至所述移动终端,使得所述移动终端将所述服务签名更新至终端数据库中离线更新的信息;receiving an offline data synchronization request sent by the mobile terminal, generating a service signature and sending it to the mobile terminal, so that the mobile terminal updates the service signature to offline updated information in a terminal database;

接收所述移动终端发送的所述更新了服务签名的信息,根据所述信息更新服务器数据库。The information of updating the service signature sent by the mobile terminal is received, and the server database is updated according to the information.

进一步的,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。Furthermore, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

进一步的,还包括:Furthermore, it also includes:

接收所述移动终端发送的在线数据更新请求,所述在线数据更新请求包括更新的信息的名称和数据;receiving an online data update request sent by the mobile terminal, wherein the online data update request includes a name and data of updated information;

生成服务签名并回传所述移动终端,同时将该信息的名称、数据和所述服务签名更新至所述服务器数据库,使得所述移动终端根据所述服务签名更新终端数据库中对应的信息的签名。Generate a service signature and transmit it back to the mobile terminal, and at the same time update the name, data and the service signature of the information to the server database, so that the mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature.

进一步的,还包括:Furthermore, it also includes:

接收所述移动终端发送的在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名;receiving an online data synchronization request sent by the mobile terminal, wherein the online data synchronization request includes a name and a signature of each information of a terminal database of the mobile terminal;

根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端,使得所述移动终端根据所述同步数据包中的各信息更新至所述终端数据库。The server database is queried according to the name and signature of each information and each information other than the name and signature is encapsulated into a synchronization data packet to be sent to the mobile terminal, so that the mobile terminal updates the terminal database according to each information in the synchronization data packet.

本发明第三个实施例提供一种移动终端与服务器之间的信息同步方法,包括A third embodiment of the present invention provides a method for synchronizing information between a mobile terminal and a server, comprising:

判断所述移动终端为离线状态时,When it is determined that the mobile terminal is in an offline state,

若信息更新则所述移动终端更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;If the information is updated, the mobile terminal updates the information in the terminal database, each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal;

判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:When it is determined that the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature:

所述移动终端向服务器发送离线数据同步请求;The mobile terminal sends an offline data synchronization request to the server;

所述服务器生成服务签名并回传所述移动终端;The server generates a service signature and transmits it back to the mobile terminal;

所述移动终端根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器;The mobile terminal updates the signature of each offline updated information in the terminal database according to the service signature, and sends each information with the updated service signature to the server;

所述服务器根据接收的信息更新服务器数据库。The server updates the server database according to the received information.

进一步的,还包括:Furthermore, it also includes:

所述移动终端接收所述服务器广播的同步请求,查询是否存在签名为终端签名的信息;The mobile terminal receives the synchronization request broadcast by the server and queries whether there is information signed by the terminal;

若存在则:If it exists:

所述移动终端向所述服务器发送离线数据同步请求;The mobile terminal sends an offline data synchronization request to the server;

所述服务器生成服务签名并回传至所述移动终端,The server generates a service signature and transmits it back to the mobile terminal.

所述移动终端根据所述服务签名更新所述终端数据库中签名为终端签名的信息的签名,并将各所述更新的信息发送至所述服务器;The mobile terminal updates the signature of the information signed as the terminal signature in the terminal database according to the service signature, and sends each of the updated information to the server;

所述服务器将各所述更新的信息更新至所述服务器数据库。The server updates the updated information to the server database.

进一步的,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。Furthermore, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

进一步的,还包括:Furthermore, it also includes:

判断所述移动终端为在线状态时:When it is determined that the mobile terminal is in an online state:

若信息更新则所述移动终端更新所述终端数据库的信息并向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据;If the information is updated, the mobile terminal updates the information in the terminal database and sends an online data update request to the server, wherein the online data update request includes the name and data of the updated information;

所述服务器生成服务签名并回传所述移动终端,并将该信息的名称、数据和所述服务签名更新至所述服务器数据库;The server generates a service signature and transmits it back to the mobile terminal, and updates the name, data and service signature of the information to the server database;

所述移动终端根据所述服务签名更新终端数据库中对应的信息的签名。The mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature.

进一步的,还包括:Furthermore, it also includes:

判断所述移动终端启动时或响应于外部操作同步时:Determine when the mobile terminal is started or synchronized in response to an external operation:

所述移动终端向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名;The mobile terminal sends an online data synchronization request to the server, wherein the online data synchronization request includes a name and a signature of each information in the terminal database of the mobile terminal;

所述服务器根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端;The server queries a server database according to the name and signature of each information and encapsulates each information except the name and signature into a synchronization data packet to send to the mobile terminal;

所述移动终端接收所述同步数据包并将其中的各信息更新至所述终端数据库。The mobile terminal receives the synchronization data packet and updates each information therein to the terminal database.

本发明第四个实施例提供一种信息同步系统,包括服务器和多个移动终端,其中包括服务器和多个移动终端,其中A fourth embodiment of the present invention provides an information synchronization system, including a server and a plurality of mobile terminals, wherein

所述服务器包括控制器、第一通信设备和服务器数据库;The server includes a controller, a first communication device and a server database;

每个移动终端包括处理器、第二通信设备、终端数据库和网络检测器器;Each mobile terminal includes a processor, a second communication device, a terminal database and a network detector;

其中,in,

所述处理器控制所述网络检测器检测网络状态,若所述移动终端为离线状态:The processor controls the network detector to detect the network status, and if the mobile terminal is in an offline state:

所述处理器更新信息并存储在所述终端数据库,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;The processor updates information and stores it in the terminal database, each information including a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal;

所述处理器控制所述网络检测器检测网络状态,若所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:The processor controls the network detector to detect the network status, if the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature:

所述处理器通过所述第二通信设备向服务器发送离线数据同步请求,或者The processor sends an offline data synchronization request to the server through the second communication device, or

所述控制器通过所述第一通信设备定时广播同步请求,所述处理器通过所述第二通信设备接收所述同步请求并通过所述第二通信设备向服务器发送离线数据同步请求,The controller broadcasts a synchronization request regularly through the first communication device, the processor receives the synchronization request through the second communication device and sends an offline data synchronization request to the server through the second communication device,

所述控制器通过所述第一通信设备接收所述离线数据同步请求,生成服务签名通过所述第一通信设备发送至所述移动终端,The controller receives the offline data synchronization request through the first communication device, generates a service signature and sends it to the mobile terminal through the first communication device,

所述处理器通过所述第二通信设备接收并根据所述服务签名更新所述终端数据库的信息并通过所述第二通信设备将所述更新了服务签名的信息发送至所述服务器,The processor receives information of updating the terminal database according to the service signature through the second communication device and sends the information of updating the service signature to the server through the second communication device,

所述控制器通过所述第一通信设备接收所述更新了服务签名的信息,根据所述信息更新所述服务器数据库;The controller receives the information of updating the service signature through the first communication device, and updates the server database according to the information;

所述处理器控制所述网络检测器检测网络状态,若所述移动终端为在线状态:The processor controls the network detector to detect the network status, and if the mobile terminal is online:

所述处理器更新信息并存储在所述终端数据库,通过所述第二通信设备向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据,The processor updates the information and stores it in the terminal database, and sends an online data update request to the server through the second communication device, wherein the online data update request includes the name and data of the updated information.

所述控制器通过所述第一通信设备接收所述在线数据更新请求并生成服务签名,将所述在线数据更新请求包括的信息的名称和数据,以及所述服务签名更新至所述服务器数据库;The controller receives the online data update request through the first communication device and generates a service signature, and updates the name and data of the information included in the online data update request and the service signature to the server database;

所述处理器通过所述第二通信设备接收并根据所述服务签名更新所述终端数据库的信息;The processor receives information of the terminal database through the second communication device and updates the information according to the service signature;

所述处理器判断所述移动终端启动时或响应于外部操作同步时:When the processor determines that the mobile terminal is started or synchronized in response to an external operation:

所述处理器通过所述第二通信设备向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名,The processor sends an online data synchronization request to the server through the second communication device, wherein the online data synchronization request includes a name and a signature of each information of the terminal database of the mobile terminal,

所述控制器通过所述第一通信设备接收所述在线数据同步请求,根据所述终端数据库的各信息的名称和签名查询服务器数据库,并将所述名称和签名之外的各信息封装为同步数据包通过所述第一通信设备发送至所述移动终端,The controller receives the online data synchronization request through the first communication device, queries the server database according to the name and signature of each information in the terminal database, and encapsulates each information other than the name and signature into a synchronization data packet and sends it to the mobile terminal through the first communication device.

所述处理器通过所述第二通信设备接收并根据所述同步数据包将其中的各信息更新至所述终端数据库。The processor receives the synchronization data packet through the second communication device and updates the information therein to the terminal database according to the synchronization data packet.

本发明第五个实施例提供一种计算机可读存储介质,其上存储有计算机程序,A fifth embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon.

该程序被处理器执行时实现第一个实施例所述的方法;When the program is executed by a processor, the method described in the first embodiment is implemented;

或者or

该程序被处理器执行时实现第二个实施例所述的方法;When the program is executed by a processor, the method described in the second embodiment is implemented;

或者or

该程序被处理器执行时实现第三个实施例所述的方法。When the program is executed by a processor, the method described in the third embodiment is implemented.

本发明第六个实施例提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,A sixth embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.

所述处理器执行所述程序时实现第一个实施例所述的方法;When the processor executes the program, the method described in the first embodiment is implemented;

或者or

所述处理器执行所述程序时实现第二个实施例所述的方法;When the processor executes the program, the method described in the second embodiment is implemented;

或者or

所述处理器执行所述程序时实现第三个实施例所述的方法。When the processor executes the program, the method described in the third embodiment is implemented.

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

本发明针对目前现有的问题,制定一种移动终端与服务器之间的信息同步方法、信息同步系统、计算机可读存储介质和计算机设备,根据移动终端在离线状态下更新的信息,在从离线状态转为在线状态时通过移动终端到服务器、以及从服务器到移动终端的双向同步方法确保离线更新的信息能够及时同步到服务器数据库,同时确保在线状态下更新的信息实时同步到服务器数据库,能够解决现有技术中因网络环境束缚导致的移动终端和服务器数据库的数据同步问题,实现多移动终端与服务器的实时同步问题,有效提高信息管理的效率。In view of the existing problems, the present invention develops an information synchronization method, an information synchronization system, a computer-readable storage medium and a computer device between a mobile terminal and a server. According to the information updated by the mobile terminal in an offline state, when the offline state is changed to an online state, a two-way synchronization method from the mobile terminal to the server and from the server to the mobile terminal is used to ensure that the offline updated information can be synchronized to the server database in time, and at the same time ensure that the information updated in the online state is synchronized to the server database in real time. This can solve the data synchronization problem of the mobile terminal and the server database caused by the constraints of the network environment in the prior art, realize the real-time synchronization problem of multiple mobile terminals and the server, and effectively improve the efficiency of information management.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

图1示出本发明的一个实施例所述信息同步方法的泳道图;FIG1 shows a swim lane diagram of an information synchronization method according to an embodiment of the present invention;

图2示出本发明的另一个实施例所述信息同步方法的泳道图;FIG2 shows a swim lane diagram of an information synchronization method according to another embodiment of the present invention;

图3示出本发明的又一个实施例所述信息同步方法的泳道图;FIG3 shows a swim lane diagram of an information synchronization method according to another embodiment of the present invention;

图4示出本发明的再一个实施例所述信息同步方法的泳道图;FIG4 shows a swim lane diagram of an information synchronization method according to yet another embodiment of the present invention;

图5示出本发明的另一个实施例所述信息同步系统的结构框图;FIG5 shows a structural block diagram of an information synchronization system according to another embodiment of the present invention;

图6示出本发明的另一个实施例所述的一种计算机设备的结构示意图。FIG6 is a schematic diagram showing the structure of a computer device according to another embodiment of the present invention.

具体实施方式Detailed ways

为了更清楚地说明本发明,下面结合优选实施例和附图对本发明做进一步的说明。附图中相似的部件以相同的附图标记进行表示。本领域技术人员应当理解,下面所具体描述的内容是说明性的而非限制性的,不应以此限制本发明的保护范围。In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the scope of protection of the present invention.

如图1所示,本发明的一个实施例提供了一种移动终端与服务器之间的信息同步方法,应用于移动终端,包括:判断所述移动终端为离线状态时:若信息更新则更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:向服务器发送离线数据同步请求,使得所述服务器生成服务签名并回传所述移动终端;根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器,使得所述服务器根据接收的信息更新服务器数据库。As shown in Figure 1, an embodiment of the present invention provides an information synchronization method between a mobile terminal and a server, which is applied to a mobile terminal, including: when it is determined that the mobile terminal is in an offline state: if the information is updated, the information in the terminal database is updated, and each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal; when it is determined that the mobile terminal is changed from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature: an offline data synchronization request is sent to the server, so that the server generates a service signature and transmits it back to the mobile terminal; the signature of each offline updated information in the terminal database is updated according to the service signature, and each information with the updated service signature is sent to the server, so that the server updates the server database according to the received information.

在本实施例中,通过设置在移动终端的终端数据库使得移动终端在离线状态下能够正常运行:在离线状态下更新信息并存储在终端数据库中;当移动终端从离线状态转为在线状态时通过移动终端发起的从移动终端到服务器的数据同步将更新的信息同步至服务器的服务器数据库,从而实现信息的同步。本实施例能够解决现有技术中因移动终端不存储数据而导致的无法在离线状态下工作,有效提高所述移动终端的工作性能。In this embodiment, the terminal database set in the mobile terminal enables the mobile terminal to operate normally in an offline state: information is updated in the offline state and stored in the terminal database; when the mobile terminal changes from the offline state to the online state, the updated information is synchronized to the server database of the server through data synchronization initiated from the mobile terminal to the server, thereby realizing information synchronization. This embodiment can solve the problem in the prior art that the mobile terminal cannot work in an offline state because the mobile terminal does not store data, and effectively improves the working performance of the mobile terminal.

在一个具体的实施例中,以企业中盘点物料更新物料信息为例进行说明,如图1所示,In a specific embodiment, an example of updating material information by taking inventory of materials in an enterprise is used for explanation, as shown in FIG1 .

在离线状态下,所述移动终端在盘点物料时,根据一项或多项物料的实际库存情况,将物料的实际数量更新至终端数据库的信息的数据中,同时生成终端签名作为签名。In an offline state, when the mobile terminal takes inventory of materials, it updates the actual quantity of the materials to the information in the terminal database according to the actual inventory status of one or more materials, and generates a terminal signature as a signature.

当移动终端从离线状态转为在线状态时,例如将移动终端从未覆盖网络信号的库房移至覆盖网络信号的办公场所时,所述移动终端连接网络,则移动终端向服务器发送离线数据同步请求。When the mobile terminal changes from an offline state to an online state, for example, when the mobile terminal is moved from a warehouse without network signal coverage to an office space with network signal coverage, the mobile terminal connects to the network and sends an offline data synchronization request to the server.

所述服务器接收所述离线数据同步请求并生成确认同步的服务签名,将所述服务签名发送至所述移动终端。The server receives the offline data synchronization request and generates a service signature to confirm synchronization, and sends the service signature to the mobile terminal.

所述移动终端接收所述服务签名,并将该服务签名更新至所述终端数据库中在离线状态下更新的信息的签名,同时将更新了服务签名的信息发送至服务器。即将服务器确认同步生成的服务签名,更新至所述终端数据库中签名为终端签名的信息。The mobile terminal receives the service signature and updates the service signature to the signature of the information updated in the terminal database in an offline state, and sends the information with the updated service signature to the server, that is, the service signature generated synchronously by the server is updated to the information in the terminal database signed as the terminal signature.

所述服务器将接收的更新了服务签名的所述信息,即离线状态下更新了数据的信息,存储至服务器数据库,从而实现了同步移动终端在离线状态下更新的数据。The server stores the received information with updated service signature, that is, the information with updated data in offline state, in the server database, thereby realizing the synchronization of data updated by the mobile terminal in offline state.

值得说明的是,本实施例仅通过物料信息说明本申请的一个具体实施方式,本申请中的移动终端和服务器之间同步的信息可以为任意存在更新的具体信息,本领域技术人员应当根据实际应用需求选择适当的应用场景,以实现移动终端和服务器的信息同步为设计准则,在此不再赘述。It is worth noting that this embodiment only illustrates a specific implementation method of the present application through material information. The information synchronized between the mobile terminal and the server in the present application can be any specific information that is updated. Those skilled in the art should select appropriate application scenarios according to actual application requirements, and use information synchronization between the mobile terminal and the server as a design criterion, which will not be repeated here.

考虑到移动终端由离线状态转为在线状态下,仅存在由移动终端到服务器一个方向的数据同步方法,在一个可选的实施例中,所述同步方法还包括:接收所述服务器广播的同步请求,查询是否存在签名为终端签名的信息;若存在则:向所述服务器发送离线数据同步请求,使得所述服务器生成服务签名并回传至所述移动终端,根据所述服务签名更新所述终端数据库中签名为终端签名的信息的签名,并将各所述更新的信息发送至所述服务器,使得所述服务器将各所述更新的信息更新至所述服务器数据库并更新所述同步日志,所述同步日志用于记录所述服务器数据库的同步信息,例如记录某个移动终端从离线状态转为在线状态时进行的同步操作。Considering that when the mobile terminal changes from an offline state to an online state, there is only a data synchronization method in one direction from the mobile terminal to the server. In an optional embodiment, the synchronization method also includes: receiving a synchronization request broadcast by the server, and querying whether there is information signed as the terminal signature; if so: sending an offline data synchronization request to the server, so that the server generates a service signature and transmits it back to the mobile terminal, updates the signature of the information signed as the terminal signature in the terminal database according to the service signature, and sends each updated information to the server, so that the server updates each updated information to the server database and updates the synchronization log. The synchronization log is used to record the synchronization information of the server database, such as recording the synchronization operation performed when a mobile terminal changes from an offline state to an online state.

在本实施例中,通过服务器定时广播的同步请求,进一步确保将移动终端在离线状态下更新的信息同步至服务器的服务器数据库,从而实现双方向的离线数据同步。In this embodiment, the synchronization request broadcasted periodically by the server further ensures that the information updated by the mobile terminal in the offline state is synchronized to the server database of the server, thereby realizing two-way offline data synchronization.

具体的,如图2所示:Specifically, as shown in Figure 2:

所述服务器定时广播同步请求。The server broadcasts synchronization requests periodically.

在本实施例中,所述服务器连接有至少一个移动终端,所述服务器通过定时广播方式向各移动终端发送同步请求,提高了现有技术中通过服务器轮询方式检测各移动终端是否存在离线的信息更新的查询效率。In this embodiment, the server is connected to at least one mobile terminal, and the server sends synchronization requests to each mobile terminal through a timed broadcast, thereby improving the query efficiency of the prior art of detecting whether each mobile terminal has offline information updates through server polling.

所述移动终端接收所述同步请求并查询自身的终端数据库是否存在离线的信息的更新,即签名为终端签名的信息,若不存在则丢弃该同步请求,否则启动离线信息的同步过程:包括:移动终端向服务器发送离线数据同步请求;服务器接收并生成确定同步的服务签名,将服务签名发送至移动终端;移动终端根据服务签名更新终端数据库中离线更新的信息中的签名,并将更新的信息发送至服务器;服务器接收信息并更新至服务器数据库。具体过程与上述实施例相类似,在此不再赘述。The mobile terminal receives the synchronization request and queries its own terminal database whether there is any offline information update, that is, information signed by the terminal. If not, the synchronization request is discarded, otherwise the offline information synchronization process is started: including: the mobile terminal sends an offline data synchronization request to the server; the server receives and generates a service signature to determine synchronization, and sends the service signature to the mobile terminal; the mobile terminal updates the signature in the offline updated information in the terminal database according to the service signature, and sends the updated information to the server; the server receives the information and updates it to the server database. The specific process is similar to the above embodiment and will not be repeated here.

值得说明的是,无论是所述移动终端向服务器发起的离线数据同步请求启动离线更新的信息的同步过程,还是移动终端响应于服务器定时广播的同步请求启动的离线更新的信息的同步过程,在一次离线数据同步过程中两种操作仅执行其中之一。It is worth noting that, no matter whether the mobile terminal initiates the offline data synchronization request to the server to start the synchronization process of offline updated information, or the mobile terminal initiates the synchronization process of offline updated information in response to the synchronization request broadcast by the server at a fixed time, only one of the two operations is performed in one offline data synchronization process.

本领域技术人员应当理解,上述同时存在的两种同步操作是用于确保移动终端在离线状态下更新的信息同步至服务器的服务器数据库,本领域技术人员应当根据实际应用需求设置两种同步操作的实现过程,避免重复进行同步操作,在此不再赘述。Those skilled in the art should understand that the two simultaneous synchronization operations mentioned above are used to ensure that the information updated by the mobile terminal in an offline state is synchronized to the server database of the server. Those skilled in the art should set the implementation process of the two synchronization operations according to actual application requirements to avoid repeated synchronization operations, which will not be repeated here.

在一个可选的实施例中,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。In an optional embodiment, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

在本实施例中,采用时间戳作为签名,不仅将所述签名用于表征信息的同步状态,同时还通过时间戳表征各信息的同步时间。当所述签名为终端签名表明所述信息为所述移动终端更新的信息并且未与所述服务器同步当所述签名为服务签名表明所述信息已经完成所述移动终端与服务器的同步并且所述时间戳为所述同步的时间。值得说明的是,由于所述服务器根据接收到移动终端发送的同步请求的时间生成服务签名,因此所述服务器每次产生的服务签名是唯一的,从而避免在多个移动终端共同工作下出现混淆更新顺序的情况。In this embodiment, a timestamp is used as a signature, and the signature is not only used to represent the synchronization status of the information, but also the synchronization time of each information is represented by the timestamp. When the signature is a terminal signature, it indicates that the information is updated by the mobile terminal and is not synchronized with the server. When the signature is a service signature, it indicates that the information has completed the synchronization between the mobile terminal and the server and the timestamp is the synchronization time. It is worth noting that since the server generates a service signature based on the time when the synchronization request sent by the mobile terminal is received, the service signature generated by the server each time is unique, thereby avoiding confusion in the update order when multiple mobile terminals work together.

考虑到移动终端在在线状态时的工作情况,在一个可选的实施例中,所述同步方法还包括:判断所述移动终端为在线状态时:若信息更新则更新所述终端数据库的信息并向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据,使得所述服务器生成服务签名并回传所述移动终端,并使得所述服务器将该信息的名称、数据和所述服务签名更新至所述服务器数据库;根据所述服务签名更新终端数据库中对应的信息的签名。Taking into account the working conditions of the mobile terminal when it is online, in an optional embodiment, the synchronization method also includes: when judging that the mobile terminal is online: if the information is updated, updating the information in the terminal database and sending an online data update request to the server, the online data update request includes the name and data of the updated information, so that the server generates a service signature and transmits it back to the mobile terminal, and the server updates the name, data and service signature of the information to the server database; and updating the signature of the corresponding information in the terminal database according to the service signature.

在本实施例中,如图3所示,仍以企业中盘点物料更新物料信息为例进行说明,具体的In this embodiment, as shown in FIG. 3 , the update of material information in an enterprise is still described as an example.

在在线状态下,所述移动终端在盘点物料时,当一项物料的实际库存情况发生变化时,将该物料的实际数量更新至终端数据库的信息的数据中,并生成终端签名作为该对应的信息的签名。In an online state, when the mobile terminal is taking inventory of materials, when the actual inventory situation of an item of material changes, the actual quantity of the material is updated to the information data of the terminal database, and a terminal signature is generated as the signature of the corresponding information.

同时,所述移动终端向服务器发送在线数据更新请求,所述在线数据请求包括该信息的名称和数据。At the same time, the mobile terminal sends an online data update request to the server, and the online data request includes the name and data of the information.

所述服务器接收所述在线数据更新请求并生成确认同步的服务签名,将所述服务签名发送至所述移动终端。The server receives the online data update request and generates a service signature for confirming synchronization, and sends the service signature to the mobile terminal.

所述移动终端接收所述服务签名,并将该服务签名更新至所述终端数据库中该信息的签名。The mobile terminal receives the service signature and updates the service signature to the signature of the information in the terminal database.

同时所述服务器根据接收到的名称和数据,以及生成的服务签名更新服务器数据库中对应的信息。At the same time, the server updates the corresponding information in the server database according to the received name and data and the generated service signature.

从而实现在线状态下,移动终端更新的信息在终端数据库和服务器数据库的同步。This enables synchronization of the updated information of the mobile terminal in the terminal database and the server database when the mobile terminal is online.

考虑到服务器与多个移动终端连接,不同移动终端可能在不同时间内工作,则不同移动终端之间存在未同步的可能,在一个可选的实施例中,如图4所示,所述同步方法还包括:判断所述移动终端启动时或响应于外部操作同步时:向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名,使得所述服务器根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端;接收所述同步数据包并将其中的各信息更新至所述终端数据库。Taking into account that the server is connected to multiple mobile terminals and different mobile terminals may work at different times, there is a possibility of non-synchronization between different mobile terminals. In an optional embodiment, as shown in Figure 4, the synchronization method also includes: when it is determined that the mobile terminal is started or synchronized in response to an external operation: sending an online data synchronization request to the server, the online data synchronization request includes the name and signature of each information in the terminal database of the mobile terminal, so that the server queries the server database according to the name and signature of each information and encapsulates each information other than the name and signature into a synchronization data packet to send to the mobile terminal; receiving the synchronization data packet and updating each information therein to the terminal database.

在本实施例中,考虑到不同移动终端在更新信息后都会与服务器进行同步,即所述服务器的服务器数据库为具有最近更新的全部信息。通过在移动终端启动时或响应于外部操作时向服务器发起同步请求,避免了因其他移动终端更新了信息而未同步的问题。In this embodiment, considering that different mobile terminals will synchronize with the server after updating information, that is, the server database of the server is all the information that has been recently updated. By initiating a synchronization request to the server when the mobile terminal is started or responding to an external operation, the problem of not being synchronized due to other mobile terminals updating information is avoided.

如图4所示,具体包括:As shown in Figure 4, it specifically includes:

移动终端向所述服务器发送在线数据同步请求。The mobile terminal sends an online data synchronization request to the server.

在本实施例中,由移动终端向所述服务器发起同步请求,所述在线数据同步请求包括所述终端数据库中所有信息中的名称和签名。In this embodiment, the mobile terminal initiates a synchronization request to the server, and the online data synchronization request includes the name and signature of all the information in the terminal database.

所述服务器接收所述信息并根据所述名称和签名查询服务器数据库中,查询所述服务器数据库是否存在签名不同于所述终端数据库的信息。The server receives the information and queries a server database according to the name and the signature to check whether the server database has information with a signature different from that of the terminal database.

在本实施例中,所述服务器通过信息的名称和签名在服务器数据库中查询所述终端数据库是否存在未同步的信息,若存在则对终端数据库进行信息的同步。具体的,所述服务器将签名不同的信息打包为数据包,为确保数据包的安全性,所述服务器对所述数据包进行加密并将加密的数据包进行压缩以便于数据包的传输。In this embodiment, the server queries the terminal database in the server database through the name and signature of the information to see whether there is any unsynchronized information, and if so, synchronizes the information with the terminal database. Specifically, the server packages the information with different signatures into a data packet, and to ensure the security of the data packet, the server encrypts the data packet and compresses the encrypted data packet to facilitate the transmission of the data packet.

所述移动终端接收所述数据包并对所述数据包进行解压缩和解密获得从服务器数据库获取的待同步的信息,根据所述待同步的信息更新终端数据库以实现移动终端与服务器的同步。The mobile terminal receives the data packet and decompresses and decrypts the data packet to obtain the information to be synchronized obtained from the server database, and updates the terminal database according to the information to be synchronized to achieve synchronization between the mobile terminal and the server.

与上述应用于移动终端的信息的同步方法相类似,如图1所示,本发明还提供了应用于服务器的一种移动终端与服务器之间的信息同步方法,包括:所述服务器接收移动终端发送的离线数据同步请求,生成服务签名并发送至所述移动终端,使得所述移动终端将所述服务签名更新至终端数据库中离线更新的信息,所述信息包括名称、数据和签名;所述服务器接收所述移动终端发送的所述更新了服务签名的信息,根据所述信息更新服务器数据库。Similar to the above-mentioned information synchronization method applied to the mobile terminal, as shown in Figure 1, the present invention also provides a method for information synchronization between a mobile terminal and a server applied to the server, including: the server receives an offline data synchronization request sent by the mobile terminal, generates a service signature and sends it to the mobile terminal, so that the mobile terminal updates the service signature to the offline updated information in the terminal database, the information including the name, data and signature; the server receives the information with the updated service signature sent by the mobile terminal, and updates the server database according to the information.

本实施例的具体实施过程与上述实施例相类似,并且前述实施例和随之带来的有益效果同样适用于本实施例,相同的部分在此不再赘述。The specific implementation process of this embodiment is similar to that of the above embodiment, and the above embodiment and the beneficial effects brought about thereby are also applicable to this embodiment, and the same parts will not be repeated here.

在一个可选的实施例中,如图2所示,所述信息同步方法还包括:所述服务器定时广播离线同步请求;所述服务器接收所述移动终端发送的离线数据同步请求,生成服务签名发送至所述移动终端,使得所述移动终端将所述服务签名更新至终端数据库中离线更新的信息;所述服务器接收所述移动终端发送的所述更新了服务签名的信息,根据所述信息更新服务器数据库并更新同步日志。In an optional embodiment, as shown in Figure 2, the information synchronization method also includes: the server periodically broadcasts an offline synchronization request; the server receives the offline data synchronization request sent by the mobile terminal, generates a service signature and sends it to the mobile terminal, so that the mobile terminal updates the service signature to the offline updated information in the terminal database; the server receives the updated service signature information sent by the mobile terminal, updates the server database and updates the synchronization log according to the information.

在一个可选的实施例中,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。In an optional embodiment, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

在本实施例中,采用时间戳作为签名,不仅将所述签名用于表征信息的同步状态,同时还通过时间戳表征各信息的同步时间。当所述签名为终端签名表明所述信息为所述移动终端更新的信息并且未与所述服务器同步当所述签名为服务签名表明所述信息已经完成所述移动终端与服务器的同步并且所述时间戳为所述同步的时间。值得说明的是,由于所述服务器根据接收到移动终端发送的同步请求的时间生成服务签名,因此所述服务器每次产生的服务签名是唯一的,从而避免在多个移动终端共同工作下出现混淆更新顺序的情况。In this embodiment, a timestamp is used as a signature, and the signature is not only used to represent the synchronization status of the information, but also the synchronization time of each information is represented by the timestamp. When the signature is a terminal signature, it indicates that the information is updated by the mobile terminal and is not synchronized with the server. When the signature is a service signature, it indicates that the information has completed the synchronization between the mobile terminal and the server and the timestamp is the synchronization time. It is worth noting that since the server generates a service signature based on the time when the synchronization request sent by the mobile terminal is received, the service signature generated by the server each time is unique, thereby avoiding confusion in the update order when multiple mobile terminals work together.

在一个可选的实施例中,如图3所示,所述信息同步方法还包括:所述服务器接收所述移动终端发送的在线数据更新请求,所述在线数据更新请求包括更新的信息的名称和数据;所述服务器生成服务签名并回传所述移动终端,同时将该信息的名称、数据和所述服务签名更新至所述服务器数据库,使得所述移动终端根据所述服务签名更新终端数据库中对应的信息的签名。In an optional embodiment, as shown in Figure 3, the information synchronization method also includes: the server receives an online data update request sent by the mobile terminal, the online data update request includes the name and data of the updated information; the server generates a service signature and transmits it back to the mobile terminal, and at the same time updates the name, data and service signature of the information to the server database, so that the mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature.

在另一个可选的实施例中,如图4所示,所述同步方法还包括:所述服务器接收所述移动终端发送的在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名;所述服务器根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端,使得所述移动终端根据所述同步数据包中的各信息更新至所述终端数据库。In another optional embodiment, as shown in Figure 4, the synchronization method also includes: the server receives an online data synchronization request sent by the mobile terminal, the online data synchronization request includes the name and signature of each information in the terminal database of the mobile terminal; the server queries the server database according to the name and signature of each information and encapsulates each information other than the name and signature into a synchronization data packet to send to the mobile terminal, so that the mobile terminal updates the terminal database according to the information in the synchronization data packet.

根据上述应用于移动终端的信息的同步方法的实施例和应用于服务器的信息的同步方法的实施例给出的教导,本领域技术人员能够明了,如下的移动终端与服务器之间的信息同步方法和信息同步系统也在本发明的保护范围内。Based on the teachings given in the above-mentioned embodiments of the information synchronization method applied to the mobile terminal and the embodiments of the information synchronization method applied to the server, those skilled in the art can understand that the following information synchronization method and information synchronization system between the mobile terminal and the server are also within the protection scope of the present invention.

在一个可选的实施例中,本申请的另一个实施例提供一种移动终端与服务器之间的信息同步方法,包括判断所述移动终端为离线状态时,若信息更新则所述移动终端更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:所述移动终端向服务器发送离线数据同步请求;所述服务器生成服务签名并回传所述移动终端;所述移动终端根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器;所述服务器根据接收的信息更新服务器数据库并更新同步日志。In an optional embodiment, another embodiment of the present application provides a method for information synchronization between a mobile terminal and a server, including: when it is determined that the mobile terminal is in an offline state, if the information is updated, the mobile terminal updates the information in the terminal database, each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal; when it is determined that the mobile terminal is changed from an offline state to an online state and there is at least one offline updated information with a signature that is a terminal signature: the mobile terminal sends an offline data synchronization request to the server; the server generates a service signature and transmits it back to the mobile terminal; the mobile terminal updates the signature of each offline updated information in the terminal database according to the service signature, and sends each information with an updated service signature to the server; the server updates the server database and updates the synchronization log according to the received information.

在一个可选的实施例中,所述信息同步方法还包括:所述移动终端接收所述服务器广播的同步请求,查询是否存在签名为终端签名的信息;若存在则:所述移动终端向所述服务器发送离线数据同步请求;所述服务器生成服务签名并回传至所述移动终端,所述移动终端根据所述服务签名更新所述终端数据库中签名为终端签名的信息的签名,并将各所述更新的信息发送至所述服务器;所述服务器将各所述更新的信息更新至所述服务器数据库并更新所述同步日志。In an optional embodiment, the information synchronization method also includes: the mobile terminal receives the synchronization request broadcast by the server, and queries whether there is information signed as the terminal signature; if so: the mobile terminal sends an offline data synchronization request to the server; the server generates a service signature and transmits it back to the mobile terminal, the mobile terminal updates the signature of the information signed as the terminal signature in the terminal database according to the service signature, and sends each updated information to the server; the server updates each updated information to the server database and updates the synchronization log.

在一个可选的实施例中,所述签名为时间戳,用于表明所述信息的同步状态和同步时间。In an optional embodiment, the signature is a timestamp, which is used to indicate the synchronization status and synchronization time of the information.

在一个可选的实施例中,所述信息同步方法还包括:还包括:判断所述移动终端为在线状态时:若信息更新则所述移动终端更新所述终端数据库的信息并向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据;所述服务器生成服务签名并回传所述移动终端,并将该信息的名称、数据和所述服务签名更新至所述服务器数据库;所述移动终端根据所述服务签名更新终端数据库中对应的信息的签名。In an optional embodiment, the information synchronization method also includes: also includes: when it is determined that the mobile terminal is in an online state: if the information is updated, the mobile terminal updates the information in the terminal database and sends an online data update request to the server, and the online data update request includes the name and data of the updated information; the server generates a service signature and transmits it back to the mobile terminal, and updates the name, data and service signature of the information to the server database; the mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature.

在一个可选的实施例中,所述同步方法还包括:还包括:判断所述移动终端启动时或响应于外部操作同步时:所述移动终端向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名;所述服务器根据所述各信息的名称和签名查询服务器数据库并将所述名称和签名之外的各信息封装为同步数据包以发送至所述移动终端;所述移动终端接收所述同步数据包并将其中的各信息更新至所述终端数据库。In an optional embodiment, the synchronization method also includes: it also includes: when the mobile terminal is started or synchronized in response to an external operation: the mobile terminal sends an online data synchronization request to the server, and the online data synchronization request includes the name and signature of each information in the terminal database of the mobile terminal; the server queries the server database according to the name and signature of each information and encapsulates each information other than the name and signature into a synchronization data packet to send to the mobile terminal; the mobile terminal receives the synchronization data packet and updates each information therein to the terminal database.

如图5所示,本发明还提供了一种信息同步系统,包括服务器和多个移动终端,其中所述服务器包括控制器、第一通信设备和服务器数据库,每个移动终端包括处理器、第二通信设备、终端数据库和网络检测器器;其中,所述处理器控制所述网络检测器检测网络状态,若所述移动终端为离线状态:所述处理器更新信息并存储在所述终端数据库,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;所述处理器控制所述网络检测器检测网络状态,若所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:所述处理器通过所述第二通信设备向服务器发送离线数据同步请求,或者所述控制器通过所述第一通信设备定时广播同步请求,所述处理器通过所述第二通信设备接收所述同步请求并通过所述第二通信设备向服务器发送离线数据同步请求,所述控制器通过所述第一通信设备接收所述离线数据同步请求,生成服务签名通过所述第一通信设备发送至所述移动终端,所述处理器通过所述第二通信设备接收并根据所述服务签名更新所述终端数据库的信息并通过所述第二通信设备将所述更新了服务签名的信息发送至所述服务器,所述控制器通过所述第一通信设备接收所述更新了服务签名的信息,根据所述信息更新所述服务器数据库;所述处理器控制所述网络检测器检测网络状态,若所述移动终端为在线状态:所述处理器更新信息并存储在所述终端数据库,通过所述第二通信设备向所述服务器发送在线数据更新请求,所述在线数据更新请求包括所述更新的信息的名称和数据,所述控制器通过所述第一通信设备接收所述在线数据更新请求并生成服务签名,将所述在线数据更新请求包括的信息的名称和数据,以及所述服务签名更新至所述服务器数据库;所述处理器通过所述第二通信设备接收并根据所述服务签名更新所述终端数据库的信息;所述处理器判断所述移动终端启动时或响应于外部操作同步时:所述处理器通过所述第二通信设备向所述服务器发送在线数据同步请求,所述在线数据同步请求包括所述移动终端的终端数据库的各信息的名称和签名,所述控制器通过所述第一通信设备接收所述在线数据同步请求,根据所述终端数据库的各信息的名称和签名查询服务器数据库,并将所述名称和签名之外的各信息封装为同步数据包通过所述第一通信设备发送至所述移动终端,所述处理器通过所述第二通信设备接收并根据所述同步数据包将其中的各信息更新至所述终端数据库。As shown in FIG5 , the present invention further provides an information synchronization system, comprising a server and a plurality of mobile terminals, wherein the server comprises a controller, a first communication device and a server database, and each mobile terminal comprises a processor, a second communication device, a terminal database and a network detector; wherein the processor controls the network detector to detect a network state, and if the mobile terminal is in an offline state: the processor updates information and stores it in the terminal database, and each information comprises a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal; the processor controls the network detector to detect a network state, and if the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature: the processor sends an offline data synchronization request to the server through the second communication device, or the controller broadcasts a synchronization request periodically through the first communication device, the processor receives the synchronization request through the second communication device and sends the offline data synchronization request to the server through the second communication device, the controller receives the offline data synchronization request through the first communication device, generates a service signature and sends it to the mobile terminal through the first communication device, the processor receives and updates the information of the terminal database according to the service signature through the second communication device and sends the information with the updated service signature to the server through the second communication device, and the controller receives the offline data synchronization request through the first communication device, generates a service signature and sends it to the mobile terminal through the first communication device, the processor receives and updates the information of the terminal database according to the service signature through the second communication device and sends the information with the updated service signature to the server through the second communication device, and the controller receives the offline data synchronization request through the first communication device The processor controls the network detector to detect the network status, and if the mobile terminal is online: the processor updates the information and stores it in the terminal database, and sends an online data update request to the server through the second communication device, wherein the online data update request includes the name and data of the updated information; the controller receives the online data update request through the first communication device and generates a service signature, and updates the name and data of the information included in the online data update request and the service signature to the server database; the processor receives the information through the second communication device and updates the service signature according to the service signature. the information of the terminal database; the processor determines when the mobile terminal is started or synchronized in response to an external operation: the processor sends an online data synchronization request to the server through the second communication device, the online data synchronization request includes the name and signature of each information in the terminal database of the mobile terminal, the controller receives the online data synchronization request through the first communication device, queries the server database according to the name and signature of each information in the terminal database, and encapsulates each information except the name and signature into a synchronization data packet and sends it to the mobile terminal through the first communication device, the processor receives it through the second communication device and updates each information therein to the terminal database according to the synchronization data packet.

本发明的另一个实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:判断所述移动终端为离线状态时:若信息更新则更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:所述移动终端向服务器发送离线数据同步请求,使得所述服务器生成服务签名并回传所述移动终端;所述移动终端根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器,使得所述服务器根据接收的信息更新服务器数据库。Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: when it is determined that the mobile terminal is in an offline state: if the information is updated, the information in the terminal database is updated, and each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal; when it is determined that the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature: the mobile terminal sends an offline data synchronization request to a server, so that the server generates a service signature and transmits it back to the mobile terminal; the mobile terminal updates the signature of each offline updated information in the terminal database according to the service signature, and sends each information with an updated service signature to the server, so that the server updates the server database according to the received information.

本发明的另一个实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:所述服务器接收移动终端发送的离线数据同步请求,生成服务签名并发送至所述移动终端,使得所述移动终端将所述服务签名更新至终端数据库中离线更新的信息,所述信息包括名称、数据和签名;所述服务器接收所述移动终端发送的所述更新了服务签名的信息,根据所述信息更新服务器数据库。Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: the server receives an offline data synchronization request sent by a mobile terminal, generates a service signature and sends it to the mobile terminal, so that the mobile terminal updates the service signature to the offline updated information in the terminal database, the information including the name, data and signature; the server receives the information of the updated service signature sent by the mobile terminal, and updates the server database according to the information.

本发明的另一个实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:判断所述移动终端为离线状态时,若信息更新则所述移动终端更新终端数据库的信息,每个信息包括名称、数据和签名,其中所述签名为所述移动终端生成的终端签名;判断所述移动终端从离线状态转为在线状态并且存在至少一个签名为终端签名的离线更新的信息时:所述移动终端向服务器发送离线数据同步请求;所述服务器生成服务签名并回传所述移动终端;所述移动终端根据所述服务签名更新所述终端数据库中的所述离线更新的各信息的签名,并将各所述更新了服务签名的信息发送至所述服务器;所述服务器根据接收的信息更新服务器数据库。Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: when it is determined that the mobile terminal is in an offline state, if the information is updated, the mobile terminal updates the information in the terminal database, each information includes a name, data and a signature, wherein the signature is a terminal signature generated by the mobile terminal; when it is determined that the mobile terminal changes from an offline state to an online state and there is at least one offline updated information whose signature is a terminal signature: the mobile terminal sends an offline data synchronization request to a server; the server generates a service signature and transmits it back to the mobile terminal; the mobile terminal updates the signature of each offline updated information in the terminal database according to the service signature, and sends each information with an updated service signature to the server; the server updates the server database according to the received information.

在实际应用中,所述计算机可读存储介质可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

如图6所示,本发明的另一个实施例提供的一种计算机设备的结构示意图。图6显示的计算机设备12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。As shown in Figure 6, a schematic diagram of the structure of a computer device provided by another embodiment of the present invention. The computer device 12 shown in Figure 6 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.

如图6所示,计算机设备12以通用计算设备的形式表现。计算机设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,系统存储器28,连接不同系统组件(包括系统存储器28和处理单元16)的总线18。6, computer device 12 is in the form of a general purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 connecting various system components (including system memory 28 and processing unit 16).

总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

计算机设备12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

系统存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。计算机设备12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32. The computer device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 6 , commonly referred to as a “hard drive”). Although not shown in FIG. 6 , a disk drive for reading and writing to a removable non-volatile disk (e.g., a “floppy disk”) and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and/or methods of the embodiments described herein.

计算机设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该计算机设备12交互的设备通信,和/或与使得该计算机设备12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,计算机设备12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图6所示,网络适配器20通过总线18与计算机设备12的其它模块通信。应当明白,尽管图6中未示出,可以结合计算机设备12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and/or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input/output (I/O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and/or public networks, such as the Internet) via a network adapter 20. As shown in FIG. 6 , the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in FIG. 6 , other hardware and/or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

处理器单元16通过运行存储在系统存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的一种移动终端与服务器之间的信息同步方法。The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing an information synchronization method between a mobile terminal and a server provided in an embodiment of the present invention.

本发明针对目前现有的问题,制定一种移动终端与服务器之间的信息同步方法、信息同步系统、计算机可读存储介质和计算机设备,根据移动终端在离线状态下更新的信息,在从离线状态转为在线状态时通过移动终端到服务器、以及从服务器到移动终端的双向同步方法确保离线更新的信息能够及时同步到服务器数据库,同时确保在线状态下更新的信息实时同步到服务器数据库,能够解决现有技术中因网络环境束缚导致的移动终端和服务器数据库的数据同步问题,实现多移动终端与服务器的实时同步问题,有效提高信息管理的效率。In view of the existing problems, the present invention develops an information synchronization method, an information synchronization system, a computer-readable storage medium and a computer device between a mobile terminal and a server. According to the information updated by the mobile terminal in an offline state, when the offline state is changed to an online state, a two-way synchronization method from the mobile terminal to the server and from the server to the mobile terminal is used to ensure that the offline updated information can be synchronized to the server database in time, and at the same time ensure that the information updated in the online state is synchronized to the server database in real time. This can solve the data synchronization problem of the mobile terminal and the server database caused by the constraints of the network environment in the prior art, realize the real-time synchronization problem of multiple mobile terminals and the server, and effectively improve the efficiency of information management.

显然,本发明的上述实施例仅仅是为清楚地说明本发明所作的举例,而并非是对本发明的实施方式的限定,对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无法对所有的实施方式予以穷举,凡是属于本发明的技术方案所引伸出的显而易见的变化或变动仍处于本发明的保护范围之列。Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.

Claims (9)

1. An information synchronization method between a mobile terminal and a server, which is applied to the mobile terminal, is characterized by comprising the following steps:
when the mobile terminal is judged to be in an offline state:
If the information is updated, updating the information of a terminal database, wherein each piece of information comprises a name, data and a signature, and the signature is a terminal signature generated by the mobile terminal;
Judging that the mobile terminal is switched from an offline state to an online state and at least one piece of offline updated information with signature being a terminal signature exists:
Sending an offline data synchronization request to a server, so that the server generates a service signature and returns the service signature to the mobile terminal;
Updating the signature of each piece of information updated offline in the terminal database according to the service signature, and sending each piece of information updated with the service signature to the server, so that the server updates the server database according to the received information;
Further comprises:
receiving a synchronization request broadcast by the server, and inquiring whether information signed as a terminal signature exists or not; if present, then:
An offline data synchronization request is sent to the server, so that the server generates a service signature and returns the service signature to the mobile terminal,
Updating the signature of the information signed as the terminal signature in the terminal database according to the service signature, and sending each updated information to the server, so that the server updates each updated information to the server database;
The signature is a timestamp and is used for indicating the synchronous state and the synchronous time of the information, when the signature is a terminal signature, the signature indicates that the information is updated information of the mobile terminal and is not synchronous with the server, and when the signature is a service signature, the signature indicates that the information has completed the synchronization of the mobile terminal and the server, and the timestamp is the synchronous time.
2. The information synchronization method according to claim 1, characterized by further comprising:
When judging that the mobile terminal is in an online state:
If the information is updated, updating the information of the terminal database and sending an online data updating request to the server, wherein the online data updating request comprises the name and the data of the updated information, so that the server generates a service signature and returns the service signature to the mobile terminal, and the server updates the name, the data and the service signature of the information to the server database;
updating the signature of the corresponding information in the terminal database according to the service signature;
And/or
Judging that the mobile terminal is started or is synchronous in response to external operation:
Sending an online data synchronization request to the server, wherein the online data synchronization request comprises the name and signature of each piece of information of a terminal database of the mobile terminal, so that the server queries the server database according to the name and signature of each piece of information and packages each piece of information except the name and signature into a synchronization data packet to be sent to the mobile terminal;
and receiving the synchronous data packet and updating each piece of information in the synchronous data packet to the terminal database.
3. An information synchronization method between a mobile terminal and a server, which is applied to the server, is characterized by comprising the following steps:
receiving an offline data synchronization request sent by a mobile terminal, generating a service signature and sending the service signature to the mobile terminal, so that the mobile terminal updates the service signature to offline updated information in a terminal database, wherein the information comprises a name, data and a signature;
Receiving the information which is sent by the mobile terminal and updates the service signature, and updating a server database according to the information;
Further comprises:
Broadcasting an offline synchronization request at regular time;
Receiving an offline data synchronization request sent by the mobile terminal, generating a service signature, and sending the service signature to the mobile terminal, so that the mobile terminal updates the service signature to offline updated information in a terminal database;
Receiving the information which is sent by the mobile terminal and updates the service signature, and updating a server database according to the information;
The signature is a timestamp and is used for indicating the synchronous state and the synchronous time of the information, when the signature is a terminal signature, the signature indicates that the information is updated information of the mobile terminal and is not synchronous with the server, and when the signature is a service signature, the signature indicates that the information has completed the synchronization of the mobile terminal and the server, and the timestamp is the synchronous time.
4. The information synchronization method according to claim 3, further comprising:
receiving an online data update request sent by the mobile terminal, wherein the online data update request comprises the name and data of updated information;
Generating a service signature and returning the service signature to the mobile terminal, and simultaneously updating the name, the data and the service signature of the information to the server database, so that the mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature;
And/or
Receiving an online data synchronization request sent by the mobile terminal, wherein the online data synchronization request comprises names and signatures of various information of a terminal database of the mobile terminal;
and inquiring a server database according to the name and the signature of each piece of information, and packaging each piece of information except the name and the signature into a synchronous data packet to be sent to the mobile terminal, so that the mobile terminal updates to the terminal database according to each piece of information in the synchronous data packet.
5. An information synchronization method between a mobile terminal and a server, comprising
When the mobile terminal is judged to be in an off-line state,
If the information is updated, the mobile terminal updates the information of a terminal database, wherein each piece of information comprises a name, data and a signature, and the signature is a terminal signature generated by the mobile terminal;
Judging that the mobile terminal is switched from an offline state to an online state and at least one piece of offline updated information with signature being a terminal signature exists:
the mobile terminal sends an offline data synchronization request to a server;
the server generates a service signature and returns the service signature to the mobile terminal;
The mobile terminal updates the signature of each piece of information updated offline in the terminal database according to the service signature, and sends each piece of information updated with the service signature to the server;
the server updates a server database according to the received information;
Further comprises:
the mobile terminal receives the synchronous request broadcast by the server and inquires whether information signed for the terminal signature exists or not;
If present, then:
The mobile terminal sends an offline data synchronization request to the server;
the server generates a service signature and transmits it back to the mobile terminal,
The mobile terminal updates the signature of the information signed as the terminal signature in the terminal database according to the service signature, and sends each updated information to the server;
the server updates each piece of updated information to the server database;
The signature is a timestamp and is used for indicating the synchronous state and the synchronous time of the information, when the signature is a terminal signature, the signature indicates that the information is updated information of the mobile terminal and is not synchronous with the server, and when the signature is a service signature, the signature indicates that the information has completed the synchronization of the mobile terminal and the server, and the timestamp is the synchronous time.
6. The information synchronization method according to claim 5, further comprising:
When judging that the mobile terminal is in an online state:
If the information is updated, the mobile terminal updates the information of the terminal database and sends an online data update request to the server, wherein the online data update request comprises the name and the data of the updated information;
The server generates a service signature and returns the service signature to the mobile terminal, and updates the name, data and the service signature of the information to the server database;
The mobile terminal updates the signature of the corresponding information in the terminal database according to the service signature;
And/or
Judging that the mobile terminal is started or is synchronous in response to external operation:
the mobile terminal sends an online data synchronization request to the server, wherein the online data synchronization request comprises names and signatures of various information of a terminal database of the mobile terminal;
The server queries a server database according to the name and the signature of each piece of information and packages each piece of information except the name and the signature into a synchronous data packet to be sent to the mobile terminal;
and the mobile terminal receives the synchronous data packet and updates each piece of information in the synchronous data packet to the terminal database.
7. An information synchronization system comprising a server and a plurality of mobile terminals, wherein the server comprises a controller, a first communication device and a server database;
each mobile terminal comprises a processor, a second communication device, a terminal database and a network detector; wherein,
The processor controls the network detector to detect a network state, and if the mobile terminal is in an offline state:
The processor updates information and stores the information in the terminal database, wherein each piece of information comprises a name, data and a signature, and the signature is a terminal signature generated by the mobile terminal;
the processor controls the network detector to detect a network state, if the mobile terminal changes from an offline state to an online state and there is at least one offline updated information signed as a terminal signature:
The processor sends an offline data synchronization request to a server through the second communication device, or
The controller periodically broadcasts a synchronization request through the first communication device, the processor receives the synchronization request through the second communication device and sends an offline data synchronization request to a server through the second communication device,
The controller receives the offline data synchronization request through the first communication device, generates a service signature, sends the service signature to the mobile terminal through the first communication device,
The processor receives and updates information of the terminal database according to the service signature through the second communication device and transmits the updated information of the service signature to the server through the second communication device,
The controller receives the information updated with the service signature through the first communication equipment, and updates the server database according to the information;
The processor controls the network detector to detect a network state, and if the mobile terminal is in an on-line state:
The processor updates information and stores in the terminal database, transmits an online data update request to the server through the second communication device, the online data update request including a name and data of the updated information,
The controller receives the online data update request through the first communication device and generates a service signature, and updates the name and data of information included in the online data update request and the service signature to the server database;
The processor receives and updates the information of the terminal database according to the service signature through the second communication equipment; the processor determines when the mobile terminal is started or is synchronized in response to an external operation:
The processor sends an online data synchronization request to the server through the second communication device, the online data synchronization request including a name and a signature of each information of a terminal database of the mobile terminal,
The controller receives the online data synchronization request through the first communication equipment, queries a server database according to the name and the signature of each piece of information of the terminal database, packages each piece of information except the name and the signature into a synchronization data packet, sends the synchronization data packet to the mobile terminal through the first communication equipment,
The processor receives the synchronous data packet through the second communication equipment and updates the information in the synchronous data packet to the terminal database;
The signature is a timestamp and is used for indicating the synchronous state and the synchronous time of the information, when the signature is a terminal signature, the signature indicates that the information is updated information of the mobile terminal and is not synchronous with the server, and when the signature is a service signature, the signature indicates that the information has completed the synchronization of the mobile terminal and the server, and the timestamp is the synchronous time.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that,
The program, when executed by a processor, implementing the method of any of claims 1-2;
Or alternatively
The program, when executed by a processor, implementing the method of any of claims 3-4;
Or alternatively
The program, when executed by a processor, implements the method of any of claims 5-6.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
The processor implementing the method of any one of claims 1-2 when executing the program; or alternatively
The processor implementing the method of any of claims 3-4 when executing the program; or alternatively
The processor, when executing the program, implements the method of any one of claims 5-6.
CN202010032343.1A 2020-01-13 2020-01-13 Information synchronization method, synchronization system, computer equipment and medium Active CN111259022B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010032343.1A CN111259022B (en) 2020-01-13 2020-01-13 Information synchronization method, synchronization system, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010032343.1A CN111259022B (en) 2020-01-13 2020-01-13 Information synchronization method, synchronization system, computer equipment and medium

Publications (2)

Publication Number Publication Date
CN111259022A CN111259022A (en) 2020-06-09
CN111259022B true CN111259022B (en) 2024-07-02

Family

ID=70950519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010032343.1A Active CN111259022B (en) 2020-01-13 2020-01-13 Information synchronization method, synchronization system, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN111259022B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112215726A (en) * 2020-10-29 2021-01-12 怀化智信能源科技有限公司 Water meter reading management method, device and system and storage medium
CN113220779A (en) * 2021-04-27 2021-08-06 阿波罗智联(北京)科技有限公司 Data processing method, device, storage medium and program product
CN113762890A (en) * 2021-08-17 2021-12-07 广州快批信息科技有限公司 Goods offline checking method and device based on PDA local storage
CN114126035A (en) * 2021-11-29 2022-03-01 云知声智能科技股份有限公司 Time synchronization method, device, terminal and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857529A (en) * 2011-06-30 2013-01-02 镇江雅迅软件有限责任公司 Offline application system based on timestamp

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103490843A (en) * 2013-09-22 2014-01-01 四川九洲电器集团有限责任公司 Method for transmitting offline data from terminal to platform
CN104967658B (en) * 2015-05-08 2018-11-30 成都品果科技有限公司 A kind of method of data synchronization on multi-terminal equipment
US20170177696A1 (en) * 2015-12-21 2017-06-22 Sap Se Usage of modeled validations on mobile devices in online and offline scenarios
CN108921542B (en) * 2018-05-30 2021-09-28 招商银行股份有限公司 Offline payment method, payment end, collection end and storage medium for digital assets

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857529A (en) * 2011-06-30 2013-01-02 镇江雅迅软件有限责任公司 Offline application system based on timestamp

Also Published As

Publication number Publication date
CN111259022A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN111259022B (en) Information synchronization method, synchronization system, computer equipment and medium
WO2021121370A1 (en) Message loss detection method and apparatus for message queue
CN111639061B (en) Data management method, device, medium and electronic equipment in Redis cluster
WO2020221190A1 (en) Applet state synchronization method, device and computer storage medium
WO2021013247A1 (en) Method and device for running applet, and computer storage medium
WO2021013242A1 (en) Method for starting mini program, device and computer storage medium
CN114676199A (en) Synchronization method, synchronization system, computer equipment and storage medium
CN114866533A (en) File uploading method and device and electronic equipment
CN118055398A (en) Device firmware upgrading method and device, electronic device and storage medium
CN112835632B (en) A terminal capability calling method, device and computer storage medium
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN112052104B (en) Message queue management method based on multi-machine-room implementation and electronic equipment
WO2025035886A1 (en) Data migration method and apparatus based on data storage, and server and storage medium
CN112416981A (en) Data processing method and device based on block chain, electronic equipment and storage medium
WO2021226965A1 (en) Resource processing method and apparatus, electronic device and storage medium
CN115022393B (en) Method, device, medium and computing equipment for determining connection state
CN112231409B (en) Database synchronization initialization loading method, device, equipment and storage medium
CN112799863B (en) Method and device for outputting information
CN119544708B (en) Data transmission method, device, equipment and readable storage medium
CN114051047B (en) Session message backup method and device, network equipment and storage medium
CN110011767B (en) Method and apparatus for TCP connection backup
JP2006004277A (en) Information sharing apparatus, information transmitting method, and information receiving method
CN117061478A (en) Mailbox service synchronization method and device, electronic equipment and storage medium
CN117093274A (en) Application running stack analysis method, device, equipment and storage medium
CN118152340A (en) ES operation method and device

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