Summary of the invention
In view of this, the present invention provides a kind of terminal of realizing local caching of network service data, and this terminal can be managed a plurality of LWS that the terminal is provided with, and realizes local caching of network service data.
The present invention also provides a kind of method that realizes local caching of network service data, and this method can be managed a plurality of LWS that the terminal is provided with, and realizes local caching of network service data.
According to above-mentioned purpose, technical scheme of the present invention is achieved in that
A kind of terminal of realizing local caching of network service data comprises a plurality of request module and LWS pond, between a plurality of request module and LWS pond, also comprises WS administrative center, wherein,
Request module is used for sending network service request to WS administrative center, receives network service data from WS administrative center;
WS administrative center is used for determining whether the network service data that buffer memory is asked to some extent according to the network service request that receives; If then obtain the network service data of being asked and send to request module, if not; When then in confirming the LWS pond, the LWS of the network service data of asking being provided; From the LWS pond, confirm to provide the LWS of the network service data of asking, from the LWS that confirms, obtain the network service data of being asked after, send to request module;
The LWS pond has a plurality of local network services LWS, is respectively from the etwork service engine of correspondence and obtains network service data.
Said WS administrative center; When also being used for from the LWS pond confirming the LWS of the network service data of asking is not provided; According to the network service data information that network service request is carried, from etwork service engine, obtain the network service data of being asked through the client communication module that the terminal is provided with.
Said WS administrative center also comprises LWS log-on message storehouse; Be used for storing the corresponding relation between the LWS sign of the LWS pond LWS that manages and the network service data information that LWS is stored; Receive carry the network service request that will obtain network service data information after; Confirm the LWS sign that this request is corresponding according to corresponding relation, confirm to provide the LWS of the network service data of asking.
Said WS administrative center also comprises WS metadata cache storehouse, is used for network service data that the client communication module that is provided with through the terminal is obtained from etwork service engine or the network service data that obtains from LWS, corresponding to the crucial index information buffer memory of WS,
Whether the said network service data that determines whether that buffer memory is asked to some extent is to have the crucial index information of corresponding WS to confirm according to said network service request.
A kind of method that realizes network service local cache is provided with WS administrative center on the terminal, this method comprises:
WS administrative center is according to the network service request that receives; Determine whether the network service data that buffer memory is asked to some extent, if then obtain the network service data of being asked and send to request module; If not; When then confirming in the LWS pond LWS of the network service data of asking to be provided, confirm to provide the LWS of the network service data of asking, obtain network service data from the LWS that confirms.
Described request is carried network service data information, saidly confirms to provide the LWS process of the network service data of asking to be:
WS administrative center is provided with the corresponding relation between the LWS sign of the LWS that manages and the network service data information that LWS is stored; Obtain the corresponding LWS sign of the entrained network service data information of network service request according to corresponding relation, confirm to provide the LWS of the network service data of asking.
When WS administrative center confirmed the LWS of the network service data of asking is not provided, this method also comprised:
WS administrative center obtains the network service data of asking from network.
The crucial index information buffer memory of the corresponding WS of network service data that said WS administrative center will obtain from LWS or that obtain from network, whether the said network service data that determines whether that buffer memory is asked to some extent is to have the crucial index information of corresponding WS to confirm according to said network service request.
The crucial index information of said WS comprises the timestamp information of corresponding network service data, and said process of caching is:
Determine whether to satisfy the WS metadata cache condition that WS sets, if crucial index information buffer memory of the corresponding WS of network service data or cover original network service data that then will buffer memory be if not, then finish process of caching.
Can find out from such scheme; The present invention is provided with WS administrative center on the terminal; Be used for the buffer memory network service data and a plurality of LWS on the terminal are carried out unified management, when receiving network service request, determine whether that buffer memory has network service data; If then directly obtain the network service data of institute's buffer memory; If, then from corresponding LWS, do not obtain the network service data of request.In addition, WS administrative center can also pass through mobile communications network or Internet access network service-Engine, behind the network service data that does not have storage to ask among the LWS that is managed, obtains network service data from the Internet.Therefore, terminal provided by the invention and method can be managed LWS, the network service request that Unified Treatment receives, and the data of providing services on the Internet realize local caching of network service data.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, below lift specific embodiment and, the present invention is carried out further detailed explanation with reference to accompanying drawing.
The present invention realizes local caching of network service data, promptly after receiving network service request in order on the terminal, a plurality of LWS to be managed; These a plurality of LWS of uniform dispatching obtain the network service data that will obtain, and on the terminal, are provided with WS administrative center; This administrative center is in request module and have between the LWS pond of a plurality of LWS; Be used for the buffer memory network service data and a plurality of LWS on the terminal are carried out unified management, when when request module receives network service request, if the network service data of buffer memory to some extent; Then directly obtain; Otherwise, when then confirming in the LWS pond LWS of the network service data of asking to be provided, from corresponding LWS, obtain the network service data of request.
Fig. 1 is the terminal structure sketch map of realization local caching of network service data provided by the invention, and is as shown in the figure, and this terminal comprises a plurality of request module, WS administrative center and have the LWS pond of a plurality of LWS, wherein,
Request module, have a plurality of, be expressed as respectively in the drawings request module #1, request module #2 ... .. and request module #M, be used for sending network service request to WS administrative center, receive network service data from WS administrative center;
WS administrative center is used for the buffer memory network service data and a plurality of LWS in LWS pond is carried out unified management, according to the network service request that receives; Determine whether the network service data of buffer memory to some extent, if then directly obtain; Otherwise, when then confirming in the LWS pond LWS of the network service data of asking to be provided, from the LWS pond, confirm to provide the LWS of the network service data of being asked; After from the LWS that confirms, obtaining the network service data of being asked, offer request module;
The LWS pond has a plurality of LWS, be expressed as respectively in the drawings LWS#1, LWS#2 ... and LWS#N, wherein the network service data that from network, obtains in advance of each LWS storage is the network service that its corresponding WS provides localization.
In this embodiment; It is exactly that network service request is transmitted to definite LWS that WS obtains the network service data of being asked from the LWS that confirms, the network service data information of being carried according to this request by the LWS that confirms sends to WS administrative center with the network service data of being asked.
In this embodiment; WS administrative center carries out unified management to a plurality of LWS in the LWS pond; In fact be exactly that the LWS sign of same LWS and the corresponding relation between its network service data information of storing are set; When receive carry the network service request that will obtain network service data information after, confirm the LWS sign that this request is corresponding according to corresponding relation, thereby confirm LWS.The corresponding relation that WS administrative center is provided with is stored in the LWS log-on message storehouse of WS administrative center.
In this embodiment; When WS administrative center confirms not provide services on the Internet the LWS of the request network service data of asking according to corresponding relation; The network service data information that then can carry according to network service request is obtained the network service data of being asked through the client communication module that the terminal is provided with from etwork service engine.At this moment, set up client between client communication module that the terminal is provided with and the etwork service engine and communicate by letter, obtain network service data through this data communication with network side data.
In this embodiment; WS administrative center also has WS metadata cache storehouse; The network service data that can from etwork service engine, obtain through the client communication module that the terminal is provided with or carry out buffer memory from the network service data that LWS obtains; So that follow-up receive network service request after, from this WS metadata cache storehouse, obtain corresponding network service data.
Below lift two specific embodiments method provided by the invention is described, Fig. 2 is method specific embodiment one flow chart of realization local caching of network service data provided by the invention, and its concrete steps are:
Step 201, WS administrative center receive network service request;
In this step, the network service request that is received is carried network service data information;
Step 202, WS administrative center ask according to this, the network service data of inquiry institute buffer memory;
In this step, the network service data of institute's buffer memory is that WS administrative center obtains from the network of network engine or from LWS, and during inquiry, whether the network service data information inquiry of carrying according to this request has corresponding network service data to get final product;
Step 203, WS administrative center judge from buffer memory, whether to inquire the network service data of being asked, if not, and execution in step 205; If, execution in step 204;
Step 204, WS administrative center directly obtain the network service data of being asked from buffer memory;
Step 205, WS administrative center inquiry LWS log-on message storehouse;
In this step; Corresponding relation between the LWS sign of the LWS that manages that WS administrative center is provided with and the network service data information that LWS is stored; Be arranged in the LWS log-on message storehouse; Therefore inquire about LWS log-on message storehouse, just can obtain the corresponding LWS sign of the entrained network service data information of network service request, thereby determine whether to provide the LWS of the network service data of asking according to corresponding relation;
Step 206, WS administrative center judge whether to exist LWS that the network service data of being asked can be provided, if, execution in step 207; If not, execution in step 209;
Step 207, WS administrative center send this network service request to the LWS that confirms;
After step 208, this LWS receive network service request, the network service data of being stored to the network service data information that should ask to carry is sent to LWS administrative center;
In this step, LWS administrative center can also be with the network service data buffer memory that receives, so that be the subsequent request data of providing services on the Internet;
Step 209, this WS administrative center communicate with the etwork service engine that the network service data of asking is provided through communication module and are connected, and send network service request and give this etwork service engine;
After step 210, etwork service engine receive network service request, will send to LWS administrative center through the client communication module to the network service data of the network service data information that should ask to carry;
In this step, LWS administrative center can also be with the network service data buffer memory that receives, so that be the subsequent request data of providing services on the Internet.
The present invention has increased WS metadata cache storehouse in the terminal; This metadata cache banked cache from network engine or the network service data that from LWS, obtains; And come corresponding with the crucial index information of WS; The crucial index information of this WS can guarantee the crucial index information of the corresponding WS of network service data information that each network service request is carried by the definition of WS administrative center, is used to inquire about the network service data of institute's buffer memory.
In the present invention; Because network service data also has the real-time characteristics; So the crucial index information of WS also comprises the timestamp information of pairing network service data, at this time, from LWS or the network service data that from network engine, obtains all have timestamp information.
Fig. 3 is method specific embodiment two flow charts of realization local caching of network service data provided by the invention, and its concrete steps are:
Step 301, WS administrative center receive the network service request that request module is sent;
Step 302, WS administrative center obtain the crucial index information of WS from WS metadata cache database;
The crucial index information of WS that the network service data information inquiry that step 303, WS administrative center carry according to network service request is corresponding;
Step 304, WS administrative center determine whether to exist the crucial index information of corresponding WS, if, execution in step 305; If not, execution in step 306;
Step 305, WS administrative center confirm whether the timestamp in the crucial index information of this WS is effective, if, execution in step 310; If then execution in step 306 not;
In this step, can the timestamp in current time and the crucial index information of this WS be compared, determine whether to surpass the scope of setting, if, then invalid, if it is not, then effective;
The network service data information that step 306, WS administrative center carry according to network service request confirms to provide the LWS or the network engine of this network service data, and this request is sent to determined LWS or network engine;
Step 307, WS administrative center receive the network service data that determined LWS or network engine return;
Step 308, WS administrative center judge whether these data satisfy the WS metadata cache condition of setting, if then execution in step 309; If then execution in step 310 not;
In this step, the WS metadata cache condition of setting is the condition that the WS metadata cache is set by WS administrative center, such as space size and time renewal etc.;
Step 309, WS be with the network service data buffer memory that is received or with this network service data cover original network service data, and increase or revise the crucial index information of WS that should network service data;
In this step; Because the consolidated network service data can be brought in constant renewal in different time; So even WS stores identical network service data, also need be after receiving the consolidated network service data, the network service data of institute's buffer memory is covered or upgrades; And revise the crucial index information of corresponding WS, comprise timestamp information etc.;
Step 310, WS administrative center send this network service data that receives to request module.
From terminal provided by the invention and method can find out; The present invention is provided with WS administrative center on the terminal; Be used for a plurality of LWS on the terminal are carried out unified management; When receiving network service request, when then confirming in the LWS pond LWS of the network service data of asking to be provided, from corresponding LWS, obtain the network service data of request.In addition, WS administrative center can also pass through mobile communications network or Internet access network service-Engine, behind the network service data that does not have storage to ask among the LWS that is managed, obtains network service data from the Internet.Therefore, terminal provided by the invention and method can be managed LWS, the network service request that Unified Treatment receives, and the data of providing services on the Internet realize local caching of network service data.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being made, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.