CN113204721A - Request processing method, node and storage medium - Google Patents

Request processing method, node and storage medium Download PDF

Info

Publication number
CN113204721A
CN113204721A CN202110530297.2A CN202110530297A CN113204721A CN 113204721 A CN113204721 A CN 113204721A CN 202110530297 A CN202110530297 A CN 202110530297A CN 113204721 A CN113204721 A CN 113204721A
Authority
CN
China
Prior art keywords
resource
request
resource request
source station
client
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
CN202110530297.2A
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 CN202110530297.2A priority Critical patent/CN113204721A/en
Publication of CN113204721A publication Critical patent/CN113204721A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The invention discloses a request processing method, a node and a storage medium. In the invention, a node receives a first resource request sent by a client, analyzes the first resource request and determines whether resources accessed by the first resource request contain external links; if not, sending the first resource request to the corresponding source station; if yes, generating a second resource request based on the first resource request, and sending the second resource request to the source station; and receiving the resource returned by the source station, if the resource is the resource returned based on the first resource request, sending the resource to the client, and if the resource is the resource returned based on the second resource request, rewriting the resource and sending the rewritten resource to the client.

Description

Request processing method, node and storage medium
Technical Field
The embodiment of the invention relates to the technical field of content distribution networks, in particular to a request processing method, a node and a storage medium.
Background
When a web page includes links of other web site contents, commonly referred to as external links, a customer generally uses a Content Delivery Network (CDN) to provide an acceleration service in order to increase the loading speed of the page, however, the existing CDN acceleration service can only accelerate internal links included in the page, and is difficult to accelerate the external links, which results in slow response of part of the Content in the page, or even no display of the Content. In order to accelerate the outer link, the current practice is to splice a special rewritten domain name after the domain name of the outer link, so that the outer link can use CDN acceleration service based on the rewritten domain name, thereby achieving an acceleration effect, and the rewritten outer link content is rewritten again if there is an outer link.
However, in the existing scheme, in order to implement the CDN acceleration service using the CDN node, specifically, the rewriting service and the CDN acceleration service are coupled together, that is, implemented by the same module or process, so that all resources passing through the module or process are rewritten first and then the CDN acceleration is executed. However, in practical applications, not all resources acquired from the source station need to execute the rewriting process, so that the existing scheme not only causes a request response delay to be increased, but also causes a serious waste of rewriting performance, thereby causing a bottleneck to the overall service of the CDN node.
Disclosure of Invention
The embodiment of the invention aims to provide a request processing method, a node and a storage medium, and aims to solve the technical problems that all resources returned from a source station need to execute rewriting service and then are fed back to a client, so that not only is rewriting performance wasted, but also the CDN has poor acceleration service effect and the overall service performance of CDN nodes is affected.
In order to solve the above technical problem, an embodiment of the present invention provides a request processing method, which is applied to a node, and the request processing method includes: receiving a first resource request sent by a client, analyzing the first resource request, and determining whether a resource accessed by the first resource request contains an external link; if not, the first resource request is sent to the corresponding source station; if yes, generating a second resource request based on the first resource request, and sending the second resource request to the source station; and receiving the resource returned by the source station, if the resource is returned based on the first resource request, sending the resource to the client, and if the resource is returned based on the second resource request, rewriting the resource and sending the rewritten resource to the client.
An embodiment of the present invention further provides a node, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the request processing method as described above.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements a request processing method as described above.
The principle followed by the CDN back to the source is what the streaming process of the request is to send out, and the received response is then streamed back to the client in the reverse process. Based on this principle, the request processing method, the node and the storage medium provided in the embodiments of the present invention implement, by determining whether the resource accessed by the first resource request initiated by the client includes an external link, and then when it is determined that the resource does not include the external link, returning to the source based on the first resource request, that is, directly obtaining the resource to be accessed from the source station based on the first resource request, and directly feeding back the obtained resource to the client, so that the whole returning to the source process does not pass through a rewriting process, thereby implementing accelerated returning to the resource accessed by the first resource request initiated by the client; when the external link exists in the first resource request access resource initiated by the client, a second resource request is generated based on the first resource request, and then the resource is acquired from the source station based on the second resource request, so that when the resource returned by the source station is acquired based on the second request, the resource can be rewritten, and then the rewritten resource is returned to the client. By the method, normal execution of rewriting service is realized, and resource return without external links can be accelerated.
In addition, the rewriting process is simplified, so that the performance overhead of the CDN is greatly reduced, and the quality of the CDN back-to-source service is ensured.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a detailed flowchart of a request processing method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an interaction relationship among a client, a CDN node and a source station based on the request processing method shown in fig. 1;
fig. 3 is a further specific flowchart of a request processing method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a node according to an embodiment of the present invention.
Detailed Description
The term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The term "plurality" in the embodiments of the present invention means two or more, and other terms are similar thereto.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in various embodiments of the invention, numerous technical details are set forth in order to provide a better understanding of the present invention. However, the claimed invention may be practiced without these specific details or with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
Referring to fig. 1, fig. 1 is a flowchart of a request processing method provided in the embodiment of the present invention, and in the embodiment, a content delivery network CDN is taken as an example, and the request processing method is mainly applied to CDN nodes.
As shown in fig. 1, the request processing method provided in this embodiment includes the following steps:
step 101, receiving a first resource request sent by a client, analyzing the first resource request, and determining whether a resource accessed by the first resource request includes an external link.
Specifically, on the World Wide Web (WWW, also known as 3W), each information Resource has a Uniform and unique address on the Web, which is a Uniform Resource Locator (URL) that is a 3W Uniform Resource Locator, i.e., a network address, and the URL usually carries the Resource type of the requested Resource. It can be determined whether the resource accessed by the first resource request initiated by the client contains an out-link based on the URL.
Moreover, it can be understood that, for resources of different resource types, the suffix names identifying the specific types of the resources are different, for example, for resources of a picture type, the suffix names may generally be. https:// csdnig. cn/pubfooter/images/joba-qr. png, and the suffix name extracted for this URL is ". png".
Accordingly, for a text-type resource, the suffix name is usually. txt, so when the resource requested to be accessed is a text-type resource, the obtained URL corresponding to the first resource request initiated by the client may be as follows: https:// vms. host. edu/disk $ user/my/nos 12345.txt, and the suffix name extracted for this URL is ". txt".
It should be understood that the above examples are only examples for better understanding of the technical solution of the present embodiment, and are not to be taken as the only limitation to the present embodiment.
Based on the above, after receiving the first resource request sent by the client, the first resource request is parsed, which is essentially to parse the URL corresponding to the first resource request, extract the suffix name of the URL, and then determine whether the resource accessed by the first resource request includes an external link according to the suffix name extracted from the URL.
Specifically, in an example, in order to quickly determine whether the resource accessed by the first resource request initiated by the client includes an external chain, a suffix name set may be constructed in advance, and preset suffix names corresponding to multiple resource types where external chains are unlikely to exist are pre-entered in the suffix name set. When determining whether the resource to which the first resource is requested to access includes an external link based on the suffix extracted from the URL, the extracted suffix may be directly matched with a predetermined suffix in a previously constructed suffix set.
Specifically, if it is determined through matching that a preset suffix name matching the extracted suffix name does not exist in the pre-constructed suffix name set, it is determined that the resource to which the first resource request initiated by the client side is accessed includes an external chain, or an external chain may exist, and step 102 may be entered; otherwise, it is determined that the resource to which the first resource request initiated by the client requests to access does not include an external link, and step 103 may be entered.
As can be seen from the above description, when the accessed resources are picture resources, audio resources, and video resources, it can be determined that no external chain is included in such resources, and therefore the preset suffix names in the pre-constructed suffix name set are mainly picture resource suffix names, audio resource suffix names, and video resource suffix names.
Regarding picture resource suffix names, including but not limited to: damp (bitmap),. jpg,. jpeg,. png,. gif.
With respect to audio resource suffix names, including but not limited to: mp3,. ogg,. wav,. ape,. cda,. au,. midi,. mac,. aac.
With respect to video resource suffix names, including but not limited to: α rmvb,. wmv,. asf,. avi,. 3gp,. mpg,. mkv,. mp4,. dvd,. ogm,. mov,. mpeg2,. mpeg 4.
It should be understood that the above examples are only examples for better understanding of the technical solution of the present embodiment, and are not to be taken as the only limitation to the present embodiment.
In addition, it is worth mentioning that, in practical applications, if the resource requested to be accessed by the first resource initiated by the client is a binary type resource, the resource to be accessed is also considered to not include an external link.
In addition, in a specific implementation, in order to still enable the request processing method provided in this embodiment to be applied when the URL does not carry a resource type, that is, when the URL does not carry a suffix capable of identifying a type of a resource that needs to be accessed, in order to avoid that a first resource request corresponding to a resource that does not actually need to be rewritten is modified into a second resource request and further all response information is subjected to a rewrite process in a source returning process, which affects both normal execution of a rewrite service and CDN acceleration service, before determining that a resource of an external link is included in a resource that the first resource request initiated by the client accesses, the resource that the first resource request initiated by the client is further verified based on a HEAD sub-request supported by a request HTTP, and finally determining whether the resources accessed by the first resource request initiated by the client do not contain the external chain or contain the external chain according to the verification result.
Specifically, a HEAD sub-request is initiated to a source station where a resource requested to be accessed by a first resource initiated by the client is located based on the URL, and then whether the resource requested to be accessed by the first resource initiated by the client includes an external link is determined according to response information returned by the source station.
It should be noted that, in practical applications, the response information returned by the source station and acquired based on the HEAD sub-request only includes metadata corresponding to the resource requested to be accessed by the first resource, and does not include a response information body, that is, does not include the resource requested to be accessed by the first resource. The metadata can reflect the specific type corresponding to the resource to be accessed, so that whether the resource requested to be accessed by the first resource initiated by the client contains an external link can be determined according to the response information returned by the source station, namely the specific type of the resource to be accessed corresponding to the metadata.
Correspondingly, if the resources accessed by the first resource request initiated by the client do not contain the external link according to the response information returned by the source station, the step of determining that the resources accessed by the first resource request initiated by the client do not contain the external link is executed; otherwise, executing the above step of determining that the resources accessed by the first resource request initiated by the client side include the resources of the external link.
Therefore, it is not difficult to find that, in the request processing method provided in this embodiment, whether the resource accessed by the first resource request initiated by the client includes an external link is determined in a single or combined manner through the above multiple manners, the resource that needs to be rewritten and the resource that does not need to be rewritten can be accurately divided, and a rewriting process performed on the resource that does not need to be rewritten is avoided, so that the performance overhead on the CDN node is further reduced, and the back-source service of the CDN node is optimized.
And 102, generating a second resource request based on the first resource request, and sending the second resource request to a corresponding source station.
And 103, sending the first resource request to a corresponding source station.
And 104, receiving the resource returned by the source station, sending the resource to the client if the resource is returned based on the first resource request, rewriting the resource if the resource is returned based on the second resource request, and sending the rewritten resource to the client.
For better understanding of the request processing method provided in this embodiment, for example, two independent processes are run in the same CDN node, that is, the CDN acceleration service and the external chaining rewrite are respectively implemented by two separately run processes, for convenience of description, a process providing the CDN acceleration service is referred to as a first process, and a process providing the rewrite service is referred to as a second process.
That is to say, in order to ensure normal execution of the request processing method provided in this embodiment, it is first necessary to perform decoupling processing on CDN acceleration service and rewriting service coupled together in an existing CDN node, so that the CDN acceleration service can be implemented by a first process running independently, and the rewriting service can be implemented by a second process running independently, that is, a bypass deployment manner is adopted in the same CDN node, and the CDN acceleration service and the rewriting service are implemented by two independent processes respectively.
As shown in fig. 2, when implementing the request processing method provided in this embodiment, a first process and a second process running in the same CDN node perform the specific process as follows:
(1) receiving a first resource request sent by a client by a first process providing CDN acceleration service, analyzing the first resource request, and determining whether resources accessed by the first resource request contain an external link.
Specifically, the received first resource request is specifically initiated by a client, such as a HyperText Transfer Protocol (HTTP) request.
Furthermore, it can be appreciated that in one example, the resources accessed by the first resource request initiated by the client can be roughly divided into two categories:
resources that do not include an external link, such as picture resources, audio resources, video resources, text resources, etc., are not listed here one by one, and this embodiment does not limit this.
Including, or possibly including, resources of the out-link, such as web page resources and the like.
For the resource not including the external link, since the acquired resource can be directly delivered to the client for displaying without other processing, when the resource accessed by the first resource request initiated by the client is the resource of this type, the first process can directly return to the source according to the first resource request initiated by the client, that is, the rewriting process is not required to be executed, and in this case, the step (3) described below is directly executed.
Correspondingly, for the resource accessed by the first resource request initiated by the client, the resource includes or may include an external link, in order to ensure that the external link to be rewritten can be extracted from the resource returned by the source station and rewritten, the first resource request needs to be modified, in this case, the first resource request needs to be forwarded to the second process, then the second process is streamed back to the first process, at this time, the original first resource request becomes the second resource request through the update of the quadruplet through the streaming, and finally, the first process sends the second resource request to the corresponding source station, that is, for the case including the external link, the processing mode of the request needs to be performed according to the following steps (3-1) to (3-3).
(2) Treatment without external chain: and sending the first resource request to a corresponding source station by the first process.
(3) The treatment mode comprising the outer chain:
(3-1) forwarding, by the first process, the first resource request to a second process that provides override services.
(3-2) updating the quadruple of the first resource request by the second process to obtain a second resource request, and forwarding the second resource request to the first process.
It can be understood that the quadruple mentioned in the embodiment specifically refers to the carried contents: a source Internet Protocol (IP), a source port number, a destination IP, and a destination port number.
For a quadruple of a first resource request arriving at a second process but not yet updated, the source IP and source port number are directed to the first process and the destination IP and destination port are directed to the second process; for the updated quadruple of the second resource request, the source IP and the source port are directed to the second process, and the destination IP and the destination port are directed to the first process.
(3-3) transmitting, by the first process, the second resource request to the source station.
(4) The method for processing the resource returned by the source station received by the first process based on the first resource request is as follows: and the first process sends the resource to the client, namely the first process directly returns the resource to the source according to the first resource request.
It should be understood that the principle followed by the CDN back to the source is what the streaming process of the outgoing request is, and the received response is streamed back to the client in the reverse process. Therefore, based on this principle, the above-mentioned directly returning the resource request initiated by the client to the source by the first process means that the resource returned by the source station based on the first resource request is directly returned to the client by the first process.
(5) The method for processing the resource returned by the source station received by the first process based on the second resource request is as follows:
(5-1) forwarding, by the first process, the resource to a second process that provides a rewriting service.
(5-2) rewriting, by the second process, the resource, and forwarding the rewritten resource to the first process.
And (5-3) sending the rewritten resource to the client by the first process.
The rewriting of the resource returned by the source station based on the second resource request by the second process is specifically to scan the resource, extract the outer chain included in the resource, and rewrite the domain name of the extracted outer chain.
It should be understood that the above examples are only examples listed for better understanding of the technical solution of the present embodiment, and are not limited to the present embodiment, and in practical applications, a first process providing a CDN acceleration service and a second process providing a rewrite service may also be respectively run in different CDN nodes, and the present embodiment is not limited to this.
In addition, it is worth mentioning that, in an example, when the second process rewrites the outer chain, the second process may encrypt and rewrite the outer chain based on a preset encryption algorithm, so as to avoid tampering after the rewritten outer chain is intercepted by a malicious third party in a process of being sent to the client, thereby bringing a potential safety hazard to the client.
Therefore, in the request processing method provided by the embodiment of the present invention, the CDN node that performs the request processing determines whether the resource that is accessed by the first resource request initiated by the client includes an external link, and then, when it is determined that the external link is not included, returns the source according to the first resource request by the first process, that is, the first process directly obtains the resource that needs to be accessed from the source station based on the first resource request, and directly feeds back the obtained resource to the client, so that the whole source returning process does not pass through the rewrite flow, and thus, accelerated source returning of the resource that is accessed by the first resource request initiated by the client is achieved.
When the first resource request initiated by the client side comprises an external link in the access resources, the first resource request initiated by the client side is set to flow from the first process to the independently operated second process, and then flow back to the first process for returning to the source, so that the resource containing the external link is directly forwarded to the independently operated second process by the first process for scanning and matching after responding to the first process, so as to extract the contained external link, rewrite the external link and return the processed resource to the client side.
By the method, normal execution of rewriting service is realized, and resource return without external links can be accelerated.
In addition, the rewriting process is simplified, so that the performance overhead of the CDN is greatly reduced, and the quality of the CDN back-to-source service is ensured.
Referring to fig. 3, fig. 3 is a flowchart of a request processing method according to an embodiment of the present invention. The present embodiment provides a specific processing manner of the CDN node for the third resource request initiated by the rewritten external link on the basis of the request processing method shown in fig. 1.
As shown in fig. 3, the request processing method according to this embodiment includes the following steps:
step 301, receiving a first resource request sent by a client, analyzing the first resource request, and determining whether a resource accessed by the first resource request includes an external link
Step 302, generating a second resource request based on the first resource request, and sending the second resource request to the source station.
Step 303, sending the first resource request to a corresponding source station.
And 304, receiving the resource returned by the source station, sending the resource to the client if the resource is returned based on the first resource request, rewriting the resource if the resource is returned based on the second resource request, and sending the rewritten resource to the client.
It is to be understood that steps 301 to 304 provided in this embodiment are substantially the same as steps 101 to 104 in the embodiment shown in fig. 1, and are not repeated herein.
Step 305, if a third resource request sent by the client and initiated for the rewritten external link is received, restoring the domain name of the rewritten external link to obtain an original external link.
Still taking an example that a first process providing CDN acceleration service and a second process providing rewriting service run on the same CDN node, with reference to fig. 2, after the first process sends the rewritten resource to the client, if a third resource request initiated by the client for the rewritten external link is received, the first process first restores the domain name of the rewritten external link, for example, the rewritten external link is added with a certain identifier, and the principle here is to remove the identifier.
Step 306, obtaining the resource requested to be accessed by the third resource from the source station corresponding to the original external link.
Specifically, regarding the resource that is obtained from the source station corresponding to the original external link and requested to be accessed by the third resource in step 306, in this embodiment, the method specifically includes:
analyzing the third resource request, and determining whether the resource accessed by the third resource request contains an external link; if not, sending the third resource request to a source station corresponding to the original external chain; if yes, generating a fourth resource request based on the third resource request, and sending the fourth resource request to a source station corresponding to the original external link; and receiving the resource returned by the source station corresponding to the original external link, if the resource is returned based on the third resource request, sending the resource to the client, and if the resource is returned based on the fourth resource request, rewriting the resource and sending the rewritten resource to the client.
In addition, it should be noted that the first resource request in this embodiment refers to a resource request for which a client initiates access for the first time, that is, a resource request which arrives at the CDN node from the client for the first time. And when the second resource request determines that the resource requested to be accessed by the first process contains an external link, the first resource request is forwarded to the second process, and then the second resource request is streamed back to the resource request after the first process.
And for the third resource request, the resource access request is actually initiated based on the rewritten external link existing in the resource returned by the second resource request. The difference between the third resource request and the first resource request is that after the third resource request reaches the first process, the first process needs to restore the rewritten external link first, and then determines whether the resource to be accessed by the third resource request includes an external link, that is, after the external link of the third resource request is restored, the subsequent operation is substantially similar to that of the first resource request.
That is, the fourth resource request is substantially the same as the third resource request sent by the client, the source station accessed by the third resource request is the same, and the content is also the same, so that the resource including the external link can be directly transferred from the first process to the second process for rewriting service after reaching the CDN node.
That is, for any resource request that reaches the first process, the first process parses the URL corresponding to the resource request, and further determines whether the resource accessed by the resource request includes an external link, that is, the operations in steps 301 to 306 need to be repeatedly executed until the resource returned by the source station does not include an external link that needs to be rewritten.
In addition, it is worth mentioning that, as the request processing party provided in this embodiment, the first process and the second process are independently run in the same CDN node or different CDN nodes, so that the first process and the second process can work simultaneously without affecting each other, that is, in the process of rewriting the resource returned by the source station by the second process, the first process can still receive the resource returned by the source station and determine whether the returned resource needs to be rewritten, if the resource does not need to be rewritten, the received resource is directly sent to the client, if the resource needs to be rewritten, the resource is added to the rewrite queue, and after the second process completes rewriting of the resource that needs to be rewritten currently, the resource that needs to be rewritten is read from the rewrite queue for rewriting.
It should be understood that the above steps of the various methods are divided for clarity, and the implementation may be combined into one step or split into a plurality of steps, and all that includes the same logical relationship is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
Embodiments of the present invention also relate to a CDN node, as shown in fig. 4, including at least one processor 401; and a memory 402 communicatively coupled to the at least one processor 401; wherein the memory 402 stores instructions executable by the at least one processor 401, the instructions being executable by the at least one processor 401 to enable the at least one processor 401 to perform the request processing method described in the above method embodiments.
Where the memory 402 and the processor 401 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 401 may be transmitted over a wireless medium via an antenna, which may receive the data and transmit the data to the processor 401.
The processor 401 is responsible for managing the bus and general processing and may provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 402 may be used to store data used by processor 401 in performing operations.
It should be noted that, in the CDN node in this embodiment, when executing the request processing method described in the foregoing method embodiment, the processor 401 may implement the CDN acceleration service through a separate process, that is, the first process, and implement the out-link rewriting through another separate process, that is, the second process. That is, when executing the request processing method described in the foregoing method embodiment, the processor 401 may control the first process and the second process to cooperate with each other as needed to implement the request processing method described in the foregoing method embodiment together.
Embodiments of the present invention also relate to a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements the request processing method embodiments described above.
That is, those skilled in the art can understand that all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (17)

1. A request processing method is applied to a node, and comprises the following steps:
receiving a first resource request sent by a client, analyzing the first resource request, and determining whether a resource accessed by the first resource request contains an external link;
if not, the first resource request is sent to the corresponding source station;
if yes, generating a second resource request based on the first resource request, and sending the second resource request to the source station;
and receiving the resource returned by the source station, if the resource is returned based on the first resource request, sending the resource to the client, and if the resource is returned based on the second resource request, rewriting the resource and sending the rewritten resource to the client.
2. The method of claim 1, wherein the parsing the first resource request to determine whether the resource accessed by the first resource request includes an out-link comprises:
analyzing a Uniform Resource Locator (URL) corresponding to the first resource request, and extracting a suffix name of the URL;
and determining whether the resources requested to be accessed by the first resource contain external links according to the suffix name.
3. The method according to claim 2, wherein the determining whether the resource requested to be accessed by the first resource includes an out-link according to the suffix name comprises:
matching the suffix name with a preset suffix name in a pre-constructed suffix name set;
if a preset suffix name matched with the suffix name exists in the suffix name set, determining that the resource requested to be accessed by the first resource does not contain an external chain;
otherwise, determining that the resource requested to be accessed by the first resource contains an external chain.
4. The method of claim 3, wherein prior to the determining that the resource to which the first resource requests access includes an out-link, the method further comprises:
initiating a HEAD sub-request to the source station;
receiving response information returned by the source station, and determining whether the resource requested to be accessed by the first resource contains an external link according to the response information, wherein the response information only comprises metadata corresponding to the resource requested to be accessed by the first resource;
if yes, executing the step of determining that the resource requested to be accessed by the first resource contains an external link;
otherwise, executing the step of determining that the resource requested to be accessed by the first resource does not contain the external link.
5. The request processing method according to claim 3, wherein the preset suffix name in the suffix name set comprises: picture resource suffix name, audio resource suffix name and video resource suffix name.
6. The method according to claim 1, wherein the receiving a first resource request sent by a client, parsing the first resource request, and determining whether a resource accessed by the first resource request includes an external link, comprises:
receiving a first resource request sent by a client by a first process providing CDN acceleration service, analyzing the first resource request, and determining whether resources accessed by the first resource request contain an external link.
7. The method of claim 6, wherein sending the first resource request to a corresponding source station comprises:
and sending the first resource request to a corresponding source station by the first process.
8. The method of claim 6, wherein generating a second resource request based on the first resource request and sending the second resource request to the source station comprises:
forwarding, by the first process, the first resource request to a second process that provides override services;
updating the quadruple of the first resource request by the second process to obtain a second resource request, and forwarding the second resource request to the first process;
sending, by the first process, the second resource request to the source station.
9. The method according to claim 7 or 8, wherein the receiving the resource returned by the source station, sending the resource to the client if the resource is returned based on the first resource request, rewriting the resource if the resource is returned based on the second resource request, and sending the rewritten resource to the client comprises:
receiving, by the first process, a resource returned by the source station, and if the resource is a resource returned based on the first resource request, sending the resource to the client, and if the resource is a resource returned based on a second resource request, forwarding the resource to a second process that provides rewriting service;
rewriting the resources by the second process, and forwarding the rewritten resources to the first process;
and sending the rewritten resource to the client by the first process.
10. The request processing method according to claim 9, wherein in the rewriting of the resource by the second process, the method further comprises:
and continuously receiving the resource returned by the source station by the first process.
11. The request processing method according to claim 1, wherein the rewriting the resource includes:
scanning the resources and extracting external links contained in the resources;
and rewriting the domain name of the external link.
12. The request processing method of claim 11, wherein after the sending the rewritten resource to the client, the method further comprises:
if a third resource request which is sent by the client and is initiated aiming at the rewritten external link is received, restoring the domain name of the rewritten external link to obtain an original external link;
and acquiring the resource which is requested to be accessed by the third resource from the source station corresponding to the original external link.
13. The method according to claim 12, wherein the obtaining the resource requested to be accessed by the third resource from the source station corresponding to the original external link includes:
analyzing the third resource request, and determining whether the resource accessed by the third resource request contains an external link;
if not, sending the third resource request to a source station corresponding to the original external chain;
if yes, generating a fourth resource request based on the third resource request, and sending the fourth resource request to a source station corresponding to the original external link;
and receiving the resource returned by the source station corresponding to the original external link, if the resource is returned based on the third resource request, sending the resource to the client, and if the resource is returned based on the fourth resource request, rewriting the resource and sending the rewritten resource to the client.
14. The method according to claim 13, wherein the obtaining the resource requested to be accessed by the third resource from the source station corresponding to the original external link includes:
analyzing the third resource request by a first process providing CDN acceleration service, and determining whether a resource accessed by the third resource request contains an external link;
if not, the first process sends the third resource request to a source station corresponding to the original external chain;
if the source station corresponding to the original external chain is contained, the first process forwards the third resource request to a second process providing rewriting service, the second process updates a quadruple of the third resource request to obtain a fourth resource request, the fourth resource request is forwarded to the first process, and the first process sends the fourth resource request to the source station corresponding to the original external chain;
receiving, by the first process, a resource returned by the source station corresponding to the original external link, sending, if the resource is returned based on the third resource request, the resource to the client, if the resource is returned based on the fourth resource request, forwarding, to the second process, rewriting the resource by the second process, forwarding the rewritten resource to the first process, and sending, by the first process, the rewritten resource to the client.
15. The request processing method according to claim 8 or 14, wherein the node is a CDN node, and the first process and the second process are respectively run in the same CDN node or in different CDN nodes.
16. A node, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a request processing method according to any one of claims 1 to 15.
17. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the request processing method of any one of claims 1 to 15.
CN202110530297.2A 2021-05-14 2021-05-14 Request processing method, node and storage medium Pending CN113204721A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110530297.2A CN113204721A (en) 2021-05-14 2021-05-14 Request processing method, node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110530297.2A CN113204721A (en) 2021-05-14 2021-05-14 Request processing method, node and storage medium

Publications (1)

Publication Number Publication Date
CN113204721A true CN113204721A (en) 2021-08-03

Family

ID=77031263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110530297.2A Pending CN113204721A (en) 2021-05-14 2021-05-14 Request processing method, node and storage medium

Country Status (1)

Country Link
CN (1) CN113204721A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024021472A1 (en) * 2022-07-29 2024-02-01 天翼云科技有限公司 Interface information processing method and apparatus

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109670131A (en) * 2018-12-18 2019-04-23 网宿科技股份有限公司 The processing of Resource Description File, the acquisition methods of page resource and intermediate server
CN109714406A (en) * 2018-12-18 2019-05-03 网宿科技股份有限公司 The processing of Resource Description File, the acquisition methods of page resource and equipment
CN109768992A (en) * 2019-03-04 2019-05-17 深信服科技股份有限公司 Webpage malicious scanning processing method and device, terminal device, readable storage medium storing program for executing
CN110392020A (en) * 2018-04-18 2019-10-29 网宿科技股份有限公司 A kind of transmission method and system of streaming media resource
CN111031128A (en) * 2019-12-12 2020-04-17 杭州安恒信息技术股份有限公司 Method for realizing skylight-free website IPv6 transformation based on cloud technology
WO2020186607A1 (en) * 2019-03-21 2020-09-24 网宿科技股份有限公司 Access request processing method and device, and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110392020A (en) * 2018-04-18 2019-10-29 网宿科技股份有限公司 A kind of transmission method and system of streaming media resource
CN109670131A (en) * 2018-12-18 2019-04-23 网宿科技股份有限公司 The processing of Resource Description File, the acquisition methods of page resource and intermediate server
CN109714406A (en) * 2018-12-18 2019-05-03 网宿科技股份有限公司 The processing of Resource Description File, the acquisition methods of page resource and equipment
CN109768992A (en) * 2019-03-04 2019-05-17 深信服科技股份有限公司 Webpage malicious scanning processing method and device, terminal device, readable storage medium storing program for executing
WO2020186607A1 (en) * 2019-03-21 2020-09-24 网宿科技股份有限公司 Access request processing method and device, and server
CN111031128A (en) * 2019-12-12 2020-04-17 杭州安恒信息技术股份有限公司 Method for realizing skylight-free website IPv6 transformation based on cloud technology

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024021472A1 (en) * 2022-07-29 2024-02-01 天翼云科技有限公司 Interface information processing method and apparatus

Similar Documents

Publication Publication Date Title
US8312172B2 (en) Method and system for delta compression
US10419398B2 (en) Method and apparatus for resource locator identifier rewrite
CN102111685B (en) Acceleration method, equipment and system for network video loading
CN102263828B (en) Load balanced sharing method and equipment
RU2365049C2 (en) System and method of use of packed compressed buffers for improved data transfer between client and server
CN102882974B (en) Method for saving website access resource by website identification version number
WO2017080459A1 (en) Method, device and system for caching and providing service contents and storage medium
KR20120083903A (en) System and method for providing faster and more efficient data communication
US10021195B2 (en) Cross-device synchronization system for account-level information
CN107135266B (en) HTTP proxy framework security data transmission method
CN109376172B (en) Data acquisition method and system based on block chain
CN111488604A (en) Data desensitization system and data desensitization method
US20060224759A1 (en) System and method for a peer-to-peer streaming content operation by a browser plug-in
CN111770072B (en) Method and device for accessing function page through single sign-on
EP3125495B1 (en) Content negotiation in a content centric network
CN113204721A (en) Request processing method, node and storage medium
JP5109901B2 (en) Session data sharing method
CN115883659B (en) Method and device for supporting batch refreshing of CDN caches
US10021207B1 (en) Architecture for proactively providing bundled content items to client devices
JP2013250691A (en) Communication device and method
JP2016154332A (en) Devices and methods for performing tcp handshakes
KR20200080416A (en) Data processing apparatus for mobile edge computing
US20130024543A1 (en) Methods for generating multiple responses to a single request message and devices thereof
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)
CN106060155A (en) P2P (Peer to Peer) resource sharing method and device

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