A CDN source retrieval method, a CDN node and a storage medium
By introducing independent origin pull components and origin pull processing module libraries into CDN nodes, the problem of low delivery efficiency caused by the complexity of caching components is solved, and efficient adaptation and rapid response to diverse origin pull requirements are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-11-09
- Publication Date
- 2026-04-10
AI Technical Summary
Existing CDN caching components are large and complex, making it difficult to quickly adapt to diverse and customized origin pull requirements, resulting in low delivery efficiency.
Add an origin pull component independent of the caching component to the CDN node, provide a variety of origin pull processing module libraries, find and run origin pull processing modules that adapt to diverse needs, and inject the processed instructions into the origin pull link to support horizontal scaling.
It improves the efficiency and flexibility of origin server processing, can adapt to various CDN scenarios, reduces frequent modifications to caching components, and improves delivery efficiency.
Smart Images

Figure CN115834693B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a CDN source returning method, a CDN node and a storage medium. BACKGROUND
[0002] The full name of CDN is Content Delivery Network, that is, content distribution network. At present, the source returning function in CDN is integrated in the cache component on the CDN node.
[0003] With the continuous diversification of application commodities, the source returning demand in CDN gradually presents individualization and customization, which requires continuous development and expansion of the cache component to adapt to these frequently changing source returning demands. However, due to the large and complex component functions of the cache component, the development and expansion period of the cache component is long, which leads to the fact that the current cache component is difficult to meet the requirement of delivery efficiency of the source returning demand. SUMMARY
[0004] Aspects of the present application provide a CDN source returning method, a CDN node and a storage medium to improve the delivery efficiency of the changing source returning demand.
[0005] The present application provides a CDN source returning method, which is suitable for a CDN node, wherein the CDN node is equipped with a cache component and a source returning component, and the method comprises the following steps:
[0006] In the case that it is determined by the cache component that a target resource does not exist locally, a source returning instruction is initiated to the source returning component, wherein the source returning instruction contains identification information corresponding to the target resource;
[0007] At least one source returning processing module associated with the identification information is searched in a source returning processing module library by using the source returning component;
[0008] The source returning instruction is processed according to the at least one source returning processing module by using the source returning component;
[0009] The target resource is source returned according to the processed source returning instruction by using the source returning component.
[0010] The present application also provides a CDN node, wherein the CDN node is equipped with a cache component and a source returning component;
[0011] The cache component is configured to initiate a source returning instruction to the source returning component in the case that it is determined that a target resource does not exist locally, wherein the source returning instruction contains identification information corresponding to the target resource;
[0012] The back-to-source component is configured to search for at least one back-to-source processing module associated with the identification information in a back-to-source processing module library, process the back-to-source instruction according to the at least one back-to-source processing module, and perform back-to-source on the target resource according to the processed back-to-source instruction.
[0013] The application also provides a computer readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to perform the CDN back-to-source method.
[0014] In the embodiments of the application, a back-to-source component is added to the CDN node, which is independent of the cache component on the CDN node but logically interfaces with the cache component. Based on this, the cache component can call the back-to-source component to perform related back-to-source work when it is determined that the target resource does not exist locally in the CDN node; the back-to-source component can provide various back-to-source processing modules to adapt to diversified back-to-source requirements; the back-to-source component can search for the back-to-source processing modules required by the target resource and run these back-to-source processing modules to process the back-to-source instruction corresponding to the target resource, and after the processing is completed, the back-to-source component can re-inject the processed back-to-source instruction into the original back-to-source link to perform back-to-source on the target resource. The back-to-source component can support horizontal expansion of the back-to-source processing modules, thereby adapting to diversified back-to-source requirements and delivering efficiently without the need to frequently modify / release the huge and complex cache component. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this application, illustrate certain illustrative embodiments of the application and together with the description serve to explain the application. In the drawings:
[0016] Figure 1 A flowchart of a CDN back-to-source method provided for an illustrative embodiment of the application;
[0017] Figure 2 A logic diagram of a CDN back-to-source method provided for an illustrative embodiment of the application;
[0018] Figure 3 An application scenario diagram of a CDN back-to-source method provided for an illustrative embodiment of the application;
[0019] Figure 4 A logic diagram of another CDN back-to-source method provided for an illustrative embodiment of the application;
[0020] Figure 5 A structure diagram of a CDN node provided for another illustrative embodiment of the application. DETAILED DESCRIPTION
[0021] In order to make the purposes, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0022] At present, in order to meet diversified back-to-source requirements, the cache component needs to be expanded, but the delivery efficiency of the cache component is poor. Therefore, in some embodiments of the present application: a back-to-source component is added in the CDN node, and the back-to-source component is independent of the cache component on the CDN node but interfaces with the cache component in working logic. Based on this, the cache component can call the back-to-source component to perform related back-to-source work when it is determined that the target resource does not exist locally in the CDN node; a plurality of back-to-source processing modules can be provided in the back-to-source component, which can adapt to diversified back-to-source requirements; the back-to-source component can find the back-to-source processing modules required by the target resource, and run these back-to-source processing modules to process the back-to-source instructions corresponding to the target resource, and after the processing is completed, the back-to-source component can re-inject the processed back-to-source instructions into the original back-to-source link to perform back-to-source on the target resource. The back-to-source component can support horizontal expansion of the back-to-source processing modules, thereby adapting to diversified back-to-source requirements and efficiently delivering without the need to frequently modify / release the huge and complex cache component.
[0023] The technical solutions provided by the embodiments of the present application will be described in detail below in combination with the drawings.
[0024] Figure 1 A flowchart of a CDN back-to-source method provided by an exemplary embodiment of the present application. Figure 2 A logic diagram of a CDN back-to-source method provided by an exemplary embodiment of the present application. The method can be applied to a CDN node. The full name of CDN is Content Delivery Network, that is, content distribution network, and the CDN includes a plurality of CDN nodes. According to the different positions in the network structure, the CDN can include various types of nodes such as edge nodes and intermediate nodes, and the CDN back-to-source method provided by the present embodiment can be applied to various types of nodes in the CDN, because the various types of nodes in the CDN can have back-to-source requirements. The back-to-source refers to that the node does not exist locally for the resource required by the user, and needs to obtain the related resource from the source station in the CDN.
[0025] In the traditional scheme, the CDN node usually inherits the source retrieval capability in the cache component. In the traditional scheme, the cache component needs to undertake the source retrieval work, as well as the cache work, the monitoring work and other more and more complex work, which leads to the large and complex component function of the cache component. Therefore, the cache component has problems such as long iteration cycle and poor system stability. The cache component cannot meet the diversified, personalized and customized source retrieval demand.
[0026] Therefore, the embodiment provides a brand new CDN source retrieval scheme. In the embodiment, a source retrieval component is assembled on the CDN node, and the source retrieval component is independent of the original cache component on the CDN node. In terms of working logic, the source retrieval component can be connected with the cache component, that is, the source retrieval component and the cache component are connected in terms of data flow. In this way, the cache component only needs to focus on the data flow and no longer needs to focus on the work flow corresponding to the user demand. In actual application, in order to support the connection in terms of working logic, the same language as the cache component can be used to write the working logic of the source retrieval component. In terms of internal function, the source retrieval component can provide a source retrieval processing module library inside, and the source retrieval processing module library can support horizontal expansion and contain a plurality of source retrieval processing modules that can adapt to diversified source retrieval demand. That is, the source retrieval processing modules provided inside the source retrieval component can be completely decoupled from the cache component and can be flexibly expanded without being constrained by the cache component, and the source retrieval component and the cache component are decoupled in terms of work flow.
[0027] In this way, for the source retrieval component, since it is more lightweight than the cache component, when the expansion event of the source retrieval processing module occurs inside the source retrieval component, the delivery can be completed more quickly, which can more efficiently meet the variability of the source retrieval demand and cover various CDN scenarios. Figure 3 An application scenario schematic diagram of a CDN source retrieval method provided by an exemplary embodiment of the present application is provided. Referring to Figure 3 Here, the source retrieval component can provide a source retrieval processing module library in the embodiment, and the CDN scenarios that can be covered by the source retrieval processing module library can include but are not limited to the ordinary CDN scenario, the full acceleration DCDN scenario, the security protection SCDN scenario, the streaming media liveCDN scenario and the like. The source retrieval demand in different CDN scenarios can be different, and the source retrieval processing module library provided by the source retrieval component in the embodiment can contain all the source retrieval processing modules that can be used in all CDN scenarios. In this way, only one source retrieval component needs to be assembled in the CDN node to support various CDN scenarios accessed by the CDN node, without the need to assemble different source retrieval components for different CDN scenarios, that is, the source retrieval processing module library has universality and can be universally used in any CDN node or any CDN scenario, which can further improve the delivery efficiency of the source retrieval component. In addition, referring to Figure 3The underlying physical resources involved in the CDN source returning method in the embodiment can include, but are not limited to, domestic standard CDN nodes, domestic small CDN nodes, overseas CDN nodes, domestic network links, overseas network links, and the like.
[0028] Preferably, in order to improve the expansion efficiency of the source returning processing module library in the source returning component, a script of each source returning processing module can be written in lua language, and the lua script can be run in a lua virtual environment in a coroutine manner. Of course, the embodiment is not limited thereto, and other languages can also be used to write the script of each source returning processing module. The lua language is a small script language that can be easily called by C or C++ language. Considering that the cache component is usually written in C or C++ language, the lua language is preferably used to write the script of each source returning processing module, so that each source returning processing module can be more efficiently externally connected to the cache component.
[0029] On the basis of the deployment structure, reference is made to Figure 1 The CDN source returning method provided by the embodiment can include the following steps.
[0030] Step 100, in the case where it is determined by the cache component that the target resource does not exist locally, a source returning instruction is initiated to the source returning component, and the source returning instruction contains identification information corresponding to the target resource;
[0031] Step 101, at least one source returning processing module associated with the identification information is found in the source returning processing module library by using the source returning component;
[0032] Step 102, the source returning instruction is processed according to the at least one source returning processing module by using the source returning component;
[0033] Step 103, the target resource is source returned according to the processed source returning instruction by using the source returning component.
[0034] Reference is made to Figure 1After the CDN node receives the source return request for the target resource, the source return request is first transmitted to the cache component. The cache component can determine whether the target resource exists locally. If the target resource exists locally, the cache component can directly respond to the source return request. If the target resource does not exist locally, the cache component invokes the source return component to perform the source return work, and the cache component itself no longer undertakes the source return work. Therefore, the cache component can initiate a source return instruction to the source return component in a case where it is determined that the target resource does not exist locally. The source return instruction can include identification information corresponding to the target resource. The identification information can be a domain name corresponding to the target resource. For example, after the CDN node receives an http request for the target resource, the cache component can be used to query the local resource. If the target resource does not exist locally, the cache component can initiate a source return instruction to the source return component based on the URL in the http request and the like. In this way, the domain name in the URL can be carried in the source return instruction and provided to the source return component. Of course, in addition to the identification information of the target resource, the source return instruction can also include other information for supporting the source return work of the source return component, which is not enumerated here. In this embodiment, the source return instruction can be an instruction related to the source return configuration.
[0035] In step 101, after receiving the source return instruction, the source return component can determine at least one source return processing module associated with the identification information of the target resource. The source return processing module can provide general functions in the source return work. The general functions can be understood as functions that can be used by all domain names, rather than functions customized for one or several domain names. In this way, the source return component can provide several source return processing modules to form a source return processing module library.
[0036] In this embodiment, the source return processing module library provided by the source return component can be expanded horizontally on demand, that is, the source return processing communication modules in the source return processing module library can be increased / decreased on demand. Since the source return component is more lightweight than the cache component, the delivery efficiency of the expansion event is high. Moreover, after the expansion on demand, the source return processing module library can comprehensively cover the demand for the source return processing module in various CDN scenarios, so that the CDN node can find the required source return processing module from the source return processing module library provided by the source return component when the CDN node accesses various CDN scenarios, thereby supporting the reuse of the same CDN node in various CDN scenarios.
[0037] In this embodiment, the source return component can be configured to determine the identification information of the target resource in the source return instruction, and determine at least one source return processing module associated with the identification information of the target resource. Figure 3The back source processing module library can include, but is not limited to, a performance optimization type module, a back source rewriting type module, a back source security type module, a source station selection type module, or a source station switching type module, etc. The performance optimization type module can include a back source speed limiting module, a consistent hash module, a back source throughput module, a combined back source module, a back source data range module, a multi-layer node architecture module, a preheating module, an edge 302 scheduling module, etc. The back source rewriting type module can include a back source parameter rewriting module, a back source request header rewriting module, a back source address rewriting module, a back source response header rewriting module, a back source host setting module, a back source 302 redirection module, a back source authentication module, a back source domain name designation module, etc. The back source security type module can include a national secret module, a protocol following module, a back source SSL protocol version module, a V4 / V6 dual stack module, etc. The source station selection type module can include a source station load balancing module, etc. The source station switching type module can include a source station failover module, etc. The above are exemplary, and the embodiment is not limited thereto, and the names of the back source processing modules are not exhaustively listed here.
[0038] In an exemplary implementation: the back source component can call a module configuration table, the module configuration table containing an association relationship between identification information and a back source processing module; in the module configuration table, at least one back source processing module associated with the identification information corresponding to the target resource is queried. The module configuration table in the management component (original component) in the CDN node is generally located, for this purpose, the back source component in the embodiment can be connected with the management component, and the module configuration table is called from the management component. The module configuration table in the management component is pre-configured, and the specific configuration process can refer to the existing or possible future configuration scheme, which is not the focus of the case and is not described in detail here. For example, the back source processing modules associated with the domain name A can be a back source request header rewriting module, a back source response header rewriting module, a back source speed limiting module, a source station failover module, etc.
[0039] Continuing to refer to Figure 1 In step 102, the back source component can process the back source instruction according to at least one back source processing module associated with the identification information of the target resource. Corresponding to the various types of modules that the back source processing module library can provide, here, the processing of the back source instruction by the back source component can include performance optimization type processing, back source rewriting type processing, back source security type processing, source station selection type module processing, or source station switching type processing, etc.
[0040] It is worth noting that reference is made to Figure 2The back-source process can include a request phase and a response phase. In step 101, the back-source component finds, for the identification information of the target resource, all back-source processing modules associated therewith, which actually covers both the request phase and the response phase. That is, some of the back-source processing modules found in step 101 can be applicable to the request phase, and some can be applicable to the response phase. Therefore, in step 102, the back-source component can determine, from the back-source processing modules found in step 101, the back-source processing modules applicable to the request phase, and process the back-source instruction according to the back-source processing modules applicable to the request phase. The back-source processing modules applicable to the response phase will be used in the subsequent response phase.
[0041] In addition, in step 102, when there are multiple back-source processing modules found for the target resource, the back-source component can sort the multiple back-source processing modules, and sequentially run the multiple back-source processing modules to process the back-source instruction. Therefore, in this embodiment, a priority configuration table can be constructed in advance, and the priorities between the back-source processing modules can be set in the priority configuration table. In this way, the back-source component can call the priority configuration table, and sort the multiple back-source processing modules found based on the priority configuration table. It should be understood that, as described above, in the request phase, the back-source component can only sort the multiple back-source processing modules found and applicable to the request phase. In actual application, the code logic related to the sorting work can be written in the working logic of the back-source component, and in this part of the code logic, the multiple back-source processing modules found and applicable to the request phase for the target resource can be recorded in the form of an array, wherein the elements in the array can be used to refer to these back-source processing modules. In this way, this part of the code logic can sort the elements in the array to sort the related back-source processing modules. Of course, this is only exemplary, and the present embodiment is not limited thereto. Other ways can also be used to enable the back-source component to sequentially run the multiple back-source processing modules.
[0042] After the above processing of the back-source instruction, the processed back-source instruction can be generated. It should be understood that the processed back-source instruction is different from the back-source instruction originally initiated by the cache component. For example, if the identification information of the target resource is associated with a back-source request header rewriting module, the back-source request header of the processed back-source instruction has been rewritten compared with the back-source instruction originally initiated.
[0043] In this way, the back-source instruction output from the back-source component is the back-source instruction that can meet the user's back-source demand.
[0044] On this basis, reference can be made to Figure 1In step 103, the source return component can return the source to the target resource according to the processed source return instruction. Here, the source return component essentially injects the processed source return instruction into the original source return link. The source return link can be understood as the source return path to the target resource. For example, the source return link can be: the current node-the next hop node-the source station, in which case the source return component on the current node can pass the processed source return instruction to the next hop node, so that the processed source return instruction is injected into the source return link.
[0045] Thereafter, the source return link can return the source according to the original logic, and return the retrieved target resource to the current CDN node.
[0046] This involves the aforementioned response stage, which can be understood as the processing stage after the CDN node receives the source return response to the target resource.
[0047] In the response stage, the CDN node can use the source return component to receive the source return response to the target resource. It should be understood here that the source return response contains two aspects: resource content and protocol-related content. In the response stage, the resource content in the source return response is generally not processed, and only the protocol-related content in the source return response is generally processed.
[0048] For the source return component, in the response stage: the source return response to the target resource can be received, the source return response contains identification information corresponding to the target resource; at least one target source return processing module for the source return response is found from at least one source return processing module associated with the identification information; at least one target source return processing module is run to process the source return response; and the processed source return response is provided to the cache component to complete the source return to the target resource by the cache component.
[0049] As mentioned earlier, in step 102, the source return component has found all source return processing modules associated with the identification information of the target resource, so in the response stage, the source return component can directly filter at least one target source return processing module suitable for the response stage from the source return processing modules found in step 102, without the need to repeatedly call the module configuration table mentioned earlier.
[0050] In addition, similar to the aforementioned request stage, the source return component can also sort the target source return processing modules in the response stage, and sequentially run the target source return processing modules to process the source return response. The technical details here can be referred to the foregoing, and will not be described in detail here.
[0051] The processed source return response will be injected into the cache component for the cache component to perform subsequent processing according to the original cache logic to complete the source return to the target resource.
[0052] In summary, in the embodiment, a backsource component is added in the CDN node, which is independent of the cache component on the CDN node but interfaces with the cache component in working logic. Based on this, the cache component can call the backsource component to perform relevant backsource work when it is determined that the target resource does not exist locally in the CDN node; the backsource component can provide multiple backsource processing modules to adapt to diversified backsource requirements; the backsource component can find the backsource processing modules required by the target resource and run these backsource processing modules to process the backsource instruction corresponding to the target resource, and after the processing is completed, the backsource component can re-inject the processed backsource instruction into the original backsource link to perform backsource on the target resource. The backsource component can support horizontal expansion of the backsource processing modules to adapt to diversified backsource requirements and efficiently deliver them without the need to frequently modify / release the huge and complex cache component.
[0053] In the above or the following embodiments, the backsource component can also be used to determine the backsource path. Figure 4 Another CDN backsource method provided by an exemplary embodiment of the present application is shown in the logical diagram. Compared with the CDN backsource method provided by the first exemplary embodiment of the present application, the CDN backsource method provided by the second exemplary embodiment of the present application can support the determination of the backsource path. Figure 2 Figure 4 The function of the backsource component to determine the backsource path is shown in the above or the following embodiments. For this, in the embodiment, the backsource component can determine the next hop address for the identification information corresponding to the target resource.
[0054] In the embodiment, the backsource component can call the routing table, the routing table contains the association between the identification information and the next hop address; the backsource component is used to query at least one next hop address associated with the identification information corresponding to the target resource in the routing table; and the backsource component is used to select the next hop address for the identification information corresponding to the target resource from the at least one next hop address found according to the preset path selection strategy.
[0055] The routing table is usually stored in the original scheduling component in the CDN node, and the backsource component can interface with the scheduling component in the CDN node and call the routing table thereon. The routing table in the scheduling component is pre-configured, and the specific configuration process can refer to the existing or possible future configuration scheme, which is not the focus of the present case and is not described in detail here. Usually, in the routing table, the next hop address associated with a single identification information is multiple, and in the exemplary scheme, the backsource component can determine the next hop address for the identification information corresponding to the target resource.
[0056] In the decision process, the source return component can support dynamic-static path selection. For this purpose, the path selection strategy can include a quality priority strategy or a cost priority strategy. In the quality priority strategy, the source return component can specify a full path for the target resource, that is, specify each subsequent hop address for the target resource, which of course includes the next hop address. In the cost priority strategy, the source return component can only determine the next hop address for the target resource, and the subsequent hop address is determined by the subsequent hop nodes. Accordingly, the source return component can meet the diversified needs of different user source return paths.
[0057] In actual application, the next hop address corresponding to the target resource can be a source station address or an internal node address in the CDN. For different cases, the source return component can also provide more optimized decisions:
[0058] If all the at least one next hop address queried is a source station address, the source return component can select the source station address of the next hop for the identification information corresponding to the target resource according to the smooth load balancing method;
[0059] If all the at least one next hop address queried is an internal node address in the CDN, the source return component can select the next hop address for the identification information corresponding to the target resource from the at least one next hop address found by using the consistent hashing algorithm.
[0060] In this way, by increasing the smooth load balancing algorithm, the access fluctuation of the source station caused by the source return event can be greatly reduced. In actual application, it can be reduced from 5% to 1.7%. Of course, in addition to using the smooth load balancing algorithm, other load balancing algorithms can also be used, and the embodiment is not limited thereto. By increasing the consistent hashing algorithm, the consistent hashing capability between the CDN nodes can be realized with the support of the source return component, so that the source return link in the CDN is more concentrated, the source return request is better converged, and the source return cost is greatly reduced.
[0061] In addition to the more optimized decisions described above, the source return component can also support more optimized decisions, including but not limited to increasing the IPV6 preference strategy. In the strategy, when the next hop address queried is a source station address, and the source station address belongs to an IPV4 or IPV6 address, the source return component can preferentially select an IPV6 type source station address as the source station address of the next hop. This enables the source return component to support the source return national secret capability.
[0062] After determining the next hop address corresponding to the identification information of the target resource, the source return component can generate a source return request for the target resource according to the processed source return instruction; and send the source return request to the next hop address to perform source return on the target resource. That is, the source return component can provide the processed source return instruction (which contains source return address information) to the next hop address in the source return link to inject the processed source return instruction into the source return link. It should be understood here that the source return request generated by the source return component for the target resource according to the processed source return instruction is mainly to adapt to the source return protocol supported in the source return link, such as the http protocol. The source return component can encapsulate the processed source return instruction and generate a source return request conforming to the source return protocol supported in the source return link. Details of this part will not be described too much.
[0063] Accordingly, in the embodiment, the source return component can call the routing table and introduce various optimization strategies to make decisions on the source return path based on the routing table, which makes the source return path more reasonable and effectively improves the source return efficiency, source return quality, and reduces the source return cost.
[0064] In the above or the following embodiments, with reference to Figure 4 The source return component provides a special source return processing module in the source return processing module library, that is, a programmable module. The programmable module can use an ES framework, which is not limited here.
[0065] In the embodiment, if the identification information corresponding to the target resource is associated with a programmable module, the source return component can obtain the customized source return processing logic configured by the user for the identification information corresponding to the target resource; and run the customized source return processing logic through the programmable module to process the source return instruction.
[0066] Among them, the user may have customized source return requirements for some specific identification information. For this, the user can write customized source return processing logic for the specified identification information (domain name, etc.) and associate the programmable module with the specified identification information in the module configuration table. In this way, the source return component can determine that the programmable module needs to be run for the specified identification information. By running the programmable module for the specified identification information, the source return component can load the customized source return processing logic of the specified identification information into the programmable module, so as to perform customized processing on the source return instruction corresponding to the target resource through the programmable module.
[0067] It should be emphasized here that the programmable module in the embodiment is also a general module provided by the source return component and can be used by all users. However, the programmable module can be used to run the customized source return processing logic written by the user for the specified identification information.
[0068] Accordingly, in the embodiment, by deploying the universal programmable module in the source return component, the source return component can support customized source return processing logic configured for the specified identification information, thereby meeting the customized source return requirement of the user for the specified identification information and improving the user experience.
[0069] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can also be executed by different devices as the execution subject. For example, the execution subject of steps 101 to 103 can be device A; for another example, the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and the like. In addition, in some of the processes described in the above embodiments and the accompanying drawings, a plurality of operations appearing in a specific order are included, but it should be clearly understood that these operations can be executed or executed in parallel without the order in which they appear in this text. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and the operations can be executed in sequence or in parallel.
[0070] Figure 5 A structural schematic diagram of a CDN node is provided for another exemplary embodiment of the present application. As shown in the figure, the CDN node can include a cache component 50 and a source return component 51. Figure 5
[0071] The cache component 50 is configured to initiate a source return instruction to the source return component 51 in the case of determining that the target resource does not exist locally, and the identification information corresponding to the target resource is included in the source return instruction.
[0072] The source return component 51 is configured to find at least one source return processing module associated with the identification information in the source return processing module library, process the source return instruction according to the at least one source return processing module, and perform source return on the target resource according to the processed source return instruction.
[0073] In an optional embodiment, the source return component 51 can be configured to:
[0074] In the case of finding multiple source return processing modules, the multiple source return processing modules are sorted;
[0075] The multiple source return processing modules are sequentially executed to process the source return instruction.
[0076] In an optional embodiment, the source return processing module library includes one or more modules of the performance optimization type, the source return rewriting type, the source return security type, the source station selection type, and the source station switching type.
[0077] In an optional embodiment, the CDN node can further comprise a management component 52, and the source retrieval component 51 can be configured to:
[0078] invoke a module configuration table from the management component 52, the module configuration table comprising an association between the identification information and the source retrieval processing module;
[0079] query, in the module configuration table, at least one source retrieval processing module associated with the identification information corresponding to the target resource.
[0080] In an optional embodiment, the source retrieval component 51 can be further configured to:
[0081] determine a next hop address for the identification information corresponding to the target resource;
[0082] In an optional embodiment, the source retrieval component 51 can be further configured to:
[0083] generate a source retrieval request for the target resource according to the processed source retrieval instruction;
[0084] send the source retrieval request to the next hop address to retrieve the target resource.
[0085] In an optional embodiment, the CDN node can further comprise a dispatch component 53, and the source retrieval component 51 can be configured to:
[0086] invoke a routing table from the dispatch component 53, the routing table comprising an association between the identification information and the next hop address;
[0087] query, in the routing table, at least one next hop address associated with the identification information corresponding to the target resource;
[0088] select, according to a preset path selection policy, the next hop address for the identification information corresponding to the target resource from the at least one next hop address found.
[0089] In an optional embodiment, the path selection policy comprises a quality priority policy or a cost priority policy.
[0090] In an optional embodiment, the source retrieval component 51 can be further configured to:
[0091] if the at least one next hop address found is all source station addresses, select a source station address of the next hop for the identification information corresponding to the target resource in a smooth load balancing manner.
[0092] In an optional embodiment, the source return component 51 can be configured to:
[0093] If all the at least one next hop address is an internal node address in the CDN, a consistent hashing algorithm is used to select a next hop address for the identification information corresponding to the target resource from the at least one next hop address.
[0094] In an optional embodiment, the source return component 51 can be configured to:
[0095] If the at least one source return processing module contains a programmable module, the customized source return processing logic configured by the user for the identification information corresponding to the target resource is obtained;
[0096] The customized source return processing logic is run through the programmable module to process the source return instruction.
[0097] In an optional embodiment, the source return component 51 can be further configured to:
[0098] Receive a source return response for the target resource, the source return response containing the identification information corresponding to the target resource;
[0099] From the at least one source return processing module associated with the identification information, at least one target source return processing module for the source return response is found;
[0100] The at least one target source return processing module is run to process the source return response;
[0101] The processed source return response is provided to the cache component 50, so that the cache component 50 completes the source return for the target resource.
[0102] In an optional embodiment, the script of the source return processing module is written in lua language, the lua script is run in a lua virtual environment in a coroutine mode, and the working logic of the source return component 51 is written in a language compatible with the cache component 50.
[0103] Further, Figure 5 The CDN node is only schematically shown with some components, and does not mean that the CDN node only includes Figure 5 The components shown.
[0104] It should be noted that the above technical details about the embodiments of the CDN node can refer to the related description of the foregoing method embodiments, and will not be repeated here to save space, but this should not cause the loss of the protection scope of the present application.
[0105] Correspondingly, the embodiment of the present application further provides a computer readable storage medium storing a computer program, the computer program being executed to implement each step that can be executed by the CDN node in the method embodiment.
[0106] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. In addition, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0107] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0108] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0110] In a typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memories.
[0111] Memory can include non-persistent memory, such as volatile random access memory (RAM) and / or non-volatile memory, such as read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory, or the like, in computer readable medium. Memory is an example of computer readable storage medium.
[0112] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable medium does not include transitory media, such as modulated data signals and carrier waves.
[0113] It should also be noted that the terms "comprising", "containing", or any other similar term are intended to encompass non-exclusive inclusions, such that a process, method, article, or apparatus that comprises a list of elements does not include those elements solely, but can also include other elements not expressly listed, or also include elements inherent in such process, method, article, or apparatus. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus including the element.
[0114] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application shall be included in the scope of the application.
Claims
1. A CDN source retrieval method, applicable to a CDN node, wherein the CDN node is equipped with a cache component and a source retrieval component, and the method comprises: initiating a source retrieval instruction to the source retrieval component when it is determined by the cache component that a target resource does not exist locally, wherein the source retrieval instruction contains identification information corresponding to the target resource; searching, by the source retrieval component, at least one source retrieval processing module associated with the identification information in a source retrieval processing module library, wherein the at least one source retrieval processing module is adapted to source retrieval requirements of the CDN node for the target resource; sequentially running, by the source retrieval component, the at least one source retrieval processing module to process the source retrieval instruction, wherein the processed source retrieval instruction has met the source retrieval requirements; and performing, by the source retrieval component, source retrieval on the target resource according to the processed source retrieval instruction. 2.The method of claim 1, wherein the processing of the source retrieval instruction by the source retrieval component according to the at least one source retrieval processing module comprises: sorting a plurality of source retrieval processing modules when the plurality of source retrieval processing modules are found; and sequentially running, by the source retrieval component, the plurality of source retrieval processing modules to process the source retrieval instruction. 3.The method of claim 1 or 2, wherein the source retrieval processing module library comprises one or more of a performance optimization module, a source retrieval rewriting module, a source retrieval security module, a source station selection module and a source station switching module, and the source retrieval processing module library is provided by the source retrieval component. 4.The method of claim 1, wherein the searching, by the source retrieval component, of the at least one source retrieval processing module associated with the identification information in the source retrieval processing module library comprises: calling, by the source retrieval component, a module configuration table, wherein the module configuration table contains an association relationship between identification information and source retrieval processing modules; and querying, by the source retrieval component, at least one source retrieval processing module associated with the identification information corresponding to the target resource in the module configuration table. 5.The method of claim 1, further comprising: determining, by the source retrieval component, a next hop address for the identification information corresponding to the target resource; and wherein the performing, by the source retrieval component, of source retrieval on the target resource according to the processed source retrieval instruction comprises: generating, by the source retrieval component, a source retrieval request for the target resource according to the processed source retrieval instruction; and sending the source retrieval request to the next hop address to perform source retrieval on the target resource. 6.The method of claim 5, wherein the determining, by the source retrieval component, of the next hop address for the identification information corresponding to the target resource comprises: calling, by the source retrieval component, a routing table, wherein the routing table contains an association relationship between identification information and next hop addresses; querying, by the source retrieval component, at least one next hop address associated with the identification information corresponding to the target resource in the routing table; and selecting, by the source retrieval component, the next hop address for the identification information corresponding to the target resource from the at least one found next hop address according to a preset path selection strategy. 7. The method of claim 6, wherein the path selection policy comprises a quality first policy or a cost first policy.
8. The method of claim 6, wherein selecting a next hop address for the identification information corresponding to the target resource comprises: if all the at least one next hop address is a source station address, selecting a next hop source station address for the identification information corresponding to the target resource by the source returning component in a smooth load balancing manner.
9. The method of claim 6, wherein selecting a next hop address for the identification information corresponding to the target resource comprises: if all the at least one next hop address is an internal node address in the CDN, selecting a next hop address for the identification information corresponding to the target resource from the at least one next hop address found by the source returning component using a consistent hashing algorithm.
10. The method of claim 1, wherein processing the source returning instruction by the source returning component according to the at least one source returning processing module comprises: if the at least one source returning processing module comprises a programmable module, obtaining a customized source returning processing logic configured by a user for the identification information corresponding to the target resource by the source returning component; and running the customized source returning processing logic by the programmable module in the source returning component to process the source returning instruction.
11. The method of claim 1, further comprising: receiving a source returning response for the target resource by the source returning component, wherein the source returning response comprises the identification information corresponding to the target resource; finding at least one target source returning processing module for the source returning response from the at least one source returning processing module associated with the identification information by the source returning component; running the at least one target source returning processing module in the source returning component to process the source returning response; and providing the processed source returning response to the cache component for the cache component to complete the source returning for the target resource.
12. The method of claim 1, wherein a script of the source returning processing module is written in a lua language, the lua script is run in a coroutine manner in a lua virtual environment, and a working logic of the source returning component is written in a language compatible with the cache component.
13. A CDN node, wherein the CDN node is equipped with a cache component and a source returning component; the cache component is configured to initiate a source returning instruction to the source returning component if it is determined that a target resource does not exist locally, wherein the source returning instruction comprises identification information corresponding to the target resource; the processed source returning instruction has met the source returning requirement; and the target resource is subjected to source returning according to the processed source returning instruction.
14. A computer readable storage medium storing computer instructions, which when executed by one or more processors, cause the one or more processors to perform the CDN source returning method of any one of claims 1-12. The back source component is configured to search, in a back source processing module library, at least one back source processing module associated with the identification information, the at least one back source processing module being adapted to a back source requirement of the CDN node for the target resource; and sequentially operate the at least one back source processing module to process the back source instruction, wherein,
Citation Information
Patent Citations
CDN back-to-source method and system and computer equipment
CN112422702A
Network system, back-to-source disaster recovery method and equipment
CN113596079A