CN102196506B - Network resource access control method, system and device - Google Patents
Network resource access control method, system and device Download PDFInfo
- Publication number
- CN102196506B CN102196506B CN2010101256784A CN201010125678A CN102196506B CN 102196506 B CN102196506 B CN 102196506B CN 2010101256784 A CN2010101256784 A CN 2010101256784A CN 201010125678 A CN201010125678 A CN 201010125678A CN 102196506 B CN102196506 B CN 102196506B
- Authority
- CN
- China
- Prior art keywords
- connection request
- terminal
- internet resources
- server
- network resource
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种网络资源访问控制方法、系统及装置,该方法包括:网关接收终端发送的第一连接请求;当判断出所述第一连接请求中携带缓存标识信息、且所述终端不是本次上线后首次请求所述第一连接请求所请求的网络资源时,所述网关发送去除所述缓存标识信息后的第二连接请求给提供所述网络资源的服务器;以及接收所述服务器所述第二连接请求下发的网络资源转发给所述终端。避免了终端频繁发送连接请求,减轻了网络设备的负荷,节约了网络资源。
The present invention discloses a network resource access control method, system and device. The method includes: a gateway receiving a first connection request sent by a terminal; when it is judged that the first connection request carries cache identification information and the terminal is not When requesting the network resource requested by the first connection request for the first time after going online this time, the gateway sends a second connection request after removing the cache identification information to the server providing the network resource; and receives the request from the server The network resource issued by the second connection request is forwarded to the terminal. This prevents the terminal from frequently sending connection requests, reduces the load on network devices, and saves network resources.
Description
技术领域 technical field
本发明涉及网络技术领域,尤指一种用于终端和网络服务器之间的网络资源访问控制方法、系统及装置。The invention relates to the field of network technology, in particular to a method, system and device for controlling network resource access between a terminal and a network server.
背景技术 Background technique
现有网络资源系统中,终端通过访问网络资源提供者的服务器,获取网络资源即服务内容。在HTTP1.1协议中描述了网络资源访问中基本的缓存机制。终端和服务器之间通过明确的消息头标识字段来描述双方是否支持缓存功能。In an existing network resource system, a terminal obtains network resources, that is, service content, by accessing a server of a network resource provider. The basic caching mechanism in network resource access is described in the HTTP1.1 protocol. Between the terminal and the server, a clear message header identification field is used to describe whether the two parties support the caching function.
如图1所示为现有技术中终端向服务提供方的服务器请求网络资源的流程图。其中:FIG. 1 is a flow chart of a terminal requesting network resources from a server of a service provider in the prior art. in:
终端首次访问某一网络资源时,包括下列步骤:(1)终端发起连接请求;(2)无线接入协议(Wireless Access Protocol,WAP)网关转发连接请求给服务器;(3)服务器下发网络资源;(4)WAP网关转发网络资源给终端。其中,服务器下发网络资源时,会携带网络资源的描述信息,包括最近更新时间(LastModified)、有效期限(Expires)和其他缓存控制信息(Cache Control)等。When a terminal accesses a certain network resource for the first time, it includes the following steps: (1) The terminal initiates a connection request; (2) The Wireless Access Protocol (WAP) gateway forwards the connection request to the server; (3) The server issues the network resource ; (4) The WAP gateway forwards network resources to the terminal. Among them, when the server delivers the network resources, it will carry the description information of the network resources, including the latest update time (LastModified), expiration date (Expires) and other cache control information (Cache Control).
终端多次访问某一网络资源时,每次访问的过程包括下列步骤:(11)终端发起连接请求,由于不是第一次访问,因此在连接请求中携带缓存标识(IfModified Since)字段;(12)WAP网关转发连接请求给服务器;(13)服务器下发响应消息通知终端内容未更新;(14)WAP网关转发响应消息给终端。When the terminal accesses a certain network resource multiple times, the process of each access includes the following steps: (11) The terminal initiates a connection request, and since it is not the first time to access, the connection request carries the cache identifier (IfModified Since) field; (12) ) The WAP gateway forwards the connection request to the server; (13) The server sends a response message to notify the terminal that the content has not been updated; (14) The WAP gateway forwards the response message to the terminal.
也就是说,现有技术中终端通过连接请求的消息头中的标识字段来标识发送请求的终端是否具有缓存功能,服务器也可以标识本次被请求的内容是否允许被缓存。当允许时,服务器一般就会通知终端所请求的内容允许被缓存的有效期,当有效期过后,终端会重新发起请求,以便获取新的内容。终端可以在连接请求中携带相关查询条件,查询缓存的内容是否被更新,服务器发现该部分内容更新后,将更新后的内容提供给终端,或服务器发现该部分内容没更新时,通知终端不需要更新。该缓存机制的目的是以最少的信息交互量,实现有效及时的更新终端中缓存的内容信息。That is to say, in the prior art, the terminal identifies whether the terminal sending the request has a caching function through the identification field in the message header of the connection request, and the server can also identify whether the content requested this time is allowed to be cached. When it is allowed, the server will generally notify the terminal of the validity period of the content requested to be cached. When the validity period expires, the terminal will re-initiate the request in order to obtain new content. The terminal can carry relevant query conditions in the connection request to check whether the cached content has been updated. After the server finds that the content of this part has been updated, it will provide the updated content to the terminal, or when the server finds that the content of this part has not been updated, it will notify the terminal that it does not need to renew. The purpose of the caching mechanism is to achieve effective and timely updating of content information cached in the terminal with the least amount of information interaction.
上述网络资源访问的实现方式,针对某一个终端,由于其缓存机制实现中存在的问题(例如:缓存内容已经被破坏等或者由于设置导致其在有效期内重复请求等),当需要重新获取所请求的网络资源时,会重新发送连接请求,而由于连接请求中携带有缓存标识字段,使得服务器会认为终端中已缓存了所请求的网络资源的内容,而不会重新下发所请求的网络资源内容给终端。终端在不能重新获得网络资源的情况下,则会频繁发送对相同网络资源的连接请求。WAP网关每次都会将连接请求直接转发给相应的提供网络资源的服务器,由于尚在有效期内,因此,服务器每次都会下发网络资源内容未改变的信息给终端,例如:每次下发代码304(Not Modified),以通知终端该网络资源内容没有发生变化。而不会将所请求的网络资源的内容发送给用户终端,导致终端无法正常显示该部分内容。The implementation of the above-mentioned network resource access, for a certain terminal, due to problems in the implementation of its cache mechanism (for example: the cache content has been destroyed, etc., or due to settings that cause repeated requests within the validity period, etc.), when it is necessary to re-acquire the requested The connection request will be resent when the connection request contains the cache identification field, so the server will think that the content of the requested network resource has been cached in the terminal, and will not resend the requested network resource content to the terminal. When the terminal cannot regain the network resources, it will frequently send connection requests for the same network resources. The WAP gateway will directly forward the connection request to the corresponding server that provides network resources each time. Since it is still within the validity period, the server will send the information that the content of the network resources has not changed to the terminal every time, for example: every time the code is sent 304 (Not Modified) to notify the terminal that the content of the network resource has not changed. Instead of sending the content of the requested network resource to the user terminal, the terminal cannot normally display this part of the content.
由于终端在网络资源有效期内频繁发送连接请求的行为,导致服务器接收到大量的无效请求,给网络设备造成很大的业务处理压力。Due to the frequent sending of connection requests by the terminal within the validity period of the network resources, the server receives a large number of invalid requests, which puts a lot of business processing pressure on the network equipment.
尤其是当具有缓存功能的多个终端请求同一个网络资源时,WAP网关会将各个终端的请求一一发送给服务提供者的服务器。当上述终端频繁发送请求的情况发生时,由于WAP网关不具备缓存功能,而是直接进行信息转发,可能会导致仍处于缓存有效期内的网络资源连接请求的大量转发,造成网络资源的浪费。Especially when multiple terminals with caching function request the same network resource, the WAP gateway will send the requests of each terminal to the server of the service provider one by one. When the above-mentioned terminal frequently sends requests, because the WAP gateway does not have a cache function, but directly forwards information, it may cause a large number of forwarding of network resource connection requests that are still within the validity period of the cache, resulting in a waste of network resources.
发明内容 Contents of the invention
本发明实施例提供一种网络资源访问控制方法、系统及装置,用于解决现有技术中终端频繁发送连接请求,增加网络设备负荷,造成网络资源浪费的问题。Embodiments of the present invention provide a network resource access control method, system and device, which are used to solve the problem in the prior art that terminals frequently send connection requests, which increases the load of network equipment and causes waste of network resources.
一种网络资源访问控制方法,包括:A network resource access control method, comprising:
网关接收终端发送的第一连接请求;The gateway receives the first connection request sent by the terminal;
当判断出所述第一连接请求中携带缓存标识信息、且所述终端不是本次上线后首次请求所述第一连接请求所请求的网络资源时,所述网关发送去除所述缓存标识信息后的第二连接请求给提供所述网络资源的服务器;以及When it is determined that the first connection request carries cache identification information and the terminal is not the first request for the network resource requested by the first connection request after going online this time, the gateway sends an the second connection request to the server providing the network resource; and
接收所述服务器根据所述第二连接请求下发的网络资源,并转发给所述终端。receiving the network resource sent by the server according to the second connection request, and forwarding it to the terminal.
一种网络资源访问控制系统,包括:终端、网关和提供网络资源的服务器;A network resource access control system, including: a terminal, a gateway and a server providing network resources;
所述网关,用于接收所述终端发送的第一连接请求;当判断出所述第一连接请求中携带缓存标识信息、且所述终端不是本次上线后首次请求所述第一连接请求所请求的网络资源时,发送去除所述缓存标识信息后的第二连接请求给提供所述网络资源的所述服务器;以及接收所述服务器根据所述第二连接请求下发的网络资源,并转发给所述终端;The gateway is configured to receive the first connection request sent by the terminal; when it is determined that the first connection request carries cache identification information and the terminal is not the first request for the first connection request after going online this time, When requesting a network resource, send a second connection request after removing the cache identification information to the server that provides the network resource; and receive the network resource issued by the server according to the second connection request, and forward to said terminal;
所述服务器,用于根据去除所述缓存标识信息后的第二连接请求下发网络资源给所述终端;The server is configured to deliver network resources to the terminal according to the second connection request after removing the cache identification information;
所述终端,用于发送网络资源第一连接请求,以及接收所述服务器下发的网络资源。The terminal is configured to send a first connection request for network resources, and receive network resources sent by the server.
一种网络资源访问控制装置,包括:A network resource access control device, comprising:
接收模块,用于接收终端发送的第一连接请求;a receiving module, configured to receive the first connection request sent by the terminal;
第一判断模块,用于判断所述第一连接请求中是否携带缓存标识信息,以及判断所述终端是否是本次上线后首次请求所述第一连接请求中所请求的网络资源;A first judging module, configured to judge whether the first connection request carries cache identification information, and judge whether the terminal requests the network resource requested in the first connection request for the first time after going online this time;
第一执行模块,用于当所述第一判断模块判断出所述第一连接请求中携带缓存标识信息且所述终端不是本次上线后首次请求所述第一连接请求中所请求的网络资源时,发送去除所述缓存标识信息后的第二连接请求给提供所述网络资源的所述服务器;The first execution module is configured to, when the first judging module judges that the first connection request carries cache identification information and the terminal is not the first request for the network resources requested in the first connection request after going online this time , sending a second connection request after removing the cache identification information to the server providing the network resource;
反馈模块,用于接收所述服务器根据去除所述缓存标识信息后的第二连接请求下发的网络资源,并转发给所述终端。A feedback module, configured to receive the network resource sent by the server according to the second connection request after removing the cache identification information, and forward it to the terminal.
本发明实施例提供的网络资源访问控制方法、系统及装置,通过网关接收终端发送的第一连接请求;当判断出所述第一连接请求中携带缓存标识信息、且所述终端不是本次上线后首次请求所述第一连接请求所请求的网络资源时,所述网关发送去除所述缓存标识信息后的第二连接请求给提供所述网络资源的服务器;以及接收所述服务器根据所述第二连接请求下发的网络资源,并转发给所述终端。该方法在终端不是首次访问所请求的网络资源时,由网关将修改后的连接请求转发给服务器,服务器则可以直接下发网络资源,使终端能够正确、及时的获取到所请求的网络资源,避免了终端频繁发送连接请求,减轻了网络设备的负荷,节约了网络资源。The network resource access control method, system and device provided by the embodiments of the present invention receive the first connection request sent by the terminal through the gateway; when it is judged that the first connection request carries cache identification information and the terminal is not going online this time When requesting the network resource requested by the first connection request for the first time afterward, the gateway sends a second connection request after removing the cache identification information to the server providing the network resource; and receiving the server according to the first connection request 2. Connect to the network resource issued by the request and forward it to the terminal. In this method, when the terminal is not accessing the requested network resource for the first time, the gateway forwards the modified connection request to the server, and the server can directly deliver the network resource, so that the terminal can correctly and timely obtain the requested network resource. This prevents the terminal from frequently sending connection requests, reduces the load on network devices, and saves network resources.
附图说明 Description of drawings
图1为现有技术中终端访问网络资源的实现流程图;Fig. 1 is the implementation flowchart of terminal accessing network resources in the prior art;
图2为本发明实施例中网络资源访问控制方法的流程图;FIG. 2 is a flowchart of a network resource access control method in an embodiment of the present invention;
图3为本发明实施例一中网络资源访问控制方法的流程图;FIG. 3 is a flow chart of a network resource access control method in Embodiment 1 of the present invention;
图4为本发明实施例一中网络资源访问控制方法的网元间的处理流程图;FIG. 4 is a flow chart of processing between network elements in the network resource access control method in Embodiment 1 of the present invention;
图5为本发明实施例二中网络资源访问控制方法的流程图;FIG. 5 is a flow chart of a network resource access control method in Embodiment 2 of the present invention;
图6为本发明实施例二中网络资源访问控制方法的网元间的处理流程图;FIG. 6 is a flow chart of processing between network elements in the network resource access control method in Embodiment 2 of the present invention;
图7为本发明实施例中网络资源访问控制系统的结构示意图;FIG. 7 is a schematic structural diagram of a network resource access control system in an embodiment of the present invention;
图8为本发明实施例中网络资源访问控制装置的一种结构示意图;FIG. 8 is a schematic structural diagram of a network resource access control device in an embodiment of the present invention;
图9为本发明实施例中网络资源访问控制装置的另一种结构示意图。FIG. 9 is another schematic structural diagram of a network resource access control device in an embodiment of the present invention.
具体实施方式 Detailed ways
本发明实施例提供一种网络资源访问控制方法,通过网关对终端的网络资源访问进行控制,使得终端访问互联网上服务内容提供者(Service Provider,SP)所提供的网络资源时,能够准确获取到所需要的网络资源,且有效地避免了重复访问获取。The embodiment of the present invention provides a network resource access control method, which controls the network resource access of the terminal through the gateway, so that when the terminal accesses the network resources provided by the service content provider (Service Provider, SP) on the Internet, it can accurately obtain the The required network resources, and effectively avoid repeated access to obtain.
本发明实施例所提供的网络资源访问控制方法中,其流程如图2所示,包括下列步骤:In the network resource access control method provided by the embodiment of the present invention, its flow is shown in Figure 2, including the following steps:
步骤S11:网关接收终端发送的连接请求(第一连接请求)。Step S11: the gateway receives the connection request (first connection request) sent by the terminal.
较佳的,上述网关为WAP网关,当然也可以是其他的网关。Preferably, the above gateway is a WAP gateway, and of course it can also be other gateways.
步骤S12:网关判断接收到的连接请求是否携带有缓存标识。Step S12: The gateway judges whether the received connection request carries a cache identifier.
当所述连接请求携带缓存标识时,执行步骤S14。当不携带时,执行步骤S13。When the connection request carries a cache identifier, step S14 is performed. When not carried, execute step S13.
步骤S13:按照不缓存网络资源的正常流程处理连接请求。Step S13: Process the connection request according to the normal process of not caching network resources.
步骤S14:判断该终端本次上线后是否首次请求上述连接请求中所请求的网络资源。Step S14: Determine whether the terminal requests the network resource requested in the above connection request for the first time after going online this time.
当确定出终端不是本次上线后首次访问所请求的网络资源时,执行步骤S15;否则执行步骤S17。When it is determined that it is not the first time that the terminal accesses the requested network resource after going online this time, step S15 is executed; otherwise, step S17 is executed.
步骤S15:网关发送去除缓存标识信息后的连接请求(第二连接请求)给提供网络资源的服务器。Step S15: The gateway sends a connection request (second connection request) after removing the cache identification information to the server providing network resources.
步骤S16:服务器通过网关下发网络资源给终端。Step S16: the server delivers network resources to the terminal through the gateway.
服务器根据去除缓存标识信息后的连接请求下发网络资源给终端。从而使得终端可以及时获取到所需的网络资源,避免连接请求的频繁发送。The server sends network resources to the terminal according to the connection request after removing the cache identification information. Therefore, the terminal can obtain the required network resources in time, and avoid frequent sending of connection requests.
较佳的,上述方法还包括:Preferably, the above method also includes:
步骤S17:网关根据获取到的判定终端所缓存的网络资源是否有效的判定结果,发送信息给终端,包括:发送表征所请求的网络资源内容未更新的响应消息或转发服务器下发的更新后的网络资源给终端。Step S17: The gateway sends information to the terminal according to the obtained judgment result of judging whether the network resource cached by the terminal is valid, including: sending a response message indicating that the content of the requested network resource has not been updated or an updated message issued by the forwarding server Network resources are given to the terminal.
当确定终端是本次上线后首次访问所请求的网络资源时,由网关将获取到的判定终端所缓存的网络资源是否有效的判定结果发送给终端,并在判定终端所缓存的网络资源无效时将服务器下发的更新后网络资源发送给终端。When it is determined that the terminal is accessing the requested network resource for the first time after going online this time, the gateway will send the obtained judgment result to the terminal to determine whether the network resource cached by the terminal is valid, and when it is determined that the network resource cached by the terminal is invalid Send the updated network resource delivered by the server to the terminal.
上述由网关将获取到的终端所缓存的网络资源是否有效的判定结果发送给终端,并在判定无效时将服务器下发的更新后网络资源发送给终端。包括两种情况,一种是由网关来判定终端所缓存的网络资源是否有效,一种是由服务器判定终端所缓存的网络资源是否有效。下面通过两个具体的实施例来进行说明(在下面的实施例中网关均以WAP网关为例进行说明)。The gateway sends the acquired determination result of whether the network resource cached by the terminal is valid to the terminal, and sends the updated network resource issued by the server to the terminal when it is determined invalid. Two situations are included, one is that the gateway determines whether the network resource cached by the terminal is valid, and the other is that the server determines whether the network resource cached by the terminal is valid. In the following, two specific embodiments are used to illustrate (the gateways in the following embodiments are all described by taking a WAP gateway as an example).
实施例一:Embodiment one:
本发明实施例提供的网络资源访问控制方法,终端访问网络资源时,若WAP网关确定终端是本次上线后首次请求所请求的网络资源,将连接请求转发给服务器,由服务器判断终端缓存的网络资源是否有效。该方法流程如图3所示,执行步骤如下:In the network resource access control method provided by the embodiment of the present invention, when a terminal accesses a network resource, if the WAP gateway determines that the terminal is requesting the requested network resource for the first time after going online this time, the connection request is forwarded to the server, and the server determines the network cached by the terminal. Whether the resource is valid. The flow of the method is shown in Figure 3, and the execution steps are as follows:
步骤S101:终端发送连接请求给WAP网关。Step S101: the terminal sends a connection request to the WAP gateway.
终端需要访问网络资源时,会发送连接请求,连接请求中一般会标明所要访问的网络资源的地址信息。一般可以通过统一资源定位符(Uniform/UniversalResource Locator,URL;或称网页地址)来标识网络资源的地址信息。When a terminal needs to access a network resource, it will send a connection request, and the connection request generally indicates the address information of the network resource to be accessed. Generally, address information of network resources can be identified by a Uniform/Universal Resource Locator (Uniform/UniversalResource Locator, URL; or web page address).
步骤S102:WAP网关接收终端发送的连接请求。Step S102: the WAP gateway receives the connection request sent by the terminal.
步骤S103:判断接收到的连接请求中是否携带有缓存标识信息。Step S103: Determine whether the received connection request carries cache identification information.
WAP终端接收到连接请求后,对其进行解析,判断其中是否携带有缓存标识信息,例如:If-Modified-Since字段,当有该字段时认为携带了缓存标识信息,否则认为没有携带缓存标识信息。After receiving the connection request, the WAP terminal parses it to determine whether it carries cache identification information, for example: If-Modified-Since field, when there is this field, it is considered that the cache identification information is carried, otherwise it is considered that the cache identification information is not carried .
若是,执行步骤S105;否则,执行步骤S104。If yes, execute step S105; otherwise, execute step S104.
步骤S104:按照不缓存网络资源的正常流程处理连接请求,由服务器下发网络资源给终端。Step S104: Process the connection request according to the normal process of not caching network resources, and send the network resources to the terminal by the server.
即如果没有携带缓存标识,则终端不具备缓存能力或该网络资源不允许被缓存,则按照不缓存情况下的正常流程处理,WAP网关将连接请求转发给提供该网络资源的服务器,服务器通过WAP网关下发网络资源给终端。That is, if the cache identifier is not carried, the terminal does not have the caching capability or the network resource is not allowed to be cached, then it will be processed according to the normal process without caching, and the WAP gateway will forward the connection request to the server that provides the network resource, and the server will pass the WAP The gateway delivers network resources to the terminal.
步骤S105:判断该终端是否是本次上线后首次请求接收到的连接请求中所请求的网络资源。Step S105: Determine whether the terminal requests the network resource requested in the connection request received for the first time after going online this time.
WAP网关一般根据连接请求中包含的所请求访问的网络资源的地址信息,例如URL,判断终端本次上线后是不是首次访问该网络地址,确定终端是否首次访问该网络地址所对应的网络资源。Generally, according to the address information of the requested network resource included in the connection request, such as URL, the WAP gateway judges whether the terminal accesses the network address for the first time after going online this time, and determines whether the terminal accesses the network resource corresponding to the network address for the first time.
若是,执行步骤S108;否则,执行步骤S106。If yes, execute step S108; otherwise, execute step S106.
步骤S106:WAP网关发送去除缓存标识信息后的连接请求给相应的服务器。Step S106: the WAP gateway sends the connection request to the corresponding server with the cache identification information removed.
即WAP网关确定出该终端不是本次上线后首次请求所请求的网络资源时,将接收到的连接请求中的缓存标识信息去掉,例如:去掉连接请求中的If-Modifled-Since字段。重新封装后,将去除缓存标识信息后的连接请求发送给提供网络资源的服务器。从而使得服务器接收到连接请求后可以顺利下发网络资源给终端,保障终端能够获取到正确的网络资源内容信息,减少后续不必要重复请求。That is, when the WAP gateway determines that the terminal is not the first request for the requested network resource after going online this time, it removes the cache identification information in the received connection request, for example: removes the If-Modifled-Since field in the connection request. After re-encapsulation, send the connection request with the cache identification information removed to the server providing the network resources. In this way, the server can smoothly deliver network resources to the terminal after receiving the connection request, ensuring that the terminal can obtain correct content information of network resources, and reducing unnecessary repeated requests in the future.
同时,WAP网关记录该连接请求涉及到的网络资源及访问该网络资源的终端标识,表明该终端已请求过连接请求中涉及到的网络资源。At the same time, the WAP gateway records the network resource involved in the connection request and the identifier of the terminal accessing the network resource, indicating that the terminal has requested the network resource involved in the connection request.
步骤S107:服务器下发网络资源给终端。Step S107: the server sends network resources to the terminal.
服务器根据去除缓存标识信息后的连接请求下发网络资源给请求网络资源的终端。The server sends the network resource to the terminal requesting the network resource according to the connection request after removing the cache identification information.
步骤S108:WAP网关将连接请求直接发送给提供所请求的网络资源的服务器。Step S108: the WAP gateway directly sends the connection request to the server providing the requested network resources.
WAP网关将接收到连接请求发送给提供网络资源的服务器之前,记录终端所请求的网络资源的缓存信息。Before the WAP gateway receives the connection request and sends it to the server providing the network resource, it records the cache information of the network resource requested by the terminal.
步骤S109:服务器判断终端缓存的网络资源是否有效。Step S109: the server judges whether the network resource cached by the terminal is valid.
若是,执行步骤S110;否则,执行步骤S111。If yes, execute step S110; otherwise, execute step S111.
服务器根据接收到连接请求和该网络资源的描述信息,判断终端缓存的网络资源是否有效。其中,描述信息中可以包括该网络资源的更新时间、有效期限和其他缓存控制信息。The server judges whether the network resource cached by the terminal is valid according to the received connection request and the description information of the network resource. Wherein, the description information may include the update time, validity period and other cache control information of the network resource.
服务器根据将接收到的连接请求中携带的所请求的网络资源的更新时间和/或有效期限,与描述信息中的更新时间和/或有效期限进行比较,确定终端缓存的网络资源是否有效。当上述连接请求中和描述信息中的更新时间和/或有效期限对应相同时,确认终端缓存的网络资源有效,否则无效。The server compares the update time and/or expiration date of the requested network resources carried in the received connection request with the update time and/or expiration date in the description information to determine whether the network resources cached by the terminal are valid. When the update time and/or validity period in the connection request and the description information correspond to the same, it is confirmed that the network resource cached by the terminal is valid; otherwise, it is invalid.
步骤S110:服务器返回响应消息通知终端所请求的网络资源内容未更新。Step S110: The server returns a response message to notify the terminal that the content of the requested network resource has not been updated.
服务器通过WAP网关向发送连接请求的终端返回响应消息,响应消息中携带内容的状态代码,用以标识终端所请求的网络资源是有效的,没有进行修改更新。The server returns a response message to the terminal sending the connection request through the WAP gateway, and the status code carried in the response message is used to identify that the network resource requested by the terminal is valid and has not been modified or updated.
步骤S111:服务器下发所请求的网络资源给终端。Step S111: the server delivers the requested network resource to the terminal.
当服务器判断终端缓存的网络资源无效时,会将更新后的网络资源下发给发送请求的终端;同时,WAP网关删除步骤S108中记录的缓存信息。When the server judges that the network resource cached by the terminal is invalid, it will send the updated network resource to the terminal sending the request; at the same time, the WAP gateway deletes the cached information recorded in step S108.
本发明实施例一提供的上述网络资源访问控制方法的一个具体实现示例如图4所示。以访问网络地址(即URL)为http://61.135.154.43/info/disengag.gif的网络资源为例,具体包括下列步骤:A specific implementation example of the above network resource access control method provided by Embodiment 1 of the present invention is shown in FIG. 4 . Taking access to a network resource whose network address (ie URL) is http://61.135.154.43/info/disengag.gif as an example, it specifically includes the following steps:
步骤S121:终端针对网络地址http://61.135.154.43/info/disengag.gif发起连接请求。Step S121: The terminal initiates a connection request for the network address http://61.135.154.43/info/disengag.gif.
连接请求中携带缓存标识信息,即If-Modified-Since字段,该字段包含描述信息:Tue,04Sep 2007 02:01:22 GMT。The connection request carries cache identification information, that is, the If-Modified-Since field, which contains description information: Tue, 04Sep 2007 02:01:22 GMT.
步骤S122:WAP网关判断接收到的连接请求中是否携带有缓存标识信息。Step S122: the WAP gateway determines whether the received connection request carries cache identification information.
即根据连接请求中的If-Modifled-Since字段,判断该终端是否缓存有该网络地址对应的网络资源。That is, according to the If-Modifled-Since field in the connection request, it is judged whether the terminal caches the network resource corresponding to the network address.
若有,执行步骤S126;否则,执行步骤S123,即按照不缓存网络资源时的正常流程处理。If so, execute step S126; otherwise, execute step S123, that is, process according to the normal process when the network resource is not cached.
步骤S123:将连接请求转发给提供该网络资源的服务器。Step S123: Forward the connection request to the server providing the network resource.
步骤S124:服务器下发网络资源至WAP网关。Step S124: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://61.135.154.43/info/disengag.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://61.135.154.43/info/disengag.gif in the connection request to the terminal sending the request.
步骤S125:WAP网关将服务器下发的网络资源转发给发送请求的终端。Step S125: the WAP gateway forwards the network resource issued by the server to the terminal sending the request.
步骤S126:判断该终端是否是本次上线后首次访问所请求的网络地址。Step S126: Determine whether the terminal accesses the requested network address for the first time after going online this time.
若是,执行步骤S130;否则,执行步骤S127。If yes, execute step S130; otherwise, execute step S127.
步骤S127:WAP网关发送去除缓存标识信息后的连接请求给服务器。Step S127: the WAP gateway sends the connection request to the server with the cache identification information removed.
即WAP网关将接收到的连接请求中的If-Modified-Since字段去掉,将连接请求发送给提供网络资源的服务器。同时,WAP网关记录该连接请求涉及到的网络地址及访问该网络地址的终端标识,表明该终端已请求过连接请求中涉及到的网络地址。That is, the WAP gateway removes the If-Modified-Since field in the received connection request, and sends the connection request to the server providing network resources. At the same time, the WAP gateway records the network address involved in the connection request and the identifier of the terminal accessing the network address, indicating that the terminal has requested the network address involved in the connection request.
较佳的,WAP网关也可以不去掉If-Modifled-Since字段,而通过修改其他字段标识终端缓存的信息已失效,需要服务器重新下发该网络地址对应的网络资源。Preferably, the WAP gateway may not remove the If-Modifled-Since field, but modifies other fields to indicate that the information cached by the terminal is invalid, and the server needs to re-send the network resource corresponding to the network address.
步骤S128:服务器下发网络资源至WAP网关。Step S128: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://61.135.154.43/info/disengag.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://61.135.154.43/info/disengag.gif in the connection request to the terminal sending the request.
同时携带网络资源的描述信息,例如:下发时间Thu,17Apr 2008 08:28:11GMT,更新时间Thu,17 Apr 2008 06:00:00 GMT,有效期限Thu,17 Apr 200810:00:00 GMT等等。At the same time, it carries the description information of network resources, such as: release time Thu, 17Apr 2008 08:28:11GMT, update time Thu, 17 Apr 2008 06:00:00 GMT, expiration date Thu, 17 Apr 2008 10:00:00 GMT, etc. wait.
步骤S129:WAP网关将终端下发的网络资源转发给发送请求的终端。Step S129: the WAP gateway forwards the network resources delivered by the terminal to the terminal sending the request.
WAP网关会同时转发网络资源的描述信息。The WAP gateway will forward the description information of the network resources at the same time.
步骤S130:WAP网关将连接请求直接发送给提供所请求的网络资源的服务器。Step S130: the WAP gateway directly sends the connection request to the server providing the requested network resources.
步骤S131:服务器判断终端缓存的网络资源是否有效。Step S131: the server judges whether the network resource cached by the terminal is valid.
若是,执行步骤S132;否则,执行步骤S134。If yes, execute step S132; otherwise, execute step S134.
服务器将接收到连接请求中的有效期限Tue,04Sep 2007 02:01:22 GMT与本地设置的该网络资源的描述信息中的有效期限进行比较,确定终端缓存的该网络资源是否有效。当然也可以根据更新时间或其他缓存控制信息判断。The server compares the validity period Tue, 04Sep 2007 02:01:22 GMT received in the connection request with the validity period in the description information of the network resource set locally to determine whether the network resource cached by the terminal is valid. Of course, it can also be judged according to the update time or other cache control information.
步骤S132:服务器返回响应消息至WAP网关。Step S132: the server returns a response message to the WAP gateway.
步骤S133:WAP网关转发响应消息通知终端所请求的网络资源内容未更新。Step S133: The WAP gateway forwards the response message to notify the terminal that the content of the requested network resource has not been updated.
转发的响应消息中携带not Modified(例如:304)的字段,标识终端所请求的网络资源未更新。The forwarded response message carries a field of not Modified (for example: 304), indicating that the network resource requested by the terminal has not been updated.
当有效期限有更新时,可以同时携带以便告知终端该网络资源的新的有效期限。When the validity period is updated, it can be carried at the same time so as to inform the terminal of the new validity period of the network resource.
步骤S134:服务器下发网络资源至WAP网关。Step S134: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://61.135.154.43/info/disengag.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://61.135.154.43/info/disengag.gif in the connection request to the terminal sending the request.
同时携带网络资源的描述信息,例如:下发时间Thu,17Apr 2008 08:28:11GMT,更新时间Thu,17Apr 2008 06:00:00 GMT,有效期限Thu,17 Apr 200810:00:00 GMT等等。At the same time, it carries the description information of network resources, such as: release time Thu, 17Apr 2008 08:28:11GMT, update time Thu, 17Apr 2008 06:00:00 GMT, expiration date Thu, 17 Apr 2008 10:00:00 GMT, etc. .
步骤135:WAP网关将终端下发的网络资源转发给发送请求的终端。Step 135: The WAP gateway forwards the network resources issued by the terminal to the terminal sending the request.
WAP网关会同时转发网络资源的描述信息。The WAP gateway will forward the description information of the network resources at the same time.
实施例二Embodiment two
本发明实施例提供的网络资源访问控制方法,终端访问网络资源时,若WAP网关确定终端是本次上线后首次请求所请求的网络资源,进一步判断终端缓存的信息是否有效,并根据判断结果执行后续步骤。该方法流程如图4所示,执行步骤如下:In the network resource access control method provided by the embodiment of the present invention, when a terminal accesses a network resource, if the WAP gateway determines that the terminal is requesting the requested network resource for the first time after going online this time, it further judges whether the information cached by the terminal is valid, and executes according to the judgment result. next steps. The process flow of this method is shown in Figure 4, and the execution steps are as follows:
步骤S201-S207同上述实施例一中的步骤S101-S107,此处不再赘述。Steps S201-S207 are the same as steps S101-S107 in the first embodiment above, and will not be repeated here.
上述当步骤S205判断为是时,执行步骤S208。When the determination in step S205 is yes, execute step S208.
步骤S208:WAP网关判断终端缓存的网络资源是否有效。若是,执行步骤S209;否则,执行步骤S210。Step S208: the WAP gateway judges whether the network resource cached by the terminal is valid. If yes, execute step S209; otherwise, execute step S210.
WAP网关根据接收到连接请求和本地缓存的该网络资源的描述信息,判断终端缓存的网络资源是否有效。其中,描述信息中可以包括该网络资源的更新时间、有效期限和其他缓存控制信息。The WAP gateway judges whether the network resource cached by the terminal is valid according to the received connection request and the description information of the network resource cached locally. Wherein, the description information may include the update time, validity period and other cache control information of the network resource.
WAP网关具体将接收到的连接请求中携带的所请求的网络资源的更新时间和/或有效期限,与描述信息中的更新时间和/或有效期限进行比较;确定终端缓存的网络资源是否有效。当上述连接请求中和描述信息中的更新时间和/或有效期限对应相同时,确认终端缓存的网络资源有效,否则无效。Specifically, the WAP gateway compares the update time and/or expiration date of the requested network resource carried in the received connection request with the update time and/or expiration date in the description information; and determines whether the network resource cached by the terminal is valid. When the update time and/or validity period in the connection request and the description information correspond to the same, it is confirmed that the network resource cached by the terminal is valid; otherwise, it is invalid.
WAP网关中预先存储了提供网络资源的各个服务器中的各网络资源的描述信息,当某个网络资源的有效期限过期时,终端会重新向对应的服务器请求描述信息,以便更新该网络资源的描述信息。WAP网关根据服务器返回的所请求的网络资源的更新时间和/或有效期限更新本地缓存的该网络资源的描述信息中的更新时间和/或有效期限。当服务器没有成功响应并下发描述信息时,删除该网络资源的描述信息。The WAP gateway pre-stores the description information of each network resource in each server that provides network resources. When the validity period of a certain network resource expires, the terminal will re-request the description information from the corresponding server in order to update the description of the network resource. information. The WAP gateway updates the update time and/or validity period in the locally cached description information of the network resource according to the update time and/or validity period of the requested network resource returned by the server. When the server does not respond successfully and sends the description information, delete the description information of the network resource.
WAP网关可以建立表格,存储各网络资源的描述信息,以存储的描述信息中包含的时有效期限为例,建立的表格可以如表1所示。The WAP gateway can create a table to store the description information of each network resource. Taking the validity period included in the stored description information as an example, the established table can be shown in Table 1.
表1Table 1
步骤S209:WAP网关返回响应消息通知终端所请求的网络资源内容未更新。Step S209: The WAP gateway returns a response message to notify the terminal that the requested network resource content has not been updated.
WAP网关向发送连接请求的终端返回响应消息,响应消息中携带内容的状态代码,用以标识终端所请求的网络资源是有效的,没有进行修改更新。The WAP gateway returns a response message to the terminal sending the connection request, and the status code carried in the response message is used to identify that the network resource requested by the terminal is valid and has not been modified or updated.
步骤S210:将连接请求发送给提供所请求的网络资源的服务器。Step S210: Send the connection request to the server providing the requested network resource.
此时,WAP网关可以将连接请求直接转发给提供所请求的网络资源的服务器,也可以去除缓存标识信息后再将修改后的连接请求发送给该服务器。At this time, the WAP gateway may directly forward the connection request to the server providing the requested network resources, or may remove the cache identification information and then send the modified connection request to the server.
步骤S211:服务器下发所请求的网络资源给终端。Step S211: the server delivers the requested network resource to the terminal.
事实上,当WAP网关判断终端缓存的网络资源无效时,服务器根据接收到的连接请求也会判断出终端缓存的网络资源是无效的,或者WAP网管直接将判断结果通知服务器。服务器则会将更新后的网络资源下发给发送请求的终端。In fact, when the WAP gateway judges that the network resources cached by the terminal are invalid, the server also judges that the network resources cached by the terminal are invalid according to the received connection request, or the WAP network management directly notifies the server of the judgment result. The server will deliver the updated network resource to the terminal sending the request.
本发明实施例二提供的上述网络资源访问控制方法的一个具体实现示例如图5所示。以访问网络地址http://121.14.76.208:8080/qbar/online.gif为例,具体包括下列步骤:A specific implementation example of the above network resource access control method provided by Embodiment 2 of the present invention is shown in FIG. 5 . Take access to the network address http://121.14.76.208:8080/qbar/online.gif as an example, including the following steps:
步骤S221:终端针对网络地址http://121.14.76.208:8080/qbar/online.gif发起连接请求。Step S221: The terminal initiates a connection request for the network address http://121.14.76.208:8080/qbar/online.gif.
连接请求中携带缓存标识信息,即If-Modified-Since字段,该字段包含描述信息:Tue,08 Jan 2008 10:06:30 GMT。The connection request carries cache identification information, that is, the If-Modified-Since field, which contains description information: Tue, 08 Jan 2008 10:06:30 GMT.
步骤S222:WAP网关判断接收到的连接请求中是否携带有缓存标识信息。Step S222: The WAP gateway determines whether the received connection request carries cache identification information.
即根据连接请求中的If-Modified-Since字段,判断该终端是否缓存有该网络地址对应的网络资源。That is, according to the If-Modified-Since field in the connection request, it is judged whether the terminal caches the network resource corresponding to the network address.
若有,执行步骤S226;否则,执行步骤S223,即按照不缓存网络资源时的正常流程处理。If so, execute step S226; otherwise, execute step S223, that is, process according to the normal process when the network resources are not cached.
步骤S223:将连接请求转发给提供该网络资源的服务器。Step S223: Forward the connection request to the server providing the network resource.
步骤S224:服务器下发网络资源至WAP网关。Step S224: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://121.14.76.208:8080/qbar/online.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://121.14.76.208:8080/qbar/online.gif in the connection request to the terminal sending the request.
步骤S225:WAP网关将服务器下发的网络资源转发给发送请求的终端。Step S225: The WAP gateway forwards the network resources issued by the server to the terminal sending the request.
步骤S226:判断该终端是否是本次上线后首次访问所请求的网络地址。Step S226: Determine whether the terminal accesses the requested network address for the first time after going online this time.
若是,执行步骤S230;否则,执行步骤S227。If yes, execute step S230; otherwise, execute step S227.
步骤S227:WAP网关发送去除缓存标识信息后的连接请求给服务器。Step S227: the WAP gateway sends the connection request to the server with the cache identification information removed.
即WAP网关将接收到的连接请求中的If-Modified-Since字段去掉,将连接请求发送给提供网络资源的服务器。同时,WAP网关记录该连接请求涉及到的网络地址及访问该网络地址的终端标识,表明该终端已请求过连接请求中涉及到的网络地址。That is, the WAP gateway removes the If-Modified-Since field in the received connection request, and sends the connection request to the server providing network resources. At the same time, the WAP gateway records the network address involved in the connection request and the identifier of the terminal accessing the network address, indicating that the terminal has requested the network address involved in the connection request.
较佳的,WAP网关同样也可以不去掉If-Modified-Since字段,而通过修改其他字段标识终端缓存的信息已失效,需要服务器重新下发该网络地址对应的网络资源。Preferably, the WAP gateway also does not delete the If-Modified-Since field, but modifies other fields to indicate that the information cached by the terminal is invalid, and the server needs to re-send the network resource corresponding to the network address.
步骤S228:服务器下发网络资源至WAP网关。Step S228: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://121.14.76.208:8080/qbar/online.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://121.14.76.208:8080/qbar/online.gif in the connection request to the terminal sending the request.
同时携带网络资源的描述信息,例如:下发时间Thu,17Apr 2008 08:31:56GMT,更新时间Tue,08 Jan 2008 10:06:30 GMT,有效期限Fri,18 Apr 20080831:56 GMT等等。At the same time, it carries the description information of network resources, such as: release time Thu, 17Apr 2008 08:31:56GMT, update time Tue, 08 Jan 2008 10:06:30 GMT, expiration date Fri, 18 Apr 20080831:56 GMT, etc.
步骤S229:WAP网关将终端下发的网络资源转发给发送请求的终端。Step S229: the WAP gateway forwards the network resources issued by the terminal to the terminal sending the request.
WAP网关会同时转发网络资源的描述信息。The WAP gateway will forward the description information of the network resources at the same time.
步骤S230:WAP网关判断终端缓存的网络资源是否有效。Step S230: the WAP gateway judges whether the network resource cached by the terminal is valid.
若是,执行步骤S231;否则,执行步骤S232。If yes, execute step S231; otherwise, execute step S232.
WAP网关将接收到连接请求中的有效期限Tue,08Jan 2008 10:06:30 GMT与本地设置的该网络资源的描述信息中的有效期限进行比较,确定终端缓存的该网络资源是否有效。当然也可以根据更新时间或其他缓存控制信息判断。The WAP gateway compares the valid period Tue, 08Jan 2008 10:06:30 GMT received in the connection request with the valid period in the description information of the network resource set locally to determine whether the network resource cached by the terminal is valid. Of course, it can also be judged according to the update time or other cache control information.
步骤S231:WAP网关返回响应消息通知终端所请求的网络资源内容未更新。Step S231: The WAP gateway returns a response message to notify the terminal that the content of the requested network resource has not been updated.
步骤S232:将针对网络地址http://121.14.76.208:8080/qbar/online.gif连接请求发送给提供所请求的网络资源的服务器Step S232: Send the connection request for the network address http://121.14.76.208:8080/qbar/online.gif to the server providing the requested network resource
步骤S233:服务器下发网络资源至WAP网关。Step S233: the server delivers network resources to the WAP gateway.
服务器下发连接请求中的网络地址http://61.135.154.43/info/disengag.gif对应的网络资源给发送请求的终端。The server sends the network resource corresponding to the network address http://61.135.154.43/info/disengag.gif in the connection request to the terminal sending the request.
同时携带网络资源的描述信息,例如:下发时间Thu,17Apr 2008 08:31:56GMT,更新时间Tue,08Jan 2008 10:06:30 GMT,有效期限Fri,18 Apr 20080831:56GMT等等。At the same time, it carries the description information of network resources, such as: release time Thu, 17Apr 2008 08:31:56GMT, update time Tue, 08Jan 2008 10:06:30 GMT, expiration date Fri, 18 Apr 20080831:56GMT, etc.
步骤S234:WAP网关将终端下发的网络资源转发给发送请求的终端。Step S234: the WAP gateway forwards the network resources issued by the terminal to the terminal sending the request.
WAP网关会同时转发网络资源的描述信息。The WAP gateway will forward the description information of the network resources at the same time.
上述实施例一和实施例二中,判断连接请求中是否携带缓存标识信息和判断终端是不是本次上线后首次请求所请求的网络资源的步骤,可以不分先后,即当确定出连接请求中携带缓存标识信息且终端不是本次上线后首次请求所请求的网络资源时,WAP网关发送去除缓存标识信息后的连接请求给提供网络资源的服务器,即可实现减少连接请求发送次数,从而减少信息交互的目的。In the first and second embodiments above, the steps of judging whether the connection request carries cache identification information and judging whether the terminal is the first request for the requested network resource after going online this time can be performed in no particular order, that is, when it is determined that the connection request contains When carrying cache identification information and the terminal is not the first request for the requested network resources after going online this time, the WAP gateway sends a connection request after removing the cache identification information to the server providing network resources, which can reduce the number of connection request transmissions, thereby reducing information purpose of the interaction.
上述实施例一和实施例二中,当多个用户的终端同时对某一网络地址的网络资源发起连接请求时,其减少网络设备负荷的作用更加明显。尤其是实施例二中网关在判断出终端缓存的网络资源有效时,直接通知终端,进一步减少了与服务器之间的信息交互。In the first and second embodiments above, when multiple user terminals initiate connection requests to network resources at a certain network address at the same time, the effect of reducing the load on the network equipment is more obvious. Especially in the second embodiment, when the gateway determines that the network resource cached by the terminal is valid, it directly notifies the terminal, which further reduces information interaction with the server.
较佳的,上述实施例一和实施例二中,当终端下线终端和WAP网关中均删除缓存的网络资源信息,从而有效避免终端不在线期间终端中的缓存信息被破坏后,所导致的重复请求获取网络资源的情况发生。Preferably, in the first and second embodiments above, when the terminal goes offline, both the terminal and the WAP gateway delete the cached network resource information, thereby effectively preventing the cached information in the terminal from being destroyed when the terminal is not online. Repeated requests for network resources occur.
上述实施例一和实施例二也可以进行变形和改动,例如:将判定终端是否是本次上线后首次发起对某个网络资源的连接请求的功能放到终端中,当不是首次发起时,直接发送不携带缓存标识信息的连接请求,当是首次发起时则发送携带有缓存标识信息的连接请求即可。这样当不是首次发起且上一次请求返回的响应消息确定其缓存内容有效时,即可以直接使用;当缓存的内容被破坏时,则可以直接去获取,从而使得终端也可以避免重复发送连接请求。The first and second embodiments above can also be modified and modified. For example, the function of judging whether the terminal is the first to initiate a connection request to a certain network resource after going online this time is placed in the terminal. Send a connection request without cache identification information, and send a connection request with cache identification information when it is initiated for the first time. In this way, when it is not initiated for the first time and the response message returned by the last request confirms that the cached content is valid, it can be used directly; when the cached content is destroyed, it can be obtained directly, so that the terminal can also avoid sending connection requests repeatedly.
根据本发明实施例提供的上述网络资源访问控制方法,可以构建一种网络资源访问控制系统。如图6所示,包括:终端10、网关20(例如:无线接入协议WAP网关)和提供网络资源的服务器30。其中,一个网关20可以为多个终端10和多个服务器30提供信息交互。According to the above network resource access control method provided by the embodiments of the present invention, a network resource access control system can be constructed. As shown in FIG. 6 , it includes: a terminal 10 , a gateway 20 (such as a WAP gateway) and a
终端10,用于发送网络资源第一连接请求,以及接收服务器30下发的网络资源。The terminal 10 is configured to send a first connection request for a network resource, and receive a network resource issued by the
网关20,用于接收终端10发送的第一连接请求;当判断出接收到第一连接请求中携带缓存标识信息、且终端10不是本次上线后首次请求第一连接请求所请求的网络资源时,发送去除缓存标识信息后的第二连接请求给提供所请求的网络资源的服务器30;以及接收服务器30根据去除缓存标识信息后的连接请求下发的网络资源,并转发给终端10。The
服务器30,用于根据去除缓存标识信息后的第二连接请求下发网络资源给终端10。The
较佳的,网关20,还用于当确定出终端10是本次上线后首次访问请求第一连接请求所请求的网络资源时,将接收到的第一连接请求发送给所述服务器30;以及转发所述服务器判断所述终端缓存的网络资源有效时返回的、表征所请求的网络资源内容未更新的响应消息给终端,或将所述服务器判断所述终端缓存的网络资源无效时下发的所请求的网络资源转发给所述终端。Preferably, the
服务器30,还用于根据接收到第一连接请求和该网络资源的描述信息,判断终端10缓存的网络资源是否有效;若是,则返回响应消息给网关20,以便通知终端10所请求的网络资源内容未更新;否则,下发所请求的网络资源给网关20。The
较佳的,网关20,还用于记录终端10所请求的网络资源的相关缓存信息;以及当获知服务器30确定出终端10所缓存的网络资源无效时,删除记录的缓存信息。Preferably, the
可选的,网关20,还用于当确定出终端10是本次上线后首次请求第一连接请求所请求的网络资源时,根据接收到的第一连接请求和本地缓存的该网络资源的描述信息,判断终端10缓存的网络资源是否有效;当判断终端10缓存的网络资源有效时,向终端10返回响应消息通知终端10所请求的网络资源内容未更新;否则,将接收到第一连接请求发送给服务器30;以及接收服务器30根据第一连接请求下发的网络资源,并转发给终端10。Optionally, the
服务器30,还用于接收到网关20转发的连接请求后下发网络资源给终端10。The
可选的,网关10,还用于根据服务器30返回的终端10所请求的网络资源的更新时间和/或有效期限更新本地缓存的该网络资源的描述信息中的更新时间和/或有效期限。Optionally, the
根据本发明实施例一提供的上述网络资源访问控制方法,可以构建一种网络资源访问控制装置,该装置设置在网络资源访问控制系统的网关中。如图7所示,包括:接收模块201、第一判断模块202、第一执行模块203和反馈模块204。According to the above-mentioned network resource access control method provided in Embodiment 1 of the present invention, a network resource access control device can be constructed, and the device is set in a gateway of a network resource access control system. As shown in FIG. 7 , it includes: a receiving
接收模块201,用于接收终端发送的第一连接请求。The receiving
第一判断模块202,用于判断出接收到第一连接请求中是否携带缓存标识信息,以及判断该终端是否是本次上线后首次请求接收到的第一连接请求中所请求的网络资源。The first judging module 202 is configured to judge whether the received first connection request carries cache identification information, and judge whether the terminal requests the network resources requested in the first connection request received for the first time after going online this time.
第一执行模块203,用于当第一判断模块201判断出第一连接请求中携带缓存标识信息且终端不是本次上线后首次请求第一连接请求中所请求的网络资源时,发送去除缓存标识信息后的第二连接请求给提供所请求的网络资源的服务器。The
反馈模块204,用于接收服务器根据去除缓存标识信息后的第二连接请求下发的网络资源,并转发给终端。The
较佳的,上述网络资源访问控制装置,还包括:第二执行模块205,用于当第一判断模块202确定出终端是本次上线后首次请求第一连接请求中所请求的网络资源时,将接收到的第一连接请求发送给提供所请求的网络资源的服务器。Preferably, the above-mentioned network resource access control device further includes: a
反馈模块204,还用于将服务器判断终端缓存的网络资源有效时返回的响应消息转发给终端,通知终端所请求的网络资源内容未更新;或将服务器判断终端缓存的网络资源无效时下发的所请求的网络资源转发给终端;其中服务器30根据第一连接请求和该网络资源的描述信息,判断终端10缓存的网络资源是否有效。The
上述网络资源访问控制装置,还包括:记录模块206,用于记录终端所请求的网络资源的相关缓存信息;以及当获知服务器确定出终端所缓存的网络资源无效时,删除记录的缓存信息。The above-mentioned network resource access control device further includes: a
根据本发明实施例二提供的上述网络资源访问控制方法,可以构建一种网络资源访问控制装置,该装置设置在网络资源访问控制系统的WAP网关中。如图8所示,包括:接收模块301、第一判断模块302、第一执行模块303和反馈模块304。According to the above-mentioned network resource access control method provided in Embodiment 2 of the present invention, a network resource access control device can be constructed, and the device is set in a WAP gateway of a network resource access control system. As shown in FIG. 8 , it includes: a receiving
接收模块301,用于接收终端发送的第一连接请求。The receiving
第一判断模块302,用于判断接收到第一连接请求中是否携带缓存标识信息,以及判断该终端是否是本次上线后首次请求第一连接请求中接收到的第一连接请求中所请求的网络资源。The
第一执行模块303,用于当第一判断模块301判断出第一连接请求中携带缓存标识信息且终端不是本次上线后首次请求第一连接请求中所请求的网络资源时,发送去除缓存标识信息后的第二连接请求给提供所请求的网络资源的服务器。The
反馈模块304,用于接收服务器根据去除缓存标识信息后的第二连接请求下发的网络资源,并转发给终端。The
上述网络资源访问控制装置,还包括:第二判断模块305,用于当第一判断模块302确定出终端是本次上线后首次请求第一连接请求中所请求的网络资源时,根据接收到的第一连接请求和本地缓存的该网络资源的描述信息,判断终端缓存的网络资源是否有效。The above-mentioned network resource access control device further includes: a
第二执行模块306,用于第二判断模块305判断出终端10缓存的网络资源有效时,向终端返回响应消息通知终端所请求的网络资源内容未更新;否则,将接收到的第一连接请求发送给提供所请求的网络资源的服务器。The
反馈模块304,还用于接收到服务器根据第二执行模块306发送的连接请求下发的网络资源,转发给终端。The
上述网络资源访问控制装置,还包括:更新模块307,用于根据服务器发送的所请求的网络资源的更新时间和/或有效期限更新本地缓存的该网络资源的描述信息中的更新时间和/或有效期限。The above-mentioned network resource access control device further includes: an
上述网络资源访问控制装置可以如上述图7和图8所示,也可以同时将图7和图8所示的各个模块集中在同一个装置中,共同设置于同一个网关中。则该网关既可以选择自己执行对终端缓存的网络资源是否有效的判断,也可以选择由服务器来完成该判断功能。The above-mentioned network resource access control device may be as shown in FIG. 7 and FIG. 8 above, or the various modules shown in FIG. 7 and FIG. 8 may be integrated in the same device and jointly installed in the same gateway. Then the gateway can either choose to perform the judgment on whether the network resource cached by the terminal is valid by itself, or choose to let the server complete the judgment function.
本发明实施例提供的上述网络资源访问控制方法、系统及装置,通过网关判断终端是否是上线后首次请求所请求的网络资源,在终端不是首次请求所请求的网络资源时,由网关将修改后的连接请求转发给服务器,服务器则可以直接下发网络资源,是保证终端在内部缓存信息被破坏时能够正确、及时的获取到所请求的网络资源,避免了终端频繁发送连接请求,减轻了网络设备的负荷,节约了网络资源。In the above-mentioned network resource access control method, system and device provided by the embodiments of the present invention, the gateway judges whether the terminal requests the requested network resource for the first time after going online, and when the terminal does not request the requested network resource for the first time, the modified The connection request is forwarded to the server, and the server can directly issue network resources, which ensures that the terminal can correctly and timely obtain the requested network resources when the internal cache information is destroyed, avoiding the frequent sending of connection requests by the terminal and reducing the network resources. equipment load, saving network resources.
当网关判断出终端是上线后首次请求所请求的网络资源时,可以将连接请求转发给服务器处理,也可以根据本地缓存的该网络资源的描述信息先进行判断,当有效时通知终端,当判断出无效时再转发给服务器处理。从而使得网关不必具备网络资源缓存功能,只记录各网络资源的描述信息,就可以进一步减少对服务器的连接请求。When the gateway judges that the terminal is requesting the requested network resource for the first time after going online, it can forward the connection request to the server for processing, or make a judgment based on the description information of the network resource cached locally, and notify the terminal when it is valid. If it is invalid, it will be forwarded to the server for processing. Therefore, the gateway does not need to have a network resource caching function, and only records the description information of each network resource, which can further reduce connection requests to the server.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化、替换或应用到其他类似的装置,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any skilled person in the technical field can easily think of changes, Replacement or application to other similar devices shall fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010101256784A CN102196506B (en) | 2010-03-15 | 2010-03-15 | Network resource access control method, system and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010101256784A CN102196506B (en) | 2010-03-15 | 2010-03-15 | Network resource access control method, system and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102196506A CN102196506A (en) | 2011-09-21 |
CN102196506B true CN102196506B (en) | 2013-12-04 |
Family
ID=44603723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010101256784A Expired - Fee Related CN102196506B (en) | 2010-03-15 | 2010-03-15 | Network resource access control method, system and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102196506B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103348648B (en) * | 2011-11-28 | 2015-11-25 | 华为技术有限公司 | A kind of method that user of judgement asks, equipment and system |
CN108370372B (en) * | 2016-02-22 | 2021-07-09 | 华为技术有限公司 | A data packet transmission method, network side device and user equipment |
CN106453117A (en) * | 2016-11-10 | 2017-02-22 | 珠海市魅族科技有限公司 | Method and device for processing network resources |
CN109964493B (en) * | 2017-10-23 | 2022-05-03 | 深圳市欢太科技有限公司 | Network connection detection method, device, terminal and computer storage medium |
CN109947081B (en) * | 2019-03-25 | 2020-12-01 | 钛马信息网络技术有限公司 | Networked vehicle control method and device |
CN110839034B (en) * | 2019-11-15 | 2022-05-13 | 腾讯科技(深圳)有限公司 | Communication connection control method and related equipment |
CN111190709B (en) * | 2019-11-19 | 2024-04-12 | 泰康保险集团股份有限公司 | Method and device for processing request, electronic equipment and readable storage medium |
CN111898054B (en) * | 2020-08-07 | 2024-11-22 | 湖南快乐阳光互动娱乐传媒有限公司 | Reverse cache control method and system, server, client and business end |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6006260A (en) * | 1997-06-03 | 1999-12-21 | Keynote Systems, Inc. | Method and apparatus for evalutating service to a user over the internet |
WO2006026193A2 (en) * | 2004-08-25 | 2006-03-09 | Qurio Holdings, Inc. | Proxy caching in a photosharing peer-to-peer network to improve guest image viewing performance |
CN101178736A (en) * | 2007-12-11 | 2008-05-14 | 腾讯科技(深圳)有限公司 | Web page collecting method and web page collecting server |
CN101193113A (en) * | 2006-11-29 | 2008-06-04 | 国际商业机器公司 | Content response and content request method and content responder and content requester |
CN101212446A (en) * | 2006-12-29 | 2008-07-02 | 朗迅科技公司 | Mobile multimedia content sharing application system |
WO2008112770A2 (en) * | 2007-03-12 | 2008-09-18 | Citrix Systems, Inc. | Systems and methods for cache operations |
CN101572707A (en) * | 2009-05-31 | 2009-11-04 | 成都市华为赛门铁克科技有限公司 | Method, apparatus and system for validating certificate state |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7730154B2 (en) * | 2001-12-19 | 2010-06-01 | International Business Machines Corporation | Method and system for fragment linking and fragment caching |
JP4215710B2 (en) * | 2004-12-13 | 2009-01-28 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Data transmission method to client and update data execution control method |
-
2010
- 2010-03-15 CN CN2010101256784A patent/CN102196506B/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6006260A (en) * | 1997-06-03 | 1999-12-21 | Keynote Systems, Inc. | Method and apparatus for evalutating service to a user over the internet |
WO2006026193A2 (en) * | 2004-08-25 | 2006-03-09 | Qurio Holdings, Inc. | Proxy caching in a photosharing peer-to-peer network to improve guest image viewing performance |
CN101193113A (en) * | 2006-11-29 | 2008-06-04 | 国际商业机器公司 | Content response and content request method and content responder and content requester |
CN101212446A (en) * | 2006-12-29 | 2008-07-02 | 朗迅科技公司 | Mobile multimedia content sharing application system |
WO2008112770A2 (en) * | 2007-03-12 | 2008-09-18 | Citrix Systems, Inc. | Systems and methods for cache operations |
CN101178736A (en) * | 2007-12-11 | 2008-05-14 | 腾讯科技(深圳)有限公司 | Web page collecting method and web page collecting server |
CN101572707A (en) * | 2009-05-31 | 2009-11-04 | 成都市华为赛门铁克科技有限公司 | Method, apparatus and system for validating certificate state |
Non-Patent Citations (3)
Title |
---|
D.Wessels等.RFC2187.《RFC2187》.1997, * |
J.Mogul等.RFC3229.《RFC3229》.2002, * |
R.Fielding等.RFC2616.《RFC2616》.1999, * |
Also Published As
Publication number | Publication date |
---|---|
CN102196506A (en) | 2011-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102196506B (en) | Network resource access control method, system and device | |
EP2263163B1 (en) | Content management | |
CA2662553C (en) | Offline execution of web based applications | |
US8639742B2 (en) | Refreshing cached documents and storing differential document content | |
CN100411341C (en) | A parallel download method and terminal | |
US8275790B2 (en) | System and method of accessing a document efficiently through multi-tier web caching | |
EP2566107A1 (en) | Apparatus and method for achieving the function of domain name resolution agent | |
US20100174861A1 (en) | System And Method For Refreshing Cached Data Based On Content Update Frequency | |
US20070124309A1 (en) | Content retrieval system | |
CN112788085B (en) | Data caching method and device | |
WO2022127319A1 (en) | Data refreshing method and apparatus, and electronic device and computer-readable storage medium | |
WO2017025052A1 (en) | Resource caching method and device | |
US20150006622A1 (en) | Web contents transmission method and apparatus | |
US20050246383A1 (en) | Web object access authorization protocol based on an HTTP validation model | |
CN113010816A (en) | Webpage cache updating method and device, electronic equipment and storage medium | |
US20130041935A1 (en) | Expediting the distribution of data files between a server and a set of clients | |
CN103731396B (en) | Resource access method, system and cache resources information push-delivery apparatus | |
WO2021120977A1 (en) | Server, data processing method and medium | |
CN109327437B (en) | Concurrent websocket service information processing method and server | |
JP2000089996A (en) | Information processor and data base system | |
JPH10207791A (en) | Hyper media system | |
WO2010054554A1 (en) | Method, system and server for centralized management of network service | |
JP5068278B2 (en) | Data distribution apparatus, cache server and method for setting browser holding period longer than cache holding period | |
TW202119798A (en) | Service communication proxy apparatus and method | |
WO2001013600A1 (en) | Caching data in a network |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20131204 |