CN107741994A - A kind of data-updating method and device - Google Patents

A kind of data-updating method and device Download PDF

Info

Publication number
CN107741994A
CN107741994A CN201711096589.XA CN201711096589A CN107741994A CN 107741994 A CN107741994 A CN 107741994A CN 201711096589 A CN201711096589 A CN 201711096589A CN 107741994 A CN107741994 A CN 107741994A
Authority
CN
China
Prior art keywords
data
user
renewal
service end
user data
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.)
Granted
Application number
CN201711096589.XA
Other languages
Chinese (zh)
Other versions
CN107741994B (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.)
Face Technology (beijing) Co Ltd
Original Assignee
Face Technology (beijing) 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 Face Technology (beijing) Co Ltd filed Critical Face Technology (beijing) Co Ltd
Priority to CN201711096589.XA priority Critical patent/CN107741994B/en
Publication of CN107741994A publication Critical patent/CN107741994A/en
Application granted granted Critical
Publication of CN107741994B publication Critical patent/CN107741994B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the present application provides a kind of data-updating method and device, and applied to service end, the data sent by receiving user by client update request;The very first time stamp of service end user data table is determined, the very first time stamp is the maximum time stamp in the timestamp of every user data item last time renewal in the service end user data table;Obtain that all generation timestamps in Update log table are later than that very first time stabs updates the data item;For updating the data item described in every, item, which is updated the data, using this updates the service end user data table, and the timestamp that the generation timestamp for updating the data item is defined as being updated by the last time of the user data item for updating the data item renewal in the service end user data table;The mode of client user's tables of data of data renewal request instruction is updated based on the service end user data table after renewal, on the basis of data renewal is realized, reduce system load it is excessive the occurrence of.

Description

A kind of data-updating method and device
Technical field
The present invention relates to computer realm, more particularly to a kind of data-updating method and device.
Background technology
With the popularization of internet, information Real-Time Sharing is with synchronous more and more important, but due to the asymmetry of each client Property so that it can not possibly work in P2P patterns, can only be worked with client-side/server-side pattern.
Client-side/server-side pattern at present, corresponding service end is set in service end primarily directed to each user User data table, corresponding client user's tables of data is set in client, when upgrading demand, directly renewal takes when existing Be engaged in end-user data table, and by client user's tables of data with renewal after service end user data table carry out data syn-chronization side Formula, realize that data update.However, with the increase of data volume, although client-side/server-side pattern can realize data more at present Newly, but it frequently can lead to the problem of system load is excessive.
In view of this, there is provided a kind of data-updating method and device, realized with reducing current client-side/server-side pattern Data update when, system load it is excessive the occurrence of.
The content of the invention
In view of this, it is an object of the invention to provide a kind of data-updating method and device, with reduce current client/ Service end pattern realize data renewal when, system load process the occurrence of, specific embodiment is as follows:
A kind of data-updating method, applied to service end, this method includes:
Receive the data that user is sent by client and update request;
Determine the Update log table of service end storage and the service end user data table related to the user;
The very first time stamp of the service end user data table is determined, the very first time stamp is the service end number of users According to the maximum time stamp in the timestamp of every user data item last time renewal in table;
Obtain that all generation timestamps in the Update log table are later than very first time stamp updates the data item;
For updating the data item described in every, update the data item using this and update the service end user data table, and will The generation timestamp for updating the data item is defined as being updated the data the user of item renewal by this in the service end user data table The timestamp of the last time renewal of data item;
Client user's data of the data renewal request instruction are updated based on the service end user data table after renewal Table.
Preferably, it is described for updating the data item described in every, update the data item using this and update the service end subscriber Tables of data, including:
For updating the data item described in every, update the data whether item has indicated the user it is determined that described;
If the item that updates the data indicates there is the user, it is determined that the action type for updating the data item instruction;
The service end user data table is updated based on the action type.
Preferably, it is described that the service end user data table is updated based on the action type, including:
Determine whether the action type has indicated data message mark;
If so, obtained from service end data logger and data message mark corresponding data information;
The service end user data table is updated based on the action type and data message.
Preferably, the service end user data table based on after renewal updates the client of the data renewal request instruction End-user data table, including:
Determine the second time of the client user tables of data related to the user that the data renewal request carries Stamp, second timestamp are the timestamp of every user data item last time renewal in client user's tables of data In maximum time stamp;
It is determined that renewal after service end user data table in, last time renewal timestamp earlier than second time The user data item of stamp;
Generate fresh information corresponding with identified every user data item respectively;
Generated fresh information is returned to the client, in order to which the client is updated using the fresh information Client user's tables of data, and the timestamp that the last time of user data item corresponding to the fresh information is updated is true It is set to the timestamp of the last time renewal of the user data item updated in client user's tables of data by the fresh information.
Preferably, the data renewal request also carries renewal quantity;Service end number of users after the determination renewal After in table, last time renewal user data item of the timestamp earlier than second timestamp, this method also includes:
From identified user data item, the priority of the timestamp updated according to the last time of the user data item Sequentially, selection and the renewal quantity identical user data item;
The generation fresh information corresponding with identified every user data item respectively, including:Generation respectively with institute Fresh information corresponding to every user data item of selection.
A kind of data update apparatus, applied to service end, the device includes:
Data update request reception unit, update request for receiving the data that user is sent by client;
Tables of data determining unit, for the Update log table for determining service end storage and the service end related to the user User data table;
The very first time stabs determining unit, for determining that the very first time of the service end user data table stabs, described first When timestamp is the maximum in the timestamp of every user data item last time renewal in the service end user data table Between stab;
An acquiring unit is updated the data, all generation timestamps for obtaining in the Update log table are later than described Very first time stamp updates the data item;
First updating block, for for updating the data item described in every, updating the data item using this and updating the service End-user data table, and the generation timestamp for updating the data item is defined as being updated by this in the service end user data table The timestamp of the last time renewal of the user data item of data item update;
Second updating block, for updating the data renewal request instruction based on the service end user data table after renewal Client user's tables of data.
Preferably, first updating block, including:
First determining unit, for for updating the data item described in every, updating the data whether item has indicated it is determined that described The user;
Second determining unit, if indicating there is the user for the item that updates the data, it is determined that the item that updates the data refers to The action type shown;
First renewal subelement, for updating the service end user data table based on the action type.
Preferably, the first renewal subelement, including:
Data message identifies determining unit, for determining whether the action type has indicated data message mark;
Data message acquiring unit, for being identified if so, being obtained from service end data logger with the data message Corresponding data information;
Service end user data table updating block, for updating the service end based on the action type and data message User data table.
Preferably, second updating block, including:
Second timestamp determining unit, the client related to the user carried for determining the data renewal request Second timestamp of end-user data table, second timestamp are every user data in client user's tables of data Maximum time stamp in the timestamp of item last time renewal;
User data item determining unit, for determining that in the service end user data table after updating, last time updates Timestamp earlier than second timestamp user data item;
Fresh information generation unit, for generating fresh information corresponding with identified every user data item respectively;
Client user's tables of data updating block, for returning to generated fresh information to the client, in order to The client updates client user's tables of data using the fresh information, and by user corresponding to the fresh information The timestamp of the last time renewal of data item is defined as the use updated in client user's tables of data by the fresh information The timestamp of the last time renewal of user data item.
Preferably, the data renewal request also carries renewal quantity, and second updating block also includes:
Selecting unit, for from identified user data item, being updated according to the last time of the user data item Timestamp sequencing, selection with it is described renewal quantity identical user data item;
The fresh information generation unit, is specifically used for:Generation is corresponding with every selected user data item respectively Fresh information.
The embodiment of the present application provides a kind of data-updating method and device, applied to service end, is passed through by receiving user The data renewal request that client is sent;The very first time stamp of service end user data table is determined, the very first time stamp is institute State the maximum time stamp in the timestamp of every user data item last time renewal in service end user data table;Obtain more What all generation timestamps in new log sheet were later than that the very first time stabs updates the data item;For renewal number every described According to item, update the data item using this and update the service end user data table, and the generation timestamp that this is updated the data to item is true It is set to the time updated in the service end user data table by the last time of the user data item for updating the data item renewal Stamp;The side of client user's tables of data of the data renewal request instruction is updated based on the service end user data table after renewal Formula, realize data renewal on the basis of, reduce system load it is excessive the occurrence of.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of data-updating method flow chart that the embodiment of the present application provides;
Fig. 2 is directed to described in every for one kind that the embodiment of the present application provides and updates the data item, and item is updated the data more using this The method flow diagram of the new service end user data table;
Fig. 3 is that a kind of of the embodiment of the present application offer updates the service end user data table based on the action type Method flow diagram;
Fig. 4 is that a kind of service end user data table based on after renewal that the embodiment of the present application provides updates the data more The method flow diagram of client user's tables of data of new request instruction;
Fig. 5 is that another service end user data table based on after renewal that the embodiment of the present application provides updates the data The method flow diagram of client user's tables of data of renewal request instruction;
Fig. 6 is a kind of structural representation for data update apparatus that the embodiment of the present application provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
Embodiment:
Fig. 1 is a kind of data-updating method flow chart that the embodiment of the present application provides.
Specifically, data-updating method as shown in Figure 1 is applied to service end, as shown in figure 1, this method includes:
S101, receive the data renewal request that user is sent by client;
Optionally, the terminal that user is held by it can install client, the client on user application terminal, by The legal account for logging in the client is inputted in client, to log in client, and then user can pass through the client Hold to service end corresponding with the client and send data renewal request.
In the embodiment of the present application, it is preferred that the service end provides service support for client, and user can pass through difference Client in terminal sends data renewal request to the service end.
Optionally, the client is the front end of application program, and the service end is provides service for the application program The server cluster of support.It is only the preferred embodiment for the client-side/server-side that the embodiment of the present application provides above, inventor can The specific manifestation form of client-side/server-side is arbitrarily set according to the demand of oneself, not limited herein.
S102, the Update log table for determining service end storage and the service end user data table related to the user;
Optionally, service end receive data renewal request after, can determine whether service end storage Update log table and with The related service end user data table of the user.
In the embodiment of the present application, it is preferred that be previously provided with service end a Update log table and respectively with it is each The related service end user data table of user, also, the initial value of the Update log table pre-set is sky, respectively with each use The initial value of the related service end user data table in family is also sky.
For example, an initial value just is created as empty renewal in service end before application issued corresponding to client Log sheet;After the application issued, as long as having user by client registers account corresponding to the application program, then It is that one initial value of user's establishment is the empty and user (being also believed to the account with the user) in service end Related service end user data table.
Optionally, whether user is operated by client to the content in its account, or service end is to application Content in the account of at least one user of the application program is operated (that is, in each account to user The operation that carries out of content), update the data item for the operation generation, and the item that updates the data generated be stored in institute State in Update log table.I.e., in the embodiment of the present application, it is preferred that item is updated the data for operating generation one each time, and The item that updates the data generated is stored in the Update log table.
In the embodiment of the present application, it is preferred that the item that updates the data comprises at least:Timestamp is generated (during the generation Between stamp be operating time for generating the operation for updating the data item, i.e. when existing to enter the content in the account of user During capable operation, operation is corresponding updates the data item with this for generation, and this time operated updates the data item for what is generated Generation timestamp).
It is only the preferred embodiment for updating the data item that the embodiment of the present application provides above, inventor can be according to the need of oneself Any particular content for setting and updating the data item is sought, is not limited herein.
S103, the very first time stamp for determining the service end user data table, the very first time stamp is the service end Maximum time stamp in the timestamp of every user data item last time renewal in user data table;
Optionally, the very first time stamp of the service end user data table is determined, including:Determine the service end number of users According to whether there is user data item in table;If it is determined that user data item is not present in the service end user data table, it is determined that The very first time stamp of the service end user data table is sky;If it is determined that user data be present in the service end user data table Item (now, very first time stamp is not sky), then determine that every user data item is last in the service end user data table respectively The timestamp once updated, and the maximum time stamp in the timestamp that identified all last times are updated is (here Maximum time stamp is to represent the time most in the timestamp updated according to time order and function order, identified all last times The timestamp in evening) it is defined as very first time stamp.
S104, all generation timestamps obtained in the Update log table are later than the renewal number of the very first time stamp According to item;
Optionally, the very first time stamp is space-time, and each in the Update log table is updated the data into item determines Item is updated the data for what the generation timestamp in a Update log table getting was later than the very first time stamp;It is described Very first time stamp is not space-time, and all generation timestamps are obtained from the Update log table and are later than the very first time stamp Update the data item.
S105, for updating the data item described in every, update the data item using this and update the service end user data table, And the generation timestamp for updating the data item is defined as to update the data item renewal by this in the service end user data table The timestamp of the last time renewal of data item;
Optionally, for every got for step S104 updates the data item, item renewal institute is updated the data using this Service end user data table is stated, and the generation timestamp for updating the data item is defined as quilt in the service end user data table This updates the data the timestamp of the last time renewal of the user data item of item renewal.
In the embodiment of the present application, it is preferred that the item that updates the data includes generation timestamp, action type and operation pair As;Wherein, the action type is addition user data item type, deletes user data item type, or, change user data Item type;User's (can be the account of user here) that the operation object instruction is operated.
Further, in the embodiment of the present application, it is preferred that in action type be addition user data item type or modification During user data item type, the action type has also indicated data message mark, and the data message mark is corresponding with unique Data message.
In a kind of data-updating method that the embodiment of the present application provides, service end data logger is additionally provided with.Optionally, An initial value just is created as empty service end data logger in service end before application issued corresponding to client; When the operation carried out to the content in the account of user be present, generation is corresponding with the operation to update the data item, if also, When the action type of the operation is changes user data item type or addition user data item type, determine that the operation is corresponding Data message, and distribute a unique data message for the data message and identify, unique data message will be corresponding with Mark the data information memory in the service end data logger, and generation update the data item in operation class Unique data message mark of the promising data message distribution of type instruction.
Optionally, the mode that the item renewal service end user data table is updated the data using this is included:It is determined that should Whether the operation object that updating the data item includes indicates to send the user of the data renewal request;If it is determined that this updates the data item Including operation object instruction send the user of data renewal request, then update the data item using this and update the service end (this service end user data table is the service end number of users related to sending the user of the data renewal request to user data table According to table);Otherwise, do not utilize this to update the data item and update the service end user data table.
Optionally, however, it is determined that the operation object instruction for updating the data item and including sends the use that the data renewal is asked Family, it is determined that the action type for updating the data item and including.
In the embodiment of the present application, it is preferred that when the action type is deletes user data item type, it is determined that described The service end-user data for treating that the deleted user to sending the data renewal request is related of action type instruction User data item in table;Delete the identified user data item in the service end user data table, and by the renewal The generation timestamp of data item is defined as the timestamp of the last time renewal of the deleted user data item.
In the embodiment of the present application, it is preferred that when the action type is changes user data item type, it is determined that described The related service end-user data of the user to sending the data renewal request for waiting to be changed of action type instruction User data item in table, and the data message mark of action type instruction;From the service end data logger Obtain the corresponding data message of data message mark with action type instruction;Institute is updated according to acquired data message State the user data item for waiting to be changed in the service end user data table of action type instruction.
In the embodiment of the present application, it is preferred that when the action type is adds user data item type, it is determined that described Action type instruction waits to be added into the service end-user data related to the user for sending the data renewal request The data message mark of the data message in user data item in table;Obtained from the service end data logger with institute really Data message corresponding to fixed data message mark;In the service end user data table related to the user add one with User data item, the data message of the user data item being added be got from the service end data logger with Data message corresponding to identified data message mark.
S106, the client user that the data renewal request indicates is updated based on the service end user data table after renewal Tables of data.
Optionally, the client for the data renewal request instruction being updated based on the service end user data table after renewal is used User data table, is referred to:Data are updated into client user's tables of data of request instruction and the service end-user data after renewal Table synchronizes renewal.
For the ease of a kind of understanding of the data-updating method provided the embodiment of the present application, now the embodiment of the present application is carried " for updating the data item described in every, updating the data item using this and updating the service in a kind of data-updating method supplied The method of end-user data table " describes in detail.
Fig. 2 is directed to described in every for one kind that the embodiment of the present application provides and updates the data item, and item is updated the data more using this The method flow diagram of the new service end user data table.
As shown in Fig. 2 this method includes:
S201, for updating the data item described in every, update the data whether item has indicated the user it is determined that described;
If S202, the item that updates the data indicate there is the user, it is determined that the action type for updating the data item instruction;
S203, the service end user data table updated based on the action type.
For the ease of a kind of understanding of the data-updating method provided the embodiment of the present application, now the embodiment of the present application is carried The method of " updating the service end user data table based on the action type " in a kind of data-updating method supplied is carried out It is discussed in detail.
Fig. 3 is that a kind of of the embodiment of the present application offer updates the service end user data table based on the action type Method flow diagram.
As shown in figure 3, this method includes:
S301, determine whether the action type has indicated data message mark;If so, perform step S302;
S302, obtained and data message mark corresponding data information from service end data logger;
S303, the service end user data table updated based on the action type and data message.
For the ease of a kind of understanding of the data-updating method provided the embodiment of the present application, now the embodiment of the present application is carried " the data renewal request instruction is updated based on the service end user data table after renewal in a kind of data-updating method supplied Client user's tables of data " method describe in detail.
Fig. 4 is that a kind of service end user data table based on after renewal that the embodiment of the present application provides updates the data more The method flow diagram of client user's tables of data of new request instruction.
As shown in figure 4, this method includes:
S401, determine the client user tables of data related to the user that the data renewal request carries second Timestamp, second timestamp be client user's tables of data in every user data item last time renewal when Between stab in maximum time stamp;
Optionally, when the data renewal request also carries the second of the client user tables of data related to the user Between stab, the client user tables of data related to the user is stored in the client.
In the embodiment of the present application, it is preferred that appoint in a not pair client user tables of data related to the user Before what is operated, client user's tables of data is sky.For example user is applied by client corresponding to the client In program after register account number, an initial value is created as the empty client user tables of data related to the user, and should Client user's tables of data is stored in the client.
Optionally, when not including user data item in client user's tables of data, client user's data are determined Maximum time stamp in table in the timestamp of every user data item last time renewal is sky, i.e. the second timestamp is sky.
S402, determine in the service end user data table after renewal, last time renewal timestamp earlier than described the The user data item of two timestamps;
Optionally, from all user data items in service end user data table, last time renewal is found out Each user data item of the timestamp earlier than second timestamp.Wherein, when second timestamp is space-time, it is determined that described The timestamp of the last time renewal of every user data item is earlier than second timestamp in service end user data table.
S403, generate fresh information corresponding with identified every user data item respectively;
Optionally, for every user data item determined by step S402, generation and this user data item pair The fresh information answered, and the fresh information generated returns to the client, in order to which the client is based on receiving The fresh information update client user's tables of data.
S404, generated fresh information is returned to the client, in order to which the client is believed using the renewal Breath updates client user's tables of data, and by the last time of user data item corresponding to the fresh information update when Between the stamp last time renewal of user data item that is defined as being updated by the fresh information in client user's tables of data Timestamp.
Optionally, the fresh information includes action type, and the action type is that user data item adds type, user Data item changes type, or, user data entry deletion type.
When the action type that fresh information includes is that user data item adds type, add in client user's tables of data Add a user data item, the data message of the user data item being added is the data message of fresh information instruction (wherein, the data message of fresh information instruction is the user data item in service end user data table corresponding to the fresh information Data message), also, by for the last time of the user data item in service end user data table corresponding to the fresh information more New timestamp, it is defined as the time of the last time renewal of the user data item being added into client user's tables of data Stamp.
When the action type that fresh information includes is that user data item changes type, in client user's tables of data really The fixed user data item for waiting to be changed corresponding with the fresh information, this is treated to the data message in the user data item changed Be revised as the fresh information instruction data message (fresh information instruction data message for it is corresponding with the fresh information clothes The data message for the user data item being engaged in end-user data table), also, end-user data will be serviced corresponding to the fresh information The timestamp of the last time renewal of user data item in table, the use changed being defined as in client user's tables of data The timestamp of the last time renewal of user data item.
When the action type that fresh information includes is user data entry deletion type, in client user's tables of data really It is calmly corresponding with the fresh information to treat deleted user data item, treat deleted user data item from client user this Deleted in tables of data, and the last time of the user data item in service end user data table corresponding to the fresh information is updated Timestamp, the deleted user data item being defined as in client user's tables of data last time renewal time Stamp.
For the ease of a kind of understanding of the data-updating method provided the embodiment of the present application, now the embodiment of the present application is carried Another service end user data table based on after renewal of confession updates client user's number of the data renewal request instruction Described in detail according to the method for table.
As shown in figure 5, this method includes:
S501, determine the client user tables of data related to the user that the data renewal request carries second Timestamp, second timestamp be client user's tables of data in every user data item last time renewal when Between stab in maximum time stamp;
S502, determine in the service end user data table after renewal, last time renewal timestamp earlier than described the The user data item of two timestamps;
S503, from identified user data item, according to the user data item last time update timestamp Sequencing, selection with it is described renewal quantity identical user data item;
S504, generate fresh information corresponding with every selected user data item respectively;
S505, generated fresh information is returned to the client, in order to which the client is believed using the renewal Breath updates client user's tables of data, and by the last time of user data item corresponding to the fresh information update when Between the stamp last time renewal of user data item that is defined as being updated by the fresh information in client user's tables of data Timestamp.
Further, a kind of data-updating method that the embodiment of the present application provides also includes:Receive and updated with the data The related data page turning renewal request of request, the number of data in every page of the data page turning renewal request instruction;Determine client Maximum time stamp in the timestamp of the last time renewal of every user data item in end-user data table;It is determined that after renewal Service end user data table in, last time renewal timestamp earlier than the maximum time stamp user data item;From In identified user data item, the sequencing of the timestamp updated according to the last time of the user data item, selection With the number of data identical user data item;Renewal corresponding with every selected user data item is believed respectively for generation Breath;Generated fresh information is returned to the client, in order to which the client is using described in fresh information renewal Client user's tables of data, and the timestamp that the last time of user data item corresponding to the fresh information updates is defined as The timestamp of the last time renewal of the user data item updated in client user's tables of data by the fresh information.
The embodiment of the present application provides a kind of data-updating method, applied to service end, passes through client by receiving user The data renewal request of transmission;The very first time stamp of service end user data table is determined, the very first time stamp is the service Maximum time stamp in the timestamp of every user data item last time renewal in end-user data table;Obtain Update log What all generation timestamps in table were later than very first time stamp updates the data item;For updating the data item described in every, Item is updated the data using this and updates the service end user data table, and the generation timestamp that this is updated the data to item is defined as institute State the timestamp updated in service end user data table by the last time of the user data item for updating the data item renewal;It is based on Service end user data table after renewal updates the mode of client user's tables of data of the data renewal request instruction, in reality On the basis of existing data renewal, reduce system load it is excessive the occurrence of.
Fig. 6 is a kind of structural representation for data update apparatus that the embodiment of the present application provides.
Data update apparatus as shown in Figure 6 is applied to service end, and the device includes:
Data update request reception unit 61, update request for receiving the data that user is sent by client;
Tables of data determining unit 62, for the Update log table for determining service end storage and the service related to the user End-user data table;
The very first time stabs determining unit 63, for determining that the very first time of the service end user data table stabs, described the One timestamp is the maximum in the timestamp of every user data item last time renewal in the service end user data table Timestamp;
An acquiring unit 64 is updated the data, all generation timestamps for obtaining in the Update log table are later than institute That states very first time stamp updates the data item;
First updating block 65, for for updating the data item described in every, updating the data item using this and updating the clothes Business end-user data table, and the generation timestamp for updating the data item is defined as in the service end user data table by this more The timestamp of the last time renewal of the user data item of new data item renewal;
Second updating block 66, refer to for updating the data renewal request based on the service end user data table after renewal The client user's tables of data shown.
Optionally, first updating block, including:First determining unit, for for updating the data item described in every, Update the data whether item has indicated the user it is determined that described;Second determining unit, if indicating have for the item that updates the data The user, it is determined that the action type for updating the data item instruction;First renewal subelement, for based on the action type Update the service end user data table.
Optionally, the first renewal subelement, including:Data message identifies determining unit, for determining the operation Whether type has indicated data message mark;Data message acquiring unit, for if so, being obtained from service end data logger Corresponding data information is identified with the data message;Service end user data table updating block, for based on the action type The service end user data table is updated with data message.
Optionally, second updating block, including:
Second timestamp determining unit, the client related to the user carried for determining the data renewal request Second timestamp of end-user data table, second timestamp are every user data in client user's tables of data Maximum time stamp in the timestamp of item last time renewal;
User data item determining unit, for determining that in the service end user data table after updating, last time updates Timestamp earlier than second timestamp user data item;
Fresh information generation unit, for generating fresh information corresponding with identified every user data item respectively;
Client user's tables of data updating block, for returning to generated fresh information to the client, in order to The client updates client user's tables of data using the fresh information, and by user corresponding to the fresh information The timestamp of the last time renewal of data item is defined as the use updated in client user's tables of data by the fresh information The timestamp of the last time renewal of user data item.
Further, the data renewal request also carries renewal quantity, and one kind second that the embodiment of the present application provides is more New unit also includes selecting unit, for from identified user data item, according to the last time of the user data item The sequencing of the timestamp of renewal, selection and the renewal quantity identical user data item.Accordingly, the fresh information Generation unit, it is specifically used for:Generate fresh information corresponding with every selected user data item respectively.
The embodiment of the present application provides a kind of data update apparatus, applied to service end, passes through client by receiving user The data renewal request of transmission;The very first time stamp of service end user data table is determined, the very first time stamp is the service Maximum time stamp in the timestamp of every user data item last time renewal in end-user data table;Obtain Update log What all generation timestamps in table were later than very first time stamp updates the data item;For updating the data item described in every, Item is updated the data using this and updates the service end user data table, and the generation timestamp that this is updated the data to item is defined as institute State the timestamp updated in service end user data table by the last time of the user data item for updating the data item renewal;It is based on Service end user data table after renewal updates the mode of client user's tables of data of the data renewal request instruction, in reality On the basis of existing data renewal, reduce system load it is excessive the occurrence of.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Member and algorithm steps, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, application-specific and design constraint depending on technical scheme.Professional and technical personnel Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the present invention. A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one The most wide scope caused.

Claims (10)

1. a kind of data-updating method, it is characterised in that applied to service end, this method includes:
Receive the data that user is sent by client and update request;
Determine the Update log table of service end storage and the service end user data table related to the user;
The very first time stamp of the service end user data table is determined, the very first time stamp is the service end user data table In every user data item last time renewal timestamp in maximum time stamp;
Obtain that all generation timestamps in the Update log table are later than very first time stamp updates the data item;
For updating the data item described in every, update the data item using this and update the service end user data table, and by this more The generation timestamp of new data item is defined as being updated the data the user data of item renewal by this in the service end user data table The timestamp of the last time renewal of item;
Client user's tables of data of the data renewal request instruction is updated based on the service end user data table after renewal.
2. according to the method for claim 1, it is characterised in that it is described for updating the data item described in every, using this more New data item updates the service end user data table, including:
For updating the data item described in every, update the data whether item has indicated the user it is determined that described;
If the item that updates the data indicates there is the user, it is determined that the action type for updating the data item instruction;
The service end user data table is updated based on the action type.
3. according to the method for claim 2, it is characterised in that described that the service end use is updated based on the action type User data table, including:
Determine whether the action type has indicated data message mark;
If so, obtained from service end data logger and data message mark corresponding data information;
The service end user data table is updated based on the action type and data message.
4. according to the method described in claim 1-3 any one, it is characterised in that the service end subscriber based on after renewal Tables of data updates client user's tables of data of the data renewal request instruction, including:
Determine the second timestamp of the client user tables of data related to the user that the data renewal request carries, institute State in timestamp of second timestamp for every user data item last time renewal in client user's tables of data Maximum time stamp;
It is determined that renewal after service end user data table in, last time renewal timestamp earlier than second timestamp User data item;
Generate fresh information corresponding with identified every user data item respectively;
Generated fresh information is returned to the client, in order to which the client is using described in fresh information renewal Client user's tables of data, and the timestamp that the last time of user data item corresponding to the fresh information updates is defined as The timestamp of the last time renewal of the user data item updated in client user's tables of data by the fresh information.
5. according to the method for claim 4, it is characterised in that the data renewal request also carries renewal quantity;Institute State use of in the service end user data table after determining renewal, last time renewal the timestamp earlier than second timestamp After user data item, this method also includes:
From identified user data item, the priority of the timestamp updated according to the last time of the user data item is suitable Sequence, selection and the renewal quantity identical user data item;
The generation fresh information corresponding with identified every user data item respectively, including:Generation respectively with it is selected Every user data item corresponding to fresh information.
6. a kind of data update apparatus, it is characterised in that applied to service end, the device includes:
Data update request reception unit, update request for receiving the data that user is sent by client;
Tables of data determining unit, for the Update log table for determining service end storage and the service end subscriber related to the user Tables of data;
The very first time stabs determining unit, for determining that the very first time of the service end user data table stabs, the very first time Stab the maximum time stamp in the timestamp for every user data item last time renewal in the service end user data table;
An acquiring unit is updated the data, all generation timestamps for obtaining in the Update log table are later than described first Timestamp updates the data item;
First updating block, for for updating the data item described in every, updating the data item using this and updating the service end use User data table, and the generation timestamp for updating the data item is defined as being updated the data by this in the service end user data table The timestamp of the last time renewal of the user data item of item renewal;
Second updating block, for updating the visitor of the data renewal request instruction based on the service end user data table after renewal Family end-user data table.
7. device according to claim 6, it is characterised in that first updating block, including:
First determining unit, for for updating the data item described in every, it is determined that it is described update the data item whether indicated it is described User;
Second determining unit, if indicating there is the user for the item that updates the data, it is determined that described update the data what item indicated Action type;
First renewal subelement, for updating the service end user data table based on the action type.
8. device according to claim 7, it is characterised in that the first renewal subelement, including:
Data message identifies determining unit, for determining whether the action type has indicated data message mark;
Data message acquiring unit, for if so, being obtained from service end data logger corresponding with data message mark Data message;
Service end user data table updating block, for updating the service end subscriber based on the action type and data message Tables of data.
9. according to the device described in claim 6-8 any one, it is characterised in that second updating block, including:
Second timestamp determining unit, for determining that the client related to the user that the data renewal request carries is used Second timestamp of user data table, second timestamp be client user's tables of data in every user data item most Maximum time stamp in the timestamp once updated afterwards;
User data item determining unit, for determine update after service end user data table in, last time renewal when Between stamp earlier than second timestamp user data item;
Fresh information generation unit, for generating fresh information corresponding with identified every user data item respectively;
Client user's tables of data updating block, for returning to generated fresh information to the client, in order to described Client updates client user's tables of data using the fresh information, and by user data corresponding to the fresh information The timestamp of the last time renewal of item is defined as the number of users updated in client user's tables of data by the fresh information The timestamp updated according to the last time of item.
10. device according to claim 9, it is characterised in that the data renewal request also carries renewal quantity, described Second updating block also includes:
Selecting unit, for from identified user data item, according to the last time of the user data item update when Between the sequencing that stabs, selection and the renewal quantity identical user data item;
The fresh information generation unit, is specifically used for:Generation renewal corresponding with every selected user data item respectively Information.
CN201711096589.XA 2017-11-09 2017-11-09 Data updating method and device Active CN107741994B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711096589.XA CN107741994B (en) 2017-11-09 2017-11-09 Data updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711096589.XA CN107741994B (en) 2017-11-09 2017-11-09 Data updating method and device

Publications (2)

Publication Number Publication Date
CN107741994A true CN107741994A (en) 2018-02-27
CN107741994B CN107741994B (en) 2021-09-07

Family

ID=61234356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711096589.XA Active CN107741994B (en) 2017-11-09 2017-11-09 Data updating method and device

Country Status (1)

Country Link
CN (1) CN107741994B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067913A (en) * 2018-09-19 2018-12-21 量子云未来(北京)信息科技有限公司 A kind of method and device for maintaining data synchronous
CN111835855A (en) * 2020-07-17 2020-10-27 浪潮软件股份有限公司 Data synchronization method and system
CN112765275A (en) * 2021-01-26 2021-05-07 成都佳发安泰教育科技股份有限公司 Data synchronous exchange method, equipment and medium based on single time coordinate system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8234286B2 (en) * 2009-08-03 2012-07-31 Hon Hai Precision Industry Co., Ltd. Media list server and method for generating favorite media list
CN102904887A (en) * 2012-09-26 2013-01-30 东软集团股份有限公司 Method and system for data synchronization of Web client and server
CN103442042A (en) * 2013-08-14 2013-12-11 福建天晴数码有限公司 Incremental data synchronization method and system
CN103440317A (en) * 2013-08-28 2013-12-11 电子科技大学 Incremental data inquiry method based on database time labels
CN103841004A (en) * 2012-11-26 2014-06-04 腾讯科技(深圳)有限公司 Information display method and information server
CN103916474A (en) * 2014-04-04 2014-07-09 北京搜狗科技发展有限公司 Method, device and system for determining caching time
CN105243067A (en) * 2014-07-07 2016-01-13 北京明略软件系统有限公司 Method and apparatus for realizing real-time increment synchronization of data
US20170099347A1 (en) * 2015-10-02 2017-04-06 Google Inc. Peer-to-peer syncable storage system
CN106648917A (en) * 2016-09-19 2017-05-10 福建天泉教育科技有限公司 Cache data differential updating method and system
CN106649415A (en) * 2015-11-03 2017-05-10 广州市动景计算机科技有限公司 Method and device for detecting updating of data of client terminal
CN106844689A (en) * 2017-01-23 2017-06-13 北京皮尔布莱尼软件有限公司 A kind of paged data synchronous method, apparatus and system
CN107229649A (en) * 2016-03-25 2017-10-03 腾讯科技(深圳)有限公司 Data update system and method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8234286B2 (en) * 2009-08-03 2012-07-31 Hon Hai Precision Industry Co., Ltd. Media list server and method for generating favorite media list
CN102904887A (en) * 2012-09-26 2013-01-30 东软集团股份有限公司 Method and system for data synchronization of Web client and server
CN103841004A (en) * 2012-11-26 2014-06-04 腾讯科技(深圳)有限公司 Information display method and information server
CN103442042A (en) * 2013-08-14 2013-12-11 福建天晴数码有限公司 Incremental data synchronization method and system
CN103440317A (en) * 2013-08-28 2013-12-11 电子科技大学 Incremental data inquiry method based on database time labels
CN103916474A (en) * 2014-04-04 2014-07-09 北京搜狗科技发展有限公司 Method, device and system for determining caching time
CN105243067A (en) * 2014-07-07 2016-01-13 北京明略软件系统有限公司 Method and apparatus for realizing real-time increment synchronization of data
US20170099347A1 (en) * 2015-10-02 2017-04-06 Google Inc. Peer-to-peer syncable storage system
CN106649415A (en) * 2015-11-03 2017-05-10 广州市动景计算机科技有限公司 Method and device for detecting updating of data of client terminal
CN107229649A (en) * 2016-03-25 2017-10-03 腾讯科技(深圳)有限公司 Data update system and method
CN106648917A (en) * 2016-09-19 2017-05-10 福建天泉教育科技有限公司 Cache data differential updating method and system
CN106844689A (en) * 2017-01-23 2017-06-13 北京皮尔布莱尼软件有限公司 A kind of paged data synchronous method, apparatus and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
S. KAMALI 等: "Better Compression through Better List Update Algorithms", 《014 DATA COMPRESSION CONFERENCE》 *
王玉标: "基于Web服务的分布式异构数据库增量同步更新应用研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067913A (en) * 2018-09-19 2018-12-21 量子云未来(北京)信息科技有限公司 A kind of method and device for maintaining data synchronous
CN111835855A (en) * 2020-07-17 2020-10-27 浪潮软件股份有限公司 Data synchronization method and system
CN112765275A (en) * 2021-01-26 2021-05-07 成都佳发安泰教育科技股份有限公司 Data synchronous exchange method, equipment and medium based on single time coordinate system

Also Published As

Publication number Publication date
CN107741994B (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN105450705B (en) Business data processing method and equipment
CN105099761B (en) A kind of method and system of configuration information that managing client concentratedly
CN106886371B (en) Caching data processing method and device
JP6521402B2 (en) Method for updating data table of KeyValue database and apparatus for updating table data
CN109451088A (en) A kind of data access method and device
CN106933836B (en) Data storage method and system based on sub-tables
CN105472045A (en) Database migration method and database migration device
JP2013178677A (en) Distributed processing system, dispatcher, and distributed processing management device
CN107741994A (en) A kind of data-updating method and device
CN105847336A (en) Address book synchronization method and device
CN106021370A (en) Memory database instance management method and device
US11212342B2 (en) Merge trees for collaboration
CN104115142A (en) Device specific folders for bookmarks synchronization
CN109245908A (en) A kind of method and apparatus of principal and subordinate's cluster switching
CN108563697A (en) A kind of data processing method, device and storage medium
EP4050850A1 (en) Service upgrading method, device and system
JP2016212656A (en) Information processor, terminal, system having information processor and terminal, and information processing method and program
CN102325367B (en) Data packet synchronizing device and method for client application
CN110083504B (en) Running state monitoring method and device for distributed tasks
CN104239486B (en) A kind of method of data processing, system and relevant device
CN110489483B (en) Data synchronization method, device, computer equipment and storage medium
CN111478953A (en) Self-construction method, device, system, equipment and storage medium of server cluster
CN107908434A (en) The method for customizing and device of web application items based on multi-tenant
CN110401709A (en) Processing method, device and the storage medium of session in a kind of instant messaging application
CN110798358A (en) Distributed service identification method and device, computer readable medium and electronic equipment

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