[go: up one dir, main page]

CN117097801A - Access method and system, CDN node, electronic equipment and storage medium - Google Patents

Access method and system, CDN node, electronic equipment and storage medium Download PDF

Info

Publication number
CN117097801A
CN117097801A CN202310921514.XA CN202310921514A CN117097801A CN 117097801 A CN117097801 A CN 117097801A CN 202310921514 A CN202310921514 A CN 202310921514A CN 117097801 A CN117097801 A CN 117097801A
Authority
CN
China
Prior art keywords
access
target url
access request
client
data
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.)
Pending
Application number
CN202310921514.XA
Other languages
Chinese (zh)
Inventor
佘江宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN202310921514.XA priority Critical patent/CN117097801A/en
Publication of CN117097801A publication Critical patent/CN117097801A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例涉及通信技术领域,公开了一种访问方法及系统、CDN节点、电子设备及存储介质。访问方法应用于CDN节点,包括:接收客户端发送携带用户信息和目标URL的访问请求;在根据用户信息和目标URL确定访问请求为等待状态的情况下,向客户端发送本地缓存的等待室页面数据,供客户端根据等待室页面数据呈现等待室页面;在根据用户信息和目标URL确定访问请求为允许连接状态的情况下,将访问请求转发至目标URL指向的源站,供源站对访问请求进行响应。至少有利于同时保证访问请求的时效性。

The embodiments of this application relate to the field of communication technology and disclose an access method and system, CDN node, electronic device and storage medium. The access method is applied to the CDN node, including: receiving an access request sent by the client carrying user information and target URL; when the access request is determined to be in a waiting state based on the user information and target URL, sending a locally cached waiting room page to the client Data for the client to present the waiting room page based on the waiting room page data; when the access request is determined to be in the allowed connection status based on the user information and the target URL, the access request is forwarded to the origin site pointed to by the target URL for the origin site to access Request a response. At least it is helpful to ensure the timeliness of access requests at the same time.

Description

访问方法及系统、CDN节点、电子设备及存储介质Access methods and systems, CDN nodes, electronic devices and storage media

技术领域Technical field

本申请实施例涉及通信技术领域,特别涉及一种访问方法及系统、CDN节点、电子设备及存储介质。The embodiments of this application relate to the field of communication technology, and in particular to an access method and system, CDN node, electronic device and storage medium.

背景技术Background technique

当网站的传入流量突然激增可能会导致网站崩溃或网站性能严重下降,例如网站加载缓慢等。进而导致糟糕的用户体验,从而导致零售商的销售损失。为解决上述问题,虚拟等候室技术应运而生,虚拟等候室技术即在网站的流量即将达到瓶颈时,将多余的用户分流至等候室页面,从而使得用户请求有序地被目标网站处理并响应。A sudden surge in incoming traffic to a website may cause the website to crash or severely degrade website performance, such as slow loading of the website. This in turn results in a poor user experience, which results in lost sales for the retailer. In order to solve the above problems, virtual waiting room technology came into being. When the traffic of the website is about to reach the bottleneck, the virtual waiting room technology diverts redundant users to the waiting room page, so that user requests are processed and responded to by the target website in an orderly manner. .

然而,目前基于虚拟等候室技术实现对网站的访问时效性低,导致用户体验较差。However, the current access to the website based on virtual waiting room technology has low timeliness, resulting in poor user experience.

发明内容Contents of the invention

本申请实施例提供了一种访问方法及系统、CDN节点、电子设备及存储介质,至少有利于提高访问请求的时效性,从而提高用户体验。The embodiments of the present application provide an access method and system, a CDN node, an electronic device, and a storage medium, which are at least conducive to improving the timeliness of access requests, thereby improving user experience.

根据本申请一些实施例,本申请实施例一方面提供了一种访问方法,应用于CDN节点,所述方法包括:接收客户端发送的访问请求,所述访问请求携带用户信息和目标URL;在根据所述用户信息和所述目标URL确定所述访问请求为等待状态的情况下,向所述客户端发送本地缓存的等待室页面数据,供所述客户端根据所述等待室页面数据呈现等待室页面;在根据所述用户信息和所述目标URL确定所述访问请求为允许连接状态的情况下,将所述访问请求转发至所述目标URL指向的源站,供所述源站对所述访问请求进行响应。According to some embodiments of the present application, on the one hand, the embodiments of the present application provide an access method, which is applied to a CDN node. The method includes: receiving an access request sent by a client, where the access request carries user information and a target URL; When it is determined that the access request is in a waiting state according to the user information and the target URL, the locally cached waiting room page data is sent to the client for the client to present the wait according to the waiting room page data. Room page; when it is determined that the access request is in the allowed connection state based on the user information and the target URL, the access request is forwarded to the origin site pointed to by the target URL for the origin site to Respond to the above access request.

根据本申请一些实施例,本申请实施例另一方面还提供了一种CDN节点,包括:边缘应用模块和等待室页面模块;所述边缘应用模块与所述等待室页面模块连接;所述边缘应用模块用于实现如上任一项所述的访问方法;所述等待室页面模块用于维护所述CDN节点的本地缓存的等待室页面数据,以向所述边缘应用模块提供本地缓存的所述等待室页面数据。According to some embodiments of the present application, on the other hand, the embodiments of the present application also provide a CDN node, including: an edge application module and a waiting room page module; the edge application module is connected to the waiting room page module; the edge The application module is used to implement the access method as described in any one of the above; the waiting room page module is used to maintain the locally cached waiting room page data of the CDN node to provide the locally cached waiting room page data to the edge application module. Waiting room page data.

根据本申请一些实施例,本申请实施例另一方面还提供了一种访问系统,包括:若干如前所述的CDN节点。According to some embodiments of the present application, on the other hand, the embodiments of the present application also provide an access system, including: several CDN nodes as described above.

根据本申请一些实施例,本申请实施例另一方面还提供了一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上任一实施例所述的访问方法。According to some embodiments of the present application, another aspect of the embodiment of the present application further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores Instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the access method as described in any of the above embodiments.

根据本申请一些实施例,本申请实施例另一方面还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如上任一实施例所述的访问方法。According to some embodiments of the present application, on the other hand, the embodiments of the present application also provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the access method as described in any of the above embodiments is implemented. .

本申请实施例提供的技术方案,至少具有以下优点:The technical solutions provided by the embodiments of this application have at least the following advantages:

在接收到访问请求且根据访问请求携带的用户信息和目标URL确定访问请求为等待状态的情况下,CDN节点向客户端发送的是本地缓存的等待室页面数据,而不是通过回源或者访问第三方网站等获取到的等待室页面数据,使得等待室页面的呈现能够基于CDN节点的本地缓存实现加速,保证了时效性。并且,通过各CDN节点对访问请求的处理,分担了源站对访问请求的处理压力,有利于提高对访问请求的承载能力,且能够减少负载不均衡,甚至是服务不可用的问题,减少了上述问题对访问请求处理带来的不利影响,进一步提高了访问请求的时效性。When an access request is received and the access request is determined to be in a waiting state based on the user information and target URL carried in the access request, the CDN node sends the locally cached waiting room page data to the client instead of returning to the origin or accessing the third page. The waiting room page data obtained by third-party websites enables the rendering of the waiting room page to be accelerated based on the local cache of the CDN node, ensuring timeliness. Moreover, the processing of access requests by each CDN node shares the pressure of processing access requests on the origin site, which is conducive to improving the carrying capacity of access requests, and can reduce load imbalance and even service unavailability problems, reducing The above-mentioned problems have an adverse impact on the processing of access requests, further improving the timeliness of access requests.

附图说明Description of the drawings

一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings. These illustrative illustrations do not constitute limitations to the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings are not intended to be limited to scale.

图1是本申请一实施例中提供的访问方法的一种流程图;Figure 1 is a flow chart of an access method provided in an embodiment of the present application;

图2是本申请一实施例中提供的访问方法的另一种流程图;Figure 2 is another flow chart of an access method provided in an embodiment of the present application;

图3是本申请一实施例中提供的访问方法的另一种流程图;Figure 3 is another flow chart of the access method provided in an embodiment of the present application;

图4是本申请一实施例中提供的访问方法的另一种流程图;Figure 4 is another flow chart of the access method provided in an embodiment of the present application;

图5是本申请一实施例中提供的访问方法的另一种流程图;Figure 5 is another flow chart of the access method provided in an embodiment of the present application;

图6是本申请一实施例中提供的访问方法的另一种流程图;Figure 6 is another flow chart of the access method provided in an embodiment of the present application;

图7是本申请一实施例中提供的访问方法的另一种流程图;Figure 7 is another flow chart of the access method provided in an embodiment of the present application;

图8是本申请一实施例中提供的访问方法的另一种流程图;Figure 8 is another flow chart of the access method provided in an embodiment of the present application;

图9是本申请一实施例中提供的访问方法的另一种流程图;Figure 9 is another flow chart of the access method provided in an embodiment of the present application;

图10是本申请一实施例中提供的CDN节点的一种结构示意图;Figure 10 is a schematic structural diagram of a CDN node provided in an embodiment of the present application;

图11是本申请一实施例中提供的CDN节点的另一种结构示意图;Figure 11 is another schematic structural diagram of a CDN node provided in an embodiment of the present application;

图12是本申请一实施例中提供的访问系统的结构示意图;Figure 12 is a schematic structural diagram of an access system provided in an embodiment of the present application;

图13是本申请一实施例中提供的电子设备的结构示意图。Figure 13 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

具体实施方式Detailed ways

由背景技术可知,目前基于虚拟等候室技术实现对网站的访问难以保证访问请求的时效性,影响了用户体验。It can be seen from the background technology that currently it is difficult to ensure the timeliness of access requests when accessing websites based on virtual waiting room technology, which affects the user experience.

经分析发现出现上述问题的原因至少在于:目前基于虚拟等候室技术实现对网站的访问主要涉及基于集中式票据中心的虚拟等候室技术,其通常是先根据用户发起的访问从票据中心取号,然后在取到号的情况下,访问请求才被允许访问网站。但是票据中心的处理能力比较有限,难以及时地对接收到的所有请求进行处理,甚至可能会由于请求数量过多,导致溢出,严重影响了取号的效率和访问网站的效率,从而导致请求的时效性差。并且不管是否有流量突增,其都会带来严重的访问时延,也会导致请求的时效性差。After analysis, it was found that the reason for the above problems is at least that: the current access to the website based on virtual waiting room technology mainly involves the virtual waiting room technology based on the centralized bill center, which usually first takes the number from the bill center based on the access initiated by the user. Then, after obtaining the number, the access request is allowed to access the website. However, the processing capacity of the ticket center is relatively limited, and it is difficult to process all the requests received in a timely manner. It may even cause overflow due to too many requests, seriously affecting the efficiency of number retrieval and website access, resulting in a delay in requests. Poor timeliness. And regardless of whether there is a sudden increase in traffic, it will bring serious access delays and lead to poor request timeliness.

为解决上述问题,本申请实施例提供了一种访问方法及系统、CDN节点、电子设备及存储介质,由CDN节点对用户的访问请求进行处理,使得能够基于CDN架构实现对处理访问请求的加速,特别地,CDN节点本地缓存有等待室页面数据,使得进入等待室的流程能够得到加速,进一步减少响应延时,提高读写时效,以及,通过将源站的承载压力和处理压力分摊至各个CDN节点,有利于降低等待室页面的访问压力,提高对访问请求的承载能力,有利于及时地处理访问请求,也提高了访问请求的时效性。In order to solve the above problems, embodiments of the present application provide an access method and system, a CDN node, an electronic device and a storage medium. The CDN node processes the user's access request, so that the processing of the access request can be accelerated based on the CDN architecture. , in particular, the CDN node locally caches the waiting room page data, so that the process of entering the waiting room can be accelerated, further reducing the response delay, improving the read and write timeliness, and by allocating the load-bearing pressure and processing pressure of the origin site to each CDN nodes can help reduce the access pressure on waiting room pages, improve the carrying capacity of access requests, process access requests in a timely manner, and improve the timeliness of access requests.

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施例进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present application, many technical details are provided to enable readers to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solution claimed in this application can also be implemented.

以下各个实施例的划分是为了描述方便,不应对本申请的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present application. The various embodiments can be combined with each other and referenced with each other on the premise that there is no contradiction.

本申请实施例一方面提供了一种访问方法,应用于内容分发网络(ContentDelivery Network,CDN)节点。在一些情况下,具体应用于CDN节点中的边缘应用模块。这样,本申请实施例提供的访问方法可以通过边缘应用的方式部署到CDN节点中,无需对CDN节点设备进行改动,有利于节约成本,降低实现难度,同时还能够更高效便捷地实现方法的升级迭代。On the one hand, embodiments of the present application provide an access method, which is applied to content delivery network (ContentDelivery Network, CDN) nodes. In some cases, it is specifically applied to edge application modules in CDN nodes. In this way, the access method provided by the embodiments of the present application can be deployed to CDN nodes through edge applications without the need to modify the CDN node equipment, which is conducive to saving costs and reducing implementation difficulty. At the same time, it can also realize method upgrades more efficiently and conveniently. Iterate.

在一些实施例中,访问方法的流程如图1所示,至少包括以下步骤:In some embodiments, the flow of the access method is shown in Figure 1, which at least includes the following steps:

步骤101,接收客户端发送的访问请求,访问请求携带用户信息和目标URL。Step 101: Receive an access request sent by the client. The access request carries user information and target URL.

本申请实施例中,用户信息可以是任一或任一些能够唯一确定一个用户的信息,如用户账号名、客户端的设备标识等。目标统一资源定位符(Uniform Resource Locator,URL)为访问请求所想要访问的URL,其中,URL为指向所想要访问的网站的地址。In the embodiment of this application, the user information may be any or some information that can uniquely identify a user, such as user account name, client device identification, etc. The target Uniform Resource Locator (URL) is the URL that the access request wants to access, where the URL is the address pointing to the website that you want to access.

其中,在一些情况下,目标URL可以是任一提供等待室页面的网站的URL,即无需判断接收到的访问请求需要访问的网站是否提供等待机制,效率更高。在一些情况下,也可以是任一URL,而不限定URL指向的网站。此时,可以通过判断接收到的访问请求需要访问的网站是否提供等待机制,确定是否进行相应的处理,这样,不论是提供等待室服务室的网站,还是不提供等待室服务的网站,CDN节点均能够统一接收并处理,无需再额外设置另一个流程专用于处理向不提供等待室服务的网站发起的访问请求,实现了访问不同类型网站的请求的处理流程的统一。In some cases, the target URL can be the URL of any website that provides a waiting room page. That is, there is no need to determine whether the website to be accessed by the received access request provides a waiting mechanism, which is more efficient. In some cases, it can be any URL without limiting the website pointed to by the URL. At this time, you can determine whether to perform corresponding processing by judging whether the website that the received access request needs to access provides a waiting mechanism. In this way, whether it is a website that provides a waiting room service room or a website that does not provide a waiting room service, the CDN node All can be received and processed uniformly, without the need to set up another process dedicated to processing access requests initiated to websites that do not provide waiting room services, realizing the unification of the processing processes for requests to access different types of websites.

可以理解的是,在目标URL为任一URL的情况下,其指向的源站可能是提供等待室服务的网站,也可能是不提供等待室服务的网站。此时,可以根据实际需求对CDN节点进行配置,使得CDN节点能够确定哪一类URL需要执行继续执行后续的步骤102等,以提供等待室服务,哪一类URL不需要执行继续执行后续的步骤102等,能够直接按照CDN节点的一般响应过程,即通过判断访问请求是否缓存命中确定是否回源。It can be understood that when the target URL is any URL, the origin site it points to may be a website that provides waiting room services, or it may be a website that does not provide waiting room services. At this time, the CDN node can be configured according to actual needs, so that the CDN node can determine which type of URL needs to perform the subsequent steps 102 and so on to provide the waiting room service, and which type of URL does not need to perform the subsequent steps. 102, etc., can directly follow the general response process of the CDN node, that is, determine whether to return to the origin by judging whether the access request hits the cache.

也就是说,在一些实施例中,在步骤101之后,访问方法还包括:接收客户端发送的请求,解析请求携带的目标URL并检测目标URL指向的源站是否为提供等待室服务的网站,在检测到目标URL指向的源站为提供等待室服务的网站的情况下,执行步骤102或步骤103;在检测到目标URL指向的源站为不提供等待室服务的网站的情况下,检测访问请求是否缓存命中,以确定是否将访问请求转发至上一级CDN节点或源站。That is to say, in some embodiments, after step 101, the access method also includes: receiving a request sent by the client, parsing the target URL carried in the request, and detecting whether the source site pointed to by the target URL is a website that provides waiting room services, When it is detected that the source site pointed by the target URL is a website that provides waiting room services, perform step 102 or step 103; when it is detected that the source site pointed by the target URL is a website that does not provide waiting room services, detect access Whether the request hits the cache to determine whether to forward the access request to the upper-level CDN node or origin site.

本申请实施例不对访问请求的形式进行限定,其可以是任一种用于对URL发起访问的请求的形式,如超文本传输协议(Hyper Text Transfer Protocol,HTTP)请求等,此处就不再一一赘述了。The embodiment of this application does not limit the form of the access request. It can be any form of request for initiating access to a URL, such as a Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) request, etc., which will not be discussed here. Described one by one.

其中,由于访问方法应用于CDN节点,因此,客户端发起的访问请求可以基于CDN节点实现加速和负载均衡等,相对于集中式票据中心,其处理效率将会得到提高,目标URL指向的源站的处理压力将会由CDN节点承担部分,有利于降低源站的处理压力,从整体上提高访问请求承载能力,避免承载能力差导致的访问延时,从而提高访问请求的时效性。Among them, since the access method is applied to the CDN node, the access request initiated by the client can be accelerated and load balanced based on the CDN node. Compared with the centralized ticket center, its processing efficiency will be improved. The origin site pointed by the target URL Part of the processing pressure will be borne by the CDN node, which will help reduce the processing pressure of the origin site, improve the access request carrying capacity as a whole, avoid access delays caused by poor carrying capacity, and thus improve the timeliness of access requests.

步骤102,在根据用户信息和目标URL确定访问请求为等待状态的情况下,向客户端发送本地缓存的等待室页面数据,供客户端根据等待室页面数据呈现等待室页面。Step 102: When it is determined that the access request is in a waiting state based on the user information and the target URL, locally cached waiting room page data is sent to the client for the client to present the waiting room page based on the waiting room page data.

本实施例中,等待状态表征的是访问请求无法立即被源站响应的状态,即访问请求需要进入等待室等待一段时间后,才能被源站响应。In this embodiment, the waiting state represents a state in which the access request cannot be immediately responded to by the origin station. That is, the access request needs to enter the waiting room and wait for a period of time before it can be responded to by the origin station.

本实施例不对等待室页面数据进行限定,其可以是任一呈现后能够被用户感知到其处于等待状态的页面数据。This embodiment does not limit the waiting room page data, which can be any page data that can be perceived by the user as being in a waiting state after being presented.

在一些实施例中,等待室页面可以是不同用户共享的,即不同用户的等待室页面数据相同。这样能够减少CDN节点中需要维护的等待室页面数据的数据量,简化处理流程,提高处理效率。In some embodiments, the waiting room page may be shared by different users, that is, the waiting room page data of different users are the same. This can reduce the amount of waiting room page data that needs to be maintained in CDN nodes, simplify the processing process, and improve processing efficiency.

在一些实施例中,等待室页面还可以随着用户的不同而不同,或者随着用户所属群体的特征的不同而不同等,这样,在客户端为不同的用户呈现出不同的等待室页面,即定制的等待室页面,也就是说,能够为用户提供差异化的等待室服务,有利于提高服务的多样性和服务质量,提高用户体验。In some embodiments, the waiting room page may also vary with different users, or with different characteristics of the group to which the user belongs. In this way, different waiting room pages are presented to different users on the client. That is, a customized waiting room page, that is to say, it can provide users with differentiated waiting room services, which is conducive to improving service diversity and service quality, and improving user experience.

基于此,在一些实施例中,如图2所示,在查询的结果为访问请求为等待状态的情况下,访问方法还包括以下步骤:Based on this, in some embodiments, as shown in Figure 2, when the result of the query is that the access request is in a waiting state, the access method also includes the following steps:

步骤104,根据定制参考信息,确定定制页面数据,定制参考信息包括以下信息中的至少一项:用户信息和访问请求的连接情况。Step 104: Determine customized page data based on customized reference information, which includes at least one of the following information: user information and connection status of the access request.

本实施例不对定制页面数据进行限定,其可以是任一与当前的访问请求有关的页面数据,且至少部分访问请求对应的页面定制数据有所不同。This embodiment does not limit the customized page data. It can be any page data related to the current access request, and the page customized data corresponding to at least part of the access requests is different.

相应地,向客户端发送本地缓存的等待室页面数据的同时,访问方法还包括以下步骤:向客户端发送定制页面数据。Accordingly, while sending the locally cached waiting room page data to the client, the access method also includes the following steps: sending customized page data to the client.

这样,在客户端处,其将能够根据等待室页面数据和定制页面数据呈现定制化等待室页面。同时由于等待室页面数据单独保存,而不是基于不同用户对等待室页面数据进行重复存储,有利于减少等待室页面数据对CDN缓存的占用。This way, at the client, it will be able to render the customized waiting room page based on the waiting room page data and the custom page data. At the same time, because the waiting room page data is stored separately instead of repeatedly storing the waiting room page data based on different users, it is helpful to reduce the occupation of the CDN cache by the waiting room page data.

在一些例子中,页面定制数据可以是访问请求的连接情况的具体信息,其在呈现后能够显示目标URL当前的等候数、本访问请求处于第几个等待的位置等。In some examples, the page customization data can be specific information about the connection status of the access request. After being presented, it can display the current waiting number of the target URL, which waiting position this access request is at, etc.

这样,通过在CDN节点本地缓冲等待室页面数据,使得无需回源,也无需访问第三方就能够得到等待室页面数据,实现基于CDN节点的加速,使得访问请求的时效性得到提高。In this way, by buffering the waiting room page data locally on the CDN node, the waiting room page data can be obtained without going back to the source or accessing a third party, achieving CDN node-based acceleration and improving the timeliness of access requests.

步骤103,在根据用户信息和目标URL确定访问请求为允许连接状态的情况下,将访问请求转发至目标URL指向的源站,供源站对访问请求进行响应。Step 103: When it is determined that the access request is in the allowed connection state based on the user information and the target URL, the access request is forwarded to the origin site pointed to by the target URL so that the origin site can respond to the access request.

本实施例中,允许连接状态表征的是访问请求可以立即被源站响应的状态,即访问请求无需进入等待室进行等待,而是立即能够被源站响应。In this embodiment, the allowed connection state represents a state in which the access request can be immediately responded to by the origin station, that is, the access request does not need to enter the waiting room to wait, but can be immediately responded to by the origin station.

需要说明的是,本实施例不对根据用户信息和目标URL确定访问请求的状态的实现方式进行限定。It should be noted that this embodiment does not limit the implementation of determining the status of the access request based on the user information and the target URL.

在一些实施例中,如图3所示,将访问请求转发至目标URL指向的源站之后,访问方法还包括以下步骤:In some embodiments, as shown in Figure 3, after forwarding the access request to the origin site pointed to by the target URL, the access method further includes the following steps:

步骤105,在结束基于访问请求对目标URL的访问后,触发确定目标客户端的步骤;在当前基于对目标URL的访问而正在呈现等待室页面的其它客户端中,目标客户端请求访问的时间最早。Step 105: After ending the access to the target URL based on the access request, trigger the step of determining the target client; among the other clients currently rendering the waiting room page based on the access to the target URL, the target client requested access the earliest .

为便于本领域技术人员更好地理解上述实施例中所述的目标客户端,以下对其进行举例说明。In order to facilitate those skilled in the art to better understand the target client described in the above embodiments, examples are provided below.

假设短时间内存在k+1个访问请求先后向目标URL指向的源站发起了访问,且第k个访问请求接入目标URL指向的源站后,目标URL指向的源站所接入的请求数达到能够承载的最大请求数量,那么当目标URL指向的源站当前所接入的请求中出现请求的响应完成时,由于有第k+1个访问请求是剩下的仍然对目标URL指向的源站请求访问的请求中时间最早的,因此,此时将会触发以发起第k+1个访问请求的客户端作为对应的目标客户端的步骤。Assume that there are k+1 access requests in a short period of time that successively initiate access to the origin site pointed by the target URL, and after the kth access request accesses the origin site pointed by the target URL, the request accessed by the origin site pointed by the target URL The number reaches the maximum number of requests that can be carried, then when the response to the request appears in the request currently accessed by the origin site pointed to by the target URL, since there is the k+1th access request that is still pointed to the target URL The source site requests the earliest access request. Therefore, the step of using the client that initiated the k+1th access request as the corresponding target client will be triggered at this time.

本申请实施例不对如何确定请求访问的时间最早以及如何记录请求访问的时间的方式进行限定。The embodiments of this application do not limit the method of determining the earliest time of access request and how to record the time of requested access.

在一些实施例中,可以设置数据表对每个访问请求所请求访问的时间进行记录,具体地,记录的时间可以是访问请求的相关信息的写入时间等,从而在目标URL指向的源站出现响应完成的请求时,就根据记录的时间确定目标客户端。In some embodiments, a data table can be set up to record the access time requested by each access request. Specifically, the recorded time can be the writing time of the relevant information of the access request, etc., so that the source site pointed to by the target URL When a request for response completion occurs, the target client is determined based on the recorded time.

在一些实施例中,还可以根据每个访问请求的访问时间先后给访问请求赋序号,在先请求访问的请求的标号小,在后请求访问的请求的标号大,从而能够在目标URL指向的源站出现响应完成的请求时,就根据序号确定目标客户端等,此处就不再一一赘述了。In some embodiments, the access requests can also be assigned sequence numbers according to the access time of each access request. The request for access earlier has a smaller number, and the request for access later has a larger number, so that the number pointed to by the target URL can be When the origin site responds to a completed request, it determines the target client based on the sequence number, etc., so I won’t go into details here.

其中,各访问请求所请求访问的时间等信息可以通过数据库保存,如CDN节点的本地数据库,或者,通过调用相关服务可以访问的外部数据库等。Among them, information such as the access time requested by each access request can be saved in a database, such as the local database of the CDN node, or an external database that can be accessed by calling relevant services.

步骤106,将目标客户端的请求转发至目标URL指向的源站。Step 106: Forward the target client's request to the origin site pointed to by the target URL.

也就是说,在先的请求将会在先响应,按照请求的顺序对访问请求进行响应,保证服务的公平性,有利于提高用户体验。In other words, earlier requests will be responded to first, and access requests will be responded to in the order of requests, ensuring fairness of the service and improving user experience.

可以理解的是,如果存在N个访问请求的响应同时或接近同时完成,此时,这N个访问请求对应的源站的资源空出来,可以用于对另外N个访问请求进行响应,这另外N个访问请求也仍然按照如上实施例提供的方式确定,使得在先请求访问的N个访问请求将会被优先转发至目标URL指向的源站,实现在先的请求将会在先响应,保证服务的公平性,有利于提高用户体验。It can be understood that if the responses to N access requests are completed at the same time or close to the same time, at this time, the resources of the origin site corresponding to these N access requests are freed and can be used to respond to another N access requests. This additional The N access requests are still determined according to the method provided in the above embodiment, so that the N access requests that previously requested access will be forwarded to the origin site pointed to by the target URL first, and the previous requests will be responded to first, ensuring that The fairness of services is conducive to improving user experience.

当然,以上仅为具体的举例说明,在一些实施例中,用户信息还可能携带优先级标识,此时,还可以根据优先级标识指示的优先级确定目标客户端。可以理解的是,为了更好地为用户提供服务,还可以对不同的用户提供差异化服务,如为其设置优先级,从而有利于满足特定用户对访问请求的更高时效性要求。Of course, the above is only a specific example. In some embodiments, the user information may also carry a priority identifier. In this case, the target client may also be determined based on the priority indicated by the priority identifier. It is understandable that in order to better provide services to users, differentiated services can also be provided to different users, such as setting priorities for them, thereby helping to meet the higher timeliness requirements of specific users for access requests.

在一些实施例中,等候室页面数据携带用于定时触发请求访问目标URL的数据,从而客户端在接收到等待室页面数据后,将会基于其携带的数据定时触发对目标URL的访问请求。基于此,如图4所示,向客户端发送本地缓存的等待室页面数据之后,访问方法还包括以下步骤:In some embodiments, the waiting room page data carries data used to regularly trigger a request to access the target URL, so that after receiving the waiting room page data, the client will regularly trigger an access request to the target URL based on the data it carries. Based on this, as shown in Figure 4, after sending the locally cached waiting room page data to the client, the access method also includes the following steps:

步骤107,接收客户端基于等待室页面数据定时发起的访问,以再次确定访问请求的状态并根据访问请求的状态执行相应的步骤,直到访问请求被转发至源站。Step 107: Receive the access periodically initiated by the client based on the waiting room page data to determine the status of the access request again and perform corresponding steps according to the status of the access request until the access request is forwarded to the origin site.

也就是说,在等待的状态下,还提供定时刷新的功能,通过多次进行查询,以及时发现访问请求的状态从等待状态到允许连接状态的转变,从而及时实现源站对访问请求的响应,避免造成等待时间过长。使得访问请求能够及时被响应,有利于提高用户体验。That is to say, in the waiting state, it also provides a scheduled refresh function. Through multiple queries, the state of the access request can be discovered in a timely manner from the waiting state to the allowed connection state, thereby realizing the origin site's response to the access request in a timely manner. , to avoid excessive waiting time. This enables access requests to be responded to in a timely manner, which is beneficial to improving user experience.

需要说明的是,客户端基于等待室页面数据定时发起访问由于是在等待室页面数据中携带的相关数据(可以理解的是,一般情况下该数据即程序代码数据),因此,会自动触发再次发起访问的动作实现,这样,能够在用户无感知的情况下及时实现对访问请求的响应,且无需改动客户端,有利于提高用户体验并减少实现成本、实现难度。It should be noted that the client periodically initiates access based on the waiting room page data. Since it is related data carried in the waiting room page data (it is understandable that in general, this data is program code data), therefore, it will automatically trigger again. The action of initiating access is implemented, so that the response to the access request can be realized in time without the user being aware of it, and there is no need to modify the client, which is conducive to improving the user experience and reducing implementation costs and difficulty.

当然,上述仅为举例说明,触发再次发起访问的动作还可以是在等待室页面数据中未携带的相关数据的情况下实现,此时客户端可以通过自身部署的程序定时发起对目标URL的访问实现相关功能,这样,有利于减少CDN节点本地需要维护的等待室页面数据的数量,减少对CDN节点的存储空间的占用。Of course, the above is just an example. The action of triggering re-initiation of access can also be implemented when there is no relevant data carried in the waiting room page data. At this time, the client can regularly initiate access to the target URL through its own deployed program. Implementing related functions will help reduce the amount of waiting room page data that the CDN node needs to maintain locally, and reduce the occupation of the storage space of the CDN node.

还需要说明的是,在定时确定访问请求的状态并根据访问请求的状态执行相应的步骤的过程中,如果访问请求仍然处于等待状态,还可以检测需要呈现的页面数据是否发生变化,如果发生变化则向客户端发送变化后的页面数据,如果未发生变化则不发生数据。如在检测到目标URL的连接情况发生变化时,将变化后的连接情况对应的页面数据发送至客户端,否则无动作。也就是说,实时将等待的情况同步至客户端,使得用户能够实时了解等待情况,有利于提高用户体验。It should also be noted that in the process of regularly determining the status of the access request and performing corresponding steps according to the status of the access request, if the access request is still in the waiting state, it can also be detected whether the page data that needs to be presented changes. If it changes, Then send the changed page data to the client. If no change occurs, no data will be generated. For example, when a change in the connection status of the target URL is detected, the page data corresponding to the changed connection status is sent to the client, otherwise no action is taken. In other words, the waiting situation is synchronized to the client in real time, so that the user can understand the waiting situation in real time, which is beneficial to improving the user experience.

在一些实施例中,向客户端发送本地缓存的等待室页面数据之后,访问方法还包括以下步骤:对客户端是否基于等待室页面数据定时发起访问进行监测;在第一预设时长内未监测到客户端基于等待室页面数据定时发起的访问的情况下,对访问请求对应的记录进行更新,以删除访问请求对应的记录。In some embodiments, after sending the locally cached waiting room page data to the client, the access method further includes the following steps: monitoring whether the client initiates access regularly based on the waiting room page data; not monitoring within the first preset time period. When the client periodically initiates access based on the waiting room page data, the record corresponding to the access request is updated to delete the record corresponding to the access request.

可以理解的是,用户在等待的过程中可能会放弃对目标URL的访问。其中,用户在放弃访问时,可以点击等待室页面提供的放弃访问按钮,然后客户端通知CDN节点放弃请求等。此时若CDN节点仍然定时刷新,则会造成资源浪费。因此,上述实施例通过监测是否再次发起访问能够及时发现用户放弃访问的动作并做出删除,有利于精确调整等候室的冗余,并确保排队的用户是否仍然在等待访问目标URL指向的源站。It is understandable that users may give up access to the target URL while waiting. Among them, when the user gives up access, he can click the give up access button provided on the waiting room page, and then the client notifies the CDN node to give up the request, etc. At this time, if the CDN node is still refreshed regularly, it will cause a waste of resources. Therefore, the above embodiment can promptly detect the user's action of abandoning the access by monitoring whether the access is initiated again and delete it, which is conducive to accurately adjusting the redundancy of the waiting room and ensuring whether the queued users are still waiting to access the origin site pointed to by the target URL. .

需要说明的是,上述实施例不对第一预设时长的数值进行限定,其可以是根据用户等待需求、源站允许的处于等待连接的数量等确定。当然,除了对是否再次发起访问进行监测,还可以对客户端是否中断连接、客户端是否发送放弃访问的相关消息等进行监测,以便及时做出相关的处理,避免资源浪费,此处就不再一一赘述了。It should be noted that the above embodiment does not limit the value of the first preset duration, which may be determined based on the user's waiting requirements, the number of waiting connections allowed by the origin station, etc. Of course, in addition to monitoring whether access is initiated again, you can also monitor whether the client interrupts the connection, whether the client sends related messages to give up the access, etc., so as to make relevant processing in a timely manner and avoid resource waste, which will not be discussed here. Described one by one.

在一些实施例中,如图5所示,将访问请求转发至目标URL指向的源站之后,访问方法还包括以下步骤:In some embodiments, as shown in Figure 5, after forwarding the access request to the origin site pointed to by the target URL, the access method further includes the following steps:

步骤108,在第二预设时长内未监测到客户端基于用户信息和目标URL发起访问的情况下,对访问请求对应的记录进行更新,以删除访问请求对应的记录。Step 108: If it is not detected that the client initiates access based on the user information and the target URL within the second preset time period, update the record corresponding to the access request to delete the record corresponding to the access request.

也就是说,在实现连接后,为该连接定义一个有效时间,即第二预设时长,当在有效时间内再次发起访问时,仍然能够使用该连接继续访问目标URL指向的源站,当超出有效时间时,不再保持该连接,而将该连接占用的资源提供给其它连接使用,使得连接既能够被高效利用,还能够减少对其他连接不利影响,避免单个连接对源站资源的占用时间过长,从而有利于其他连接的建立。实现对用户体验的提高,还实现请求信息记录压力的减少。That is to say, after the connection is realized, a valid time is defined for the connection, that is, the second preset time period. When access is initiated again within the valid time, the connection can still be used to continue to access the origin site pointed to by the target URL. During the effective time, the connection is no longer maintained, and the resources occupied by the connection are provided to other connections, so that the connection can be efficiently utilized, and the adverse impact on other connections can be reduced, and the time occupied by a single connection on the origin site resources can be avoided. Too long to facilitate the establishment of other connections. This improves user experience and reduces the pressure of requesting information records.

需要说明的是,本实施例不对第二预设时长的具体数值进行限定,其可以根据源站的处理压力、当前处于等待状态的请求数量等确定,此处就不再一一赘述了。It should be noted that this embodiment does not limit the specific value of the second preset duration, which can be determined based on the processing pressure of the origin station, the number of requests currently in the waiting state, etc., and will not be described again here.

上述实施例提供的访问方法,在接收到访问请求且根据访问请求携带的用户信息和目标URL确定访问请求为等待状态的情况下,CDN节点向客户端发送的是本地缓存的等待室页面数据,而不是通过回源或者访问第三方网站等获取到的等待室页面数据,使得等待室页面的呈现能够基于CDN节点的本地缓存实现加速,保证了时效性。并且,通过各CDN节点对访问请求的处理,分担了源站对访问请求的处理压力,有利于提高对访问请求的承载能力,且能够减少负载不均衡,甚至是服务不可用的问题,进一步提高了访问请求的时效性。According to the access method provided in the above embodiment, when an access request is received and the access request is determined to be in a waiting state based on the user information and target URL carried in the access request, the CDN node sends the locally cached waiting room page data to the client. Instead of obtaining the waiting room page data by going back to the source or visiting a third-party website, the rendering of the waiting room page can be accelerated based on the local cache of the CDN node, ensuring timeliness. In addition, the processing of access requests by each CDN node shares the pressure of processing access requests on the origin site, which is conducive to improving the carrying capacity of access requests, and can reduce load imbalance and even service unavailability problems, further improving ensure the timeliness of access requests.

此外,上述CDN节点上所实现的访问方法,相对于目前提供的基于集中式票据中心的虚拟等候室技术,实际可以视为票据中心的功能从票据中心下沉至靠近用户侧的各CDN节点。其中,相对于票据中心,CDN节点可以视为边缘。也就是说,本申请实施例提供的访问方法实际是将票据中心的功能通过边缘应用的形式部署到位于用户边缘的CDN节点上进行实现,这样就能够通过CDN节点对访问请求的接收,在CDN节点上驱动对访问请求进行本地处理,降低了访问请求的延时,提高了访问请求的时效性,同时也减轻了处理压力。In addition, compared with the currently provided virtual waiting room technology based on a centralized bill center, the access method implemented on the CDN node mentioned above can actually be regarded as the function of the bill center being moved down from the bill center to each CDN node close to the user side. Among them, relative to the bill center, CDN nodes can be regarded as edges. In other words, the access method provided by the embodiment of this application actually deploys the functions of the ticket center to the CDN node located at the user edge through the edge application. In this way, the access request can be received by the CDN node on the CDN. The driver on the node processes the access request locally, which reduces the delay of the access request, improves the timeliness of the access request, and also reduces the processing pressure.

除了前述提到的基于集中式票据中心的虚拟等候室技术,目前还存在一种基于区域性的票据中心的虚拟等候室技术。其在实现对网站的访问时,首先用户发起的访问将会到其所属区域的票据服务提供者处取号,不同的区域票据服务提供者独立维护各自的票据队列,然后在取到号的情况下,访问请求才被允许访问网站。此时,无法保证数据一致性,从而导致无法同步开启或关闭等候室功能,可能导致网站的负载不均衡,甚至服务不可用。In addition to the aforementioned virtual waiting room technology based on a centralized ticket center, there is also a virtual waiting room technology based on a regional ticket center. When accessing the website, first the access initiated by the user will get a number from the ticket service provider in the region to which it belongs. Different regional ticket service providers independently maintain their own ticket queues, and then when the number is obtained Access requests are allowed to the website only if required. At this time, data consistency cannot be guaranteed, resulting in the inability to turn on or off the waiting room function synchronously, which may lead to unbalanced load on the website or even service unavailability.

为解决上述问题,在一些实施例中,CDN节点部署有本地数据库,CDN节点的本地数据库与其它CDN节点的本地数据库保持数据同步。其中,本地数据库为部署在CDN节点本地的数据库。In order to solve the above problem, in some embodiments, the CDN node is deployed with a local database, and the local database of the CDN node maintains data synchronization with the local databases of other CDN nodes. Among them, the local database is a database deployed locally on the CDN node.

相应的,如图6所示,在接收客户端发送的访问请求之后,访问方法还包括:Correspondingly, as shown in Figure 6, after receiving the access request sent by the client, the access method also includes:

步骤109,根据用户信息和目标URL,在本地数据库中进行查询,以确定访问请求是否为等待状态。Step 109: Query the local database according to the user information and the target URL to determine whether the access request is in a waiting state.

本实施例中,本地数据库中存储有用户信息、目标URL以及目标URL相关的连接情况,如用户标识、用户当前是否已与目标URL建立连接、目标URL当前允许的最大连接数、目标URL当前的连接数、目标URL当前允许的最大等待连接数等,此处就不再一一赘述了。In this embodiment, the local database stores user information, target URL, and connection status related to the target URL, such as user identification, whether the user has currently established a connection with the target URL, the maximum number of connections currently allowed by the target URL, and the current number of connections of the target URL. The number of connections, the maximum number of waiting connections currently allowed by the target URL, etc. will not be described one by one here.

这样,各CDN节点通过各自的本地数据库之间的数据同步,使得用户信息、目标URL及其相关信息的全局一致性,而不会出现正在使用的号码(即当前访问请求为等待的第几个请求的序号)之间存在空闲未被使用的号码或者不同请求被分配同一号码而导致访问出错等问题。In this way, each CDN node achieves global consistency of user information, target URL and related information through data synchronization between their respective local databases, without the number being used (that is, which number is the current access request waiting for)? There are idle and unused numbers among the requested sequence numbers) or problems such as access errors caused by different requests being assigned the same number.

在一些实施例中,根据用户信息和目标URL,在本地数据库中进行查询,可以通过如下方式实现:根据用户信息和目标URL,在本地数据库中查询用户信息对应的客户端是否处于与目标URL建立连接的状态;在用户信息对应的客户端未处于与目标URL建立连接的状态的情况下,根据目标URL,在本地数据库中查询目标URL的连接情况。相应地,根据用户信息和目标URL,在本地数据库中进行查询之后,访问方法还包括:根据目标URL的连接情况,确定访问请求是否为等待状态。In some embodiments, querying in the local database based on the user information and the target URL can be implemented in the following manner: based on the user information and the target URL, querying in the local database whether the client corresponding to the user information is in an established state with the target URL. The status of the connection; when the client corresponding to the user information is not in the state of establishing a connection with the target URL, query the connection status of the target URL in the local database based on the target URL. Correspondingly, after querying the local database according to the user information and the target URL, the access method also includes: determining whether the access request is in a waiting state according to the connection status of the target URL.

需要说明的是,客户端可能较短时间内向不同的URL发起访问,即本地数据库中可能存在同一用户信息关于多个URL的连接状态。当客户端发起向目标URL的访问,即发送携带目标URL的访问请求时,在本地数据库中存在同一用户信息关于多个URL的连接之间是否在客户端和对应的URL之间建立连接,此时,查询用户信息对应的客户端是否与目标URL之间处于建立连接的状态,而不是其他的URL。基于此,在一些实施例中,本地数据库中存在同一用户信息仅关于特定的一个URL在客户端是否与该URL之间建立连接的相关信息,此时不存在多个URL的干扰,不需要使用目标URL进行查询,此处就不再一一赘述了。It should be noted that the client may initiate access to different URLs within a short period of time, that is, the local database may have the same user information regarding the connection status of multiple URLs. When the client initiates access to the target URL, that is, sends an access request carrying the target URL, the same user information exists in the local database regarding whether a connection between multiple URLs is established between the client and the corresponding URL. This When querying, whether the client corresponding to the user information is in the established connection state with the target URL, not other URLs. Based on this, in some embodiments, the same user information in the local database is only relevant information about whether a specific URL establishes a connection between the client and the URL. At this time, there is no interference from multiple URLs, and there is no need to use Query the target URL, so I won’t go into details here.

在一些实施例中,根据目标URL的连接情况,确定访问请求是否为等待状态,可以通过如下方式实现:在目标URL的连接未满的情况下,确定访问请求为允许连接状态;在目标URL的连接已满的情况下,确定访问请求为等待状态。In some embodiments, determining whether the access request is in the waiting state according to the connection status of the target URL can be implemented in the following manner: when the connection to the target URL is not full, determine that the access request is in the allowed connection status; When the connection is full, the access request is determined to be in a waiting state.

为便于本领域技术人员更好地理解上述实施例,以下将对查询以及确定访问请求的状态进行举例说明。In order to facilitate those skilled in the art to better understand the above embodiments, examples of querying and determining the status of an access request will be described below.

首先,根据用户信息和目标URL,确定用户信息对应的客户端是否与目标URL指向的源站之间建立连接。若是,则说明该客户端发起的访问可以直接被响应,无需等待,即访问请求处于运行连接状态;若否,则需要进一步确认目标URL指向的源站是否能够接入该访问请求。具体地,先要根据目标URL查询目标URL指向的源站当前已接入的请求数量,即目标URL的连接情况;然后根据查询到的目标URL指向的源站当前已接入的请求数量,确定是否已经达到目标URL指向的源站能够承载的请求数量上限,即确定目标URL的连接是否已满。若是,则确定访问请求为等待状态,若否,则确定访问请求为运行连接状态。First, based on the user information and the target URL, it is determined whether the client corresponding to the user information has established a connection with the origin site pointed to by the target URL. If yes, it means that the access initiated by the client can be responded directly without waiting, that is, the access request is in the running connection state; if not, you need to further confirm whether the origin site pointed to by the target URL can access the access request. Specifically, we first need to query the number of requests currently connected to the origin site pointed by the target URL based on the target URL, that is, the connection status of the target URL; and then determine the number of requests currently connected to the origin site pointed to by the target URL based on the query. Whether the upper limit of the number of requests that the origin site pointed to by the target URL can handle has been reached, that is, determine whether the connection to the target URL is full. If yes, the access request is determined to be in the waiting state; if not, the access request is determined to be in the running connection state.

也就是说,上述实施例通过目标URL指向的源站所能承载的请求数量上限,使得目标URL指向的源站所需要处理的请求不会超过其承载能力,保证其能够以足够的资源对已连接的请求进行响应,避免用户等待时间过长或无效等待,提高响应质量,进而提高用户体验。当然,以上仅为对查询以及基于查询结果确定访问请求的状态的举例说明,在其他实施例或例子中还可以通过其他方式实现,此处就不再一一赘述了。That is to say, the above embodiment uses the upper limit of the number of requests that the origin site pointed to by the target URL can handle, so that the requests that the origin site pointed to by the target URL needs to process will not exceed its carrying capacity, ensuring that it can use sufficient resources to handle already processed requests. Respond to connection requests to avoid users waiting for too long or invalid waiting, improve response quality, and thus improve user experience. Of course, the above is only an example of querying and determining the status of the access request based on the query results. In other embodiments or examples, it can also be implemented in other ways, and the details will not be described here.

需要说明的是,在处于等待状态的访问请求数量过多时,后续进入等待状态的访问请求等待的时间可能会过长。此时,为了进一步避免用户等待时间过长,还可以为访问请求设置拒绝状态,具体地,目标URL指向的源站接入的请求数量达到上限,处于等待状态的请求也达到上限后,再接收到的访问请求不再是处于等待状态,而是将会处于拒绝状态。It should be noted that when there are too many access requests in the waiting state, the waiting time for subsequent access requests that enter the waiting state may be too long. At this time, in order to further prevent users from waiting too long, you can also set a rejection status for access requests. Specifically, the number of requests accessed by the origin site pointed to by the target URL reaches the upper limit, and the requests in the waiting state also reach the upper limit before receiving them again. Incoming access requests are no longer in a waiting state, but will be in a denied state.

在一些实施例中,CDN节点的本地数据库中的数据以键值(Key-Value,KV)的形式存储,即本地数据库为KV数据库,从而能够更高效地完成查询,且有利于本地数据库和数据中心的数据维护。In some embodiments, the data in the local database of the CDN node is stored in the form of key-value (KV), that is, the local database is a KV database, so that the query can be completed more efficiently and is beneficial to the local database and data Central data maintenance.

基于此,在一些实施例中,如图7所示,根据用户信息和目标URL,在本地数据库中进行查询,可以包括以下步骤:Based on this, in some embodiments, as shown in Figure 7, querying the local database according to user information and target URL may include the following steps:

步骤1091,根据用户信息,生成用户标识,用户标识用于唯一标识用户信息。Step 1091: Generate a user ID based on the user information. The user ID is used to uniquely identify the user information.

本实施例不对用户标识进行限定,其可以是字符串或者标号等,此处就不再一一赘述了。This embodiment does not limit the user identification, which may be a string or a label, etc., which will not be described in detail here.

步骤1092,根据用户标识和目标URL,在本地数据库中进行查询。Step 1092: Query in the local database according to the user ID and target URL.

相应地,访问方法还包括:Correspondingly, access methods also include:

步骤1010,在根据用户标识查询失败的情况下,在本地数据库中查询目标URL的连接情况并将用户标识、目标URL和目标URL的连接情况以KV的形式更新到本地数据库中。Step 1010: If the query based on the user ID fails, query the connection status of the target URL in the local database and update the user ID, target URL, and connection status of the target URL to the local database in the form of KV.

本实施例中,目标URL为指向所想要访问的网站的地址。目标URL的连接情况可以是目标URL的连接数、等候连接数、连接数的上限等中的一种或多种,也可以是用于表示是否达到连接数上限或者是否达到等候连接数上限的状态标志位等,此处就不再一一赘述了。In this embodiment, the target URL is an address pointing to the website you want to visit. The connection status of the target URL can be one or more of the number of connections of the target URL, the number of waiting connections, the upper limit of the number of connections, etc. It can also be a state used to indicate whether the upper limit of the number of connections has been reached or whether the upper limit of the number of waiting connections has been reached. Flag bits, etc. will not be described one by one here.

可以理解的是,用户信息可能包括多种信息,通过多种信息进行查询的效率会比较低,而将其转换为唯一标识用户信息的用户标识后以KV形式写入本地数据库,能够简化查询,有利于提高查询效率,降低维护难度,且减少出错概率。It is understandable that user information may include a variety of information, and the efficiency of querying through multiple types of information will be relatively low. Converting it into a user ID that uniquely identifies the user information and then writing it to the local database in KV form can simplify the query. It is helpful to improve query efficiency, reduce maintenance difficulty, and reduce the probability of errors.

当然,本地数据库为KV数据库仅为对本地数据库的一种举例说明,在一些实施例中,本地数据库还可以是联机事务处理(On-Line Transaction Processing,OLTP)数据库等。Of course, the fact that the local database is a KV database is only an example of the local database. In some embodiments, the local database can also be an online transaction processing (On-Line Transaction Processing, OLTP) database, etc.

在一些实施例中,各CDN节点的本地数据库之间的数据同步是通过其共同连接的同一数据中心实现的。即各CDN节点的本地数据库可以视为以数据中心为中心的多个边缘数据库,只是这些数据库分布在不同的CDN节点上。这样,通过数据中心的推送机制和订阅机制,实现各个CDN节点的本地数据库之间的数据同步。In some embodiments, data synchronization between the local databases of each CDN node is implemented through the same data center to which they are commonly connected. That is, the local database of each CDN node can be regarded as multiple edge databases centered on the data center, but these databases are distributed on different CDN nodes. In this way, data synchronization between the local databases of each CDN node is achieved through the push mechanism and subscription mechanism of the data center.

在一些实施例中,如图8所示,访问方法还包括:In some embodiments, as shown in Figure 8, the access method also includes:

步骤1011,在本地数据库发生数据更新的情况下,向数据中心发送更新的数据,供数据中心将接收到的更新的数据推送至订阅更新的数据的其他CDN节点的本地数据库。Step 1011: When data update occurs in the local database, the updated data is sent to the data center, so that the data center can push the received updated data to the local databases of other CDN nodes that subscribe to the updated data.

也就是说,允许从本地数据库到数据中心再到本地数据库的数据同步。That is, allowing data synchronization from the local database to the data center and back to the local database.

需要说明的是,本实施例不对本地数据库发送更新的情况进行限定,其可以是任何一种由于本地数据库所在CDN节点上的访问请求的相关变化而导致的其在本地数据库中的对应的数据发送变化而造成的更新。例如,新写入某个访问请求相关的信息、删除某个访问请求相关的信息、某个访问请求从等待状态变化为允许连接状态等均可以是本地数据库发送更新的情况。It should be noted that this embodiment does not limit the situation of sending updates to the local database. It can be any corresponding data sending in the local database caused by related changes in access requests on the CDN node where the local database is located. Updates due to changes. For example, newly writing information related to an access request, deleting information related to an access request, changing an access request from the waiting state to the allowed connection state, etc. can all be cases where the local database sends updates.

例如,由于在前述实施例提供的步骤106将目标客户端的请求转发至目标URL指向的源站的过程,实质上是目标客户端从等待状态转变为允许连接状态,因此,需要及时将目标客户端对应的等待状态更新为允许连接状态,此时如果基于本地数据库保存用户对应的状态信息,则会呈现为本地数据库发生数据更新。For example, since the process of forwarding the target client's request to the origin site pointed to by the target URL in step 106 provided in the foregoing embodiment is essentially the target client transitioning from the waiting state to the connection allowed state, therefore, the target client needs to be transferred to the target client in a timely manner. The corresponding waiting status is updated to the allowed connection status. At this time, if the user's corresponding status information is saved based on the local database, it will appear that data update has occurred in the local database.

可以理解的是,在本地数据库主动发生变化的情况之外,还可能是存在本地数据库均被动发生变化的情况,即数据中心的数据先发生变化。此时,由数据中心主动向各个本地数据库下发数据,以实现数据同步。如目标URL的连接情况发生变化后,源站将该变化通知到数据中心,此时,数据中心也会将该变化通知到各个本地数据库。It is understandable that in addition to the situation where the local database changes actively, there may also be situations where the local database changes passively, that is, the data in the data center changes first. At this time, the data center actively delivers data to each local database to achieve data synchronization. If the connection status of the target URL changes, the origin site will notify the data center of the change. At this time, the data center will also notify each local database of the change.

基于此,在一些实施例中,如图9所示,访问方法还包括:Based on this, in some embodiments, as shown in Figure 9, the access method also includes:

步骤1012,在目标URL的连接情况发生变化的情况下,通过本地数据库接收数据中心推送的同步数据并同步至本地数据库,同步数据为数据中心根据目标URL的连接情况的变化得到的数据。Step 1012: When the connection status of the target URL changes, the synchronization data pushed by the data center is received through the local database and synchronized to the local database. The synchronization data is data obtained by the data center according to the change in the connection status of the target URL.

也就是说,允许从数据中心到各CDN节点的本地数据库的数据同步。That is, data synchronization is allowed from the data center to the local database of each CDN node.

在一些实施例中,既允许CDN节点的本地数据库到其他各CDN节点的本地数据库之间的数据同步,也允许数据中心到各CDN节点的本地数据库的数据同步。In some embodiments, data synchronization between the local database of a CDN node and the local databases of other CDN nodes is allowed, and data synchronization between the data center and the local database of each CDN node is allowed.

需要说明的是,以上仅为对数据中心和各本地数据库之间的数据推送、订阅过程的举例说明,在一些实施例中还可以通过其它方式实现,例如定时同步数据等,此处就不再一一赘述了。It should be noted that the above is only an example of the data push and subscription process between the data center and each local database. In some embodiments, it can also be implemented in other ways, such as timing data synchronization, etc., which will not be discussed here. Described one by one.

上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the various methods above are divided just for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are within the scope of protection of this patent.

本申请实施例另一方面还提供了一种CDN节点,如图10所示,CDN节点1000包括:边缘应用模块1001和等待室页面模块1003;边缘应用模块1001与等待室页面模块1003分别连接。On the other hand, the embodiment of the present application also provides a CDN node. As shown in Figure 10, the CDN node 1000 includes: an edge application module 1001 and a waiting room page module 1003; the edge application module 1001 and the waiting room page module 1003 are connected respectively.

其中,边缘应用模块1001用于实现上述任一实施例提供的访问方法;Among them, the edge application module 1001 is used to implement the access method provided by any of the above embodiments;

等待室页面模块1003用于维护CDN节点1000的本地缓存的等待室页面数据,以向边缘应用模块1001提供本地缓存的等待室页面数据。The waiting room page module 1003 is configured to maintain locally cached waiting room page data of the CDN node 1000 to provide the locally cached waiting room page data to the edge application module 1001 .

需要说明的是,上述实施例通过在CDN节点1000上部署边缘应用模块1001,使得当CDN节点接收到访问请求后,能够基于边缘应用模块1001驱动自身和等待室页面模块1003实现相应的动作,从而相互配合以完成上述任一方法实施例提供的访问方法。It should be noted that the above embodiment deploys the edge application module 1001 on the CDN node 1000, so that when the CDN node receives an access request, it can drive itself and the waiting room page module 1003 to implement corresponding actions based on the edge application module 1001, thereby Cooperate with each other to complete the access method provided by any of the above method embodiments.

也就是说,本申请实施例提供的CDN节点实际是将票据中心的功能通过边缘应用的形式部署到位于用户侧(即边缘)的CDN节点后所形成的,此时,能够通过对访问请求的接收,驱动CDN节点对访问请求进行本地处理,降低了访问请求的延时,提高了访问请求的时效性,同时也减轻了处理压力。In other words, the CDN node provided by the embodiment of this application is actually formed by deploying the functions of the bill center to the CDN node located on the user side (ie, the edge) in the form of an edge application. At this time, the access request can be processed through Receive and drive the CDN node to process the access request locally, which reduces the delay of the access request, improves the timeliness of the access request, and also reduces the processing pressure.

在一些实施例中,如图11所示,CDN节点1000还包括边缘数据库服务模块1002。In some embodiments, as shown in Figure 11, the CDN node 1000 also includes an edge database service module 1002.

其中,边缘数据库服务模块1002内部署有本地数据库1004,边缘数据库服务模块1002内部部署的本地数据库1004与其它CDN节点1000的边缘数据库服务模块1002内部部署的本地数据库1004之间数据同步;Among them, a local database 1004 is deployed in the edge database service module 1002, and data is synchronized between the local database 1004 deployed within the edge database service module 1002 and the local database 1004 deployed within the edge database service module 1002 of other CDN nodes 1000;

边缘数据库服务模块1002,与边缘应用模块1001连接,用于维护CDN节点1000的本地数据库,以向边缘应用模块1001提供数据库服务。The edge database service module 1002 is connected to the edge application module 1001 and is used to maintain the local database of the CDN node 1000 to provide database services to the edge application module 1001.

这样,通过各个CDN节点1000之间的本地数据库的数据同步,保证全局请求状态等信息的强一致性,有利于提供访问的准确性,避免出现取号错误、跳号等导致的等待时间过长问题。In this way, through data synchronization of local databases between each CDN node 1000, strong consistency of information such as global request status is ensured, which is conducive to providing access accuracy and avoiding long waiting times caused by number retrieval errors, number hopping, etc. question.

在一些实施例中,如图12所示,CDN节点1000的边缘数据库服务模块与其它CDN节点1000的边缘数据库服务模块1002通过内部部署的本地数据库1004连接于同一数据中心2000。In some embodiments, as shown in Figure 12, the edge database service module of a CDN node 1000 and the edge database service modules 1002 of other CDN nodes 1000 are connected to the same data center 2000 through an internally deployed local database 1004.

需要说明的是,在本地数据库部署在边缘数据库服务模块1002之外的情况下,本地数据库可以仅向数据中心2000订阅上述实施例所述的访问请求的相关数据,以高效地同步,以及减轻本地数据库的处理压力。It should be noted that when the local database is deployed outside the edge database service module 1002, the local database can only subscribe to the data center 2000 for the relevant data of the access request described in the above embodiment to efficiently synchronize and alleviate local Database processing pressure.

这样,通过数据中心2000,各个CDN节点1000之间能够以简洁的部署、低难度地实现数据同步,有利于广泛应用各种不同的访问场景,降低成本。In this way, through the data center 2000, each CDN node 1000 can achieve data synchronization with simple deployment and low difficulty, which is conducive to the wide application of various access scenarios and reduced costs.

不难发现,本实施例为与方法实施例相对应的节点实施例,本实施例可与方法实施例互相配合实施。方法实施例中提到的相关技术细节在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在方法实施例中。It is not difficult to find that this embodiment is a node embodiment corresponding to the method embodiment, and this embodiment can be implemented in cooperation with the method embodiment. The relevant technical details mentioned in the method embodiment are still valid in this embodiment. In order to reduce duplication, they will not be described again here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the method embodiment.

本申请实施例另一方面还提供了一种访问系统,如图11所示,访问系统包括:若干如上一任一实施例所述的CDN节点1000。On the other hand, the embodiment of the present application also provides an access system. As shown in Figure 11, the access system includes: a plurality of CDN nodes 1000 as described in any of the previous embodiments.

需要说明的是,图12为便于呈现出系统中各CDN节点1000之间的关系,示意出了每个CDN节点1000均部署有边缘数据库服务模块1002,且边缘数据库服务模块1002通过各自内部部署的本地数据库1004与同一数据中心2000连接,以保持数据同步的情况。其中,数据库2000可以视作访问系统的一部分,也可以视为独立于访问系统之外的另一结构,此处就不再一一赘述了。It should be noted that, in order to facilitate the presentation of the relationship between each CDN node 1000 in the system, Figure 12 illustrates that each CDN node 1000 is deployed with an edge database service module 1002, and the edge database service module 1002 is deployed internally through the respective The local database 1004 is connected to the same data center 2000 to maintain data synchronization. Among them, the database 2000 can be regarded as a part of the access system, or can be regarded as another structure independent of the access system, which will not be described in detail here.

但是,在一些实施例中,访问系统还可以不通过数据中心2000实现数据同步,此时,各CDN节点1000的边缘数据库服务模块1002则不再需要通过各自的本地数据库1004与数据中心2000连接。However, in some embodiments, the access system can also achieve data synchronization without going through the data center 2000. At this time, the edge database service module 1002 of each CDN node 1000 no longer needs to connect to the data center 2000 through its respective local database 1004.

不难发现,本实施例为与节点实施例相对应的系统实施例,本实施例可与方法实施例互相配合实施。方法实施例中提到的相关技术细节在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在方法实施例中。It is not difficult to find that this embodiment is a system embodiment corresponding to the node embodiment, and this embodiment can be implemented in cooperation with the method embodiment. The relevant technical details mentioned in the method embodiment are still valid in this embodiment. In order to reduce duplication, they will not be described again here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the method embodiment.

为便于本领域技术人员更好地理解上述实施例,以下将对其进行举例说明。In order to facilitate those skilled in the art to better understand the above embodiments, examples will be provided below.

客户端3000在需要访问目标URL的情况下,生成对应的访问请求,边缘应用模块1001接收到客户端3000发送过来的访问请求,解析出其携带的目标URL,然后边缘应用模块1001根据预先配置的信息检测目标URL指向的源站是否提供有等待室服务。When the client 3000 needs to access the target URL, it generates a corresponding access request. The edge application module 1001 receives the access request sent by the client 3000 and parses out the target URL it carries. Then the edge application module 1001 executes the request according to the preconfigured The information detects whether the origin site pointed to by the target URL provides a waiting room service.

在目标URL指向的源站提供有等待室服务的情况下,边缘应用模块1001将访问请求转发至边缘数据库服务模块1002,边缘数据库服务模块1002根据用户信息生成用户标识并基于该用户标识在部署的本地数据库1004中进行查询,并将查询得到的数据返回给边缘应用模块1001。When the origin site pointed to by the target URL provides a waiting room service, the edge application module 1001 forwards the access request to the edge database service module 1002. The edge database service module 1002 generates a user ID based on the user information and based on the user ID in the deployed Query is performed in the local database 1004 and the data obtained by the query is returned to the edge application module 1001.

边缘应用模块1001在接收到查询结果后,先确定查询是否失败。After receiving the query result, the edge application module 1001 first determines whether the query failed.

如果查询失败,则说明该访问请求无记录,边缘应用模块1001进一步根据目标URL的连接情况,即目标URL的连接数和等候连接数进行判断。具体地:If the query fails, it means that there is no record of the access request. The edge application module 1001 further makes a judgment based on the connection status of the target URL, that is, the number of connections and the number of waiting connections of the target URL. specifically:

在目标URL的连接数和等候连接数均达到上限的情况下则确定访问请求为拒绝状态,拒绝访问请求;在目标URL的连接数达到上限、等候连接数未达到上限的情况下,则确定访问请求为等待状态,从等待室页面模块1003处获取等待室页面数据并返回给客户端3000;在目标URL的连接数和等候连接数均未达到上限的情况下,则确定访问请求为允许连接状态,将访问请求转发至目标URL指向的源站4000,供源站4000对访问请求进行响应。When the number of connections to the target URL and the number of waiting connections both reach the upper limit, the access request is determined to be in the denied state and the access request is rejected; when the number of connections to the target URL reaches the upper limit and the number of waiting connections does not reach the upper limit, the access request is determined The request is in the waiting state, and the waiting room page data is obtained from the waiting room page module 1003 and returned to the client 3000; when the number of connections to the target URL and the number of waiting connections have not reached the upper limit, it is determined that the access request is in the allowed connection state. , forward the access request to the origin site 4000 pointed by the target URL, so that the origin site 4000 responds to the access request.

其中,在查询失败的情况下,还可以在本地数据库1004中写入用户信息、目标URL以及查询到的目标URL的连接情况,并通过数据中心的订阅、推送功能同步至其它CDN节点1000。Among them, if the query fails, the user information, target URL and the connection status of the queried target URL can also be written in the local database 1004, and synchronized to other CDN nodes 1000 through the subscription and push functions of the data center.

如果查询成功,则说明该访问请求有记录,边缘应用模块1001进一步根据访问请求是否处于连接状态进行判断。具体地:If the query is successful, it means that the access request is recorded, and the edge application module 1001 further makes a judgment based on whether the access request is in a connected state. specifically:

如果处于连接状态,边缘应用模块1001则确定访问请求为允许连接状态,将访问请求转发至目标URL指向的源站4000,供源站4000对访问请求进行响应。如果未处于连接状态,则边缘应用模块1001进一步根据目标URL的连接情况,即目标URL的连接数进行判断。具体地:If it is in the connected state, the edge application module 1001 determines that the access request is in the allowed connection state, and forwards the access request to the origin site 4000 pointed to by the target URL, so that the origin site 4000 responds to the access request. If it is not in the connected state, the edge application module 1001 further makes a judgment based on the connection status of the target URL, that is, the number of connections to the target URL. specifically:

边缘应用模块1001在目标URL的连接数达到上限的情况下,则确定访问请求为等待状态,将访问请求转发至等待室页面模块1003;在目标URL的连接数未达到上限的情况下,则确定访问请求为允许连接状态,将访问请求转发至目标URL指向的源站4000,供源站4000对访问请求进行响应。When the number of connections to the target URL reaches the upper limit, the edge application module 1001 determines that the access request is in a waiting state, and forwards the access request to the waiting room page module 1003; when the number of connections to the target URL does not reach the upper limit, determines The access request is in the allowed connection state, and the access request is forwarded to the origin site 4000 pointed to by the target URL, so that the origin site 4000 responds to the access request.

其中,在访问请求无记录的情况下,边缘应用模块1001在确定访问请求的状态后,还通知边缘数据库服务模块1002以KV的形式,将用户标识、访问请求的状态等信息写入本地数据库1004中。在查询到访问请求为等待状态且确定出访问请求当前为允许连接状态的情况下,边缘应用模块1001通知边缘数据库服务模块1002更新本地数据库1004中访问请求的状态。Wherein, when there is no record of the access request, after determining the status of the access request, the edge application module 1001 also notifies the edge database service module 1002 to write the user ID, the status of the access request and other information into the local database 1004 in the form of KV. middle. When it is queried that the access request is in the waiting state and it is determined that the access request is currently in the allowed connection state, the edge application module 1001 notifies the edge database service module 1002 to update the status of the access request in the local database 1004.

而当本地数据库1004中的数据发生更新时,边缘数据库服务模块1002将会向数据中心2000上报更新的数据,从而数据中心2000将更新的数据下发给其他CDN节点1000的边缘数据库服务模块1002,从而实现其他CDN节点的本地数据库1004的更新。When the data in the local database 1004 is updated, the edge database service module 1002 will report the updated data to the data center 2000, so the data center 2000 will deliver the updated data to the edge database service modules 1002 of other CDN nodes 1000. Thus, the local database 1004 of other CDN nodes is updated.

而客户端3000在接收到等待室页面模块1003返回的等待室页面数据后,会定时再次发起访问请求,边缘应用模块1001就会再次执行上述步骤,直到访问请求被转发至目标URL指向的源站4000。同时边缘应用模块1001在向客户端300-返回等待室页面数据后还会为访问请求上设置超时时间——第一预设时长,一旦在超时时间内未刷新,则认为用户退出等待。After receiving the waiting room page data returned by the waiting room page module 1003, the client 3000 will periodically initiate an access request again, and the edge application module 1001 will perform the above steps again until the access request is forwarded to the origin site pointed to by the target URL. 4000. At the same time, the edge application module 1001 will also set a timeout for the access request after returning the waiting room page data to the client 300 - the first preset duration. Once it is not refreshed within the timeout period, the user is considered to have exited the waiting period.

并且,边缘应用模块1001还会在访问请求从等待状态变为允许连接状态后,为访问请求设置超时时间——第二预设时长,一旦在超时时间内为接收到携带用户信息和目标URL的请求,则会通知边缘数据库服务模块1002在本地数据库1004中删除访问请求相关的信息。In addition, the edge application module 1001 will also set a timeout for the access request after the access request changes from the waiting state to the allowed connection state - the second preset time period. Once the access request carrying user information and target URL is received within the timeout period, request, the edge database service module 1002 will be notified to delete the information related to the access request in the local database 1004.

而在当前的访问请求完成响应后,确定本地数据库1004中记录的等待访问目标URL的请求中记录时间最早所对应的客户端3000为目标客户端,边缘应用模块1001将目标客户端对应的访问请求转发至目标URL指向的源站4000,并通知边缘数据库服务模块1002在本地数据库1004中修改目标客户端对应的访问请求的状态为允许连接状态。并如前所述,将目标客户端对应的访问请求的状态为允许连接状态同步至其他CDN节点的本地数据库1004中。After the current access request completes the response, it is determined that the client 3000 corresponding to the earliest recorded time among the requests waiting to access the target URL recorded in the local database 1004 is the target client, and the edge application module 1001 determines the access request corresponding to the target client. Forward to the origin site 4000 pointed by the target URL, and notify the edge database service module 1002 to modify the status of the access request corresponding to the target client in the local database 1004 to the allowed connection status. And as mentioned above, the status of the access request corresponding to the target client is the allowed connection status and is synchronized to the local database 1004 of other CDN nodes.

当然,以上例子并未涉及上述所有实施例,在不产生矛盾的情况下,上述实施例还可以结合到上述例子中,此处就不再一一赘述了。Of course, the above examples do not involve all the above-mentioned embodiments, and the above-mentioned embodiments can also be combined into the above-mentioned examples if no contradiction occurs, so the details will not be described one by one here.

值得一提的是,本实施例中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本申请的创新部分,本实施例中并没有将与解决本申请所提出的技术问题关系不太密切的单元引入,但这并不表明本实施例中不存在其它的单元。It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, or it can be multiple physical units. The combination of units is realized. In addition, in order to highlight the innovative part of this application, units that are not closely related to solving the technical problems raised in this application are not introduced in this embodiment, but this does not mean that other units do not exist in this embodiment.

本申请实施例另一方面还提供了一种电子设备,如图13所示,包括:至少一个处理器1301;以及,与至少一个处理器1301通信连接的存储器1302;其中,存储器1302存储有可被至少一个处理器1301执行的指令,指令被至少一个处理器1301执行,以使至少一个处理器1301能够执行上述任一方法实施例所描述的访问方法。On the other hand, the embodiment of the present application also provides an electronic device, as shown in Figure 13, including: at least one processor 1301; and a memory 1302 communicatively connected to the at least one processor 1301; wherein the memory 1302 stores data that can Instructions executed by at least one processor 1301, instructions are executed by at least one processor 1301, so that at least one processor 1301 can execute the access method described in any of the above method embodiments.

其中,存储器1302和处理器1301采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器1301和存储器1302的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器1301处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传输给处理器1301。The memory 1302 and the processor 1301 are connected using a bus. The bus may include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors 1301 and the memory 1302 together. The bus may also connect various other circuits together such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be one element or may be multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. The data processed by the processor 1301 is transmitted on the wireless medium through the antenna. Further, the antenna also receives the data and transmits the data to the processor 1301.

处理器1301负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器1302可以被用于存储处理器1301在执行操作时所使用的数据。Processor 1301 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 1302 may be used to store data used by the processor 1301 when performing operations.

本申请实施方式另一方面还提供了一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。Another aspect of the embodiment of the present application also provides a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.

即,本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in implementing the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to make a device (can It is a microcontroller, chip, etc.) or processor that executes all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code.

本领域的普通技术人员可以理解,上述各实施例是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and spirit of the present application. scope.

Claims (19)

1.一种访问方法,其特征在于,应用于CDN节点,所述方法包括:1. An access method, characterized in that it is applied to CDN nodes, and the method includes: 接收客户端发送的访问请求,所述访问请求携带用户信息和目标URL;Receive an access request sent by the client, where the access request carries user information and target URL; 在根据所述用户信息和所述目标URL确定所述访问请求为等待状态的情况下,向所述客户端发送本地缓存的等待室页面数据,供所述客户端根据所述等待室页面数据呈现等待室页面;When it is determined that the access request is in a waiting state based on the user information and the target URL, locally cached waiting room page data is sent to the client for presentation by the client based on the waiting room page data. Waiting room page; 在根据所述用户信息和所述目标URL确定所述访问请求为允许连接状态的情况下,将所述访问请求转发至所述目标URL指向的源站,供所述源站对所述访问请求进行响应。When it is determined that the access request is in the allowed connection state based on the user information and the target URL, the access request is forwarded to the origin site pointed to by the target URL for the origin site to respond to the access request. to respond. 2.根据权利要求1所述的访问方法,其特征在于,所述CDN节点部署有本地数据库,所述CDN节点的本地数据库与其它CDN节点的本地数据库保持数据同步;2. The access method according to claim 1, characterized in that the CDN node is deployed with a local database, and the local database of the CDN node maintains data synchronization with the local databases of other CDN nodes; 所述接收客户端发送的访问请求之后,所述方法还包括:After receiving the access request sent by the client, the method further includes: 根据所述用户信息和所述目标URL,在本地数据库中进行查询,以确定所述访问请求是否为等待状态。According to the user information and the target URL, a query is performed in a local database to determine whether the access request is in a waiting state. 3.根据权利要求2所述的访问方法,其特征在于,所述CDN节点的本地数据库与其它CDN节点的本地数据库连接于同一数据中心;3. The access method according to claim 2, characterized in that the local database of the CDN node and the local databases of other CDN nodes are connected to the same data center; 所述方法还包括:The method also includes: 在本地数据库发生数据更新的情况下,向所述数据中心发送所述更新的数据,供所述数据中心将接收到的所述更新的数据推送至订阅所述更新的数据的所述其他CDN节点的本地数据库。When data update occurs in the local database, the updated data is sent to the data center, so that the data center can push the received updated data to the other CDN nodes that subscribe to the updated data. local database. 4.根据权利要求3所述的访问方法,其特征在于,所述方法还包括:4. The access method according to claim 3, characterized in that the method further includes: 在所述目标URL的连接情况发生变化的情况下,通过本地数据库接收所述数据中心推送的同步数据并同步至本地数据库,所述同步数据为所述数据中心根据所述目标URL的连接情况的变化得到的数据。When the connection status of the target URL changes, the synchronization data pushed by the data center is received through the local database and synchronized to the local database. The synchronization data is the data generated by the data center according to the connection status of the target URL. Change the data obtained. 5.根据权利要求2所述的访问方法,其特征在于,所述CDN节点的本地数据库中的数据以键值的形式存储,所述根据所述用户信息和所述目标URL,在本地数据库中进行查询,包括:5. The access method according to claim 2, characterized in that the data in the local database of the CDN node is stored in the form of key values, and according to the user information and the target URL, in the local database Make inquiries including: 根据所述用户信息,生成用户标识,所述用户标识用于唯一标识所述用户信息;Generate a user identification according to the user information, and the user identification is used to uniquely identify the user information; 根据所述用户标识和所述目标URL,在本地数据库中进行查询;Query in the local database according to the user ID and the target URL; 所述方法还包括:The method also includes: 在根据所述用户标识查询失败的情况下,在本地数据库中查询所述目标URL的连接情况并将所述用户标识、所述目标URL和所述目标URL的连接情况以键值的形式更新到本地数据库中。If the query based on the user ID fails, query the connection status of the target URL in the local database and update the user ID, the target URL, and the connection status of the target URL in the form of key values to in the local database. 6.根据权利要求2所述的访问方法,其特征在于,所述根据所述用户信息和所述目标URL,在本地数据库中进行查询,包括:6. The access method according to claim 2, characterized in that querying in a local database according to the user information and the target URL includes: 根据所述用户信息和所述目标URL,在本地数据库中查询所述用户信息对应的所述客户端是否处于与所述目标URL建立连接的状态;According to the user information and the target URL, query in a local database whether the client corresponding to the user information is in a state of establishing a connection with the target URL; 在所述用户信息对应的所述客户端未处于与所述目标URL建立连接的状态的情况下,根据所述目标URL,在本地数据库中查询所述目标URL的连接情况;When the client corresponding to the user information is not in a state of establishing a connection with the target URL, query the connection status of the target URL in the local database according to the target URL; 所述根据所述用户信息和所述目标URL,在本地数据库中进行查询之后,所述方法还包括:After querying the local database according to the user information and the target URL, the method further includes: 根据所述目标URL的连接情况,确定所述访问请求是否为等待状态。According to the connection status of the target URL, it is determined whether the access request is in a waiting state. 7.根据权利要求6所述的访问方法,其特征在于,所述根据所述目标URL的连接情况,确定所述访问请求是否为等待状态,包括:7. The access method according to claim 6, wherein determining whether the access request is in a waiting state according to the connection status of the target URL includes: 在所述目标URL的连接未满的情况下,确定所述访问请求为允许连接状态;When the connection to the target URL is not full, determine that the access request is in the allowed connection state; 在所述目标URL的连接已满的情况下,确定所述访问请求为等待状态。When the connection to the target URL is full, it is determined that the access request is in a waiting state. 8.根据权利要求1至7中任一项所述的访问方法,其特征在于,在根据所述用户信息和所述目标URL确定所述访问请求为等待状态的情况下,所述方法还包括:8. The access method according to any one of claims 1 to 7, characterized in that, when it is determined that the access request is in a waiting state according to the user information and the target URL, the method further includes : 根据定制参考信息,确定定制页面数据,所述定制参考信息包括以下信息中的至少一项:所述用户信息和所述访问请求的连接情况;Determine customized page data based on customized reference information, which includes at least one of the following information: the connection status of the user information and the access request; 所述向所述客户端发送本地缓存的等待室页面数据的同时,所述方法还包括:While sending the locally cached waiting room page data to the client, the method also includes: 向所述客户端发送所述定制页面数据。Send the customized page data to the client. 9.根据权利要求1至7中任一项所述的访问方法,其特征在于,所述将所述访问请求转发至所述目标URL指向的源站之后,所述方法还包括:9. The access method according to any one of claims 1 to 7, characterized in that after forwarding the access request to the origin site pointed by the target URL, the method further includes: 在结束基于所述访问请求对所述目标URL的访问后,触发确定目标客户端的步骤;在当前基于对所述目标URL的访问而正在呈现所述等待室页面的其它客户端中,所述目标客户端请求访问的时间最早;After the access to the target URL based on the access request is completed, the step of determining the target client is triggered; among other clients currently presenting the waiting room page based on the access to the target URL, the target The earliest time the client requests access; 将所述目标客户端的请求转发至所述目标URL指向的所述源站。Forward the request of the target client to the origin site pointed by the target URL. 10.根据权利要求9所述的访问方法,其特征在于,所述触发确定目标客户端的步骤之后,所述方法还包括:10. The access method according to claim 9, characterized in that after triggering the step of determining the target client, the method further includes: 将所述目标客户端对应的等待状态更新为允许连接状态。Update the waiting status corresponding to the target client to the allowed connection status. 11.根据权利要求1至7中任一项所述的访问方法,其特征在于,所述等候室页面数据携带用于定时触发请求访问所述目标URL的数据,所述向所述客户端发送本地缓存的等待室页面数据之后,所述方法还包括:11. The access method according to any one of claims 1 to 7, characterized in that the waiting room page data carries data used to regularly trigger a request to access the target URL, and the data sent to the client After locally caching the waiting room page data, the method further includes: 接收所述客户端基于所述等待室页面数据定时发起的访问,以再次确定所述访问请求的状态并根据所述访问请求的状态执行相应的步骤,直到所述访问请求被转发至所述源站。Receive the access initiated by the client based on the waiting room page data regularly to determine the status of the access request again and perform corresponding steps according to the status of the access request until the access request is forwarded to the source stand. 12.根据权利要求11所述的访问方法,其特征在于,所述向所述客户端发送本地缓存的等待室页面数据之后,所述方法还包括:12. The access method according to claim 11, wherein after sending the locally cached waiting room page data to the client, the method further includes: 对所述客户端是否基于所述等待室页面数据定时发起访问进行监测;Monitor whether the client regularly initiates access based on the waiting room page data; 在第一预设时长内未监测到所述客户端基于所述等待室页面数据定时发起的访问的情况下,对所述访问请求对应的记录进行更新,以删除所述访问请求对应的记录。If the access initiated regularly by the client based on the waiting room page data is not detected within the first preset time period, the record corresponding to the access request is updated to delete the record corresponding to the access request. 13.根据权利要求1至7中任一项所述的访问方法,其特征在于,所述将所述访问请求转发至所述目标URL指向的源站之后,所述方法还包括:13. The access method according to any one of claims 1 to 7, characterized in that after forwarding the access request to the origin site pointed by the target URL, the method further includes: 在第二预设时长内未监测到所述客户端基于所述用户信息和所述目标URL发起访问的情况下,对所述访问请求对应的记录进行更新,以删除所述访问请求对应的记录。If it is not detected that the client initiates access based on the user information and the target URL within the second preset time period, update the record corresponding to the access request to delete the record corresponding to the access request. . 14.一种CDN节点,其特征在于,包括:边缘应用模块和等待室页面模块;所述边缘应用模块与所述等待室页面模块连接;14. A CDN node, characterized in that it includes: an edge application module and a waiting room page module; the edge application module is connected to the waiting room page module; 所述边缘应用模块用于实现如权利要求1至13中任一项所述的访问方法;The edge application module is used to implement the access method as described in any one of claims 1 to 13; 所述等待室页面模块用于维护所述CDN节点的本地缓存的等待室页面数据,以向所述边缘应用模块提供本地缓存的所述等待室页面数据。The waiting room page module is configured to maintain the locally cached waiting room page data of the CDN node, so as to provide the locally cached waiting room page data to the edge application module. 15.根据权利要求14所述的CDN节点,其特征在于,还包括边缘数据库服务模块;15. The CDN node according to claim 14, further comprising an edge database service module; 所述边缘数据库服务模块内部署有本地数据库,所述边缘数据库服务模块内部部署的本地数据库与其它CDN节点的所述边缘数据库服务模块内部部署的本地数据库之间数据同步;A local database is deployed in the edge database service module, and data is synchronized between the local database deployed within the edge database service module and the local database deployed within the edge database service module of other CDN nodes; 所述边缘数据库服务模块,与所述边缘应用模块连接,用于维护内部部署的本地数据库,以向所述边缘应用模块提供数据库服务。The edge database service module is connected to the edge application module and is used to maintain an internally deployed local database to provide database services to the edge application module. 16.根据权利要求15所述的CDN节点,其特征在于,所述CDN节点的所述边缘数据库服务模块与其它CDN节点的所述边缘数据库服务模块通过内部部署的本地数据库连接于同一数据中心。16. The CDN node according to claim 15, wherein the edge database service module of the CDN node and the edge database service modules of other CDN nodes are connected to the same data center through an internally deployed local database. 17.一种访问系统,其特征在于,包括:若干如权利要求14至16中任一项所述的CDN节点。17. An access system, characterized by comprising: a plurality of CDN nodes according to any one of claims 14 to 16. 18.一种电子设备,其特征在于,包括:18. An electronic device, characterized in that it includes: 至少一个处理器;以及,at least one processor; and, 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至13中任一项所述的访问方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor, so that the at least one processor can perform as claimed in any one of claims 1 to 13 access method described above. 19.一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至13中任一项所述的访问方法。19. A computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the access method according to any one of claims 1 to 13 is implemented.
CN202310921514.XA 2023-07-25 2023-07-25 Access method and system, CDN node, electronic equipment and storage medium Pending CN117097801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310921514.XA CN117097801A (en) 2023-07-25 2023-07-25 Access method and system, CDN node, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310921514.XA CN117097801A (en) 2023-07-25 2023-07-25 Access method and system, CDN node, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117097801A true CN117097801A (en) 2023-11-21

Family

ID=88770762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310921514.XA Pending CN117097801A (en) 2023-07-25 2023-07-25 Access method and system, CDN node, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117097801A (en)

Similar Documents

Publication Publication Date Title
EP2369494A1 (en) Web application based database system and data management method therof
WO2021254330A1 (en) Memory management method and system, client, server and storage medium
US12314262B2 (en) Configuration-aware micro-database caches
CN114827145B (en) Server cluster system, metadata access method and device
WO2007115477A1 (en) Data synchronization method und system
EP4213038A1 (en) Data processing method and apparatus based on distributed storage, device, and medium
WO2020019743A1 (en) Traffic control method and device
US20090158298A1 (en) Database system and eventing infrastructure
CN107451853A (en) Method, apparatus, system and the storage medium that a kind of red packet distributes in real time
JP2022550401A (en) Data upload method, system, device and electronic device
CN111787058A (en) A lightweight information subscription and push method in cross-domain virtual data space
CN112764948B (en) Data transmission method, data transmission device, computer device, and storage medium
CN113010549A (en) Data processing method based on remote multi-active system, related equipment and storage medium
CN114238518A (en) Data processing method, device, equipment and storage medium
US20130185329A1 (en) Distributed database
CN103064898A (en) Business locking and unlocking method and device
CN109951540A (en) A data transmission method, device and electronic device
WO2010031297A1 (en) Method of wireless application protocol (wap) gateway pull service and system thereof
CN117097801A (en) Access method and system, CDN node, electronic equipment and storage medium
CN118503264A (en) Data query method, apparatus, computer device, readable storage medium, and program product
CN112052104A (en) Message queue management method based on multi-computer-room realization and electronic equipment
CN116074250B (en) Stream table processing method, system, device and storage medium
CN117407159A (en) Memory space management method and device, equipment and storage medium
EP4394573A1 (en) Data processing method and related device
KR101696911B1 (en) Distributed Database Apparatus and Method for Processing Stream Data Thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination