The content of the invention
To overcome above-mentioned the shortcomings of the prior art, the purpose of the present invention is that providing a kind of multimedia messages that are based on sends outThe resource file caching dissemination system and method for distribution system, to improve access speed, avoid real time access central server from droppingLow central server pressure and the service ability for improving system.
In view of the above and other objects, the present invention proposes a kind of resource file caching based on multi-medium information spreading systemDissemination system, including:
Central server, including the communication server and WEB server, for handling the transmitting-receiving of instant messages and being custodianMember provides WEB management services;
One-level Distributor, including multiple Distributors, for providing resource for terminal and two level DistributorProxy caching download function;
Two level Distributor, including multiple Distributors, download function is cached for providing Resource Broker for terminal;And
Multiple terminals.
Further, the central server is connected to each Distributor of the one-level Distributor, each distributionServer connects multiple terminal or two level Distributors respectively, and the two level Distributor connects multiple terminals.
Further, the Distributor provides Resource Broker caching download function, when resource is visited by terminal for the first timeCan be buffered after asking to the Distributor nearest from the terminal, subsequent terminal can directly arrive the Distributor and obtain the moneySource.
Further, the Distributor using con current control and is lined up processing strategy.
To reach above-mentioned purpose, the present invention also provides a kind of resource file caching point based on multi-medium information spreading systemForwarding method, comprise the following steps:
Step 1, terminal send resource download request to central server, and request obtains Distributor address;
Step 2, download resource is asked to corresponding Distributor according to the address of the Distributor of acquisition;
Step 3, Distributor judge to request, judge that requested resource whether there is, if resource is presentResource file is returned to terminal, corresponding resource is sent to upper level Distributor or central server if resource is not presentDownload request;
Step 4, after the resource file of upper level Distributor or central server is obtained, the DistributorThe resource file is returned to terminal.
Further, the Distributor includes one-level Distributor and/or two level Distributor.
Further, also include before step 1:
Terminal sends resource downloading detection request to central server, and whether detection local side resource is complete;
The central server returns to the corresponding information of resource download request file according to resource download request;
The terminal judges that resource corresponding to the resource download request locally whether there is;
In resource corresponding to the resource download request when being locally not present, into step 1.
Further, if resource is in the presence of local corresponding to the resource download request, determine whether that local file isIt is no complete, if local file is complete, terminate download request;If local file is imperfect, the information of local file is addedBreakpoint transmission is realized in resource download request.
Further, the step for judging whether local file is complete is returned by local file size with central serverThe server resource file size returned relatively judges whether local file is complete.
Further, timing cycle is needed when terminal is not completed and downloaded asks resource until resource to DistributorDownload and complete.
Compared with prior art, a kind of resource file caching dissemination system based on multi-medium information spreading system of the present inventionAnd method by design Distributor with provide Resource Broker cache download function so that resource access after can be buffered to pointSend out on server, the Web page that frequently accesses and object can will be needed to be stored on Distributor closer to the user, soWhen subsequent terminal accesses again, can directly arrives Distributor and obtains the resource, is effectively improved access speed, keeps awayThe service ability for having exempted from real time access central server to reduce central server pressure and improve system.
Embodiment
Below by way of specific instantiation and embodiments of the present invention are described with reference to the drawings, those skilled in the art canUnderstand the further advantage and effect of the present invention easily by content disclosed in the present specification.The present invention can also pass through other differencesInstantiation implemented or applied, the various details in this specification also can be based on different viewpoints with application, without departing substantially fromVarious modifications and change are carried out under the spirit of the present invention.
Fig. 1 is the system architecture that a kind of resource file based on multi-medium information spreading system of the present invention caches dissemination systemFigure.As shown in figure 1, a kind of resource file caching dissemination system based on multi-medium information spreading system of the present invention, including:CenterServer 10, one-level Distributor CDN (Content Delivery Network) 20, two level Distributor CDN(Content Delivery Network) 30 and multiple terminals 40 form.
Wherein, central server 10 is made up of the communication server (Message Server) and WEB server, for handlingThe transmitting-receiving of instant messages and provide WEB management services for administrative staff;One-level Distributor CDN (Content DeliveryNetwork) 20 by multiple Distributor CDN0KComposition, for for terminal 40 and two level Distributor CDN (ContentDelivery Network) 30 offer Resource Broker caching download functions;Two level Distributor CDN (ContentDelivery Network) 30 by multiple Distributor CDN1JComposition, downloaded for providing Resource Broker caching for terminal 40Function.
Central server 10 is connected to each point of one-level Distributor CDN (Content Delivery Network) 30Send out server CDN0K, each Distributor CDN0KMultiple terminals 40 or two level Distributor CDN1J, two fractions are connected respectivelySend out the multiple terminals 40 of server CDN1J connections.
As above scheme, Distributor CDN (Content Delivery Network), there is provided Resource Broker caching downloads work(Can, resource can be buffered to the server after accessing for the first time, and follow-up other terminals can directly arrive server acquisition shouldResource, the service ability for avoiding real time access server to reduce server stress and improve system so that resource file cachesDistribute pressure to reduce, speed lifting.
In the specific embodiment of the invention, central server 10 adds the binding work(of terminal and two-stage DistributorEnergy;The http interfaces of query field of terminal download address and simple con current control function are provided.The communication server is whole systemCore hinge, once obstruction, whole system will collapse.Therefore, as far as possible should not be by logical without the returning to demand immediately of the taskTelecommunications services device is to reduce the impact to main business.
In the present invention, in order to ensure Distributor traffic handing capacity, Distributor (including one-level distribution serviceDevice uses con current control with two level Distributor, is lined up processing strategy, and the reasonable value of its con current control number is needed according to toolBody environment is assessed, and assesses object emphasis number bandwidth resources, and specifically, such as when not having resource in caching, control is concurrently controlledNumber processed is less than 5;When resource in caching being present, con current control can reach 50, even more more;
Fig. 2 is the step flow that a kind of resource file based on multi-medium information spreading system of the present invention caches distribution methodFigure.As shown in Fig. 2 a kind of resource file caching distribution method based on multi-medium information spreading system of the present invention, including it is as followsStep:
Step 201, terminal sends resource download request to central server, and request obtains Distributor address and protectedDeposit, that is to say, that terminal can obtain the relative of the Distributor that resource is cached according to the program bag that central server issuesAddress, i.e. central server returns to the program bag issued according to resource download request to terminal can include the relative address of resource,Terminal then obtains the address of Distributor accordingly.In the specific embodiment of the invention, Distributor includes two layers of distribution and takenBusiness device, one layer is LAN environment, and one layer is configuration public network IP world, and in the present invention, Distributor provides Resource BrokerDownload function is cached, can be buffered after resource accessed download for the first time to Distributor, subsequent terminal then can be directThe resource is obtained to Distributor, without obtaining the resource from central server, can so be avoided genuinely convinced in real time accessService ability of the business device to reduce central server pressure and improve system so that resource file caching distribution pressure is reduced, speedDegree lifting.
Step 202, asked to download resource to corresponding Distributor according to the address of the Distributor of acquisition.AlsoIt is to say, terminal can submit to corresponding Distributor according to the relative address assembly of resource in the program bag issued and ask whetherIt can download;
Now server can judge to request, and whether resource whether there is, concurrently exceed), it can be returned when can not downloadReturn terminal wait state
Step 203, whether Distributor judges to request, judge that requested resource whether there is, concurrently surpassWhen, specifically, searched according to the resource of terminal request in the Resources list of Distributor, the Resources list can record oftenThe state of individual resource, for example, have download downloaded resource be not present etc.;According to judged result carry out requestCorresponding processing, resource file is returned to terminal if resource is present, here it should be noted that, when terminal is not completed to downloadThen need timing cycle asks resource until resource downloading is completed, to upper level point if resource is not present to DistributorSend out server or central server sends corresponding resource download request;Specifically, if resource is not present, distribute to upper levelThe WEB server of server or central server asks the WEB server of resource, upper level Distributor or central serverReturn to resource file;
Step 204, after the resource file of upper level Distributor or central server is obtained, Distributor is to endEnd returns to resource file.In the specific embodiment of the invention, returned from one-level Distributor or two level Distributor to terminalReturn resource file.
Preferably, as shown in figure 3, before step 201, further comprise:
After program bag is taken, terminal sends resource downloading detection request to central server, and detection local side resource isNo complete, specifically, terminal sends resource downloading detection request to the communication server of central server, in the present invention, eventuallyHold the hash file for sending a request for downloading resource to central server;
Central server returns to the hash file of request download resource according to resource download request;
Terminal resource according to corresponding to the hash file of acquisition judges resource downloading detection request locally whether there is;
If local be not present, into step 201, if local have file corresponding to resource downloading detection request,Determine whether local file is complete, specifically, the central server that can be returned by local file and central serverResource size relatively judge whether local file complete, such as local file size be less than server resource size, thenRepresent that the resource is imperfect, need further to download the resource by breakpoint transmission;
If local file is imperfect, the information for adding local file enters step 201, i.e., by the information of local file,Such as the size of local file, resume starting position of file etc. and add in resource download request, realized breakpoint transmission.
Fig. 4 is that the resource file based on multi-medium information spreading system of the specific embodiment of the invention caches distribution methodProcess schematic.The present invention will be further illustrated by a specific embodiment below:
On the one hand, the first step, when administrative staff send program by the WEB server selection operation of central server 10,The transmission program download instruction is uploaded to the communication server of central server 10 by second step, WEB server, the 3rd step, inThe communication server of central server 10 sends download instruction, the 4th step to terminal 40, and terminal 40 takes to the WEB of central server 10It to be engaged in the address of device request Distributor 20, the 5th step, the WEB server of central server 10 is to the return address of terminal 40, and theSix steps, the server that terminal 40 is designated by the address ask resource and complete to download;
On the other hand, the first step, the hash file (Hash Code) of the transmission request download resource of terminal 40, second step, inThe communication server of central server 10 returns to hash file, the 3rd step to terminal 40, and whether terminal 40 judges hash file localIt has been existed that, if being not present, carry out resource download request;If in the presence of acquisition local file size and server resource fileSize, when in the same size, then without downloading, during cause not of uniform size, then breakpoint transmission, the 4th step are carried out, terminal 40 takes HashFile asks resource, the 5th step, one-level Distributor 20 or two to one-level Distributor 20 or two level Distributor 30Level Distributor 30 judges that resource whether there is, and resource file is returned to terminal 40 if resource is present, if resource is not presentThen to the WEB server request resource of, central server 10, the WEB server of central server 10 is to one-level Distributor20 or two level Distributor 30 return resource file, then one-level Distributor 20 or two level Distributor 30 are again to endEnd 40 returns to resource file;5th step, terminal 40, which is downloaded to finish to the communication server notice of central server 10, downloads resultAnd more new resources upstate.
In summary, the present invention a kind of resource file caching dissemination system and method based on multi-medium information spreading systemDownload function is cached to provide Resource Broker so that resource can be buffered to distribution after accessing and service by designing DistributorOn device, the Web page that frequently accesses and object can will be needed to be stored on Distributor closer to the user, so when follow-upCan directly arrives Distributor and obtains the resource when terminal accesses again, is effectively improved access speed, avoids realityWhen access central server with reduce central server pressure and improve system service ability.
Because service has all been dispersed to different servers, it is mutually isolated between server, and every serverFire wall can be pointedly set.When a certain server is attacked, other server can be with unaffected, will notThere are all situations for servicing and all collapsing.
The above-described embodiments merely illustrate the principles and effects of the present invention, not for the limitation present invention.AnyArt personnel can be modified above-described embodiment and changed under the spirit and scope without prejudice to the present invention.Therefore,The scope of the present invention, should be as listed by claims.