CN101271410A - Data sharing method, system and device - Google Patents

Data sharing method, system and device Download PDF

Info

Publication number
CN101271410A
CN101271410A CNA2008100995052A CN200810099505A CN101271410A CN 101271410 A CN101271410 A CN 101271410A CN A2008100995052 A CNA2008100995052 A CN A2008100995052A CN 200810099505 A CN200810099505 A CN 200810099505A CN 101271410 A CN101271410 A CN 101271410A
Authority
CN
China
Prior art keywords
data
buffer memory
query
thread
thread buffer
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
CNA2008100995052A
Other languages
Chinese (zh)
Other versions
CN100589079C (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.)
Chuangze intelligent robot Group Co.,Ltd.
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN200810099505A priority Critical patent/CN100589079C/en
Publication of CN101271410A publication Critical patent/CN101271410A/en
Application granted granted Critical
Publication of CN100589079C publication Critical patent/CN100589079C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

An embodiment provided by the invention discloses a method, a system and a device for data sharing; wherein, the method for data sharing disclosed by the embodiment of the invention includes: receiving a request of data inquiry and checking whether the thread cache is accessed or not; sending an inquiry request to the thread cache when the result is that the thread cache is accessed; receiving the returned inquiry data of the thread cache and returning the inquiry result data to a sending party requesting data inquiry. The embodiment of the invention can effectively ensure no dirty data on the condition that the single calling data is fully shared.

Description

A kind of mthods, systems and devices of data sharing
Technical field
The present invention relates to field of network communication, relate in particular to a kind of mthods, systems and devices of data sharing.
Background technology
In the management-type application system, special API (ApplicationProgramming Interface is usually used in the verification of data, application programming interface) finishes, for example whether correct according to the Subscriber Number checking data, these API often will finish verification by the data query of database table, but this data check often because unreasonable the bringing of planning repeated inquiry, causes extra performance cost.
Existing technology is with the database data buffer memory, is carrying out data relatively the time, because data query is directly from buffer memory, thereby reduces the repeatedly performance cost of inquiry greatly.Specifically, data of database is pre-loaded or be loaded into when visiting for the first time in the high-speed cache in the internal memory, use API and when visit data, directly from high-speed cache, obtain relevant data, even the same data access of a plurality of like this needs, because the access cache time overhead is few, can significantly improve the performance of data access.In addition, if variation has taken place in the data in the buffer memory, can by the update notifications interface with Data Update in buffer memory, obtain up-to-date data in the time of can guaranteeing data access like this, to safeguard data cached and consistance database data.
The inventor finds that there is following problem at least in prior art in realizing process of the present invention:
Prior art is not suitable for the buffer memory of big data quantity, and sometimes for the shared buffer memory data, needs the buffer memory basic data, at every turn in the enterprising row operation of this basic data, thereby has increased the weight of the burden of service logic.The ageing difficult control of data in the buffer memory simultaneously.
Summary of the invention
The embodiment of the invention provides a kind of mthods, systems and devices of data sharing, and is fully shared with effective realization single call data, reduces the burden of service logic.
The embodiment of the invention provides a kind of method of data sharing, comprising:
Receive the data query request, judge whether to visit the thread buffer memory;
Described judged result sends query requests to described thread buffer memory during for the described thread buffer memory of visit;
Receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request.
The embodiment of the invention provides a kind of device of data sharing simultaneously, comprising:
First receiver module is used to receive the data query request;
First judge module is used for judging whether to visit the thread buffer memory when described first receiver module receives the data query request;
First sending module is used for sending query requests to described thread buffer memory when described first judge module is judged visit thread buffer memory;
Second receiver module is used to receive the Query Result data that described thread buffer memory returns;
Second sending module is used for when described second receiver module receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
The embodiment of the invention provides a kind of system of data sharing simultaneously, comprising:
The condition controller, thread buffer memory, data access controller and database;
Described condition controller receives the data query request, need to judge whether the described thread buffer memory of visit; Described judged result is when needing visit thread buffer memory, to send query requests to described thread buffer memory; Receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request.
Compared with prior art, the embodiment of the invention has the following advantages:
By judging whether needs visit thread buffer memory and sending query requests to the thread buffer memory, the Query Result data that the receiving thread buffer memory returns and judge that described data effectively after, return the Query Result data, when therefore inquiring about repeating data, can from the thread buffer memory, directly obtain data, and the data that inquire from database can typing thread buffer memory, and it is fully shared effectively to guarantee to call data like this.
Description of drawings
Fig. 1 is the applied environment synoptic diagram of the embodiment of the invention;
Fig. 2 is the method flow diagram of data sharing in the embodiment of the invention;
Fig. 3 is the method flow diagram of data sharing in the embodiment of the invention;
Fig. 4 is the scene synoptic diagram of the embodiment of the invention;
Fig. 5 is the call flow chart of function A in the embodiment of the invention;
Fig. 6 is the call flow chart of function B in the embodiment of the invention;
Fig. 7 is the apparatus structure synoptic diagram of data sharing in the embodiment of the invention;
Fig. 8 is the apparatus structure synoptic diagram of data sharing in the embodiment of the invention.
Embodiment
The embodiment of the invention provides a kind of mthods, systems and devices of data sharing, effectively to guarantee dirty data can not occur under the fully shared prerequisite of single call data.
In order can not influence under the conforming prerequisite of business semantics, abundant shared service data, improve the performance of data access and solve data consistency and ageing problem, the embodiment of the invention has proposed a kind of based on the shared method of thread data in buffer, by tape spare control, be kept at the interim buffer memory in the thread, under the prerequisite that does not change business logic codes, guarantee the high-performance of using.
As shown in Figure 1, the system applies environment for the embodiment of the invention comprises:
Condition controller 1, be positioned at before the data access controller, tackled and used the true visit of API to data, coming control data by built-in condition steering logic is directly to obtain from database or obtain from buffer memory by the thread buffer memory by the data access device;
Thread buffer memory 2, itself and thread are bound, the life cycle of thread buffer memory can equal the life cycle of thread, also can be less than the life cycle of thread, avoid occurring dirty data, be mainly used in to described condition controller the Query Result data are provided, when the data access controller when the condition controller returns the Query Result data, the described Query Result data of typing, once request generally binds together with a thread in application system, after a Request Processing is finished, in order to prevent dirty data to occur when memory overflow and thread from sharing, need be with the data cached removing of thread;
Data access controller 3 is used to provide the encapsulation to database access, is data access layer common in the application system;
Database 4 refers to store the system of data, refers generally to the relation data library storage, other storage medium storehouses such as general reference text, multimedia.
When using API or other devices when described condition controller 1 sends the data query request, described condition controller 1 need to judge whether the described thread buffer memory 2 of visit.Judged result is when needing visit thread buffer memory 2, to send query requests to described thread buffer memory 2; After receiving the Query Result data that described thread buffer memory 2 returns, return described Query Result data.Judged result is not when needing to visit thread buffer memory 2, condition controller 1 sends the data query request to data access controller 3, data access controller 3 is searched for corresponding data according to the data query request in database 4, and the Query Result data are returned to condition controller 1.Condition controller 1 returns the Query Result data.
The methods, devices and systems of the data sharing that the embodiment of the invention is provided below in conjunction with the drawings and specific embodiments are elaborated.
The process flow diagram of the method for the data sharing that Fig. 2 provides for the embodiment of the invention comprises:
Step S201, receive the data query request, judge whether to visit the thread buffer memory.
Concrete, buffer memory and thread can be bound, form the thread buffer memory.And the life cycle of the thread variable sign buffer memory of use thread, make its life cycle consistent with thread.After receiving the data query request, according to the condition steering logic of setting to data query request judge.The way of realization of described condition steering logic can be a series of Rule of judgment.
Step S202, described judged result send query requests to described thread buffer memory during for the described thread buffer memory of visit.
Concrete, judged result is when needing visit thread buffer memory, to send query requests to the thread buffer memory; Judged result sends the data query request to the data access controller when not needing to visit the thread buffer memory, and receives the Query Result data that the data access controller obtains from database.
Can judge whether receive the Query Result data needs typing thread buffer memory, and return described Query Result data to the transmit leg of described data query request.Can whether needs typing thread buffer memory be judged to described Query Result data according to inner corresponding configuration.
Step S203, receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request.
Concrete, receive the Query Result data that the thread buffer memory returns after, can judge whether the Query Result data effective.For example, when thread buffer memory return data was empty, data were invalid; After perhaps the number of times inquired about of the data of being inquired about surpassed threshold value, these data were invalid.After judging that the Query Result data effectively, return described Query Result data to the transmit leg of described data query request.Judge when the Query Result data are invalid, need send the data query request to the data qualification controller.
After receiving the data query request, at first judge whether to visit the thread buffer memory,, can directly from the thread buffer memory, obtain the Query Result data if judgement needs visit thread buffer memory, can effectively guarantee so can not occur under the prerequisite of dirty data, make the single call data fully shared.
Below by embodiment the method for data sharing provided by the invention is elaborated, as shown in Figure 3, specifically comprises:
Step S301, application API initiate data access in inside to database.
Concrete, the application interface that described application API general reference designs in order to finish business operation has comprised one or more atomic function usually, as user's verification, flow process control.For using API, its main target is to finish a certain specific function, needs accessing database generally speaking in order to finish described specific function.
Step S302, application API send the data query request to the condition controller.
Step S303, condition controller inquiry self interior condition steering logic need to judge whether visit thread buffer memory.
Concrete, described condition controller is controlled the position that obtains of data query by built-in condition steering logic, that is to say that the control data query is directly to obtain from database, still obtains from buffer memory by the thread buffer memory.We can say that also the condition controller is an intermediate controlled assembly of using API and database, all-access is all transmitted through the condition controller.
The condition steering logic implementation of described condition controller is a series of condition judgment, and can utilize database, decision table or other modes to realize.These Rule of judgment can be fixed on condition controller inside.For example the condition steering logic can be set at: be designated the inquiry of the SQL of x to the inquiry of certain entity A or to the inquiry of certain SQL (Structure Query Language, Structured Query Language (SQL)) or to certain.
According to the actual needs, described condition steering logic can be set at and come into force sometime, also can be set at sometime the section come into force.For example need safeguard database, can set thread and be buffered in this time period and come into force in certain time period.
Step S304, condition controller judge whether needs access cache of data query request according to the condition steering logic, and judged result is during for needs, execution in step S305; Otherwise, execution in step S308.
Concrete, during condition steering logic in the data query request satisfies condition controller, being judged as needs access cache; Otherwise being judged as does not need access cache.
Step S305, condition controller send the data query request to the thread buffer memory.
Described thread buffer memory is actually the buffer memory of the transient state that is positioned at a threads store inside, and inside is the mapping of key assignments and object.Concrete, the SQL that has special parameter determines that has a uniquely identified key assignments, this key-value pair should unique object.That is to say that described key assignments can be used to identify the uniqueness of Query Result data.The way of realization of the described SQL that has a special parameter can be the name of SQL and parameter, SQL and parameter etc.
Step S306, thread buffer memory return the Query Result data to the condition controller.
Step S307, condition controller judge whether the Query Result data that the thread buffer memory returns are effective.
Concrete, data effectively can index according to existing or in the data term of validity, satisfying certain regulation.For example, when thread buffer memory return data was empty, data were invalid; After perhaps the number of times inquired about of the data of being inquired about surpassed threshold value, these data were invalid.Certainly, the judgment data effective and efficient manner is not limited to above-described mode in actual conditions.
Judge that the Query Result data are effective, execution in step S314; Otherwise, execution in step S308.
Step S308, condition controller send the data query request to the data access controller.
Concrete, the condition controller judges that according to the condition steering logic data query request during needs visit thread buffer memory, sends the data query request to the data access controller.
Step S309, data access controller are inquired about corresponding data information according to the data query request that the conditional access controller sends in database.
Step S310, database return the Query Result data to the data access controller.
Step S311, data access controller send to the condition controller with the Query Result data that database returns.
Step S312, condition controller judge whether the Query Result data need typing thread buffer memory.If desired, execution in step S313; Otherwise, direct execution in step S314.
Concrete, can be according to the configuration determination of condition controller needs typing thread buffer memory whether, meet configuration requirement and can think needs typing thread buffer memory.
The typing thread buffer memory that needs described here comprises two implications: the one, at first from the thread buffer memory, search during data query; The 2nd, the Query Result data of inquiring about (do not find data in the thread buffer memory and use the data access controller to obtain data) first will be saved in the thread buffer memory.
Step S313, with Query Result data typing thread buffer memory.
Step S314, the Query Result data are returned to use API.
Step S315, application API send the ending request that this request of expression finishes to the condition controller.
After step S316, condition controller receive the ending request of using the API transmission, destroy cache object and buffer memory self in the thread buffer memory, and cleaning thread variable, flow process finishes.
Visit the thread buffer memory and obtain corresponding data query route by judging whether, and obtain the Query Result data, can improve the performance of data access keeping using under the consistance prerequisite of API semanteme according to judged result.
The embodiment of the invention is an example with the order in the management-type application system, and a kind of method of data sharing is provided, and can improve the performance of data access.
Whether whether a large amount of application API imports as using API with Subscriber Number in the order flow process, for example judge whether the user exists, allow the product that the user orders, the user orders to exist mutex relation (promptly ordered a product and just can not order another product), user whether to repeat to have ordered certain product with existing product.
Problem is supposed to order calling function A, function merit B, function C and function D successively for convenience of explanation, and function described here is just used API.Using API can be a concrete business function interface, can be implemented as a method, as the function of C++, the method for Java, perhaps can be implemented as component interface, as the interface of an EJB (Enterprise JavaBean) etc.Here be embodied as example with the Java method, the scene synoptic diagram has been listed the internal request that need carry out data access as shown in Figure 4 in each function, only listed the data access request that a plurality of functions repeat to call for the sake of simplicity here.
Function A, function B, function C and function D all need by Subscriber Number inquiring user key assignments, and wherein function C and function D all need by user's key assignments inquiring user existing products order record.
Set forth how to realize data shared access below in conjunction with concrete flow process based on the thread buffer memory.
Sight one: function A call flow;
During product subscription at first calling function A judge whether the user exists, need " according to Subscriber Number inquiring user key assignments " among the function A, as shown in Figure 5, comprising:
Step S501, function A send the data query request to the condition controller.
Concrete, the way of realization of request adds relevant parameter for the SQL (Structured Query Language (SQL)) of band name, and wherein each SQL all identifies by a title, and described relevant parameter is a Subscriber Number.
Step S502, condition controller inquiry interior condition steering logic need to judge whether visit thread buffer memory.
The mode of condition controller service regeulations engine realizes, described regulation engine is developed by inference engine, be a kind of assembly that is embedded in the application program, can realize operational decision making is separated from application code, and use predefined semantic module to write operational decision making.Utilize regulation engine definite condition steering logic herein.
Ios dhcp sample configuration IOS DHCP for condition controller in the present embodiment is as follows:
The information of IF inquiring user
THEN uses the thread buffer memory
Send to the query requests of condition controller for function A, because inquiry is user profile, above-mentioned condition judgment is set up, and the condition controller of that is to say is judged " according to Subscriber Number inquiring user key assignments " needs access cache.
Step S503, condition controller send the data query request to the thread buffer memory.
The thread buffer memory uses the thread variable of binding with thread herein, in the thread with the Java language structure thread variable can be set, and expression buffer memory life cycle is consistent with thread.Preserve a Hash table in the thread variable, the condition controller sends the Hash key assignments to the thread buffer memory, and key assignments is the Hash codes that has SQL title and parameter.Utilize key assignments in the thread buffer memory, to inquire about corresponding data.
Step S504, thread buffer memory return the Query Result data to the condition controller.
If do not inquire corresponding Query Result data in the thread buffer memory, the data that the thread buffer memory returns are for empty, and these Query Result data are invalid, continue execution in step S505.In this embodiment, there are not corresponding data in the thread buffer memory.
Step S505, condition controller send the data query request to the data access controller.
Concrete, the condition controller sends the data query request to the data access controller, and according to the Subscriber Number inquiring user key assignments in the query requests, data access controller way of realization is the data access encapsulation of JDBC here.
Described JDBC (Java Data Base Connectivity, the java database connects) is a kind of Java API that is used to carry out SQL statement, can provide unified visit for multiple relational database, and it is made up of one group of class and interface of writing with Java language.
Step S506, data access controller be according to Subscriber Number, the key assignments of inquiring user in the directory of database.
Step S507, database turn back to the data access controller with user's key assignments.
Step S508, data access controller return to the condition controller with user's key assignments.
Step S509, with user's key assignments typing buffer memory.
Can judge these Query Result data by the configuration of condition controller among the step S502 needs typing thread buffer memory, so continue to carry out following steps.
Step S510, condition controller turn back to function A with user's key assignments.
Sight two: function B call flow;
Product subscription calling function B judges " whether allowing the user to order ", needs " according to Subscriber Number inquiring user key assignments " among the function B.As shown in Figure 6, comprising:
Step S601, function B send the data query request to the condition controller.
Step S602, condition controller are according to the condition steering logic of inside needs inquiry thread buffer memory whether.
Because the ios dhcp sample configuration IOS DHCP of condition controller is as follows:
The information of IF inquiring user
THEN uses the thread buffer memory
So judging needs inquiry thread buffer memory.The condition controller continues to carry out following steps after judging and needing visit thread buffer memory;
Step S603, condition controller send the data query request to the thread buffer memory.
Step S604, thread buffer memory return to the condition controller with the Query Result data.
Because function A is entered into the relevant query result data in the thread buffer memory before this, the thread buffer memory can directly return the Query Result data to the condition controller.
Step S605, condition controller return to function B with the user's key assignments that inquires.
The call flow of the flow process of " according to Subscriber Number inquiring user key assignments " and function B is similar among function C, the function D.
" according to user's key assignments inquiry existing procucts order record " is similar with the flow process of function A among the function C, needs accessing database for the first time during data query; The flow process and the function B call flow of " according to user's key assignments inquiry existing procucts order record " are similar among the function D, can directly obtain data from the thread buffer memory.
After subscription process was finished, application API sent ending request and represents that this request finishes for the condition controller, cache object and buffer memory self during condition controller destruction thread delays, and cleaning thread variable, and thread buffer memory life cycle finishes.
The data sharing method that the application of the invention embodiment provides can reduce the number of times of accessing database keeping using under consistance (as only using C++, the Java) prerequisite of API semanteme, improves the performance of data access.
Simultaneously, the embodiment of the invention also provides a kind of device of data sharing, as shown in Figure 7, specifically comprises:
First receiver module 10 is used to receive the data query request;
First judge module 20 is used for judging whether to visit the thread buffer memory when described first receiver module 10 receives the data query request;
First sending module 30 is used for sending query requests to described thread buffer memory when described first judge module 20 is judged visit thread buffer memory;
Second receiver module 40 is used to receive the Query Result data that described thread buffer memory returns;
Second sending module 50 is used for when described second receiver module 40 receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
By above-described device, can realize data sharing, specific implementation is as follows:
After first receiver module 10 received the data query request, first judge module 20 judged whether this request needs to visit the thread buffer memory.When 20 judgements of first judge module needed visit thread buffer memory, first sending module 30 sent query requests to described thread buffer memory.
Second receiver module 40 receives the Query Result data that described thread buffer memory returns according to query requests, returns described Query Result data by second sending module 50 to the transmit leg of described data query request then.
As shown in Figure 8, the device of described data sharing in another embodiment can also comprise:
The 3rd sending module 60 is used for sending query requests to the data access controller when the thread buffer memory is not visited in 20 judgements of described first judge module;
The 3rd receiver module 70 is used to receive the Query Result data that described data access controller returns;
The 4th sending module 80 is used for when described the 3rd receiver module 70 receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
The device of described data sharing in another embodiment can also comprise:
Second judge module 90 is used to judge whether the Query Result data of described second receiver module 40 receptions are effective;
Typing judge module 100 is used to judge whether typing thread buffer memory of Query Result data that described the 3rd receiver module 70 receives.
The device of described data sharing can also comprise:
Destroy module 110, be used for receiving object and the buffer memory self of destroying the thread buffer memory after the ending request and also clear up the thread variable.
By above-described module, can realize data sharing, specific implementation is as follows:
After first receiver module 10 received the data query request, first judge module 20 judged whether this request needs to visit the thread buffer memory.Concrete, according to the condition steering logic of setting in first judge module 20 to data query request judge.The way of realization of described condition steering logic is a series of Rule of judgment.
When 20 judgements of first judge module needed visit thread buffer memory, first sending module 30 sent query requests to described thread buffer memory.After second receiver module 40 receives the Query Result data that described thread buffer memory returns according to query requests, whether the Query Result data that second judge module 90 detects 40 receptions of described second receiver module are effective, if effectively, the Query Result data are sent to application interface by second sending module 50; If invalid, send query requests to the data access controller by the 3rd sending module 60.
When 20 judgements of first judge module did not need to visit the thread buffer memory, the 3rd sending module 60 sent query requests to the data access controller.After the 3rd receiver module 70 received the Query Result data that described data access controller returns, typing judge module 100 judged whether the Query Result data need typing thread buffer memory.After this 4th sending module 80 returns the Query Result data to application interface.
After receiving ending request, object and the buffer memory self destroyed in the module 110 destruction thread buffer memorys are also cleared up the thread variable.
The device of the data sharing that the application of the invention embodiment provides can be realized the method for data sharing, has effectively guaranteed can not occur under the prerequisite of dirty data, makes the single call data fully shared.
The embodiment of the invention also provides a kind of system of data sharing simultaneously, as shown in Figure 1, comprising: condition controller 1, thread buffer memory 2;
Described condition controller 1 is used to receive the data query request, need to judge whether the described thread buffer memory of visit; Described judged result is when needing visit thread buffer memory, to send query requests to described thread buffer memory; Receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request;
Described thread buffer memory 2 is used to described condition controller 1 that the Query Result data are provided, when the data access controller when the condition controller returns the Query Result data, the described Query Result data of typing.
The system of described data sharing also comprises: data access controller 3 and database 4;
Described data access controller 3, be used to receive the data query request that condition controller 2 sends after, data query and the Query Result data are sent to the condition controller in database;
Described database 4 is used to described data access controller 3 that data query is provided.
Concrete, described condition controller 1 receives the data query request, need to judge whether the described thread buffer memory 2 of visit; Described judged result is when needing visit thread buffer memory, to send query requests to described thread buffer memory 2; After receiving the Query Result data that described thread buffer memory 2 returns, return described Query Result data to the transmit leg of described data query request.Described judged result is not when needing to visit thread buffer memory 2, condition controller 1 sends the data query request to data access controller 3, described data access controller 3 is searched for corresponding data according to the data query request in database 4, and the Query Result data are returned condition controller 1.Condition controller 1 returns described Query Result data to the transmit leg of described data query request.
Described condition controller comprises:
First receiver module 10 is used to receive the data query request;
First judge module 20 is used for judging whether to visit the thread buffer memory when described first receiver module 10 receives the data query request;
First sending module 30 is used for sending query requests to described thread buffer memory when described first judge module 20 is judged visit thread buffer memory;
Second receiver module 40 is used to receive the Query Result data that described thread buffer memory returns;
Second sending module 50 is used for when described second receiver module 40 receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
By the above module, can realize data sharing, specific implementation is as follows:
After first receiver module 10 received the data query request, first judge module 20 judged whether this request needs to visit the thread buffer memory.When 20 judgements of first judge module needed visit thread buffer memory, first sending module 30 sent query requests to described thread buffer memory.
Second receiver module 40 receives the Query Result data that described thread buffer memory returns according to query requests, returns described Query Result data by second sending module 50 to the transmit leg of described data query request then.
Described condition controller also comprises:
The 3rd sending module 60 is used for sending query requests to the data access controller when the thread buffer memory is not visited in 20 judgements of described first judge module;
The 3rd receiver module 70 is used to receive the Query Result data that described data access controller returns;
The 4th sending module 80 is used for when described the 3rd receiver module 70 receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
Described condition controller also comprises:
Second judge module 90 is used to judge whether the Query Result data of described second receiver module 40 receptions are effective;
Typing judge module 100 is used to judge whether typing thread buffer memory of Query Result data that described the 3rd receiver module 70 receives.
Described condition controller also comprises:
Destroy module 110, be used for receiving object and the buffer memory self of destroying the thread buffer memory after the ending request and also clear up the thread variable.
By the above module, can realize data sharing, specific implementation is as follows:
After first receiver module 10 received the data query request, first judge module 20 judged whether this request needs to visit thread buffer memory 2.Concrete, according to the condition steering logic of setting in first judge module 20 to data query request judge.The way of realization of described condition steering logic is a series of Rule of judgment.
When 20 judgements of first judge module needed visit thread buffer memory 2, first sending module 30 sent query requests to described thread buffer memory 2.After second receiver module 40 receives the Query Result data that described thread buffer memory 2 returns according to query requests, whether the Query Result data that second judge module 90 detects 40 receptions of described second receiver module are effective, if effectively, the Query Result data are sent to application interface by second sending module 50; If invalid, send query requests to data access controller 3 by the 3rd sending module 60.
When 20 judgements of first judge module did not need to visit the thread buffer memory, the 3rd sending module 60 sent query requests to data access controller 3.Data access controller 3 obtains corresponding data in database 4.After the 3rd receiver module 70 received the Query Result data that described data access controller 3 returns, typing judge module 100 judged whether the Query Result data need typing thread buffer memory 2.After this 4th sending module 80 returns the Query Result data to application interface.
After receiving ending request, object and the buffer memory self destroyed in the module 110 destruction thread buffer memorys are also cleared up the thread variable.
The mthods, systems and devices that the embodiment of the application of the invention provides, can effectively guarantee can not occur under the prerequisite of dirty data, make the single call data fully shared, and, improve the performance of data access keeping using under the consistance prerequisite of API semanteme.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize based on such understanding by the mode that software adds necessary general hardware platform, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (17)

1, a kind of method of data sharing is characterized in that, comprising:
Receive the data query request, judge whether to visit the thread buffer memory;
Described judged result sends query requests to described thread buffer memory during for the described thread buffer memory of visit;
Receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request.
2, the method for data sharing according to claim 1 is characterized in that, describedly also comprises before receiving the data query request:
Buffer memory and thread are bound the described thread buffer memory of formation.
3, as the method for data sharing as described in the claim 2, it is characterized in that, use the thread variable of described thread to identify the life cycle of described buffer memory behind the described thread buffer memory of described formation, make described buffer memory consistent with the life cycle of described thread.
4, the method for data sharing according to claim 1 is characterized in that, describedly judges whether to visit the thread buffer memory and specifically comprises:
Judge according to the condition steering logic whether described data query request visits the thread buffer memory.
5, the method for data sharing according to claim 1, it is characterized in that, described judged result is not when visiting the thread buffer memory, send the data query request to the data access controller, and receive described data access controller and in database, inquire about the Query Result data that obtain, return described Query Result data to the transmit leg of described data query request.
6, as the method for data sharing as described in the claim 5, it is characterized in that described reception data access controller is inquired about after the Query Result data that obtain, and also comprises in database:
Judge whether the typing thread is buffered in described Query Result data;
Described judged result is a typing thread buffer memory, with described Query Result data typing thread buffer memory.
7, the method for data sharing according to claim 1 is characterized in that, also comprises after the Query Result data that the described thread buffer memory of described reception returns:
Judge whether the Query Result data are effective;
Described judged result is effectively, returns described Query Result data to the transmit leg of described data query request;
Described judged result is invalid, sends the data query request to the data access controller.
8, the method for data sharing according to claim 1 is characterized in that described transmit leg to described data query request also comprises after returning described Query Result data:
Receive ending request, object and the buffer memory self destroyed in the thread buffer memory are also cleared up the thread variable.
9, a kind of device of data sharing is characterized in that, comprising:
First receiver module is used to receive the data query request;
First judge module is used for judging whether to visit the thread buffer memory when described first receiver module receives the data query request;
First sending module is used for sending query requests to described thread buffer memory when described first judge module is judged visit thread buffer memory;
Second receiver module is used to receive the Query Result data that described thread buffer memory returns;
Second sending module is used for when described second receiver module receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
10, as the device of data sharing as described in the claim 9, it is characterized in that, also comprise:
The 3rd sending module is used for sending query requests to the data access controller when described first judge module judgement does not need to visit the thread buffer memory;
The 3rd receiver module is used to receive the Query Result data that described data access controller returns;
The 4th sending module is used for when described the 3rd receiver module receives the Query Result data, sends query requests to described thread buffer memory.
11, as the device of data sharing as described in the claim 9, it is characterized in that, also comprise:
Second judge module is used to judge whether the Query Result data of described second receiver module reception are effective.
12, as the device of data sharing as described in the claim 9, it is characterized in that, also comprise:
The typing judge module is used to judge whether typing thread buffer memory of Query Result data that described the 3rd receiver module receives.
13, as the device of data sharing as described in the claim 9, it is characterized in that, also comprise:
Destroy module, be used for receiving object and the buffer memory self of destroying the thread buffer memory after the ending request and also clear up the thread variable.
14, as the device of data sharing as described in each in the claim 9 to 13, it is characterized in that described device is the condition controller.
15, a kind of system of data sharing is characterized in that, comprising: condition controller, thread buffer memory;
Described condition controller is used to receive the data query request, need to judge whether the described thread buffer memory of visit; Described judged result is when needing visit thread buffer memory, to send query requests to described thread buffer memory; Receive the Query Result data that described thread buffer memory returns, return described Query Result data to the transmit leg of described data query request;
Described thread buffer memory is used to receive described query requests, and provides the Query Result data for described condition controller.
16, as the system of data sharing as described in the claim 15, it is characterized in that,
Also comprise: data access controller and database; Described condition controller is further used for judged result when not needing to visit the thread buffer memory, and described condition controller sends the data query request to described data access controller;
Described data access controller, be used to receive the data query request that described condition controller sends after, data query and the Query Result data are sent to described condition controller in described database;
Described database is used to described data access controller that data query is provided.
17, as the system of data sharing as described in the claim 15, it is characterized in that described condition controller comprises:
First receiver module is used to receive the data query request;
First judge module is used for judging whether to visit the thread buffer memory when described first receiver module receives the data query request;
First sending module is used for sending query requests to described thread buffer memory when described first judge module is judged visit thread buffer memory;
Second receiver module is used to receive the Query Result data that described thread buffer memory returns;
Second sending module is used for when described second receiver module receives the Query Result data, returns described Query Result data to the transmit leg of described data query request.
CN200810099505A 2008-05-09 2008-05-09 Data sharing method, system and device Active CN100589079C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810099505A CN100589079C (en) 2008-05-09 2008-05-09 Data sharing method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810099505A CN100589079C (en) 2008-05-09 2008-05-09 Data sharing method, system and device

Publications (2)

Publication Number Publication Date
CN101271410A true CN101271410A (en) 2008-09-24
CN100589079C CN100589079C (en) 2010-02-10

Family

ID=40005399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810099505A Active CN100589079C (en) 2008-05-09 2008-05-09 Data sharing method, system and device

Country Status (1)

Country Link
CN (1) CN100589079C (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101815094A (en) * 2010-03-18 2010-08-25 中兴通讯股份有限公司 Method, device and system for realizing data shared access
CN102880557A (en) * 2012-09-13 2013-01-16 浙江金大科技有限公司 Multistage distribution type high-speed cache of heterogeneous data source
CN102999522A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Data storage method and device
CN103164347A (en) * 2013-02-18 2013-06-19 中国农业银行股份有限公司 Method and device of data-caching mechanism
CN103716375A (en) * 2013-12-05 2014-04-09 北京用友政务软件有限公司 Distributed cache-based multistage financial data interaction method and system
CN104391876A (en) * 2014-10-30 2015-03-04 北京思特奇信息技术股份有限公司 Static data storing and querying method and system
CN105635208A (en) * 2014-10-30 2016-06-01 阿里巴巴集团控股有限公司 Business processing method and device
CN112130909A (en) * 2019-06-24 2020-12-25 杭州海康威视系统技术有限公司 Software framework and method of function execution
CN109062647B (en) * 2018-07-20 2021-11-09 武汉斗鱼网络科技有限公司 Data sharing method, device and equipment of active window and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5848241A (en) * 1996-01-11 1998-12-08 Openframe Corporation Ltd. Resource sharing facility functions as a controller for secondary storage device and is accessible to all computers via inter system links
CN100377247C (en) * 2003-10-31 2008-03-26 浙江中控技术股份有限公司 Real-time data on-line compression and decompression method
US7318127B2 (en) * 2005-02-11 2008-01-08 International Business Machines Corporation Method, apparatus, and computer program product for sharing data in a cache among threads in an SMT processor
CN100489814C (en) * 2007-08-01 2009-05-20 杭州华三通信技术有限公司 Shared buffer store system and implementing method

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101815094A (en) * 2010-03-18 2010-08-25 中兴通讯股份有限公司 Method, device and system for realizing data shared access
CN102999522A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Data storage method and device
CN102999522B (en) * 2011-09-15 2016-09-14 阿里巴巴集团控股有限公司 A kind of date storage method and device
CN102880557A (en) * 2012-09-13 2013-01-16 浙江金大科技有限公司 Multistage distribution type high-speed cache of heterogeneous data source
CN102880557B (en) * 2012-09-13 2015-06-10 浙江金大科技有限公司 look-up method of multistage distribution type high-speed cache of heterogeneous data source
CN103164347A (en) * 2013-02-18 2013-06-19 中国农业银行股份有限公司 Method and device of data-caching mechanism
CN103716375A (en) * 2013-12-05 2014-04-09 北京用友政务软件有限公司 Distributed cache-based multistage financial data interaction method and system
CN104391876A (en) * 2014-10-30 2015-03-04 北京思特奇信息技术股份有限公司 Static data storing and querying method and system
CN105635208A (en) * 2014-10-30 2016-06-01 阿里巴巴集团控股有限公司 Business processing method and device
CN109062647B (en) * 2018-07-20 2021-11-09 武汉斗鱼网络科技有限公司 Data sharing method, device and equipment of active window and storage medium
CN112130909A (en) * 2019-06-24 2020-12-25 杭州海康威视系统技术有限公司 Software framework and method of function execution

Also Published As

Publication number Publication date
CN100589079C (en) 2010-02-10

Similar Documents

Publication Publication Date Title
CN100589079C (en) Data sharing method, system and device
US11349940B2 (en) Server side data cache system
EP2002343B1 (en) Multi-cache cooperation for response output caching
CN1755677B (en) System and method for scoping searches using index keys
US8219544B2 (en) Method and a computer program product for indexing files and searching files
US7840547B1 (en) Methods and systems for efficient query rewriting
US8818942B2 (en) Database system with multiple layer distribution
CN103957239B (en) DNS cache information processing method, equipment and system
CN1975731A (en) System and method for managing access to data in a database
CN113420052B (en) Multi-level distributed cache system and method
US20070136306A1 (en) Distributed method for synchronizing and updating bookmarks on multiple computer devices
KR20060048655A (en) System and method for batched indexing of network documents
KR101634403B1 (en) Approaches to reducing lock communications in a shared disk database system
CN102314375A (en) Heterogeneous database storage unified interface and database access method
CN106202261A (en) The distributed approach of a kind of data access request and engine
CN104077397A (en) Response method for distributed big data classification retrieval webpage
JP2004514193A (en) Selective auditing of access to rows in a relational database on a database server
CN106372266A (en) Cache and accessing method of cloud operation system based on aspects and configuration documents
CN101236569A (en) Highly effective dynamic path analysis method based on ContextFS
CN109690522A (en) A kind of data-updating method, device and storage device based on B+ tree index
CN103136205A (en) Web picture service system and method
CN104346345A (en) Data storage method and device
CN104123356A (en) Method for increasing webpage response speed under large data volume condition
CN107526762A (en) Service end, multi-data source searching method and system
CN103559307A (en) Caching method and device for query

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201216

Address after: 276800 No. 71 Taiyuan Road, Rizhao Economic Development Zone, Shandong Province

Patentee after: Chuangze intelligent robot Group Co.,Ltd.

Address before: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20201216

Address after: 510640 2414-2416 of the main building 371, five mountain road, Tianhe District, Guangzhou, Guangdong.

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.