CN109189797A - A kind of data-updating method and system - Google Patents

A kind of data-updating method and system Download PDF

Info

Publication number
CN109189797A
CN109189797A CN201811037867.9A CN201811037867A CN109189797A CN 109189797 A CN109189797 A CN 109189797A CN 201811037867 A CN201811037867 A CN 201811037867A CN 109189797 A CN109189797 A CN 109189797A
Authority
CN
China
Prior art keywords
data
target data
distributed
distributed cache
server
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.)
Pending
Application number
CN201811037867.9A
Other languages
Chinese (zh)
Inventor
艾国信
汤文强
周志成
赵鸿楠
宋超
康林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201811037867.9A priority Critical patent/CN109189797A/en
Publication of CN109189797A publication Critical patent/CN109189797A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The present invention provides a kind of methods that data update, comprising: when there are when data update, generating target data in Relational DBMS;Distributed cache system receives the target data that Relational DBMS is sent, and caches;Server obtains target data from distributed cache system, and is added in local cache.The data-updating method provided through the embodiment of the present invention, server actively obtains target data from distributed cache system, without according to prefixed time interval poll relational data management system, to can reduce server to the access pressure of Relational DBMS.

Description

A kind of data-updating method and system
Technical field
The present invention relates to technical field of data processing, more particularly to a kind of data-updating method and system.
Background technique
Target authentication system is mainly that corporate user provides certification, judges the permission of user.Mobile terminal calling is recognized at present Card interface authenticates the permission of user, and most user is unverified user, so authentication interface increases this Ground caches, and storing all certification user identity in local cache proves, when user is in local cache, then directly by recognizing Card.
During updating local cache, Servers-all timing loads all from Relational DBMS Data are stored into local cache, since server is excessive and determines the data in Relational DBMS When obtain, therefore it is frequent to the access of Relational DBMS, so as to cause the visit of Relational DBMS Ask that pressure is excessive.
Summary of the invention
The present invention provides a kind of data-updating method and systems, to solve the acquisition pair of data existing in the prior art The problem that Relational DBMS causes access pressure big.
To solve the above-mentioned problems, the invention discloses a kind of data-updating methods, which comprises when relationship type number According to there are when data update, generating target data in base management system;Distributed cache system receives the relevant database The target data that management system is sent, and cache;Described in determining and be cached in the distributed cache system when server When target data, the target data is obtained from the distributed cache system, and be added in local cache.
Preferably, described when there are generate target data when data update in Relational DBMS It include: when, there are when data update, the data according to update generate data logging in Relational DBMS;According to institute It states data logging and obtains target data.
Preferably, the distributed cache system receives the number of targets that the Relational DBMS is sent According to, and the step of caching includes: that the distributed cache system receives the described of the Relational DBMS transmission Target data;The distributed cache system judges whether the target data arranges with the data in the distributed cache system Table matching;If so, caching the target data.
Preferably, the target that the Relational DBMS is sent is received in the distributed cache system Data, and after the step of caching, the method also includes: distributed coordination system changes nodal value, wherein the distribution The nodal value of coordination system indicates that the distributed cache system whether there is target data;It is described described point determining when server When being cached with the target data in cloth caching system, the target data is obtained from the distributed cache system, and add Add to the step in local cache, comprising: when the nodal value that the server listens to the distributed coordination system is modified When, it determines and is cached with the target data in the distributed cache system;Described in being obtained from the distributed cache system Target data, and be added in local cache.
The invention also discloses a kind of data update system, the system comprises: Relational DBMS, distribution Formula caching system and server;The Relational DBMS, for generating number of targets when there are data update According to;The distributed cache system, the target data sent for receiving the Relational DBMS, and delay It deposits;The server, for when determine be cached with the target data in the distributed cache system when, from the distribution Caching system obtains the target data, and is added in local cache.
Preferably, the Relational DBMS is specifically used for: when there are data update, according to the number updated According to generation data logging;Target data is obtained according to the data logging.
Preferably, the distributed cache system is specifically used for: receiving what the Relational DBMS was sent The target data;Judge whether the target data matches with the data list in the distributed cache system;If so, slow Deposit the target data.
Preferably, the data update system further includes distributed coordination system: distributed coordination system is used for described After distributed cache system receives the target data that the Relational DBMS is sent and caches, change section Point value, wherein the nodal value of the distributed coordination system indicates that the distributed cache system whether there is target data;Institute It states server to be specifically used for: when the nodal value for listening to the distributed coordination system is modified, determine described distributed slow The target data is cached in deposit system;The target data is obtained from the distributed cache system, and is added to this In ground caching.
Compared with prior art, the invention has the following advantages that
The data-updating method provided through the embodiment of the present invention, when there are data in Relational DBMS more When new, target data is generated;Distributed cache system receives the target data that Relational DBMS is sent, and delays It deposits;When server, which determines, is cached with target data in distributed cache system, number of targets is obtained from distributed cache system According to and be added in local cache.Data-updating method provided in an embodiment of the present invention, server are determining distributed caching system After being cached with target data in system, then target data is actively obtained from distributed cache system, without according between preset time Every poll relational data management system, it not only can reduce server and may be used also to the access pressure of Relational DBMS To mitigate the access load of server.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of data-updating method of the embodiment of the present invention one;
Fig. 2 is a kind of step flow chart of data-updating method of the embodiment of the present invention two;
Fig. 3 is a kind of structural block diagram of data update system of the embodiment of the present invention three.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Embodiment one
Referring to Fig.1, a kind of step flow chart of data-updating method of the embodiment of the present invention one is shown.
Data-updating method provided in an embodiment of the present invention the following steps are included:
Step 101: when there are when data update, generating target data in Relational DBMS.
More new data may include: newly added data and legacy data make an amendment after data.Wherein, newly added number According to user information generated when can be new user in Verification System and complete certification, the data after legacy data is made an amendment can Think and has authenticated the modified user information of user.
Step 102: distributed cache system receives the target data that Relational DBMS is sent, and caches.
When Relational DBMS has more new data, the target data of update is sent to distributed caching System, distributed cache system cache target data.
Distributed cache system is one distributed, and the distributed application program coordination service of open source code, it is one A to provide the software of Consistency service for Distributed Application, the function of providing includes: configuring maintenance, domain name service, distributed same Step, group service etc..
It is similar to the problem of restarting of server since distributed cache system is not present, uses distributed caching system Unite caching of target data, can to avoid restarting because of distributed cache system caused by target data loss the problem of.
Step 103: when server, which determines, is cached with target data in distributed cache system, from distributed cache system Target data is obtained, and is added in local cache.
During specific implementation, a kind of server determines the side that target data whether is cached in distributed cache system Formula are as follows: it is slow that distributed cache system sends target data after having cached target data, to the corresponding server of the target data Completion notice is deposited, server can determine according to the notice received is cached with target data in distributed cache system.
It is another are as follows: server monitors in distributed cache system whether be cached with target data.
When server, which determines, is cached with target data in distributed cache system, actively obtained from distributed cache system Target data is taken, when server gets target data, target data is added for a corresponding local cache under each server Into local cache.The data-updating method provided through the embodiment of the present invention, when existing in Relational DBMS When data update, target data is generated;Distributed cache system receives the target data that Relational DBMS is sent And it caches;When server, which determines, is cached with target data in distributed cache system, mesh is obtained from distributed cache system Mark data are simultaneously added in local cache.Data-updating method provided in an embodiment of the present invention, server are determining distributed delay After being cached with target data in deposit system, then actively target data is obtained from distributed cache system, without according to it is default when Between be spaced poll relational data management system, not only can reduce server to the access pressure of Relational DBMS The access load of server can also be mitigated.Embodiment two
Referring to Fig. 2, a kind of step flow chart of data-updating method of the embodiment of the present invention two is shown.
Data-updating method provided in an embodiment of the present invention the following steps are included:
Step 201: when, there are when data update, the data according to update generate data in Relational DBMS Log.
When Relational DBMS is there are when data update, Relational DBMS can be according to update Data generate data logging.Data logging is the record file or file set for recording system operatio event, has processing The important function such as historical data, the tracking for diagnosing problem and the activity for understanding system.
Server needs each data in timer access Relational DBMS in the prior art, is updated with obtaining Data.Server can be determined whether it is according to data each in the Relational DBMS corresponding generation time The data of update, if the data corresponding generation time before server before access relational database management system, It can determine the data of itself and non-update;Conversely, if data corresponding generation time access relation type data before server After base management system, then it can determine that it is the data updated.Server timer access relational data depositary management in the prior art Each data in reason system when obtaining the data of update, exist and update the incomplete problem of data acquisition.Such as server can Every the Relational DBMS of access in one minute, if server may in one minute when once being accessed It can not access to data all in Relational DBMS, finally will be unable to obtain whole more new datas.And When Relational DBMS is there are when data update in this step, the data of direct basis update generate data logging, Target data is obtained according to data logging, final goal data are buffered into distributed cache system, and server determines distribution , can be directly against the target complete data of the acquisition caching of property when being cached with target data in formula caching system, therefore can keep away Exempt from server and obtains the problem of updating data transformation.
Step 202: target data is obtained according to data logging.
Corresponding data logging is read by the reading manner of Relational DBMS, and data logging is sent Into message queue, message queue can be fully processed data progress persistent storage until them, therefore will count It is sent in message queue according to log, it can be to avoid the risk of loss of data.
Specifically, Relational DBMS data logging generated, effect are for recording relational data Additions and deletions, which change, inside base management system looks into, and has the record of the content of update to Relational DBMS, is based on relationship type The reading manner of data base management system determines position of the data in Relational DBMS according to data logging, And the data at the position are obtained as target data.
Step 203: distributed cache system receives the target data that Relational DBMS is sent.
Step 204: distributed cache system judge target data whether with the data list in distributed cache system Match.
Judge whether target data matches with the data list in distributed cache system, due to working as relational data depositary management When the data of reason system update, the data of caching required for the data of update not necessarily server, it is therefore desirable to according to Data list in distributed cache system judges whether target data is the data cached required for the local cache of server.
Specifically, include each mark for needing data in data list, the mark of each target data is arranged with data respectively Each mark in table is matched, and upon a match, will be identified consistent target data and is determined as and the matched data of data list.
Such as: as the UID (user identification, user's identification) for being identified as user information in data list When, then judge identifying whether as UID for each target data, if so, the target data be determined as it is matched with data list Data.
Step 205: if so, caching the target data.
If target data is matched with the data list in distributed cache system, distributed cache system is by caching relation type The target data that data base management system is sent.
It should be noted that target data is at least one, when target data is multiple, respectively by each target data Mark matched with the mark of data list, the target data of successful match is cached, when target data be one When, the mark of the target data is matched with the mark in data list only, works as successful match, by the target data It is cached.
Step 206: distributed coordination system changes nodal value.
Wherein, the nodal value instruction distributed cache system of distributed coordination system whether there is target data.
Distributed coordination system is used to judge in distributed cache system with the presence or absence of target data.When monitoring distribution Caching system then changes the nodal value of distributed coordination system there are when target data.Such as: distributed coordination system can supervise It measures in distributed cache system there are when target data, nodal value is changed to 1, when monitoring in distributed cache system not There are when target data, nodal value is changed to 0.Specifically, when server obtains target data from distributed cache system After taking, distributed cache system can delete the target data cached, and correspondingly, distributed coordination system will monitor to be distributed No longer there is target data in formula caching system.
Distributed cache system is one distributed, and the distributed application program coordination service of open source code, it is one A to provide the software of Consistency service for Distributed Application, the function of providing includes: configuring maintenance, domain name service, distributed same Step, group service etc..
Step 207: when the nodal value that server listens to distributed coordination system is modified, determining distributed caching system Target data is cached in system;Target data is obtained from distributed cache system, and is added in local cache.
When the nodal value that server listens to distributed coordination system is modified, then show to deposit in distributed cache system It in the target data of update, is updated so that it is determined that the data of Relational DBMS exist, server is slow from distribution Target data is obtained in deposit system, and is added in local cache.
The data-updating method provided through the embodiment of the present invention, except with data-updating method shown in embodiment one Outside possessed beneficial effect, whether server can also be altered to confirm by judging the nodal value of distributed coordination system It whether there is target data in distributed cache system, can be avoided server and blindly access distributed cache system to distribution Caching system can reduce the accessed pressure of distributed cache system.
Embodiment three
Referring to Fig. 3, a kind of structural block diagram of data update system of the offer of the embodiment of the present invention three is shown.
Data update system provided in an embodiment of the present invention includes: Relational DBMS 301, distributed caching System 302 and server 303.
The Relational DBMS 301, for generating target data when there are data update;Described point Cloth caching system 302, for receiving the target data of the Relational DBMS transmission and caching;It is described Server 303, for delaying from the distribution when server determines and is cached with the target data in distributed cache system Deposit system obtains the target data, and is added in local cache.
Preferably, the Relational DBMS 301 is specifically used for: when there are data update, according to update Data generate data logging;Target data is obtained according to the data logging.
Preferably, the distributed cache system 302 is specifically used for: receiving the Relational DBMS 301 The target data sent;Judge whether the target data matches with the data list in the distributed cache system; If so, caching the target data.
Preferably, the data update system further includes distributed coordination system 304, and distributed coordination system 304 is used for The target data that the Relational DBMS is sent is received in the distributed cache system 302, and is cached Later, nodal value is changed, wherein the nodal value of the distributed coordination system indicates that the distributed cache system whether there is Target data;The server 303 is specifically used for: when the nodal value for listening to the distributed coordination system is modified, really It is cached with the target data in the fixed distributed cache system, the number of targets is obtained from the distributed cache system According to, and be added in local cache.
The data update system provided through the embodiment of the present invention, when there are data in Relational DBMS more When new, target data is generated;Distributed cache system receives the target data that Relational DBMS is sent, and delays It deposits;Target data is sent to server by distributed cache system;Target data is added in local cache by server.Pass through Data update system provided in an embodiment of the present invention, after server is cached with target data in determining distributed cache system, Target data is actively obtained from distributed cache system again, without according to prefixed time interval poll relational data management system It is negative not only to can reduce the access that server can also mitigate server to the access pressure of Relational DBMS for system Lotus.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.For system embodiment For, since it is basically similar to the method embodiment, so being described relatively simple, referring to the portion of embodiment of the method in place of correlation It defends oneself bright.
Above to a kind of data-updating method provided by the present invention and system, it is described in detail, it is used herein A specific example illustrates the principle and implementation of the invention, and the above embodiments are only used to help understand Method and its core concept of the invention;At the same time, for those skilled in the art is having according to the thought of the present invention There will be changes in body embodiment and application range, in conclusion the content of the present specification should not be construed as to the present invention Limitation.

Claims (8)

1. a kind of data-updating method, which is characterized in that the described method includes:
When there are when data update, generating target data in Relational DBMS;
Distributed cache system receives the target data that the Relational DBMS is sent, and caches;
When server, which determines, is cached with the target data in the distributed cache system, from the distributed cache system The target data is obtained, and is added in local cache.
2. the method according to claim 1, wherein described when there are data in Relational DBMS When update, generate target data the step of include:
When, there are when data update, the data according to update generate data logging in Relational DBMS;
Target data is obtained according to the data logging.
3. the method according to claim 1, wherein the distributed cache system receives the relational data The target data that base management system is sent, and the step of caching includes:
The distributed cache system receives the target data that the Relational DBMS is sent;
The distributed cache system judge the target data whether with the data list in the distributed cache system Match;
If so, caching the target data.
4. the method according to claim 1, wherein receiving the relationship type number in the distributed cache system According to the target data that base management system is sent, and after the step of caching, the method also includes:
Distributed coordination system changes nodal value, wherein the nodal value instruction of the distributed coordination system is described distributed slow Deposit system whether there is target data;
When server, which determines, is cached with the target data in the distributed cache system, from the distributed cache system The target data is obtained, and is added to the step in local cache, comprising:
When the nodal value that the server listens to the distributed coordination system is modified, the distributed caching system is determined System is cached with the target data;
The server obtains the target data from the distributed cache system, and is added in local cache.
5. a kind of data update system, which is characterized in that the system comprises: Relational DBMS, distribution are slow Deposit system and server;
The Relational DBMS, for generating target data when there are data update;
The distributed cache system, the target data sent for receiving the Relational DBMS, and Caching;
The server, for when determine be cached with the target data in the distributed cache system when, from the distribution Formula caching system obtains the target data, and is added in local cache.
6. system according to claim 5, which is characterized in that the Relational DBMS is specifically used for: when There are when data update, data logging is generated according to the data updated;
Target data is obtained according to the data logging.
7. system according to claim 5, which is characterized in that the distributed cache system is specifically used for:
Receive the target data that the Relational DBMS is sent;Judge the target data whether with it is described Data list matching in distributed cache system;If so, caching the target data.
8. system according to claim 5, which is characterized in that the data update system further includes distributed coordination system System:
Distributed coordination system is used to receive what the Relational DBMS was sent in the distributed cache system The target data, and after caching, change nodal value, wherein described point of the nodal value instruction of the distributed coordination system Cloth caching system whether there is target data.
The server is specifically used for: when the node for listening to the distributed coordination system is modified, determining the distribution The target data is cached in formula caching system;The target data is obtained from the distributed cache system, and is added Into local cache.
CN201811037867.9A 2018-09-06 2018-09-06 A kind of data-updating method and system Pending CN109189797A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811037867.9A CN109189797A (en) 2018-09-06 2018-09-06 A kind of data-updating method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811037867.9A CN109189797A (en) 2018-09-06 2018-09-06 A kind of data-updating method and system

Publications (1)

Publication Number Publication Date
CN109189797A true CN109189797A (en) 2019-01-11

Family

ID=64915099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811037867.9A Pending CN109189797A (en) 2018-09-06 2018-09-06 A kind of data-updating method and system

Country Status (1)

Country Link
CN (1) CN109189797A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119409A (en) * 2019-05-23 2019-08-13 武汉神算云信息科技有限责任公司 Cache design method, device, equipment and storage medium in Distributed Application
CN111259031A (en) * 2020-01-16 2020-06-09 上海米哈游天命科技有限公司 Data updating method, device, equipment and storage medium
CN112835870A (en) * 2021-01-28 2021-05-25 山东浪潮通软信息科技有限公司 Content caching method and system based on user permission
CN113901141A (en) * 2021-10-11 2022-01-07 京信数据科技有限公司 Distributed data synchronization method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140317359A1 (en) * 2013-04-17 2014-10-23 International Business Machines Corporation Clustered file system caching
CN105335170A (en) * 2014-06-05 2016-02-17 阿里巴巴集团控股有限公司 Distributed system and incremental data updating method
CN106021468A (en) * 2016-05-17 2016-10-12 上海携程商务有限公司 Updating method and system for distributed caches and local caches
CN107315761A (en) * 2017-04-17 2017-11-03 阿里巴巴集团控股有限公司 A kind of data-updating method, data query method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140317359A1 (en) * 2013-04-17 2014-10-23 International Business Machines Corporation Clustered file system caching
CN105335170A (en) * 2014-06-05 2016-02-17 阿里巴巴集团控股有限公司 Distributed system and incremental data updating method
CN106021468A (en) * 2016-05-17 2016-10-12 上海携程商务有限公司 Updating method and system for distributed caches and local caches
CN107315761A (en) * 2017-04-17 2017-11-03 阿里巴巴集团控股有限公司 A kind of data-updating method, data query method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119409A (en) * 2019-05-23 2019-08-13 武汉神算云信息科技有限责任公司 Cache design method, device, equipment and storage medium in Distributed Application
CN111259031A (en) * 2020-01-16 2020-06-09 上海米哈游天命科技有限公司 Data updating method, device, equipment and storage medium
CN112835870A (en) * 2021-01-28 2021-05-25 山东浪潮通软信息科技有限公司 Content caching method and system based on user permission
CN112835870B (en) * 2021-01-28 2023-01-24 浪潮通用软件有限公司 Content caching method and system based on user permission
CN113901141A (en) * 2021-10-11 2022-01-07 京信数据科技有限公司 Distributed data synchronization method and system
CN113901141B (en) * 2021-10-11 2022-08-05 京信数据科技有限公司 Distributed data synchronization method and system

Similar Documents

Publication Publication Date Title
CN109189797A (en) A kind of data-updating method and system
CN109460349B (en) Test case generation method and device based on log
US9002811B2 (en) System, method and program for information processing
US10275347B2 (en) System, method and computer program product for managing caches
KR101876674B1 (en) Method of managing common account using block chain and system performing the same
CN101557427A (en) Method for providing diffluent information and realizing the diffluence of clients, system and server thereof
CN110096517A (en) Data cached monitoring method, device and system based on distributed system
CN106874281A (en) Realize the method and apparatus that data base read-write is separate
CN109981627B (en) Method and system for updating network threat information
CN108710801B (en) A kind of behavior management-control method of mobile application dynamically load code
CN110147684A (en) For realizing the method and apparatus of block chain data-privacy protection
CN106372266A (en) Cache and accessing method of cloud operation system based on aspects and configuration documents
WO2012044214A1 (en) Method and arrangement for processing data
JP2012146083A (en) Session management system, session management apparatus, server device and session management method
CN106021566A (en) Method, device and system for improving concurrent processing capacity of single database
CN107241300A (en) The hold-up interception method and device of user's request
WO2022206439A1 (en) Method and apparatus for providing cross-chain message
JP2019503021A (en) System environment and user behavior analysis based self-defense security device and its operation method
CN113760976A (en) Service processing method, device, equipment and storage medium
CN103595761B (en) Data processing method based on distributed file system and server
US7480651B1 (en) System and method for notification of group membership changes in a directory service
CN103377292B (en) Database result set caching method and device
CN104461929A (en) Distributed type data caching method based on interceptor
CN105812189B (en) A kind of information processing method and server
CN107066877A (en) A kind of permission modification method and system of transaction system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190111