CN101188566B - A method and system for data buffering and synchronization under cluster environment - Google Patents

A method and system for data buffering and synchronization under cluster environment Download PDF

Info

Publication number
CN101188566B
CN101188566B CN2007101948730A CN200710194873A CN101188566B CN 101188566 B CN101188566 B CN 101188566B CN 2007101948730 A CN2007101948730 A CN 2007101948730A CN 200710194873 A CN200710194873 A CN 200710194873A CN 101188566 B CN101188566 B CN 101188566B
Authority
CN
China
Prior art keywords
server node
cache object
message body
cache
order parameter
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.)
Expired - Fee Related
Application number
CN2007101948730A
Other languages
Chinese (zh)
Other versions
CN101188566A (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.)
Neusoft Medical Systems Co Ltd
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN2007101948730A priority Critical patent/CN101188566B/en
Publication of CN101188566A publication Critical patent/CN101188566A/en
Application granted granted Critical
Publication of CN101188566B publication Critical patent/CN101188566B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a cluster environment data caching synchronous method, including the steps that a storage queue is created in server nodes; when caching object in one server node is updated successfully, method name and ordered parameter list table for updating of the caching object are positioned in the queue waiting to be sent; the queue waiting to be sent is checked according to preset time threshold, and method name and ordered parameter list table for updating of the caching object in the queue are packaged into a message body; the packaged message body is sent to all other sever nodes that subscibe the packaged message body; after the other server nodes receive the packaged message body, the method name and the ordered parameter list table are acquired from the packaged message body; The corresponding caching object updating method is matched in the local sever nodes according to the method name and the ordered parameter list table; and the caching object updating method after matching is implemented to update the caching object of the local sever nodes. The caching updating efficiency is enhanced and the network resource and the computer system resource are saved.

Description

The synchronous method and system of metadata cache under a kind of cluster environment
Technical field
The present invention relates to the database application technology, particularly relate to the synchronous method and system of metadata cache under a kind of cluster environment.
Background technology
In database application system, in order to satisfy the performance requirement of large-scale application, in the service end of application system two kinds of technical solutions are arranged usually: Clustering and caching technology.Wherein, described Clustering is to make alone server realize being connected on physics and the program, and works in coordination with communication between server, so that they can carry out common task; Even a certain station server is out of service, the emergent process of fault can be automatically be transferred to another station server with the operating load of this server, to guarantee to provide continual service.Therefore, Clustering can be by the computing capability of multiple servers parallel computation elevator system.In order to improve the response speed of system, in application, introduce caching technology usually.Described caching technology is meant by utilizing existing result, avoids double counting, reduces the pressure of system comprehensively.When the different server node of an application deployment under cluster environment, each server node only is responsible for safeguarding the cache object in the local Java Virtual Machine.Be easy to cause the cache object version under the different server node inconsistent like this, thereby the data that cause the user to ask are expired useless data.
In order to solve the inconsistent problem of cache object version under the cluster environment, thereby normally notify other node updates local cache to reach synchronous purpose by the mechanism of broadcast.
In the prior art, the synchronous method of buffer memory mainly contains following two kinds under the cluster environment:
One, broadcast makes the data cached invalid of other node.
With reference to Fig. 1, when the object of buffer memory changes under being arranged in certain server node of cluster, this server node will send message informing, and all subscribe to other server node of this message, after other server node receives this message, with the object that empties in the local cache zone, when object in the corresponding cache region territory is visited in request once more,, will reload data from the backstage automatically and to buffer memory, guarantee that buffer memory is synchronous if there is not this object in the buffer memory.Adopt this kind method mainly to have following problem separately:
1, just upgrade one or more cache objects of buffer zone under a lot of situations, the cache object granularity that is updated is also very little.And other server node receives and can inquire about latest data again from database after the message and upgrade whole buffer zone, when the object of buffer zone very for a long time, can consume very much performance, the waste resource for computer system.
2, when the frequency of buffer update is higher, other server node can receive a lot of message, suppose to carry out to inquire about for N time and obtain latest data from database and upgrade whole buffer zone, then N-1 time inquiry all is unnecessary this moment of before, also is a waste greatly for resource for computer system therefore.
Two, the cache object that appendix will upgrade in message body.
With reference to Fig. 2, when the object that is arranged in certain server node buffer memory of cluster changes, this station server notifies all to subscribe to other server node of this message body on message body the cache object appendix that is updated, after other server node received this message body, the cache object that is updated of obtaining appendix from message body upgraded local buffer zone.Adopt the method mainly to have following problem separately:
1, when the cache object granularity that is updated was big, cache object was transmitted in message body by appendix, can have a strong impact on the network bandwidth, and the waste Internet resources cause performance low.
2, when the frequency of message transmission was higher, broadcast that can be a large amount of can cause network blockage under the serious situation, has wasted Internet resources greatly.
In sum, adopt every kind of prior art scheme to solve the buffer memory stationary problem separately, all fail well to solve simultaneously the various shortcomings of its existence.
Summary of the invention
Technical problem to be solved by this invention provides the synchronous method and system of metadata cache under a kind of cluster environment, improves buffer efficiency, saves resource for computer system and Internet resources.
Under cluster environment, the web application code that each server node is disposed is basic identical, thereby guaranteed that the interface of renewal buffer memory in each server node and the code that interface is realized thereof are in full accord, for example, the buffering updating method that exists at some server nodes also certainly exists at other server node.
Based on the above-mentioned fact, in order to address the above problem, the invention discloses the synchronous method of metadata cache under a kind of cluster environment, the web application code that each server node under the cluster environment is disposed is identical, the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described method comprises:
After the cache object of certain server node upgrades successfully, method name and the order parameter tabulation of upgrading this cache object is packaged into message body;
The packetizes messages body is sent to other server node that all subscribe to described packetizes messages body;
After other server node receives described packetizes messages body, from described packetizes messages body, obtain the tabulation of described method name and order parameter;
Tabulate in the corresponding cache object update method of home server node matching according to described method name and order parameter;
Carry out cache object update method after the described coupling and upgrade the cache object of home server node.
The invention also discloses the synchronous method of metadata cache under the another kind of cluster environment, the web application code that each server node under the cluster environment is disposed is identical, the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described method comprises:
In server node, create storage queue;
After the cache object of certain server node upgrades successfully, place described formation medium to be sent method name and the order parameter tabulation of upgrading this cache object;
Check formation to be sent by the preset time threshold value, method name and the order parameter tabulation of upgrading cache object in the formation is packaged into message body;
The packetizes messages body is sent to other server node that all subscribe to described packetizes messages body;
After other server node receives described packetizes messages body, from described packetizes messages body, obtain the tabulation of described method name and order parameter;
Tabulate in the corresponding cache object update method of home server node matching according to described method name and order parameter;
Carry out cache object update method after the described coupling and upgrade the cache object of home server node.
Wherein, the concrete steps of aforementioned two kinds of described coupling buffering updating methods of method are:
Obtain all methods of the same name in the cache interface according to the method name;
According to the described whole methods of the same name of order parameter list traversal;
The buffering updating method that the type that gets parms is mated fully.
Further, after the cache object of certain server node upgrades successfully, also comprise:
Need to judge whether the cache object of other server node synchronously.
Further, also comprise:
Judge whether all message bodies that sent are successfully handled.
Wherein, the specific implementation process of described judgement is:
With after upgrading the method name of cache object and order parameter tabulation and being packaged into message body, generate message body ID;
After the success synchronously of the cache object of server node with the state information of described packetizes messages body and described message body ID corresponding stored in database;
Inquire about the state information that described database obtains message body according to described message body ID according to the time interval of presetting;
Judge whether message body is successfully handled by other Servers-all node in the cluster;
Again send described processing failure body to other Servers-all node, finish the synchronous renewal of other Servers-all nodal cache object;
If other server node has all been handled success then has been deleted the Message Record of successfully having been handled in the described database.
The invention also discloses the synchronous system of metadata cache under a kind of cluster environment, the web application code that each server node under the cluster environment is disposed is identical, the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described system comprises:
Packaged unit, the method name and the order parameter tabulation that are used for upgrading cache object are packaged into message body;
Transmitting element is used for the packetizes messages body is sent to other server node;
Acquiring unit is used for obtaining method name and the order parameter tabulation of upgrading cache object from message body;
Matching unit is used for according to the method name and the corresponding buffering updating method of order parameter list match that upgrade cache object;
Updating block is used to carry out the cache object that cache object update method after the coupling is upgraded the home server node.
The invention also discloses the synchronous system of metadata cache under the another kind of cluster environment, the web application code that each server node under the cluster environment is disposed is identical, the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described system comprises:
The formation creating unit is used for creating storage queue at server node;
Insert the unit, the method name and the order parameter tabulation that are used for upgrading cache object place described formation;
Packaged unit is used for the method name and the order parameter tabulation of formation renewal cache object are packaged into message body;
Transmitting element is used for the packetizes messages body is sent to other server node;
Acquiring unit is used for obtaining method name and the order parameter tabulation of upgrading cache object from message body;
Matching unit is used for according to the method name and the corresponding buffering updating method of order parameter list match that upgrade cache object;
Updating block is used to carry out the cache object that cache object update method after the coupling is upgraded the home server node.
Wherein, aforementioned two kinds of described matching units of system comprise:
First acquiring unit is used for obtaining according to the method name all methods of the same name of cache interface;
The traversal unit is used for according to the described whole methods of the same name of order parameter list traversal;
Second acquisition unit is used to obtain the buffering updating method that mates fully with parameter type.
Further, also comprise:
First judging unit is used to judge whether the needs cache object of other server node synchronously.
Further, also comprise:
Second judging unit is used to judge whether all message bodies that sent are successfully handled.
Wherein, described second judging unit comprises:
The ID generation unit is used for generating message body ID after the tabulation of method name and order parameter is packaged into message body;
Memory cell is used for after the success synchronously of the cache object of server node, with the state information of message body and message body ID corresponding stored in database;
The 3rd acquiring unit is used for obtaining the state information of message body according to message body ID Query Database;
The 3rd judging unit is used for judging whether message body is successfully handled by other Servers-all node of cluster;
Updating block is sent in repeating transmission, if having any server node successfully to handle then resend described processing failure body, finishes the synchronous renewal of other Servers-all nodal cache object;
Delete cells is used for the Message Record that delete database has successfully been handled by other Servers-all node.
Compared with prior art, the present invention has the following advantages:
The present invention will upgrade each side's religious name of cache object and order parameter tabulation appendix and send to all receiving terminals of subscribing to this message body handle on message body, and other server node will be carried out the synchronous renewal that identical method is carried out buffer memory after receiving message body.Meeting of the present invention takes to be fit to the different buffering updating methods of concrete application scenarios according to the method name decision of upgrading buffer memory, has given full play to the advantage of various buffering updating methods.
Simultaneously, at every turn all can broadcast in the prior art and influence the performance of Network Transmission to the renewal of cache object, the waste Internet resources, the present invention is by being provided with storage queue, every interval regular time section, and the method name of automatically in the formation all being upgraded cache objects is packaged in the message body, be sent to other server node again, can reduce the frequency that message sends greatly, thereby Internet resources and computer resource have been saved in the very big lifting that brings performance.
Description of drawings
Fig. 1 is the invalid schematic diagram of cache object that broadcast makes other node in the prior art;
Fig. 2 is the schematic diagram that appendix will upgrade in message body in the prior art cache object upgrades;
Fig. 3 is the synchronous schematic diagram of cache object of the present invention;
Fig. 4 is the flow chart of metadata cache method for synchronous first embodiment under a kind of cluster environment of the present invention;
Fig. 5 is the flow chart of metadata cache method for synchronous second embodiment under a kind of cluster environment of the present invention;
Fig. 6 is the flow chart that mates the buffering updating method detailed step described in Fig. 5 in the step 507;
Fig. 7 is the flow chart of determining step among metadata cache method for synchronous second embodiment under a kind of cluster environment of the present invention;
Fig. 8 is the structured flowchart of metadata cache synchro system first embodiment under a kind of cluster environment of the present invention.
Embodiment
Under cluster environment, the web application code that each server node is disposed is basic identical, thereby guaranteed that the interface of renewal buffer memory in each server node and the code that interface is realized thereof are in full accord, for example, the buffering updating method that exists at some server nodes also certainly exists at other server node.
Based on the above-mentioned fact, with reference to Fig. 3, core concept of the present invention is: when the cache object of certain server node changes, judge whether the needs cache object of other server node synchronously according to the buffer memory synchronization policy.If desired, described server node will upgrade the method name of cache object and order parameter tabulation packing and appendix be sent to other server node that all subscribe to this message body on message body.After other server node receives described message body, from message body, obtain the method name and the order parameter tabulation of described renewal cache object, the method that coupling is obtained in tabulation from this locality according to described method name and order parameter is upgraded the cache object of home server node again, reaches the synchronous purpose of buffer memory.
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
With reference to Fig. 4, show the flow chart of metadata cache method for synchronous first embodiment under a kind of cluster environment of the present invention, comprise step:
Step 401, after the cache object of certain server node upgrades successfully, method name and the order parameter tabulation of upgrading this cache object is packaged into message body.
Step 402, the packetizes messages body is sent to other server node that all subscribe to described packetizes messages body.
After step 403, other server node receive described packetizes messages body, from described packetizes messages body, obtain the tabulation of described method name and order parameter;
After other server node receives appendix that described server node sends the message body of the method name of upgrading cache object and order parameter tabulation is arranged, from message body, obtain method name and the order parameter tabulation of upgrading cache object.
Step 404, according to the tabulation of described method name and order parameter in the corresponding cache object update method of home server node matching;
Cache object update method after step 405, the described coupling of execution is upgraded the cache object of home server node.
With reference to Fig. 5, show the flow chart of metadata cache method for synchronous second embodiment under a kind of cluster environment of the present invention, comprise step:
Step 501, in server node, create storage queue, enter step 503.
Step 503, after the cache object of certain server node upgrades successfully, place described formation medium to be sent the method name of described renewal cache object and order parameter tabulation.
Embodiment of the present invention adopts AOP (Aspect-oriented programming) technology to tackle all methods that cache object is upgraded pellucidly, places formation medium to be sent to other server node method name and the order parameter tabulation of upgrading cache object.
Further, between step 501 and step 503, can also comprise step 502, judge whether the needs cache object of other server node synchronously.
When the cache object of certain server node changes, judge whether the needs cache object of other server node synchronously according to the buffer memory synchronization policy.The purpose that increases step 502 is to send the performance loss of bringing for fear of unnecessary messages, improves utilization rate of network resource.
Usually, web application can be when application server starts the object in the initialization book server nodal cache zone.And prior art generally can not dispose any self-defining buffer memory synchronization policy, also can broadcast carry out buffer update this moment, but the process that application server starts is exactly the process of local cache area synchronized in fact, it is not the renewal of carrying out the cache object that any concrete business operation causes, therefore this moment, broadcast was carried out the meaningless and great performance that influences program of meeting of buffer update, even may cause severely subnormal.Therefore, whether the buffer memory synchronization policy that preferably adopts of embodiment of the present invention is to use to have started according to WEB to determine whether that needs carry out buffer update and avoid unnecessary messages to send performance loss and the waste of network resources of bringing.
Step 504, check formation to be sent, method name and the order parameter tabulation of upgrading cache object in the formation is packaged into message body by the preset time threshold value.
Described time threshold can preestablish according to actual needs, can be 1s, 10s, 30s, 60s or the like, and the present invention does not limit this.
All can send message to the renewal of cache object in the prior art at every turn and influence the performance of Network Transmission.Embodiment of the present invention is by creating a formation, and every interval regular time section is packaged in the method name of all the renewal cache objects in the formation in the message body automatically, is sent to other server node again.Can reduce the frequency that message sends greatly by described mechanism, save Internet resources and computer resource, thereby brought the lifting of performance.
Step 505, the packetizes messages body is sent to other server node that all subscribe to described message, enters step 506.
Step 506, the method name of from message body, obtaining the renewal cache object and order parameter tabulation.
After other server node receives appendix that described server node sends the message body of the method name of upgrading cache object and order parameter tabulation is arranged, from message body, obtain method name and the order parameter tabulation of upgrading cache object.
Step 507, according to the method name of upgrading cache object and order parameter tabulation at the corresponding buffering updating method of home server node matching.
Buffering updating method after step 508, the described coupling of execution upgrades the cache object of home server node.
With reference to Fig. 6, show the flow chart of the buffering updating method of coupling described in the step 507 detailed step, comprising:
Step 5071, obtain all methods of the same name in the cache interface according to the method name.
From message body, after the tabulation of acquisition methods name and order parameter, obtain all methods of the same name in the cache interface according to the method name.
Step 5072, according to the described whole methods of the same name of order parameter list traversal.
The buffering updating method that step 5073, the type that gets parms are mated fully.
Embodiment of the present invention upgrades all methods of cache object by interception, and will upgrade the method name of cache object and order parameter tabulation appendix and on message body, send to all receiving terminals of subscribing to this message and handle, other server node receives after the message method of carrying out coupling at the home server node and upgrades cache object.The embodiment of the invention is taked " reloading the Data Update cache object from database automatically " or " cache object that appendix will upgrade message body upgrades buffer memory " or other update method according to the method decision of upgrading buffer memory.Select suitable method to upgrade cache object according to concrete application scenarios, rather than the fixing separately a certain method of employing is upgraded cache object, give full play to the advantage of the whole bag of tricks, improved the cache object updating efficiency, saved Internet resources and resource for computer system.
Method to preferred several renewal cache objects in the embodiment of the invention is introduced below:
1, reload the Data Update buffer memory from database automatically and can call following method:
public?Object?getCacheObject(Object?cacheKey,boolean?fromCache, ICacheLoaders?cacheLoaders,String?groupName,String?regionName) throws?CachingException;
After other server node receives and has the message body of the method name, be that the cacheLoaders parameter loads latest data renewal buffer memory from database automatically according to the method name of from message body, obtaining.
2, the cache object that appendix will upgrade in message body upgrades buffer memory and can call following method:
public?void?putCacheObject(Object?cacheKey,Object?cacheObject) throws?CachingException;
public?void?putCacheObject(Object?cacheKey,Object?cacheObject, String?groupName,String?regionName)throws?CachingException;public?void?putCacheObject(Object?cacheKey,Object?cacheObject, String?regionName)throws?CachingException;
Server node will upgrade cache object in the local cache zone according to the cacheObject parameter after receiving this message.
3, the cache object in the situation named cache zone can call following method:
?public?void?clear()throws?CachingException;?public?void?clear(String?regionName)throws?CachingException;
Server node decides all cache objects that empty in the concrete zone of local cache according to the regionName parameter.
Under a kind of cluster environment of the present invention, among second embodiment of metadata cache method for synchronous, increase a step of judging whether all transmitted message bodies are successfully handled.If, resend message by the described technical scheme of present embodiment and guarantee Message Processing and the synchronous correctness of buffer memory because temporary transient interruption of network or other factors cause message to send failure.
With reference to Fig. 7, show the flow chart of determining step among second embodiment of the present invention, comprising:
Step 701, generation message body ID.
After the method name of renewal cache object and order parameter tabulation are packaged into message body in formation, generate message body ID.
Step 702, after the success synchronously of the cache object of server node with the state information of message body and message body ID corresponding stored in database.
The synchronous local cache of buffering updating method after carrying out coupling, upgrade the cache object of home server node after, with the state information of message body and message body ID corresponding stored in database.The state information of described message body comprises timestamp, information processing success mark or the like, can know the disposition of the serviced device node of described message body by the state information of described message body.
Step 703, obtain the state information of message body according to message body ID Query Database according to the time interval of presetting.
In step 702,, therefore can realize obtaining the state information of message body by message id with the state information corresponding stored of message body ID and message body.The described time interval can preset according to actual needs and to performance demands, can be arbitrary time span, and the present invention does not limit this.
Step 704, judge that whether message body is successfully handled by other Servers-all node in the cluster, if then enter step 706, otherwise enters step 705.
Know promptly that according to the state information corresponding corresponding message body is by the disposition of server node in the cluster with message body ID.
Step 705, send described processing failure body to other Servers-all node again, finish the synchronous renewal of other Servers-all nodal cache object.
If handling the number of times of success and the transmission of this message body, any station server node do not surpass predetermined threshold value, then again to the described processing failure of other Servers-all node broadcasts body, after other server node receives this message body that resends, judge whether successfully to handle this message body, if successfully do not handle, then handle synchronous renewal that this message body finishes this server node cache object and the state information of this message body in the new database more again, if successfully handle, then abandon handling this message body.
The Message Record of successfully having been handled by other Servers-all node in step 706, the delete database.
If the processed success of message body illustrates that server node finished the renewal of cache object.In order to save resource for computer system, the message body ID and the corresponding state information that are stored in the database can be removed.
With reference to Fig. 8, show the structured flowchart of metadata cache synchro system first embodiment under a kind of cluster environment of the present invention, comprising:
Formation creating unit 801, be used for creating storage queue at server node.
The method name and the order parameter tabulation of inserting unit 802, being used for upgrading cache object place described formation.
Packaged unit 803, the method name and the order parameter tabulation that are used for formation is upgraded cache object are packaged into message body.
Transmitting element 804, be used for the packetizes messages body is sent to other server node.
Acquiring unit 805, be used for obtaining method name and the order parameter tabulation of upgrading cache object from message body.
Matching unit 806, be used for according to the method name and the corresponding buffering updating method of order parameter list match that upgrade cache object.
Updating block 807, be used to carry out the cache object that buffering updating method after the described coupling upgrades the home server node.
The operation principle and the course of work to described system is described in detail below:
Each server node in the cluster is created the storage queue that is used for storage means name and order parameter tabulation by formation creating unit 801, when the cache object of certain server node in the cluster changes, insert unit 802 the method name of described renewal cache object and order parameter tabulation placed the formation of establishment, and etc. to be sent.By packaged unit 803 medium method name to be sent of formation and order parameter tabulation are packaged into message body every the time threshold that presets, and described packetizes messages body is sent to other server node that other subscribes to this message body by transmitting element 804, after other server node receives described message body, from message body, obtain method name and the order parameter tabulation of upgrading cache object by acquiring unit 805.At the corresponding buffering updating method of home server node matching, the method for updating block 807 after according to described coupling finished the renewal of home server nodal cache object to matching unit 806 according to the tabulation of described method name and order parameter then.
Wherein said matching unit 806 specifically comprises:
First acquiring unit is used for obtaining according to the method name all methods of the same name of cache interface.
The traversal unit is used for according to the described whole methods of the same name of order parameter list traversal.
Second acquisition unit is used to obtain the buffering updating method that mates fully with parameter type.
Further, described system can also comprise first judging unit, is used to judge whether the needs cache object of other server node synchronously.
When the cache object of certain server node in the cluster changes, first judging unit according to the buffer memory synchronization policy judge in the cluster other server node whether needs upgrade cache object, effect by described first judging unit, can when having server node to upgrade cache object, not send message body, thereby saved Internet resources, improved systematic function.
Under a kind of cluster environment of the present invention, among second embodiment of metadata cache synchro system, except comprising the various unit described in first embodiment, also comprise second judging unit, be used to judge whether all message bodies that sent are successfully handled.
Wherein, described second judging unit specifically comprises:
The ID generation unit is used for generating message body ID after the tabulation of method name and order parameter is packaged into message body.
Memory cell is used for after the success synchronously of the cache object of server node, with the state information of message body and message body ID corresponding stored in database.
The 3rd acquiring unit is used for obtaining the state information of message body according to message body ID Query Database.
The 3rd judging unit is used for judging whether message body is successfully handled by other Servers-all node of cluster.
Updating block is sent in repeating transmission, if having any server node successfully to handle then resend described processing failure body, finishes the synchronous renewal of other Servers-all nodal cache object;
Delete cells is used for the Message Record that delete database has successfully been handled by other Servers-all node.
Among the 3rd embodiment of metadata cache synchro system, described system comprises under a kind of cluster environment of the present invention:
Packaged unit, the method name and the order parameter tabulation that are used for upgrading cache object are packaged into message body.
Transmitting element is used for the packetizes messages body is sent to other server node.
Acquiring unit is used for obtaining method name and the order parameter tabulation of upgrading cache object from message body.
Matching unit is used for according to the method name and the corresponding buffering updating method of order parameter list match that upgrade cache object.
Updating block is used to carry out the cache object that cache object update method after the coupling is upgraded the home server node.
System embodiment described in the present invention is corresponding with method embodiment, and therefore, not specifically described part is described referring to previous methods embodiment relevant portion and got final product in system embodiment.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other order or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
More than to the synchronous method and system of metadata cache under a kind of cluster environment provided by the present invention, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (12)

1. the synchronous method of metadata cache under the cluster environment, it is characterized in that, the web application code that each server node under the cluster environment is disposed is identical, and the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described method comprises:
After the cache object of certain server node upgrades successfully, method name and the order parameter tabulation of upgrading this cache object is packaged into message body;
The packetizes messages body is sent to other server node that all subscribe to described packetizes messages body;
After other server node receives described packetizes messages body, from described packetizes messages body, obtain the tabulation of described method name and order parameter;
Tabulate in the corresponding cache object update method of home server node matching according to described method name and order parameter;
Carry out cache object update method after the described coupling and upgrade the cache object of home server node.
2. the synchronous method of metadata cache under the cluster environment, it is characterized in that, the web application code that each server node under the cluster environment is disposed is identical, and the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described method comprises:
In server node, create storage queue;
After the cache object of certain server node upgrades successfully, place described formation medium to be sent method name and the order parameter tabulation of upgrading this cache object;
Check formation to be sent by the preset time threshold value, method name and the order parameter tabulation of upgrading cache object in the formation is packaged into message body;
The packetizes messages body is sent to other server node that all subscribe to described packetizes messages body;
After other server node receives described packetizes messages body, from described packetizes messages body, obtain the tabulation of described method name and order parameter;
Tabulate in the corresponding cache object update method of home server node matching according to described method name and order parameter;
Carry out cache object update method after the described coupling and upgrade the cache object of home server node.
3. method as claimed in claim 1 or 2 is characterized in that, the concrete steps of described coupling buffering updating method are:
Obtain all methods of the same name in the cache interface according to the method name;
According to the described whole methods of the same name of order parameter list traversal;
The buffering updating method that the type that gets parms is mated fully.
4. method as claimed in claim 2 is characterized in that, after the cache object of certain server node upgrades successfully, also comprises:
Need to judge whether the cache object of other server node synchronously.
5. method as claimed in claim 2 is characterized in that, also comprises:
Judge whether all message bodies that sent are successfully handled.
6. method as claimed in claim 5 is characterized in that, the specific implementation process of described judgement is:
With after upgrading the method name of cache object and order parameter tabulation and being packaged into message body, generate message body ID;
After the success synchronously of the cache object of server node with the state information of described packetizes messages body and described message body ID corresponding stored in database;
Inquire about the state information that described database obtains message body according to described message body ID according to the time interval of presetting;
Judge whether message body is successfully handled by other Servers-all node in the cluster;
If have any server node successfully to handle then resend described processing failure body, finish the synchronous renewal of other Servers-all nodal cache object;
If other server node has all been handled success then has been deleted the Message Record of successfully having been handled in the described database.
7. the synchronous system of metadata cache under the cluster environment, it is characterized in that, the web application code that each server node under the cluster environment is disposed is identical, and the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described system comprises:
Packaged unit, the method name and the order parameter tabulation that are used for upgrading cache object are packaged into message body;
Transmitting element is used for the packetizes messages body is sent to other server node;
Acquiring unit is used for obtaining method name and the order parameter tabulation of upgrading cache object from message body;
Matching unit is used for according to the method name and the corresponding buffering updating method of order parameter list match that upgrade cache object;
Updating block is used to carry out the cache object that cache object update method after the coupling is upgraded the home server node.
8. the synchronous system of metadata cache under the cluster environment, it is characterized in that, the web application code that each server node under the cluster environment is disposed is identical, and the code that the interface of renewal buffer memory and interface thereof are realized in each server node is in full accord, and described system comprises:
The formation creating unit is used for creating storage queue at server node;
Insert the unit, the method name and the order parameter tabulation that are used for upgrading cache object place described formation;
Packaged unit is used for the method name and the order parameter tabulation of formation renewal cache object are packaged into message body;
Transmitting element is used for the packetizes messages body is sent to other server node;
Acquiring unit is used for obtaining method name and the order parameter tabulation of upgrading cache object from message body;
Matching unit is used for tabulating at the corresponding buffering updating method of home server node matching according to the method name of upgrading cache object and order parameter;
Updating block is used to carry out the cache object that cache object update method after the coupling is upgraded the home server node.
9. as claim 7 or 8 described systems, it is characterized in that described matching unit comprises:
First acquiring unit is used for obtaining according to the method name all methods of the same name of cache interface;
The traversal unit is used for according to the described whole methods of the same name of order parameter list traversal;
Second acquisition unit is used to obtain the buffering updating method that mates fully with parameter type.
10. system as claimed in claim 8 is characterized in that, also comprises:
First judging unit is used to judge whether the needs cache object of other server node synchronously.
11. system as claimed in claim 8 is characterized in that, also comprises:
Second judging unit is used to judge whether all message bodies that sent are successfully handled.
12. system as claimed in claim 11 is characterized in that, described second judging unit comprises:
The ID generation unit is used for generating message body ID after the tabulation of method name and order parameter is packaged into message body;
Memory cell is used for after the success synchronously of the cache object of server node, with the state information of message body and message body ID corresponding stored in database;
The 3rd acquiring unit is used for obtaining the state information of message body according to message body ID Query Database;
The 3rd judging unit is used for judging whether message body is successfully handled by other Servers-all node of cluster;
Updating block is sent in repeating transmission, if having any server node successfully to handle then resend described processing failure body, finishes the synchronous renewal of other Servers-all nodal cache object;
Delete cells is used for the Message Record that delete database has successfully been handled by other Servers-all node.
CN2007101948730A 2007-12-13 2007-12-13 A method and system for data buffering and synchronization under cluster environment Expired - Fee Related CN101188566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101948730A CN101188566B (en) 2007-12-13 2007-12-13 A method and system for data buffering and synchronization under cluster environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101948730A CN101188566B (en) 2007-12-13 2007-12-13 A method and system for data buffering and synchronization under cluster environment

Publications (2)

Publication Number Publication Date
CN101188566A CN101188566A (en) 2008-05-28
CN101188566B true CN101188566B (en) 2010-06-02

Family

ID=39480761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101948730A Expired - Fee Related CN101188566B (en) 2007-12-13 2007-12-13 A method and system for data buffering and synchronization under cluster environment

Country Status (1)

Country Link
CN (1) CN101188566B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102741843B (en) * 2011-03-22 2014-03-26 青岛海信传媒网络技术有限公司 Method and apparatus for reading data from database
CN102314505B (en) * 2011-09-07 2016-04-13 北京人大金仓信息技术股份有限公司 Based on the buffer zone version production method of partial ordering relation
CN102387204B (en) * 2011-10-21 2014-12-10 中国科学院计算技术研究所 Method and system for maintaining consistency of cluster caching
CN102945236A (en) * 2011-11-29 2013-02-27 Ut斯达康通讯有限公司 Method for synchronizing different databases by triggering events
CN102591679B (en) * 2011-11-30 2014-09-17 中国科学院计算机网络信息中心 Quick application software arrangement method for cluster system
CN104869166A (en) * 2015-05-28 2015-08-26 北京呈创科技股份有限公司 Desktop cloud cluster system and desktop cloud cluster system information interaction method
CN106980625B (en) * 2016-01-18 2020-08-04 阿里巴巴集团控股有限公司 Data synchronization method, device and system
CN106506586B (en) * 2016-09-21 2019-05-03 东软集团股份有限公司 Distributed caching synchronous method, device, node and system
CN109167810B (en) * 2018-07-27 2021-09-14 创新先进技术有限公司 Monitoring, notification and refreshing method and device, computing device and storage medium
CN109284305A (en) * 2018-08-23 2019-01-29 阿里巴巴集团控股有限公司 A kind of update method of data, apparatus and system
CN111245876B (en) * 2018-11-29 2023-04-28 杭州海康威视数字技术股份有限公司 List synchronization method and cluster system
CN109582686B (en) * 2018-12-13 2021-01-15 中山大学 Method, device, system and application for ensuring consistency of distributed metadata management
CN109710427A (en) * 2018-12-26 2019-05-03 苏州沁游网络科技有限公司 A kind of information processing method, system and server
CN110503167B (en) * 2019-08-07 2021-10-08 清远蓄能发电有限公司 RFID-based shelf tool inventory method, system, device and medium
CN110837427B (en) * 2019-11-15 2022-02-01 四川长虹电器股份有限公司 Method for preventing cache breakdown based on queue sorting task mechanism
CN111479142B (en) * 2020-04-14 2022-10-21 深圳市鸿合创新信息技术有限责任公司 Program content updating method and system based on information release
CN111506668B (en) * 2020-07-01 2024-02-02 西安安森智能仪器股份有限公司 Robot cluster intelligent data synchronization method and system
CN112000618B (en) * 2020-08-07 2022-06-07 北京浪潮数据技术有限公司 File change management method, device, equipment and storage medium for cluster nodes
CN112416884A (en) * 2020-11-23 2021-02-26 中国移动通信集团江苏有限公司 Data synchronization method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1602489A (en) * 2001-10-25 2005-03-30 Bea系统公司 System and method for flushing bean cache
US20050132074A1 (en) * 2003-12-12 2005-06-16 Dan Jones Systems and methods for synchronizing data between communication devices in a networked environment
WO2007088081A1 (en) * 2006-01-31 2007-08-09 International Business Machines Corporation Efficient data management in a cluster file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1602489A (en) * 2001-10-25 2005-03-30 Bea系统公司 System and method for flushing bean cache
US20050132074A1 (en) * 2003-12-12 2005-06-16 Dan Jones Systems and methods for synchronizing data between communication devices in a networked environment
WO2007088081A1 (en) * 2006-01-31 2007-08-09 International Business Machines Corporation Efficient data management in a cluster file system

Also Published As

Publication number Publication date
CN101188566A (en) 2008-05-28

Similar Documents

Publication Publication Date Title
CN101188566B (en) A method and system for data buffering and synchronization under cluster environment
CN102255752B (en) Configuration management system and method of server cluster
CN102291416B (en) A kind of method and system of client and server bi-directional synchronization
CN104202423B (en) A kind of system by software architecture expansion buffer memory
CN103856569A (en) Method and device for synchronizing domain name system resource information
CN102411598A (en) Method and system for realizing data consistency
CN105337923A (en) Data distribution method and system, data transmitting apparatus and data receiving apparatus
CN102333108A (en) Distributed cache synchronization system and method
CN111143382A (en) Data processing method, system and computer readable storage medium
CN112416969B (en) Parallel task scheduling system in distributed database
CN105554142A (en) Method, apparatus and system for pushing messages
CN101557390A (en) Method for improving system performance by flexibly using cache technology
CN101013996A (en) Block storage service method, block storage service system and block storage service client
CN103186536A (en) Method and system for scheduling data shearing devices
US20070050447A1 (en) Method and device arrangement for managing a client/server environment
CN111124717A (en) Message delivery method, system and computer storage medium
CN103164262A (en) Task management method and device
CN112069152B (en) Database cluster upgrading method, device, equipment and storage medium
CN101751292B (en) Method for realizing consistency function of multimachine core data in ATC (automatic timing corrector) system
WO2023142924A1 (en) Electronic map operation and maintenance method, electronic map data use method and service system
CN107273047B (en) Cache management method, cache manager and storage management software
CN116405547A (en) Message pushing method and device, processor, electronic equipment and storage medium
CN101526959A (en) Data storing method and device
CN104052723A (en) Information processing method and server
CN107220129B (en) Communication method and system between software modules

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100602

Termination date: 20171213

CF01 Termination of patent right due to non-payment of annual fee