CN108959278B - Data synchronization method and device, electronic equipment and storage medium - Google Patents

Data synchronization method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108959278B
CN108959278B CN201710347158.XA CN201710347158A CN108959278B CN 108959278 B CN108959278 B CN 108959278B CN 201710347158 A CN201710347158 A CN 201710347158A CN 108959278 B CN108959278 B CN 108959278B
Authority
CN
China
Prior art keywords
site
type
site information
latest
changed
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
CN201710347158.XA
Other languages
Chinese (zh)
Other versions
CN108959278A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710347158.XA priority Critical patent/CN108959278B/en
Publication of CN108959278A publication Critical patent/CN108959278A/en
Application granted granted Critical
Publication of CN108959278B publication Critical patent/CN108959278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a data synchronization method, a data synchronization device, electronic equipment and a storage medium, wherein the method comprises the following steps: when station information in the network ticketing system is changed, generating latest station data corresponding to the type of the target user terminal based on the changed station information; and storing the latest site data to a storage space corresponding to the type of the target user terminal so that the user terminal of the type can acquire the latest site information from the storage space. The invention can ensure the data synchronization between the server end and the user terminal in the network ticketing system.

Description

Data synchronization method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data synchronization method and apparatus, an electronic device, and a storage medium.
Background
Trains are one of the most common travel modes, and in particular, a single difficulty appears in spring festival, holiday and the like. For a network ticketing system, site information is a basic element of the whole train ticket inquiry service and is the basis of core services such as order submission, ticket buying, ticket robbing, online ticket change, ticket refunding and the like.
In the network ticketing system, because train stations are numerous, station information is changed frequently, if a terminal cannot provide latest station information for a user timely and accurately, the ticket buying experience of the user can be seriously influenced, and therefore how to keep various terminals supported by the network ticketing system in real time is realized, for example: data synchronization between a mobile terminal (including a mobile phone), a fixed terminal (including a Personal Computer (PC)) and the like and a server side of a network ticketing system is a very critical problem.
Disclosure of Invention
In view of the above, the present invention is directed to a data synchronization method, apparatus, electronic device and storage medium, which can ensure data synchronization between a server and a user terminal in a network ticketing system.
In order to achieve the purpose, the invention provides the following technical scheme:
a data synchronization method is applied to a server side of a network ticketing system, and comprises the following steps:
when station information in the network ticketing system is changed, generating latest station data corresponding to the type of the target user terminal based on the changed station information;
and storing the latest site data to a storage space corresponding to the type of the target user terminal so that the user terminal of the type can acquire the latest site information from the storage space.
A data synchronizer is applied to a server side of a network ticketing system and comprises: a generating unit and a transmitting unit;
the generating unit is used for generating the latest station data corresponding to the type of the target user terminal based on the changed station information when the station information in the network ticketing system is changed;
and the transmission unit is used for storing the latest site data into a storage space corresponding to the type of the target user terminal so that the user terminal of the type can acquire the latest site information from the storage space.
An electronic device, comprising: the system comprises at least one processor and a memory connected with the at least one processor through a bus; the memory stores one or more computer programs executable by the at least one processor; the at least one processor, when executing the one or more computer programs, performs the above-described method steps.
A computer readable storage medium storing one or more computer programs which, when executed by a processor, implement the method described above.
According to the technical scheme, after the site information is changed, different latest site data are generated aiming at different types of target user terminals, and the latest site data are stored in the storage space corresponding to the type of target user terminal, so that the type of target user terminal can acquire the latest site information from the corresponding storage space at any time, and the timely synchronization of the data between the server side and the user terminal in the network ticketing system can be effectively ensured.
Drawings
FIG. 1 is a flow chart of a data synchronization method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for synchronizing two data according to an embodiment of the present invention
FIG. 3 is a flow chart of a data synchronization method according to an embodiment of the present invention
FIG. 4 is a flowchart of a four-data synchronization method according to an embodiment of the present invention
FIG. 5 is a schematic structural diagram of a five-data synchronization apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention are described in detail below with reference to the accompanying drawings according to embodiments.
The user can use different types of terminals, such as fixed terminals or mobile terminals, to inquire train tickets in the network ticketing system.
When a fixed terminal such as a PC is used to perform train ticket inquiry in a network ticketing system, data needs to be acquired from a server side immediately, and during a peak time period of ticket purchase, the manner of acquiring data from the server side immediately causes huge processing pressure on the server side.
Therefore, in the present invention, an improvement is made to a method for querying a train ticket by using a fixed terminal, and specifically refer to the flow shown in fig. 1.
Referring to fig. 1, fig. 1 is a flowchart of a data synchronization method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step 101, when the site information in the network ticketing system is changed, writing all the site information including the changed site information into a JavaScript file.
And 102, judging whether the operation of writing the JavaScript file is successful, if so, executing a step 103, and otherwise, executing a step 104.
And 103, uploading the JavaScript file serving as the latest site data corresponding to the fixed terminal to a cloud storage service, generating an access link aiming at/pointing to the JavaScript file stored in the cloud storage service, and providing the access link for the fixed terminal. The process is ended.
The fixed terminal can acquire the latest station data by clicking the access link, and the data synchronization of the fixed terminal and a server side in the network ticketing system is realized.
And 104, judging whether the operation failure times of writing the JavaScript file exceed the preset times, if so, executing the step 105, and otherwise, executing the step 106.
And 105, judging whether the access link generated last time is invalid, if so, providing a preset default access link for the user terminal, and otherwise, providing the access link generated last time for the fixed terminal. The process is ended.
The access link generated last time, that is, the access link pointing to the latest site data generated after the latest site information is changed before the site information is changed this time.
And 106, writing all the site information including the changed site information into a JavaScript file, and returning to the step 102.
In this embodiment, in order to ensure the performance of the fixed terminal, the fixed terminal should avoid processing again after fetching data, and provide a plurality of data formats that meet the requirements of the front end as much as possible, for example: the data format of each data format comprises three-character codes, Chinese names, Chinese full spellings, Chinese simple spellings and the like of the sites.
The following describes, by way of simple example, various data formats:
total site data:
Figure GDA0002570544620000041
Figure GDA0002570544620000051
in the network ticketing system, the number of sites is very large, and because the data of all the sites, the data of popular sites and the data of letter classification sites have no dependency relationship, the three types of data can be generated by using three different threads, and finally, a complete JavaScript file is obtained by assembling.
The main code may be as follows:
Figure GDA0002570544620000052
Figure GDA0002570544620000061
it can be seen that the above method is used for obtaining the total site data assignment to arr [0], obtaining the popular site assignment to arr [1], obtaining the letter classification site assignment to arr [2], and finally splicing arr [0], arr [1] and arr [2] together to serve as the content of the JavaScript file by starting three different threads. The method can avoid the reprocessing after the fixed terminal acquires the latest station data, and can reduce the processing pressure of the fixed terminal.
When a mobile terminal, such as a mobile phone, is used to perform train ticket inquiry in a network ticketing system, data needs to be acquired from a mobile terminal side server, the mobile terminal side server needs to acquire all site data from a server side at regular time, and a time difference exists between the server side updating operation and the operation of acquiring all site data by the mobile terminal side server at regular time, and the two data are inconsistent in the time difference. Moreover, the number of stations is too large, but the number of stations changed each time is limited, and the possibility of transmission failure generally exists when the mobile terminal side server acquires all station data each time, which is long in time consumption and unstable in network.
For this reason, in the present invention, an improvement is made to a method for querying a train ticket by using a mobile terminal, and specifically refer to the flows shown in fig. 2 and fig. 3.
Referring to fig. 2, fig. 2 is a flowchart of a method for synchronizing data according to an embodiment of the present invention, and as shown in fig. 2, the method includes the following steps:
step 201, when the station information in the network ticketing system is changed, the changed station information and the corresponding change type are bound, and all the changed station information bound with the change type is sent to the mobile terminal side server as the latest station data.
In this embodiment, when the mobile terminal side server is online, all the site information is loaded and stored from the network ticketing system into the cache for storing the site information.
In this embodiment, the change type includes insertion, deletion, and modification. The latest site information transmitted from the server side to the mobile terminal side server in the network ticketing system includes only changed site information and does not include unchanged site information.
Step 202, the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data, so that the mobile terminal can obtain the site information.
The method includes that a mobile terminal side server receives change site information which is sent by a server side in a network ticketing system and is bound with change types, and for each site change information, stored site information is updated based on the bound change types, and the method specifically includes the following steps: if the bound change type is insertion, directly storing the changed site information into a cache for storing the site information; if the bound change type is deletion, searching site information corresponding to the site change information in a cache for storing the site information, and deleting the searched site information; if the bound change type is modification, searching site information corresponding to the site change information in a cache for storing the site information, and covering the searched site information with the change site information.
Referring to fig. 3, fig. 3 is a flowchart of a data synchronization method according to an embodiment of the present invention, and as shown in fig. 3, the method includes the following steps:
step 301, when the mobile terminal side server determines that the station information of the server side of the network ticketing system is changed, sending a station information change request to a main database of the server side of the network ticketing system.
In the embodiment, the server side of the network ticketing system stores the site information by using a master database and a slave database, wherein the master database realizes synchronous data updating between the master database and the slave database by pushing a data updating log to the slave database. In addition, when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system into a cache for storing the site information.
In this embodiment, the server at the mobile terminal may send a log pushing request to the master database, receive the data update log pushed by the master database, extract a log related to a change of the station information in the data update log, and if the log related to the change of the station information is extracted, determine that the station information at the server of the network ticketing system is changed, at this time, may analyze the extracted log to determine the station identifier and the change type of the changed station.
If the change type of a certain changed site extracted from the log by the mobile terminal side server is deleted, the site information corresponding to the changed site can be searched in the site information stored in the mobile terminal side server, and the searched site information is deleted. If the change type of a certain changed station extracted from the log by the mobile terminal side server is insertion or modification, the station identification of the changed station can be carried in the changed station information request and sent to the main database of the server side of the network ticketing system.
And step 302, the master database extracts the changed site information from the master database or the slave database as the latest site data according to the site identification of the changed site carried by the changed site information request, and sends the latest site data to the mobile terminal side server.
The latest site information transmitted from the master database to the mobile terminal side server includes only changed site information of which the change type is insertion and/or modification, does not include changed site information of which the change type is deletion, nor does it include unchanged site information.
Step 303, the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data, so that the mobile terminal can obtain the site information.
In this embodiment, after the mobile terminal side server sends a request for changing site information to the master database and receives the latest site data returned by the master database, the stored site information may be updated based on the change type of each piece of changed site information in the latest site data, wherein when the change type of a changed site is an insertion, the changed site information may be directly stored in a cache for storing the site information; when the change type of the changed site is modified, the site information corresponding to the site change information can be searched in the cache for storing the site information, and the searched site information is covered by the changed site information.
As can be seen from the embodiments shown in fig. 2 and fig. 3, the server side of the network ticket-buying system only synchronizes the changed site information to the mobile terminal side server, so that on one hand, the synchronized data amount can be reduced, and the transmission failure rate caused by network instability can be reduced, and on the other hand, by the method of performing data synchronization immediately when the site is changed, the situation that the site data in the server side of the network ticket-buying system and the site data in the mobile terminal side server are inconsistent due to the time difference of acquiring all the site data regularly in the prior art is avoided.
The principle of the data synchronization method according to the present invention is described in detail above by three embodiments, and based on the above principle, the present invention provides a data synchronization method and a data synchronization apparatus, which are described in detail below with reference to fig. 4 and 5.
Referring to fig. 4, fig. 4 is a flowchart of a four-data synchronization method according to an embodiment of the present invention, where the method is applied to a server side of a network ticketing system, and includes:
step 401, when the station information in the network ticketing system is changed, generating the latest station data corresponding to the type of the target user terminal based on the changed station information;
step 402, storing the latest site data to a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can obtain the latest site information from the storage space.
In the method shown in figure 4 of the drawings,
the type of the target user terminal is a fixed terminal; the fixed terminal comprises a Personal Computer (PC);
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: writing all the site information existing after the change into a data file of a preset type, and taking the data file as the latest site data corresponding to the type of the target user terminal;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are uploaded to the cloud storage service, an access link for the latest site data stored in the cloud storage service is generated, and the access link is provided for the fixed terminal.
In the method shown in figure 4 of the drawings,
and if the operation of generating the latest site data corresponding to the target user terminal type based on the changed site information fails, retrying to execute the operation, if the operation fails to be executed repeatedly and the failure times exceed the preset times, providing the access link generated recently to the fixed terminal if the access link generated recently does not fail, and providing a preset default access link to the user terminal if the access link generated recently fails.
In the method shown in figure 4 of the drawings,
the type of the target user terminal is a mobile terminal;
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: binding the changed site information and the corresponding change types, and taking all the changed site information bound with the change types as the latest site data;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are transmitted to a mobile terminal side server, so that the mobile terminal side server updates the stored site information based on the change type of each piece of changed site information in the latest site data for the mobile terminal to obtain; and when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system.
In the method shown in figure 4 of the drawings,
the change type comprises insertion, deletion and modification;
the method for updating the stored site information by the mobile terminal side server based on the change type of each changed site information in the latest site data comprises the following steps: if the change type is insertion, storing the changed site information into a cache for storing the site information; if the change type is deletion, deleting the site information corresponding to the changed site from a cache for storing the site information; and if the change type is modification, searching the site information corresponding to the changed site in the cache for storing the site information, and covering the searched site information with the changed site information.
In the method shown in figure 4 of the drawings,
the type of the target user terminal is a mobile terminal;
a server side of the network ticketing system stores site information by using a master database and a slave database, wherein the master database realizes synchronous data updating between the master database and the slave database by pushing a data updating log to the slave database;
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: receiving a station change information request sent by a server at a mobile terminal after determining that station information at a server side of the network ticketing system is changed, and extracting the changed station information from the main database or the slave database as latest station data according to a station identification of a changed station carried by the station change information request;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: transmitting the latest site data to a mobile terminal side server so that the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data for the mobile terminal to obtain; when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system; when detecting that the site information of the server side of the network ticketing system is changed, the server on the mobile terminal side determines the change type of the changed site information.
In the method shown in figure 4 of the drawings,
the mobile terminal side server sends a log pushing request to the main database, receives a data updating log pushed by the main database, extracts a log related to the change of the site information in the data updating log, determines that the site information of the server side of the network ticketing system is changed if the log related to the change of the site information is extracted, and analyzes the extracted log to determine the site identification and the change type of the changed site.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a five-data synchronization apparatus according to an embodiment of the present invention, where the apparatus is applied to a server side of a network ticketing system, and includes: a generating unit 501 and a transmitting unit 502; wherein the content of the first and second substances,
a generating unit 501, configured to generate latest site data corresponding to a type of a target user terminal based on changed site information when the site information in the network ticketing system is changed;
a transmitting unit 502, configured to store the latest site data in a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can obtain the latest site information from the storage space.
In the device shown in figure 5 of the drawings,
the type of the target user terminal is a fixed terminal; the fixed terminal comprises a Personal Computer (PC);
the generating unit 501, when generating the latest station data corresponding to the target ue type based on the changed station information, is configured to: writing all the site information existing after the change into a data file of a preset type, and taking the data file as the latest site data corresponding to the type of the target user terminal;
the transmitting unit 502 stores the latest station data in a storage space corresponding to the type of the target ue, so that the obtaining of the latest station information from the storage space by the ue of the type includes: the latest site data are uploaded to the cloud storage service, an access link for the latest site data stored in the cloud storage service is generated, and the access link is provided for the fixed terminal.
In the device shown in figure 5 of the drawings,
the generating unit 501 retries to execute the operation when the operation of generating the latest station data corresponding to the target user terminal type based on the changed station information fails;
the transmission unit 502 is configured to, if the generation unit 501 retries to execute the operation multiple times and the number of failures exceeds a preset number, provide the access link generated most recently to the fixed terminal if the access link generated most recently is not failed, and provide a default access link set in advance to the user terminal if the access link generated most recently is failed.
In the device shown in figure 5 of the drawings,
the type of the target user terminal is a mobile terminal;
the generating unit 501, when generating the latest station data corresponding to the target ue type based on the changed station information, is configured to: binding the changed site information and the corresponding change types, and taking all the changed site information bound with the change types as the latest site data;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are transmitted to a mobile terminal side server, so that the mobile terminal side server updates the stored site information based on the change type of each piece of changed site information in the latest site data for the mobile terminal to obtain; and when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system.
In the device shown in figure 5 of the drawings,
the change type comprises insertion, deletion and modification;
the method for updating the stored site information by the mobile terminal side server based on the change type of each changed site information in the latest site data comprises the following steps: if the change type is insertion, storing the changed site information into a cache for storing the site information; if the change type is deletion, deleting the site information corresponding to the changed site from a cache for storing the site information; and if the change type is modification, searching the site information corresponding to the changed site in the cache for storing the site information, and covering the searched site information with the changed site information.
In the device shown in figure 5 of the drawings,
the type of the target user terminal is a mobile terminal;
a server side of the network ticketing system stores site information by using a master database and a slave database, wherein the master database realizes synchronous data updating between the master database and the slave database by pushing a data updating log to the slave database;
the generating unit 501, when generating the latest station data corresponding to the target ue type based on the changed station information, is configured to: receiving a station change information request sent by a server at a mobile terminal after determining that station information at a server side of the network ticketing system is changed, and extracting the changed station information from the main database or the slave database as latest station data according to a station identification of a changed station carried by the station change information request;
the transmitting unit 502 stores the latest station data in a storage space corresponding to the type of the target ue, so that the obtaining of the latest station information from the storage space by the ue of the type includes: transmitting the latest site data to a mobile terminal side server so that the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data for the mobile terminal to obtain; when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system; when detecting that the site information of the server side of the network ticketing system is changed, the server on the mobile terminal side determines the change type of the changed site information.
Referring to fig. 6, another embodiment of the present invention further provides an electronic device, which has the same function as the apparatus shown in fig. 5, and the electronic device shown in fig. 6 includes: at least one processor 601, and a memory 602 connected to the at least one processor via a bus; the memory 602 stores one or more computer programs executable by the at least one processor; the method steps as shown in fig. 4 are implemented when the one or more computer programs are executed by the at least one processor 601.
The present invention also provides a computer readable storage medium storing one or more computer programs which, when executed by a processor, implement the method as shown in fig. 4.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (15)

1. A data synchronization method is applied to a server side of a network ticketing system, and is characterized by comprising the following steps:
when station information in the network ticketing system is changed, generating latest station data corresponding to the type of the target user terminal based on the changed station information;
and storing the latest site data to a storage space corresponding to the type of the target user terminal so that the user terminal of the type can acquire the latest site information from the storage space.
2. The method of claim 1,
the type of the target user terminal is a fixed terminal; the fixed terminal comprises a Personal Computer (PC);
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: writing all the site information existing after the change into a data file of a preset type, and taking the data file as the latest site data corresponding to the type of the target user terminal;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are uploaded to the cloud storage service, an access link for the latest site data stored in the cloud storage service is generated, and the access link is provided for the fixed terminal.
3. The method of claim 2,
and if the operation of generating the latest site data corresponding to the target user terminal type based on the changed site information fails, retrying to execute the operation, if the operation fails to be executed repeatedly and the failure times exceed the preset times, providing the access link generated recently to the fixed terminal if the access link generated recently does not fail, and providing a preset default access link to the user terminal if the access link generated recently fails.
4. The method of claim 1,
the type of the target user terminal is a mobile terminal;
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: binding the changed site information and the corresponding change types, and taking all the changed site information bound with the change types as the latest site data;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are transmitted to a mobile terminal side server, so that the mobile terminal side server updates the stored site information based on the change type of each piece of changed site information in the latest site data for the mobile terminal to obtain; and when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system.
5. The method of claim 4,
the change type comprises insertion, deletion and modification;
the method for updating the stored site information by the mobile terminal side server based on the change type of each changed site information in the latest site data comprises the following steps: if the change type is insertion, storing the changed site information into a cache for storing the site information; if the change type is deletion, deleting the site information corresponding to the changed site from a cache for storing the site information; and if the change type is modification, searching the site information corresponding to the changed site in the cache for storing the site information, and covering the searched site information with the changed site information.
6. The method of claim 1,
the type of the target user terminal is a mobile terminal;
a server side of the network ticketing system stores site information by using a master database and a slave database, wherein the master database realizes synchronous data updating between the master database and the slave database by pushing a data updating log to the slave database;
the method for generating the latest site data corresponding to the type of the target user terminal based on the changed site information comprises the following steps: receiving a station change information request sent by a server at a mobile terminal after determining that station information at a server side of the network ticketing system is changed, and extracting the changed station information from the main database or the slave database as latest station data according to a station identification of a changed station carried by the station change information request;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: transmitting the latest site data to a mobile terminal side server so that the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data for the mobile terminal to obtain; when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system; when detecting that the site information of the server side of the network ticketing system is changed, the server on the mobile terminal side determines the change type of the changed site information.
7. The method of claim 6,
the mobile terminal side server sends a log pushing request to the main database, receives a data updating log pushed by the main database, extracts a log related to the change of the site information in the data updating log, determines that the site information of the server side of the network ticketing system is changed if the log related to the change of the site information is extracted, and analyzes the extracted log to determine the site identification and the change type of the changed site.
8. A data synchronizer is applied to a server side of a network ticketing system, and is characterized by comprising: a generating unit and a transmitting unit;
the generating unit is used for generating the latest station data corresponding to the type of the target user terminal based on the changed station information when the station information in the network ticketing system is changed;
and the transmission unit is used for storing the latest site data into a storage space corresponding to the type of the target user terminal so that the user terminal of the type can acquire the latest site information from the storage space.
9. The apparatus of claim 8,
the type of the target user terminal is a fixed terminal; the fixed terminal comprises a Personal Computer (PC);
the generation unit, when generating the latest site data corresponding to the target user terminal type based on the changed site information, is configured to: writing all the site information existing after the change into a data file of a preset type, and taking the data file as the latest site data corresponding to the type of the target user terminal;
the transmission unit stores the latest site data in a storage space corresponding to the type of the target user terminal, so that the user terminal of the type acquires the latest site information from the storage space, and the transmission unit includes: the latest site data are uploaded to the cloud storage service, an access link for the latest site data stored in the cloud storage service is generated, and the access link is provided for the fixed terminal.
10. The apparatus of claim 9,
the generation unit retries to execute the operation when the operation of generating the latest site data corresponding to the target user terminal type based on the changed site information fails;
and the transmission unit is used for providing the access link generated recently to the fixed terminal if the generation unit fails to execute the operation repeatedly and the failure times exceed the preset times, and providing the default access link which is preset to the user terminal if the access link generated recently fails.
11. The apparatus of claim 8,
the type of the target user terminal is a mobile terminal;
the generation unit, when generating the latest site data corresponding to the target user terminal type based on the changed site information, is configured to: binding the changed site information and the corresponding change types, and taking all the changed site information bound with the change types as the latest site data;
storing the latest site data into a storage space corresponding to the type of the target user terminal, so that the user terminal of the type can acquire the latest site information from the storage space, wherein the method comprises the following steps: the latest site data are transmitted to a mobile terminal side server, so that the mobile terminal side server updates the stored site information based on the change type of each piece of changed site information in the latest site data for the mobile terminal to obtain; and when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system.
12. The apparatus of claim 11,
the change type comprises insertion, deletion and modification;
the method for updating the stored site information by the mobile terminal side server based on the change type of each changed site information in the latest site data comprises the following steps: if the change type is insertion, storing the changed site information into a cache for storing the site information; if the change type is deletion, deleting the site information corresponding to the changed site from a cache for storing the site information; and if the change type is modification, searching the site information corresponding to the changed site in the cache for storing the site information, and covering the searched site information with the changed site information.
13. The apparatus of claim 8,
the type of the target user terminal is a mobile terminal;
a server side of the network ticketing system stores site information by using a master database and a slave database, wherein the master database realizes synchronous data updating between the master database and the slave database by pushing a data updating log to the slave database;
the generation unit, when generating the latest site data corresponding to the target user terminal type based on the changed site information, is configured to: receiving a station change information request sent by a server at a mobile terminal after determining that station information at a server side of the network ticketing system is changed, and extracting the changed station information from the main database or the slave database as latest station data according to a station identification of a changed station carried by the station change information request;
the transmission unit stores the latest site data in a storage space corresponding to the type of the target user terminal, so that the user terminal of the type acquires the latest site information from the storage space, and the transmission unit includes: transmitting the latest site data to a mobile terminal side server so that the mobile terminal side server updates the stored site information based on the change type of each changed site information in the latest site data for the mobile terminal to obtain; when the mobile terminal side server is on line, all site information is loaded and stored from the network ticketing system; when detecting that the site information of the server side of the network ticketing system is changed, the server on the mobile terminal side determines the change type of the changed site information.
14. An electronic device, comprising: the system comprises at least one processor and a memory connected with the at least one processor through a bus; the memory stores one or more computer programs executable by the at least one processor; characterized in that the at least one processor, when executing the one or more computer programs, implements the method steps of any of claims 1-7.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more computer programs which, when executed by a processor, implement the method of any one of claims 1-7.
CN201710347158.XA 2017-05-17 2017-05-17 Data synchronization method and device, electronic equipment and storage medium Active CN108959278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710347158.XA CN108959278B (en) 2017-05-17 2017-05-17 Data synchronization method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710347158.XA CN108959278B (en) 2017-05-17 2017-05-17 Data synchronization method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108959278A CN108959278A (en) 2018-12-07
CN108959278B true CN108959278B (en) 2020-12-22

Family

ID=64462602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710347158.XA Active CN108959278B (en) 2017-05-17 2017-05-17 Data synchronization method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108959278B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956474B (en) * 2019-01-29 2024-02-27 深圳市智税链科技有限公司 Electronic invoice system based on block chain
CN110222065A (en) * 2019-05-29 2019-09-10 深圳市思迪信息技术股份有限公司 Computer room website update method and system based on mobile platform
CN112200471B (en) * 2020-10-15 2023-11-21 国网北京市电力公司 Charging pile quantity configuration method and device and charging pile distribution system
CN115098538B (en) * 2022-08-25 2022-11-25 北京永洪商智科技有限公司 Database query optimization method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7979390B2 (en) * 2006-10-27 2011-07-12 Purdue Pharma L.P. Software, systems, and methodologies for realignment of remote databases by a central database in support field representative territory assignments
CN104834749A (en) * 2015-05-27 2015-08-12 惠州Tcl移动通信有限公司 File synchronization method and synchronization system for mobile terminal and PC terminal
CN105323307A (en) * 2015-09-23 2016-02-10 上海斐讯数据通信技术有限公司 Content providing system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10235383B2 (en) * 2012-12-19 2019-03-19 Box, Inc. Method and apparatus for synchronization of items with read-only permissions in a cloud-based environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7979390B2 (en) * 2006-10-27 2011-07-12 Purdue Pharma L.P. Software, systems, and methodologies for realignment of remote databases by a central database in support field representative territory assignments
CN104834749A (en) * 2015-05-27 2015-08-12 惠州Tcl移动通信有限公司 File synchronization method and synchronization system for mobile terminal and PC terminal
CN105323307A (en) * 2015-09-23 2016-02-10 上海斐讯数据通信技术有限公司 Content providing system

Also Published As

Publication number Publication date
CN108959278A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108959278B (en) Data synchronization method and device, electronic equipment and storage medium
CN103457905B (en) Method of data synchronization, system and equipment
US20170034264A1 (en) Application Information Sharing Method and Apparatus
EP3508985B1 (en) Scalable synchronization with cache and index management
CN106657149B (en) Communication protocol conversion method and device
US9690796B2 (en) Non-transitory computer-readable media storing file management program, file management apparatus, and file management method
CN111221469B (en) Method, device and system for synchronizing cache data
CN108093026B (en) Method and device for processing multi-tenant request
CN104301428A (en) Data synchronization method and server
CN103905495A (en) Application synchronization method and backstage server
US20140164574A1 (en) Method and System for Downloading a Font File
CN103220643B (en) Information providing method and device, ATL matching process and device
CN107463657A (en) File operation method and terminal
CN104881454A (en) Updating method and system of parameter
CN105704177A (en) UA identification method and device
CN111767297B (en) Big data processing method, device, equipment and medium
CN104079623A (en) Method and system for controlling multilevel cloud storage synchrony
CN106407288B (en) Method and system for synchronously updating information
JP4719732B2 (en) Backup server, mobile device, communication system using these, and backup method
US20180302404A1 (en) Method for processing data request and system therefor, access device, and storage device
CN101902613A (en) Information synchronization method and system, set top box and server in IPTV (Internet Protocol Television) system
CN105094787B (en) Method and device for processing enterprise internet application
CN111552527A (en) Method, device and system for translating characters in user interface and storage medium
CN102685220A (en) Method and system for data interaction based on WEB page
CN103220327B (en) user information storage 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
GR01 Patent grant