CN114006915B - Resource request method, device, equipment and computer readable storage medium - Google Patents

Resource request method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN114006915B
CN114006915B CN202210000555.0A CN202210000555A CN114006915B CN 114006915 B CN114006915 B CN 114006915B CN 202210000555 A CN202210000555 A CN 202210000555A CN 114006915 B CN114006915 B CN 114006915B
Authority
CN
China
Prior art keywords
node
target
resource request
resource
target node
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.)
Active
Application number
CN202210000555.0A
Other languages
Chinese (zh)
Other versions
CN114006915A (en
Inventor
蒲文宾
年彦东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202210000555.0A priority Critical patent/CN114006915B/en
Publication of CN114006915A publication Critical patent/CN114006915A/en
Application granted granted Critical
Publication of CN114006915B publication Critical patent/CN114006915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The disclosure relates to a resource request method, device, equipment and computer readable storage medium. The resource request method comprises the following steps: receiving a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node; if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule; forwarding the resource request to the target node; and acquiring the target resource corresponding to the resource request through the target node. The utilization rate of the physical middle-layer nodes is improved.

Description

Resource request method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of information technology, and in particular, to a resource request method, apparatus, device, computer-readable storage medium, and system.
Background
A Content Delivery Network (CDN) is an intelligent virtual Network built on top of an existing Network, which includes edge servers deployed in various locations. In addition, the network enables a user to acquire needed resources nearby through functional modules such as load balancing, content distribution and scheduling, network congestion is reduced, and response speed and hit rate of resource requests are improved.
In order to increase the cache hit rate of the resource request and reduce the back-sourcing rate, a three-layer CDN architecture as shown in fig. 1 is usually adopted for back-sourcing. Wherein, only the edge node 110 can directly access the resource request sent from the client, and the middle node 120 cannot directly access the resource request sent from the client, resulting in a lower utilization rate of the middle node 120.
Disclosure of Invention
In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a resource request method, device, apparatus, computer readable storage medium, and system, so as to improve the utilization rate of a physical middle layer node in a CDN and reduce the cost of the CDN.
In a first aspect, an embodiment of the present disclosure provides a resource request method, including:
receiving a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node;
if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule;
forwarding the resource request to the second target node;
and acquiring the target resource corresponding to the resource request through the second target node.
Optionally, the first target node and the second target node are the same node.
Optionally, the second target node is a physical middle-layer node in a content distribution network; a middle tier service logic is deployed in the second target node.
Optionally, an edge service logic is also deployed in the second target node.
Optionally, the second target node is a virtual middle layer node obtained by multiplexing a physical edge node in a content distribution network, and an edge service logic and a middle layer service logic are deployed in the virtual middle layer node.
Optionally, the obtaining, by the second target node, a target resource corresponding to the resource request includes:
if the target resource corresponding to the resource request is not cached in the second target node, determining an upper node in a content distribution network based on a second preset rule;
forwarding the resource request to the upper node;
and acquiring the target resource corresponding to the resource request through the upper node.
Optionally, the obtaining, by the upper node, a target resource corresponding to the resource request includes:
if the target resource corresponding to the resource request is cached in the upper node, the target resource is sent to the client;
and if the target resource corresponding to the resource request is not cached in the upper node, acquiring the target resource from a source station corresponding to the resource request through the upper node.
Optionally, the method further includes:
when an instruction for refreshing the cache record is received, refreshing the cache record of the upper node;
refreshing the cache record of the first identifier stored in the first target node and the cache record of the second identifier stored in the second target node;
refreshing the cache record of the second identifier stored in the first target node and the cache record of the first identifier stored in the second target node;
two records are respectively cached in the first target node and the second target node aiming at the same target resource, and the identifications of the two records are the first identification and the second identification respectively.
Optionally, before receiving, by the first target node in the content distribution network, the resource request sent by the client, the method further includes:
analyzing the resource request through a preset node associated with a client to determine whether a domain name corresponding to the resource request meets a preset condition;
and if the domain name meets the preset condition, determining the first target node through the preset node based on a third preset rule so that the client sends the resource request to the first target node.
Optionally, the determining a second target node based on the first preset rule includes:
determining a target scheduling policy corresponding to the resource request from one or more pre-stored scheduling policies through the first target node, where the target scheduling policy includes a uniform resource locator, and the uniform resource locator points to the second target node.
In a second aspect, an embodiment of the present disclosure provides a resource request apparatus, including:
a receiving module, configured to receive, by a first target node in a content distribution network, a resource request sent by a client, where the first target node includes a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node;
a determining module, configured to determine, if a target resource corresponding to the resource request is not cached in the first target node, a second target node based on a first preset rule;
a forwarding module, configured to forward the resource request to the second target node;
and the acquisition module is used for acquiring the target resource corresponding to the resource request through the second target node.
In a third aspect, an embodiment of the present disclosure provides a resource request device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method of the first aspect.
According to the resource request method provided by the embodiment of the disclosure, the physical middle layer node in the CDN is sunk into the virtual edge node, that is, the edge service logic is additionally deployed in the physical middle layer node, so that the physical middle layer node has the capability of accessing the resource request, the utilization rate of the physical middle layer node is improved, and the cost of the CDN is reduced. Specifically, a resource request sent by a client is received through a first target node, where the first target node includes a virtual edge node obtained by sinking a physical middle-layer node in a content distribution network to an edge, an edge service logic and a middle-layer service logic are deployed in the virtual edge node, and if a target resource corresponding to the resource request is not cached in the first target node, a second target node is determined based on a first preset rule; forwarding the resource request to the second target node; and acquiring the target resource corresponding to the resource request through the second target node.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a three-tier CDN architecture before improvement provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of a resource request method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an application scenario provided by the embodiment of the present disclosure;
fig. 4 is a flowchart of a resource request method provided by an embodiment of the present disclosure;
fig. 5 is a schematic diagram of an improved three-tier CDN architecture according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a resource request method provided by an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a resource request apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a resource request device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Typically, in a CDN network, a three-tier CDN architecture is employed as shown in fig. 1. Wherein, only the edge node 110 can directly access the resource request sent from the client, and the middle node 120 cannot directly access the resource request sent from the client, resulting in a lower utilization rate of the middle node 120. The specific processing flow is as follows: a resource request sent by a client reaches the edge node 111, and if a target resource corresponding to the resource request is cached in the edge node 111, the edge node 111 directly feeds the target resource back to the client; if the target resource corresponding to the resource request is not cached in the edge node 111, the edge node 111 forwards the resource request to the middle node 120, and if the target resource corresponding to the resource request is cached in the middle node 120, the middle node 120 sends the target resource to the edge node 111, and the edge node 111 feeds the target resource back to the client. If the target resource corresponding to the resource request is not cached in the middle layer node 120, the middle layer node 120 forwards the resource request to the upper layer node 130, if the target resource corresponding to the resource request is not cached in the upper layer node 130, the upper layer node 130 acquires the target resource corresponding to the resource request from the source station 140 and sends the target resource to the middle layer node 120, the middle layer node 120 sends the target resource to the edge node 111, and the edge node 111 finally feeds the target resource back to the client.
As can be seen from the above processing flow, the middle node 120 does not have a function of directly serving the client, cannot directly access to the resource request sent by the client, and cannot directly feed back the target resource to the client, so that there is a problem that the utilization rate of the middle node 120 is low.
It should be noted that the middle layer node in the existing CDN (e.g., the middle layer node 120 in fig. 1) is labeled as the physical middle layer node in the embodiment of the present disclosure, and the edge node in the existing CDN (e.g., the edge node 110 or the edge node 111 in fig. 1) is labeled as the physical edge node in the embodiment of the present disclosure. Only middle-layer service logic is deployed in a physical middle-layer node in the existing CDN to provide middle-layer service; in an existing CDN, only an edge service logic is deployed in a physical edge node, and is used for serving a netizen, specifically, for obtaining a resource request from a client. Obviously, the physical middle-layer node does not have the capability of directly serving the netizen, that is, the physical middle-layer node cannot directly obtain the resource request from the client. Accordingly, the physical edge node does not have the capability to provide mid-tier services, such as being unable to return to a source.
In view of the foregoing problems, embodiments of the present disclosure provide a resource request method, which is described below with reference to specific embodiments.
Fig. 2 is a flowchart of a resource request method according to an embodiment of the disclosure. The method comprises the following specific steps:
s201, receiving a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node.
As shown in fig. 3, the client may be an application or a module in the terminal device 21, or the client may be the terminal device 21 itself. In particular, the client may send a resource request to the first target node 22, the resource request requesting a target resource.
The first target node includes a virtual edge node obtained by sinking a physical middle layer node in the CDN to an edge, that is, the first target node may specifically be a virtual edge node, and the virtual edge node is obtained by additionally deploying an edge service logic in the physical middle layer node. In other words, the virtual edge node is additionally deployed with the edge service logic in addition to the middle layer service logic, so that the virtual edge node has the capability of directly serving the netizen, that is, has the capability of accessing the resource request sent by the client. The virtual edge node has two service capabilities, one is the capability of the service middle layer, and the other is the capability of the service edge, namely the capability of accessing a resource request sent by a client, so that the purpose of improving the utilization rate of the physical middle layer node can be achieved.
Optionally, the first target node may also be a physical edge node in the CDN.
In summary, the scheme of the present disclosure sinks a physical middle layer node in the CDN to a virtual edge node, and additionally deploys an edge service logic on the basis of maintaining the middle layer service logic, so that the physical middle layer node has two roles, one is serving as an edge node, and the other is serving as a middle layer node, thereby improving the utilization rate of the physical middle layer node.
S202, if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule.
The first preset rule may be a physical topological relationship between the first target node and other nodes, that is, according to the physical topological relationship, the resource request is forwarded from the first target node to a node communicatively connected to the first target node, that is, a second target node.
The first preset rule may also be one or more scheduling policies pre-stored in the first target node. Specifically, the determining the second target node based on the first preset rule includes:
determining a target scheduling policy corresponding to the resource request from one or more pre-stored scheduling policies through the first target node, where the target scheduling policy includes a uniform resource locator, and the uniform resource locator points to the second target node. The scheduling policy is pre-stored in the first target node, which is beneficial to improving the response speed of the resource request, and if the scheduling policy is not pre-stored in the first target node, the first target node needs to request the scheduling policy from the scheduling server in which the scheduling policy is stored, and then can schedule the resource request, obviously, a certain delay exists, which is not beneficial to improving the response speed of the resource request.
Specifically, the second target node is a physical middle-layer node in the CDN; a middle tier service logic is deployed in the second target node. Further, an edge service logic may be deployed in the second target node, so that the physical middle layer node corresponding to the second target node also has two roles, one is serving as an edge node, and the other is serving as a middle layer node, thereby improving the utilization rate of the physical middle layer node.
It can be understood that, if a target resource corresponding to the resource request has been cached in the first target node, the target resource is directly fed back to the client through the first target node.
S203, forwarding the resource request to the second target node.
And S204, acquiring the target resource corresponding to the resource request through the second target node.
In the resource request method provided by this embodiment, the physical middle layer node in the CDN is sunk as the virtual edge node, that is, the edge service logic is additionally deployed in the physical middle layer node, so that the physical middle layer node has the capability of accessing the resource request, and the utilization rate of the physical middle layer node is improved.
Further, in order to ensure that the middle layer service logic can be executed as expected and improve the utilization rate of the physical edge node, so that the physical edge node has the capability of returning to the source, the middle layer service logic needs to be added on the basis of deploying the edge service logic by the physical edge node, so that the physical edge node becomes a virtual middle layer node, namely the physical edge node also has two roles, one is used as the edge node, the other is used as the middle layer node, and the utilization rate of the physical edge node is improved while the utilization rate of the physical middle layer node is improved.
Illustratively, the second target node is a virtual middle layer node obtained by multiplexing a physical edge node in the CDN, and the virtual middle layer node is deployed with an edge service logic and a middle layer service logic. On this basis, the first target node and the second target node may be the same node. Specifically, the resource request may be accessed through a first port of a first target node, and when the target resource is not cached in the first target node, the resource request is forwarded to a second target node through a second port of the first target node. In summary, the port used by the transmission resource request can distinguish that the resource request comes from the edge node (including the physical edge node and the virtual edge node) and needs to be transferred to the middle layer node (including the physical middle layer node and the virtual middle layer node)
If the first target node and the second target node are the same node, which is equivalent to that the same resource request accesses the same node twice through different ports, when the first target node does not cache the target resource, the resource request accessed through the first port is a resource request which needs to be forwarded to other middle-layer nodes, and the resource request accessed through the second port is a resource request which needs to be forwarded to an upper-layer node (corresponding to a three-layer CDN, as shown in fig. 1, the middle-layer node forwards the resource request to the upper-layer node, and the upper-layer node obtains the target resource from the source station).
On the basis of the foregoing embodiment, taking a three-tier CDN as an example, an optional implementation is given to the step "S204, obtaining, by the second target node, a target resource corresponding to the resource request". A flow chart of a resource request method is shown in fig. 4. The method comprises the following specific steps:
s401, receiving a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node.
S402, if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule.
S403, forwarding the resource request to the second target node.
S404, if the target resource corresponding to the resource request is not cached in the second target node, determining an upper node in the content distribution network based on a second preset rule.
The second preset rule is similar to the first preset rule, and the second preset rule may be a physical topological relation between the second target node and an upper node, that is, the resource request is sent from the second target node to the upper node in communication connection with the second target node according to the physical topological relation.
The second preset rule may also be one or more scheduling policies pre-stored in a second target node, and specifically, the determining an upper node in the content distribution network based on the second preset rule includes: and the second target node determines a target scheduling policy corresponding to the resource request from one or more pre-stored scheduling policies, wherein the target scheduling policy comprises a uniform resource locator, and the uniform resource locator points to the upper node. The scheduling policy is pre-stored in the second target node, which is beneficial to improving the response speed of the resource request, and if the scheduling policy is not pre-stored in the second target node, the second target node needs to request the scheduling policy from the scheduling server in which the scheduling policy is stored, and then can schedule the resource request, obviously, a certain delay exists, which is not beneficial to improving the response speed of the resource request.
S405, forwarding the resource request to the upper node, and acquiring a target resource corresponding to the resource request through the upper node.
Specifically, for the three-layer CDN shown in fig. 1, the physical middle layer node 120 does not have a function of directly providing a service for the client, that is, the physical middle layer node 120 cannot directly access a resource request sent by the client, and cannot directly feed back a target resource to the client, which results in a low utilization rate of the physical middle layer node 120. To solve this problem, in the solution of this embodiment, the physical middle layer node 120 is sunk as a virtual edge node, and in addition to maintaining the original middle layer service logic of the physical middle layer node 120, an edge service logic is additionally deployed in the physical middle layer node 120, so that the physical middle layer node 120 can have both the service function of the edge node and the service function of the middle layer node, thereby improving the utilization rate of the physical middle layer node.
Fig. 5 shows a CDN schematic diagram after improvement of the three-tier CDN shown in fig. 1 according to the technical solution of this embodiment, where the CDN schematic diagram includes a physical edge node 510, a physical middle tier node 520, an upper tier node 530, and a source station 540, where the physical middle tier node 520 may serve as a virtual edge node to receive a resource request from a client, so as to improve utilization of the physical middle tier node.
In some embodiments, the obtaining, by the upper node, a target resource corresponding to the resource request includes: if the target resource corresponding to the resource request is cached in the upper node, the target resource is sent to the client; and if the target resource corresponding to the resource request is not cached in the upper node, acquiring the target resource from a source station corresponding to the resource request through the upper node.
In this embodiment, taking a three-layer CDN as an example, an optional implementation is given to the step "S204, obtaining, by the second target node, a target resource corresponding to the resource request", specifically, if the target resource corresponding to the resource request is not cached in the second target node, determining an upper node in a content delivery network based on a second preset rule; forwarding the resource request to the upper node; and acquiring the target resource corresponding to the resource request through the upper node.
On the basis of the technical solutions of the above embodiments, in order to improve a refresh effect (a cache of a CDN node in the CDN is refreshed according to a preset period to ensure that resources fed back to a user are correct and newer), and avoid a problem that the refresh cannot be performed, two records are respectively cached in the first target node and the second target node for the same target resource, where the identifiers of the two records are the first identifier and the second identifier, respectively. This is because each node has two roles, there being one matching cache record for each role. For example, when the physical middle layer node acts as a middle layer node for requesting a target resource from an upper layer node, the physical middle layer node CACHEs the target resource returned by the upper layer node, and marks an identifier of a CACHE record corresponding to the target resource as CACHE-KEY (i.e., a first identifier). When the physical middle layer node acts as an edge node for accessing a resource request sent by the client, the physical middle layer node also CACHEs a target resource, and marks an identifier of a CACHE record corresponding to the target resource as CACHE-KEY & virtual (i.e. a second identifier, which may be understood as an identifier of a CACHE record corresponding to the virtual edge node).
Similarly, the physical edge node also has two roles, one is the role of the edge node, and the other is the role of the middle layer node, so that two same target resources are cached in the physical edge node, one corresponds to the role of the edge node, the other corresponds to the role of the middle layer node, the identifier of the cache record corresponding to the role of the edge node is marked as a first identifier, and the identifier of the cache record corresponding to the role of the middle layer node is marked as a second identifier (which can be understood as the identifier of the cache record corresponding to the virtual middle layer node). When an instruction for refreshing cache records is received, the cache records of the upper node are refreshed; and refreshing the cache record of the first identifier stored in the first target node and the cache record of the second identifier stored in the second target node, namely refreshing the cache records serving as middle-layer nodes. And finally, refreshing the cache record which serves as the role of the edge node, specifically, refreshing the cache record of the second identifier stored in the first target node and the cache record of the first identifier stored in the second target node.
Optionally, for the second-tier CDN, the obtaining, by the second target node, the target resource corresponding to the resource request includes: if the target resource corresponding to the resource request is cached in the second target node, sending the target resource to the client; if the target resource corresponding to the resource request is not cached in the second target node, the target resource is acquired from the source station corresponding to the resource request through the second target node, that is, the second target node may directly acquire the target resource from the source station.
On the basis of the above embodiment, the present embodiment continuously optimizes the scheme, specifically, it is supported whether the scheme in the above embodiment is used by the resource request according to the domain name granularity configuration, that is, whether the middle layer node sinking to the edge serving as the edge node is used as the virtual edge node, and whether the edge node serving as the middle layer node is used as the virtual middle layer node. The above functions are collectively referred to as virtual functions (i.e., virtual middle level nodes and virtual edge nodes), and a resource request method flowchart is shown in fig. 6. The method comprises the following specific steps:
s601, analyzing the resource request sent by the client through a preset node associated with the client to determine whether the domain name corresponding to the resource request meets the preset condition.
It is understood that the CDN network serves users, which are not internet users (i.e., netizens), who refer to developers of websites, i.e., users who provide network resources to netizens. Therefore, different users have different service requirements, the service that the middle layer node sinks as the edge node can be individually started or closed for the users according to the specific requirements of the users, and the edge node serves as the service of the virtual middle layer node.
Specifically, a resource request sent by a client is analyzed through a preset node associated with the client to determine whether a domain name corresponding to the resource request is a domain name for starting a virtual function, and if so, the CDN is used to serve the resource request as shown in fig. 5. If the domain name for which the resource request is directed does not belong to the domain name for opening the virtual function, the CDN shown in fig. 1 is used to service the resource request.
And S602, if the domain name meets the preset condition, receiving the operation of a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node.
S603, if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule.
S604, forwarding the resource request to the second target node.
S605, obtaining the target resource corresponding to the resource request through the second target node.
The technical solution of this embodiment supports a user to configure whether to open a virtual function according to domain name granularity, and if the domain name of the resource request belongs to the domain name for opening the virtual function, the CDN shown in fig. 5 is used to serve the resource request. If the domain name for which the resource request is directed does not belong to the domain name for opening the virtual function, the CDN shown in fig. 1 is used to service the resource request.
Fig. 7 is a schematic structural diagram of a resource request device according to an embodiment of the present disclosure. The resource request device provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the resource request method, as shown in fig. 7, the resource request device 700 includes: a receiving module 710, a determining module 720, a forwarding module 730, and an obtaining module 740.
The receiving module 710 is configured to receive a resource request sent by a client through a first target node in a content distribution network, where the first target node includes a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node; a determining module 720, configured to determine, if a target resource corresponding to the resource request is not cached in the first target node, a second target node based on a first preset rule; a forwarding module 730, configured to forward the resource request to the second target node; an obtaining module 740, configured to obtain, by the second target node, a target resource corresponding to the resource request.
Optionally, the second target node is a virtual middle layer node obtained by multiplexing a physical edge node in a content distribution network, and an edge service logic and a middle layer service logic are deployed in the virtual middle layer node.
Optionally, the first target node and the second target node are the same node.
Optionally, the second target node is a physical middle-layer node in a content distribution network; a middle tier service logic is deployed in the second target node. Optionally, an edge service logic is also deployed in the second target node.
Optionally, the obtaining module 740 includes: a determining unit, configured to determine, based on a second preset rule, an upper node in a content delivery network if a target resource corresponding to the resource request is not cached in the second target node; a forwarding unit, configured to forward the resource request to the upper node; a first obtaining unit, configured to obtain, by the upper node, a target resource corresponding to the resource request.
Optionally, the first obtaining unit includes: a sending subunit, configured to send a target resource corresponding to the resource request to the client if the target resource is cached in the upper node; an obtaining subunit, configured to obtain, by the upper node, the target resource from the source station corresponding to the resource request if the target resource corresponding to the resource request is not cached in the upper node.
Optionally, two records are cached in the first target node and the second target node for the same target resource, and the identifiers of the two records are the first identifier and the second identifier, respectively. The device further comprises: the refreshing module is used for refreshing the cache record of the upper node when receiving a command of refreshing the cache record; refreshing the cache record of the first identifier stored in the first target node and the cache record of the second identifier stored in the second target node; and refreshing the cache records of the second identifier stored in the first target node and the first identifier stored in the second target node.
Optionally, the resource request apparatus 700 further includes: the judging module is used for analyzing the resource request through a preset node associated with the client before the resource request sent by the client is received through a first target node in the content distribution network so as to determine whether a domain name corresponding to the resource request meets a preset condition or not; and if the domain name meets the preset condition, executing the operation of receiving the resource request sent by the client through the first target node in the content distribution network.
Optionally, the determining module 720 is specifically configured to: determining a target scheduling policy corresponding to the resource request from one or more pre-stored scheduling policies through the first target node, where the target scheduling policy includes a uniform resource locator, and the uniform resource locator points to the second target node.
In the resource request device provided in this embodiment, the physical middle layer node in the CDN is sunk as the virtual edge node, that is, the edge service logic is additionally deployed in the physical middle layer node, so that the physical middle layer node has the capability of accessing the resource request, and the utilization rate of the physical middle layer node is improved.
The resource request device in the embodiment shown in fig. 7 may be configured to execute the technical solution of the above method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of a resource request device according to an embodiment of the present disclosure. The resource request device provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the resource request method, as shown in fig. 8, the resource request device 150 includes: memory 151, processor 152, computer programs, and communications interface 153; wherein the computer program is stored in the memory 151 and is configured to be executed by the processor 152 for the resource request method as described above.
In addition, the embodiment of the present disclosure also provides a computer readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the resource request method described in the above embodiment.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A method for resource request, the method comprising:
receiving a resource request sent by a client through a first target node in a content distribution network, wherein the first target node comprises a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node;
if the target resource corresponding to the resource request is not cached in the first target node, determining a second target node based on a first preset rule;
forwarding the resource request to the second target node;
and acquiring the target resource corresponding to the resource request through the second target node.
2. The method of claim 1, wherein the first target node and the second target node are the same node.
3. The method of claim 1, wherein the second target node is a physical middle layer node in a content distribution network;
a middle tier service logic is deployed in the second target node.
4. The method of claim 3, wherein edge service logic is also deployed in the second target node.
5. The method of claim 1, wherein the second target node is a virtual mid-level node obtained by multiplexing physical edge nodes in a content distribution network, and wherein edge service logic and mid-level service logic are deployed in the virtual mid-level node.
6. The method of claim 5, wherein the obtaining, by the second target node, the target resource corresponding to the resource request comprises:
if the target resource corresponding to the resource request is not cached in the second target node, determining an upper node in a content distribution network based on a second preset rule;
forwarding the resource request to the upper node;
and acquiring the target resource corresponding to the resource request through the upper node.
7. The method according to claim 6, wherein the obtaining, by the upper node, the target resource corresponding to the resource request comprises:
if the target resource corresponding to the resource request is cached in the upper node, the target resource is sent to the client;
and if the target resource corresponding to the resource request is not cached in the upper node, acquiring the target resource from a source station corresponding to the resource request through the upper node.
8. The method of claim 6, further comprising:
when an instruction for refreshing the cache record is received, refreshing the cache record of the upper node;
refreshing the cache record of the first identifier stored in the first target node and the cache record of the second identifier stored in the second target node;
refreshing the cache record of the second identifier stored in the first target node and the cache record of the first identifier stored in the second target node;
two records are respectively cached in the first target node and the second target node aiming at the same target resource, and the identifications of the two records are the first identification and the second identification respectively.
9. The method of claim 1, wherein before receiving, by the first target node in the content distribution network, the resource request sent by the client, the method further comprises:
analyzing the resource request through a preset node associated with a client to determine whether a domain name corresponding to the resource request meets a preset condition;
and if the domain name meets the preset condition, executing the operation of receiving the resource request sent by the client through the first target node in the content distribution network.
10. The method according to any one of claims 1 to 9, wherein the determining the second target node based on the first preset rule comprises:
determining a target scheduling policy corresponding to the resource request from one or more pre-stored scheduling policies through the first target node, where the target scheduling policy includes a uniform resource locator, and the uniform resource locator points to the second target node.
11. A resource request apparatus, comprising:
a receiving module, configured to receive, by a first target node in a content distribution network, a resource request sent by a client, where the first target node includes a virtual edge node obtained by sinking a physical middle-layer node in the content distribution network to an edge, and an edge service logic and a middle-layer service logic are deployed in the virtual edge node;
a determining module, configured to determine, if a target resource corresponding to the resource request is not cached in the first target node, a second target node based on a first preset rule;
a forwarding module, configured to forward the resource request to the second target node;
and the acquisition module is used for acquiring the target resource corresponding to the resource request through the second target node.
12. A resource requesting device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202210000555.0A 2022-01-04 2022-01-04 Resource request method, device, equipment and computer readable storage medium Active CN114006915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210000555.0A CN114006915B (en) 2022-01-04 2022-01-04 Resource request method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210000555.0A CN114006915B (en) 2022-01-04 2022-01-04 Resource request method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114006915A CN114006915A (en) 2022-02-01
CN114006915B true CN114006915B (en) 2022-03-11

Family

ID=79932648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210000555.0A Active CN114006915B (en) 2022-01-04 2022-01-04 Resource request method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114006915B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785794A (en) * 2022-03-29 2022-07-22 北京字节跳动网络技术有限公司 Resource allocation method, device, equipment, medium, program product and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525626A (en) * 2017-09-20 2019-03-26 中兴通讯股份有限公司 The management method of CDN network virtualization of function, apparatus and system
CN110875947A (en) * 2018-09-03 2020-03-10 阿里巴巴集团控股有限公司 Data processing method and edge node equipment
CN112087312B (en) * 2019-06-15 2023-02-03 华为云计算技术有限公司 Method, device and equipment for providing edge service
CN112839070B (en) * 2019-11-22 2023-08-22 北京金山云网络技术有限公司 Data processing method and device and node equipment in CDN (content delivery network)
CN113132443B (en) * 2019-12-31 2022-06-07 北京金山云网络技术有限公司 Resource acquisition method and device and node equipment in CDN (content delivery network)

Also Published As

Publication number Publication date
CN114006915A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
US10742550B2 (en) Updating routing information based on client location
US9160703B2 (en) Request routing management based on network components
US20180212880A1 (en) Managing network computing components utilizing request routing
US8577992B1 (en) Request routing management based on network components
CN115442423A (en) Method for discovering services provided by a network repository function
US20230171618A1 (en) Communication method and apparatus
US8433793B2 (en) Dispatching method, dispatching apparatus and dispatching system
CN109151009B (en) CDN node distribution method and system based on MEC
CN101540759B (en) Method for acquiring address of service server and communication system
CN101924785A (en) Data uploading and downloading methods and system
CA2741895A1 (en) Request routing and updating routing information utilizing client location information
CN113037855B (en) Multimedia access system, method, device, terminal and medium
US20150249636A1 (en) Resource download method, service server and cellular phone client
CN111327668B (en) Network management method, device, equipment and storage medium
CN109672698B (en) Content distribution method, device and system
US11350267B2 (en) Method of obtaining user subscription data pertaining to a subscriber in a telecommunication network
US9417887B2 (en) Method and apparatus for bootstrapping gateway in device management system
CN109756584B (en) Domain name resolution method, domain name resolution device and computer readable storage medium
CN114006915B (en) Resource request method, device, equipment and computer readable storage medium
CN114025023B (en) Source returning method, device, equipment and computer readable storage medium
CN108494870B (en) CDN-based dynamic data loading method and device
CN107770203B (en) Service request forwarding method, device and system
WO2012000455A1 (en) Client terminal and load balancing method
CN104955153A (en) Method, device and appliances for discovering resources
US20170195426A1 (en) Maintaining session across plural providing devices

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
GR01 Patent grant
GR01 Patent grant