Back-to-source configuration method and apparatus, computer device, and storage medium

By generating origin scheduling configurations based on origin domain group configuration information and link detection results independent of rule codes, the problem of difficult management of origin domains in content delivery networks is solved, and reliable distribution of origin configurations and efficient link selection are achieved.

CN123185070APending Publication Date: 2026-11-27BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611545497.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing content delivery networks, it is difficult to reliably obtain the origin server domain name through origin configuration management, and the configuration coverage and link selection are unreasonable, resulting in complex configuration generation and high maintenance costs.

Method used

By using origin domain group configuration information independent of the target rule code, and combining it with link detection results, origin scheduling configuration is generated and distributed to content delivery network nodes through an independent channel, ensuring the independence and reliability of origin domain and link selection.

Benefits of technology

This reduces the impact of rule code changes on back-to-source scheduling configuration, reduces configuration overwrite risk, and improves the reliability and efficiency of link selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185070A_ABST
    Figure CN123185070A_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a back-to-source configuration method and device, computer equipment and a storage medium. The method comprises: obtaining back-to-source domain name group configuration information corresponding to a target service domain name and target rule code, establishing a mapping relationship between the target service domain name and the back-to-source domain name group configuration information; obtaining a link detection result of a candidate back-to-source link corresponding to each source station domain name, and determining a target back-to-source link corresponding to each source station domain name according to the link detection result; associating the target service domain name, each source station domain name and the target back-to-source link corresponding to the source station domain name according to the mapping relationship, and generating a back-to-source scheduling configuration; and respectively delivering the back-to-source scheduling configuration and the target rule code to a target content distribution network node through mutually independent delivery channels. Thus, a scheduling configuration that can be called by a dynamic back-to-source interface can be generated without analyzing the business logic of the target rule code, and the possibility of configuration mutual coverage and unreasonable back-to-source link selection is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of content delivery network technology, and in particular to a back-to-origin configuration method, apparatus, computer equipment, and storage medium. Background Technology

[0002] A Content Delivery Network (CDN) reduces the transmission distance required for users to access content by distributing it to network nodes closer to them. Real-world business scenarios typically include both static content such as images, style sheets, and scripts, and dynamic content such as API data, real-time pages, and interactive results. Static content is suitable for direct caching by CDN nodes, while dynamic content usually requires accessing the origin server and optimizing the back-to-origin link. Therefore, CDNs need to employ appropriate caching or dynamic back-to-origin processing methods for different requests.

[0003] Programmable content delivery networks (CDNs) allow business users to write rule code to customize processing logic such as request rewriting, access control, caching control, and origin server selection. Existing programmable solutions typically write information such as the origin server address, origin server host field, protocol, and port directly into the rule code. Since the rule code may dynamically generate the origin server address through conditional branches, string concatenation, or variable references, it is difficult for the configuration management side to reliably obtain the origin server domain name required to generate dynamic acceleration scheduling configurations. Furthermore, fully parsing the business semantics of the rule code would increase implementation complexity and maintenance costs.

[0004] Meanwhile, standard content delivery network (CDN) console configurations and programmable rule codes may generate origin pull configurations for the same service domain. If both types of configurations use the same configuration path or the same distribution process, configuration overwriting is likely to occur. Even if the origin domain can be obtained, if routing is not performed in conjunction with the real-time status and latency of candidate origin pull links, an unavailable or high-latency link may be selected. Therefore, how to generate origin pull scheduling configurations that can be invoked by rule codes without relying on business semantic parsing of the rule codes, and how to reliably distribute and activate these configurations, is a technical problem that needs to be solved. Summary of the Invention

[0005] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, embodiments of the present invention provide a source configuration method, apparatus, computer equipment and storage medium.

[0006] In a first aspect, embodiments of the present invention provide a back-to-origin configuration method, including: Obtain the origin domain group configuration information and target rule code corresponding to the target service domain name, and establish a mapping relationship between the target service domain name and the origin domain group configuration information. The origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. Obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name. Based on the link detection results, determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links. The link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin links. Based on the mapping relationship, the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name are associated to generate the back-to-origin scheduling configuration; Through independent distribution channels, the back-to-origin scheduling configuration and target rule code are distributed to the target content distribution network nodes respectively. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

[0007] In one possible implementation, at least one origin domain name includes a primary origin domain name and an optional backup origin domain name; before obtaining the link detection results, the method further includes: Retrieve the primary origin domain and optional backup origin domain carried in the interface parameters of the dynamic origin pull interface; Perform consistency checks between the primary source domain name and the backup source domain name carried in the interface parameters and the primary source domain name and the backup source domain name in the origin domain name group configuration information. If the consistency check passes, continue generating the back-to-source scheduling configuration; otherwise, stop generating the back-to-source scheduling configuration.

[0008] In one possible implementation, based on the link detection results, the target back-to-origin link corresponding to each origin domain name is determined from multiple candidate back-to-origin links, including: Obtain link latency and link status from the link detection results; From multiple candidate source links, determine the candidate source links whose link status is available; The candidate back-to-source link with the minimum link latency is selected from the available candidate back-to-source links and used as the target back-to-source link.

[0009] In one possible implementation, generating the back-to-source scheduling configuration includes: Based on the mapping relationship, the target service domain name, the main source domain name, and the target back-to-origin link corresponding to the main source domain name are associated to generate the main source back-to-origin scheduling configuration; When the back-to-origin domain group configuration information includes the backup domain, the target service domain, the backup domain, and the target back-to-origin link corresponding to the backup domain are associated to generate the backup back-to-origin scheduling configuration; Based on the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration, a back-to-source scheduling configuration is generated, and the switching rules between the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration are set.

[0010] In one possible implementation, the origin scheduling configuration and target rule code are distributed to the target content distribution network nodes through independent distribution channels, including: Determine the first storage path in the target content distribution network node for storing the back-to-origin scheduling configuration, and the second storage path for storing the target rule code; The origin scheduling configuration is distributed and stored in the first storage path of the target content distribution network node through the first distribution channel, and the target rule code is distributed and stored in the second storage path of the target content distribution network node through the second distribution channel. When executing the target rule code and calling the dynamic origin interface, based on the target service domain name corresponding to the current request and the origin domain name carried in the interface parameters of the dynamic origin interface, the matching origin scheduling configuration is searched from the first storage path, and the found origin scheduling configuration is determined as the origin scheduling configuration for the dynamic origin interface call.

[0011] In one possible implementation, the method further includes, when invoking the dynamic origin interface: Get the status of site-wide acceleration enabled for the target service domain; When the "Site-wide acceleration is enabled" status indicates that site-wide acceleration is enabled, the dynamic origin server interface is allowed to load the found origin server scheduling configuration; when the "Site-wide acceleration is disabled" status indicates that site-wide acceleration is not enabled, the dynamic origin server interface is stopped from being called, and origin server processing is performed according to the origin server information set for the target service domain name in the console. When dynamic origin interface loading of origin scheduling configuration is allowed, and the target content delivery network node also stores standard origin scheduling configuration, the origin scheduling configuration is merged with the standard origin scheduling configuration. The standard origin scheduling configuration is a configuration generated based on the origin information set for the target service domain name in the console. When both the origin routing configuration and the standard origin routing configuration contain the target service domain name, the origin routing configuration shall be used first for origin routing processing.

[0012] In one possible implementation, after performing origin pull processing via the dynamic origin pull interface, the method further includes: Obtain the response information returned by the origin server; Obtain cache control information from the response header of the origin server's response information, and determine whether the origin server's response information is allowed to be cached on the target content distribution network node based on the cache control information; If the origin server's response information is allowed to be cached on the target content distribution network node, the current request processing method is changed from dynamic origin server processing to static caching processing, and the origin server's response information is cached; otherwise, the current request's dynamic origin server processing method is maintained.

[0013] Secondly, embodiments of the present invention provide a source-back configuration device, comprising: A module is established to obtain the back-to-origin domain group configuration information and target rule code corresponding to the target service domain name, and to establish a mapping relationship between the target service domain name and the back-to-origin domain group configuration information. The back-to-origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. The determination module is used to obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name, and to determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links based on the link detection results. The link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin link. The generation module is used to associate the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name according to the mapping relationship, and generate the back-to-origin scheduling configuration. The distribution module is used to distribute the back-to-origin scheduling configuration and target rule code to the target content distribution network nodes through independent distribution channels. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

[0014] Thirdly, embodiments of the present invention provide a computer device, including: a processor and a memory, wherein the processor is configured to execute a program stored in the memory to implement the back-to-source configuration method of any of the first aspects described above.

[0015] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the back-to-source configuration method of any of the first aspects described above.

[0016] This application's embodiment separates the origin server domain name from the target rule code in the form of origin domain name group configuration information. This allows the configuration generation side to directly obtain the origin server domain name based on the mapping relationship between the target service domain name and the origin domain name group configuration information. Then, it combines the link detection results of candidate origin links to generate an origin scheduling configuration, which is then distributed to the target content delivery network nodes through a distribution channel independent of the target rule code. Therefore, an executable association between the dynamic origin interface and the origin scheduling configuration can be established without parsing the business logic of the target rule code, reducing the impact of code changes on the generation of the origin scheduling configuration and mitigating the risk of different origin scheduling configurations overwriting each other. Attached Figure Description

[0017] Figure 1 A flowchart illustrating a back-to-source configuration method provided in an embodiment of this application; Figure 2 A structural diagram of a source return configuration device provided in an embodiment of this application; Figure 3 This is a structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] The origin-pull configuration method provided in this application is used for origin-pull configuration generation, link selection, configuration distribution, and node-side invocation in a programmable content delivery network. It declaratively manages the origin domain group configuration information, enabling the origin-pull scheduling configuration and target rule code to be maintained separately. It selects a target origin-pull link for each origin domain based on link detection results. Then, it searches for the corresponding configuration in the target content delivery network node based on the current request and the interface parameters of the dynamic origin-pull interface, thus forming a closed loop from configuration generation to node execution.

[0020] A programmable content delivery network (CDN) refers to a content delivery network that allows business users to customize request processing logic through rule code. The target rule code can be written in a lightweight scripting language (Lua) and can run on a high-performance web server (Engine X Web Server, Nginx) or an open web application platform (OpenResty Web Platform, OpenResty). The dynamic origin pull interface can be a function interface pre-encapsulated by the system and exposed to the target rule code, for example, an interface identified by the code origin.dynamic_origin(). This code identifier is only used to describe one form of interface implementation and does not constitute a limitation on the interface name or programming language.

[0021] Static and dynamic request separation refers to classifying requests into static requests suitable for node caching and dynamic requests requiring access to the origin server, and then handling them separately using static caching and dynamic origin server requests. Dynamic origin server requests can include link detection routing, intelligent origin server requests, and transmission optimization. Response-driven reclassification refers to modifying the processing method of the current request based on the cache control information in the response header after the origin server returns a response, so that requests with cacheable responses are transferred to static caching processing.

[0022] In terms of logical architecture, a programmable content delivery network (CDN) system can include configuration management, configuration distribution, link detection, and node execution functions. The configuration management function manages the target service domain name, origin domain name group configuration information, target rule codes, and the site-wide acceleration activation status. The configuration distribution function sends the origin scheduling configuration and target rule codes through independent distribution channels. The link detection function probes candidate origin links and provides the probe results. The node execution function stores and loads the configuration, executes the target rule codes, and completes origin and caching processing. These functions can be deployed on a single computer device or distributed across multiple communicating computer devices. Regardless of whether a centralized or distributed deployment is used, the aforementioned functions constitute the same programmable content delivery network system, and the execution entity for each method step in this application remains this programmable content delivery network system.

[0023] Figure 1 This is a flowchart illustrating a back-to-source configuration method provided in an embodiment of this application. Figure 1 As shown, the specific implementation steps of the origin-based configuration method are as follows: Step S101: Obtain the origin domain group configuration information and target rule code corresponding to the target service domain name, and establish a mapping relationship between the target service domain name and the origin domain group configuration information.

[0024] This application's embodiments can be applied to scenarios such as webpage acceleration, file download, audio and video distribution, application programming interface (API) access, and full-site acceleration that includes both dynamic and static content. The execution entity of the origin-following configuration method can be the aforementioned programmable content delivery network (CDN) system. Different functions within this system can exchange data via messages, API calls, or configuration files.

[0025] Among them, the target service domain name is the business domain name that provides content delivery network acceleration services to the client; the origin domain group configuration information is a structured configuration data that is stored separately from the target rule code and is used to declare at least one origin domain name; the origin domain name is the domain name of the origin server accessed when the target content delivery network node misses the cache or needs to obtain dynamic content; the target rule code is the program code associated with the target service domain name and used to customize the request processing logic; the mapping relationship is used to represent the correspondence between a target service domain name and the origin domain group configuration information it adopts.

[0026] The system receives origin domain group configuration information submitted by business users for the target service domain through the configuration management interface and assigns group identifiers. The system also receives or reads the target rule code bound to the target service domain, associating and saving the target service domain identifier with the group identifier to establish a mapping relationship. The origin domain group configuration information and the target rule code can be stored in different database tables, different configuration objects, or different version repositories, and both can be updated separately. The target rule code does not need to contain the complete origin server configuration used to generate the link scheduling policy.

[0027] For example, the target service domain name could be service.example.com. The system stores the origin domain name group configuration information, including the origin domain name origin.example.com, and associates service.example.com with the corresponding group identifier. The target rule code only triggers the origin pull through the dynamic origin pull interface, and the origin domain name used to generate the scheduling configuration is provided by the origin domain name group configuration information. Therefore, the system can obtain the origin domain name without analyzing conditional branches, string concatenation, or variable references in the target rule code.

[0028] Step S102: Obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name, and determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links based on the link detection results.

[0029] Among them, the candidate back-to-origin link is the optional network transmission path from the target content delivery network node or the corresponding probe node to the origin domain name. Different candidate back-to-origin links can correspond to different exits, different relay nodes, different line operators, or different link combinations. The link probe result is the data obtained after performing connection probe, data transmission probe, or reachability probe on the candidate back-to-origin link, which is used to characterize the link latency and link status of the corresponding candidate back-to-origin link. The target back-to-origin link is the link selected from multiple candidate back-to-origin links corresponding to the same origin domain name, and is used to generate the back-to-origin scheduling configuration.

[0030] The link probing function periodically sends probing requests based on the origin server domain name and candidate back-to-origin link identifiers, records the time required to establish a connection and receive a response, and determines the link status based on whether continuous probing has been successful. When generating the back-to-origin scheduling configuration, the configuration management function reads the link probing results from the most recent valid probing period and determines the target back-to-origin link for each origin server domain name in the back-to-origin domain name group configuration information. Therefore, when the back-to-origin domain name group configuration information includes multiple origin server domain names, each origin server domain name has a target back-to-origin link corresponding to its own probing results.

[0031] For example, the origin domain name origin.example.com corresponds to candidate origin link A, candidate origin link B, and candidate origin link C. After the system performs link probing and obtains the link latency and link status of each of the three links, it can eliminate origin links with unavailable status and determine the target origin link with the lowest latency from the remaining origin links.

[0032] In other possible implementations, the method for determining the target backhaul link is not limited to selecting based on link status and link latency. The system can also determine the target backhaul link from multiple candidate backhaul links based on at least one of the following: preset link priority, available bandwidth, and stability records corresponding to each candidate backhaul link; or, it can comprehensively evaluate multiple candidate backhaul links based on at least two of the following: link latency, preset link priority, available bandwidth, and stability records, and determine the candidate backhaul link whose comprehensive evaluation results meet preset routing conditions as the target backhaul link. Therefore, appropriate link selection methods can be adopted according to different service scenarios, rather than being limited to selecting only the candidate backhaul link with the lowest link latency.

[0033] Step S103: Based on the mapping relationship, associate the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name to generate the back-to-origin scheduling configuration.

[0034] The origin routing configuration is a structured configuration used to describe the correspondence between the target service domain name, the origin domain name, and the target origin routing link. The origin routing configuration must at least enable the target content delivery network node to locate the corresponding target origin routing link based on the target service domain name and the origin domain name. The target origin routing link can be represented in the configuration by a link identifier, or further by the target Internet Protocol address, line identifier, next-hop node, or link parameters.

[0035] The system iterates through the configuration information of the origin domain group mapped to the target service domain. For each origin domain, it reads the target origin link determined in step S102 and uses the target service domain plus the origin domain as a configuration index to write the corresponding target origin link into the same origin scheduling configuration. The origin scheduling configuration may also include execution parameters such as the origin host field, link cost, link weight, and time to live (TTL) to guide nodes in establishing origin connections without changing the basic relationship between the target service domain, the origin domain, and the target origin link.

[0036] For example, the system can generate a configuration record indexed by service.example.com and origin.example.com, with candidate origin link B as the target origin link. When the target content delivery network node subsequently receives a request corresponding to service.example.com and specifies origin.example.com through the dynamic origin interface, it can match this configuration record.

[0037] Step S104: Through independent distribution channels, the back-to-source scheduling configuration and target rule code are distributed to the target content distribution network nodes respectively.

[0038] Among them, the mutually independent distribution channels refer to the fact that the back-to-origin scheduling configuration and the target rule code have independent distribution tasks, transmission objects and version control processes, and the generation, update or distribution failure of one type of object does not directly overwrite the other type of object; the target content distribution network node is an edge node used to receive client requests and perform caching processing or back-to-origin processing; the dynamic back-to-origin interface is a standardized function interface in the target rule code used to request the system to load and use the back-to-origin scheduling configuration.

[0039] The configuration distribution function establishes a first distribution task and a second distribution task based on the node range corresponding to the target service domain name. The origin-pull scheduling configuration is used as the transmission object for the first distribution task, and the target rule code is used as the transmission object for the second distribution task. Version numbers, checksums, and distribution status are recorded for each task. The target content distribution network node receives both types of objects. When executing the target rule code and triggering the dynamic origin-pull interface, it then looks up the corresponding origin-pull scheduling configuration based on the current request and interface parameters. Both types of objects are distributed to the same target content distribution network node but use independent channels, thus balancing code execution and scheduling configuration invocation.

[0040] As described above, this embodiment utilizes independently stored origin domain name group configuration information to directly provide the origin domain name to the configuration generation process, and generates an origin scheduling configuration based on link detection results. The origin scheduling configuration and target rule code are then distributed to the target content distribution network nodes. This solves the problem of difficulty in obtaining the origin domain name on the configuration generation side due to embedding origin information into rule code, and reduces the impact of rule code changes, configuration overriding, and unreasonable link selection on dynamic origin processing.

[0041] In one possible implementation, a specific process for dynamic source interface parameter consistency verification is described: Step S201: Obtain the primary source domain name and optional backup source domain name carried in the interface parameters of the dynamic origin interface.

[0042] Among them, the primary source domain is the origin domain that is given priority for back to the origin under normal circumstances; the backup source domain is the origin domain that can be switched when the back to the origin corresponding to the primary source domain is unavailable or does not meet the back to the origin conditions, and the backup source domain is optional configuration; the interface parameters are the structured parameters passed to the interface when the target rule code calls the dynamic back to the origin interface.

[0043] The dynamic origin pull interface specifies that the primary origin domain name parameter is mandatory, while the backup origin domain name parameter is optional. When the target rule code is submitted, the system can simultaneously save the structured parameters corresponding to the dynamic origin pull interface call; or, when the target rule code enters the controlled loading process, it can only read the parameters from the standardized interface call location without analyzing other business logic of the target rule code. The system obtains the primary origin domain name from the interface parameters; when the interface parameters include a backup origin domain name field and the field value is not empty, it further obtains the backup origin domain name.

[0044] For example, the interface parameters of a dynamic origin pull API can include the primary origin domain name `origin-a.example.com` and the backup origin domain name `origin-b.example.com`. If the business logic does not configure a backup origin, the interface parameters will only carry the primary origin domain name. By restricting the interface parameters to standardized, structured, and readable fields, the complete parsing of common code semantics such as conditional branches and variable operations can be avoided.

[0045] Step S202: Perform consistency verification between the primary source domain name and the backup source domain name carried in the interface parameters and the primary source domain name and the backup source domain name in the back-to-origin domain name group configuration information.

[0046] The consistency check is used to confirm that the origin domain name requested by the target rule code belongs to the origin domain group already declared by the target service domain name, thus preventing the target rule code from calling origin domain names that are not included in the link detection and scheduling configuration generation scope by the configuration management side. Consistency can be obtained by comparing characters after the domain name has been normalized, the last dot has been processed, and the internationalized domain name encoding has been unified, or it can be compared using pre-assigned origin identifiers.

[0047] The system first verifies whether the primary source domain name in the interface parameters is the same as the primary source domain name in the origin domain group configuration information. When both the interface parameters and the origin domain group configuration information include a backup source domain name, it then verifies whether the two backup source domain names are the same. If neither includes a backup source domain name, the backup source domain name verification is considered successful. If only one side includes a backup source domain name, or if the backup source domain names included by both sides are different, the backup source domain name verification is determined to fail. This can cover configuration scenarios with and without backup sources.

[0048] Step S203: If the consistency check passes, continue to obtain the link probe results and generate the back-to-source scheduling configuration; if the consistency check fails, stop generating the back-to-source scheduling configuration.

[0049] When the primary source domain name verification passes, and the backup source domain name verification also passes if one exists, the system marks the origin domain name group configuration information as verified and continues to execute steps S102 and S103. When any verification fails, the system does not initiate or read link probe results for inconsistent origin domain names, nor does it generate corresponding origin scheduling configurations. Instead, it outputs the target service domain name, interface parameter values, group configuration values, and inconsistent fields for business users to modify.

[0050] As can be seen from the above, this embodiment ensures that the dynamic origin interface parameters are consistent with the declaratively managed origin domain group configuration information, thereby guaranteeing that subsequent link detection, configuration generation, and node invocation revolve around the same group of origin domains, reducing the possibility that the origin domain of the interface request does not have a corresponding origin scheduling configuration.

[0051] In one possible implementation, a specific process for determining the target back-to-source link based on link detection results is described: Step S301: Obtain the link delay and link status from the link detection results.

[0052] Link latency is used to characterize the time required to establish a connection with the corresponding origin domain name, send probe data and obtain a response via the candidate back-to-origin link; link status is used to characterize whether the candidate back-to-origin link is currently available for back-to-origin, including at least available and unavailable states.

[0053] The link probing function performs multiple probes on each candidate backhaul link within a preset probing period, determining the link latency as the average, median, or preset percentile value of the successfully probed samples. When a candidate backhaul link reaches at least the preset number of successful probes within the current probing period, and the most recent or multiple consecutive probes do not time out, its link status is set to available. When a connection fails, a response times out, or the number of consecutive failures reaches a threshold, its link status is set to unavailable. The configuration generates the latest valid link probing results with timestamps to reduce the possibility of using expired results.

[0054] Step S302: Determine the candidate back-to-source links whose link status is available from multiple candidate back-to-source links.

[0055] The system groups the link detection results according to the origin server domain name, and excludes candidate back-to-origin links in each group that are unavailable, have expired detection results, or lack valid latency values, forming a set of available candidate links. This filtering first ensures that the links can handle back-to-origin requests, and then compares the latency to avoid selecting currently unavailable links simply because they have low historical latency.

[0056] Step S303: Determine the candidate back-to-source link with the minimum link latency from the available candidate back-to-source links as the target back-to-source link.

[0057] The system sorts the available candidate links in ascending order according to link latency and determines the top-ranked candidate back-to-source link as the target back-to-source link. When two or more links have the same latency, one of them can be further determined according to preset link priority, available bandwidth, or stability records. Further comparison is only used to handle cases with the same latency and does not change the basic process of first screening available status and then comparing link latency.

[0058] For example, the detection results of three candidate back-to-source links are as follows: Link A is available with a latency of 30 milliseconds, Link B is unavailable with a historical latency of 10 milliseconds, and Link C is available with a latency of 20 milliseconds. The system first excludes Link B, and then selects Link C, which has the lower latency, as the target back-to-source link between Link A and Link C.

[0059] As can be seen from the above, this embodiment first ensures the availability of the target back-to-source link based on the link status, and then selects from the available links based on the link latency. This can reduce the possibility of back-to-source failure and slow response caused by selecting unavailable links or high-latency links.

[0060] In one possible implementation, a specific process for generating primary / standby source return scheduling configuration and setting switchover rules is described: Step S401: Based on the mapping relationship, associate the target service domain name, the main source domain name, and the target back-to-origin link corresponding to the main source domain name to generate the main source back-to-origin scheduling configuration.

[0061] The primary source back-to-origin scheduling configuration is the part of the back-to-origin scheduling configuration that describes the relationship between the target service domain name, the primary source domain name, and the target back-to-origin link corresponding to the primary source domain name. This name is used to distinguish the configuration content corresponding to the primary source from the configuration content corresponding to the optional backup source, and does not indicate that it belongs to a different type of data from the back-to-origin scheduling configuration in step S103.

[0062] The system forms a primary source configuration index using the target service domain name and the primary source domain name, writes the target back-to-origin link corresponding to the primary source domain name determined in step S303 into the configuration record, and marks the origin server role of the configuration record as primary source. The primary source back-to-origin scheduling configuration may also include a back-to-origin host field, link cost, weight, and validity period, so that the target content distribution network nodes can establish back-to-origin connections.

[0063] Step S402: When the back-to-origin domain group configuration information includes the backup domain, associate the target service domain, the backup domain, and the target back-to-origin link corresponding to the backup domain to generate the backup back-to-origin scheduling configuration.

[0064] The backup source back-to-origin scheduling configuration is an optional configuration part of the back-to-origin scheduling configuration, used to describe the relationship between the target service domain name, the backup source domain name, and the target back-to-origin link corresponding to the backup source domain name. The system only generates the backup source back-to-origin scheduling configuration when the back-to-origin domain name group configuration information includes the backup source domain name and the corresponding target back-to-origin link has been determined in step S303.

[0065] The system first checks if the backup source domain name field in the origin domain name group configuration information exists and is valid. If it exists, a backup source configuration record is generated in the same way as the primary source, and the origin server role is marked as a backup source; if it does not exist, the backup source configuration generation is skipped, and no empty backup source origin scheduling configuration is generated.

[0066] Step S403: Generate a back-to-source scheduling configuration based on the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration, and set the switching rules between the two.

[0067] The switching rules are written into the back-to-source scheduling configuration and describe the triggering conditions and switching targets for switching from the primary source target back-to-source link to the backup source target back-to-source link. The triggering conditions can be that the primary source target back-to-source link becomes unavailable, the number of consecutive connection failures reaches a threshold, or no response is received from the source station within a preset time; the switching target is the target back-to-source link associated with the backup source back-to-source scheduling configuration.

[0068] When a backup source back-to-origin scheduling configuration has been generated, the system writes the primary source configuration record and the backup source configuration record into the same back-to-origin scheduling configuration. The system sets the normal execution priority of the primary source configuration record to be higher than that of the backup source configuration record and includes a switchover rule for redirecting to the backup source when the primary source becomes unavailable. When no backup source back-to-origin scheduling configuration has been generated, the system only uses the primary source back-to-origin scheduling configuration to form the back-to-origin scheduling configuration, without setting a switchover target from the primary source to the backup source. Furthermore, the handling method after a switchover failure can be set to enter the standard back-to-origin mode. This maintains the selectability of the backup source domain name while avoiding referencing a non-existent backup source configuration when no backup source exists.

[0069] For example, the primary source domain for service.example.com is origin-a.example.com, and the backup source domain is origin-b.example.com. The system associates the target back-to-origin links for both and includes a rule in the configuration to switch to the backup source link when the primary source link fails a preset number of consecutive connections. Nodes normally use the primary source link; switching only occurs when the trigger condition is met.

[0070] As can be seen from the above, this embodiment retains both the primary source priority relationship and the optional backup source switching relationship in the back-to-source scheduling configuration, enabling the target content distribution network node to switch to the backup source link according to the issued configuration when the primary source link is abnormal, thereby improving the continuity of back-to-source processing.

[0071] In one possible implementation, a specific process is described for isolating the source scheduling configuration and target rule code for distribution, storage, and lookup based on call parameters: Step S501: Determine the first storage path in the target content distribution network node for storing the back-to-source scheduling configuration, and the second storage path for storing the target rule code.

[0072] The first storage path is a file path, directory path, or logical configuration space within the target content distribution network node specifically used to store the origin scheduling configuration that can be queried by the dynamic origin interface. The second storage path is a file path, directory path, or code storage space within the same target content distribution network node specifically used to store the target rule code. The two paths are distinct, ensuring that configuration data and program code are stored separately.

[0073] The system pre-creates a first and second storage path according to the node initialization configuration. Before distribution, it reads the node type, operating system directory, and version directory to determine the actual path corresponding to this distribution. For example, the first storage path may correspond to the programmable origin-wait scheduling configuration file, and the second storage path may correspond to the rule code directory script / . The above path names are for illustrative purposes only; in practice, database keyspace, memory configuration area, or other storage locations that can distinguish between the two types of objects can be used.

[0074] Step S502: The origin scheduling configuration is distributed and stored in the first storage path of the target content distribution network node through the first distribution channel, and the target rule code is distributed and stored in the second storage path of the target content distribution network node through the second distribution channel.

[0075] In this system, the first distribution channel uses the origin scheduling configuration as the transmission object, while the second distribution channel uses the target rule code as the transmission object. Distribution and storage means that the system first transmits the object to the target content distribution network node through the corresponding channel, and then the node writes the received object to the corresponding storage path; therefore, this description simultaneously defines the transmission process and the result of the node writing the object to disk or writing it to the configuration space.

[0076] The first and second distribution channels maintain the distribution version, object verification value, and effectiveness status, respectively. After receiving the origin scheduling configuration, the target content distribution network node first performs format and integrity checks, then writes it to a temporary file and uses atomic replacement to make the new version in the first storage path effective. For target rule codes, the node saves the corresponding version in the second storage path according to the target service domain name or code identifier. If distribution fails in either channel, objects already effective in the other channel will not be overwritten.

[0077] Step S503: When executing the target rule code and calling the dynamic origin interface, based on the target service domain name corresponding to the current request and the origin domain name carried in the interface parameters, search for the matching origin scheduling configuration from the first storage path, and determine the found origin scheduling configuration as the origin scheduling configuration for the dynamic origin interface call.

[0078] Here, the current request is a client request that the target content distribution network node is processing and triggering the target rule code; the target service domain name corresponding to the current request can be obtained from the host field of the request or the domain name context that the node has already established; the origin domain name carried in the interface parameters is the primary origin domain name specified when the target rule code calls the dynamic origin interface or the backup origin domain name specified in the switching scenario; the matched origin scheduling configuration is a configuration record that contains the association relationship between the target service domain name and the origin domain name.

[0079] When generating the origin server scheduling configuration, the system uses a composite lookup key consisting of the target service domain name and the origin server domain name. When the target content delivery network node calls the dynamic origin server interface, it obtains the target service domain name from the request context and the origin server domain name from the interface parameters, uses the same normalization rule to form a composite lookup key, and searches for it in the configuration index loaded in the first storage path. If the lookup is successful, the corresponding configuration record and its target origin server link parameters are returned to the dynamic origin server interface; if the lookup fails, the system does not use the configuration of other target service domain names or other origin server domain names, and can proceed to error handling or the standard origin server process.

[0080] For example, the target service domain name of the current request is service.example.com, and the origin domain name in the dynamic origin pull interface parameters is origin-a.example.com. The node forms a composite lookup key and searches in the first storage path; only configuration records that simultaneously associate service.example.com, origin-a.example.com, and their target origin pull links are determined as the origin pull scheduling configuration for this interface call. Therefore, the call relationship between the dynamic origin pull interface and the origin pull scheduling configuration is established through a consistent composite lookup key, rather than solely based on storage paths or fuzzy domain name matching.

[0081] As can be seen from the above, this embodiment distributes and stores the origin scheduling configuration and target rule code in different paths of the same target content distribution network node, and then completes the accurate call through the composite search conditions composed of the target service domain name and the origin domain name, which can reduce the possibility of mutual overwriting of the two types of objects and incorrect configuration of dynamic origin interface calls.

[0082] In one possible implementation, a specific process for dynamic origin interface admission verification, configuration merging, and conflict prioritization is described: Step S601: Obtain the site-wide acceleration activation status corresponding to the target service domain name.

[0083] Among them, the full-site acceleration enabled status is used to characterize whether the target service domain name is allowed to use the static / dynamic separation and dynamic acceleration capabilities; the console is a configuration management interface for business users to manage the target service domain name, standard origin information, and function switches.

[0084] The configuration management function stores the site-wide acceleration switch at the target service domain level and distributes the switch status along with the domain's basic configuration to the target content delivery network nodes. When a node calls the dynamic origin pull interface, it reads the locally effective site-wide acceleration status based on the target service domain currently being requested; if the local status is missing or has expired, it can also query the configuration management function for the latest status.

[0085] Step S602: When the "Site-wide acceleration enabled" status indicates that site-wide acceleration is enabled, allow the dynamic origin-back interface to load the found origin-back scheduling configuration; when the "Site-wide acceleration enabled" status indicates that site-wide acceleration is not enabled, stop calling the dynamic origin-back interface and perform origin-back processing according to the origin-back information set for the target service domain name in the console.

[0086] The node determines whether to allow the dynamic origin pull interface to load the found origin pull scheduling configuration based on the overall site acceleration activation status. When the overall site acceleration activation status indicates that overall site acceleration is enabled, the node passes the admission verification, allows the dynamic origin pull interface to load the origin pull scheduling configuration found in step S503, and enters the dynamic origin pull process. When the overall site acceleration activation status indicates that overall site acceleration is not enabled, the node does not load the origin pull scheduling configuration, terminates the current dynamic origin pull interface call, and reads the standard origin pull information set for the target service domain name in the console, such as the origin pull address, origin pull host field, origin pull protocol, or origin pull port, and accesses the origin server according to the standard origin pull process.

[0087] The term "stop call" means that the link scheduling logic encapsulated in the dynamic origin pull interface will not continue to be executed; it does not mean that the current request will be terminated. The current request can still complete the standard origin pull through the origin pull information in the console, thereby avoiding the incorrect occupation of the dynamic link by the target service domain name that has not enabled dynamic acceleration capability.

[0088] Step S603: When the dynamic origin interface is allowed to load the origin scheduling configuration, and the target content delivery network node also stores the standard origin scheduling configuration, merge the origin scheduling configuration with the standard origin scheduling configuration.

[0089] The standard origin server scheduling configuration is generated and distributed based on the standard origin server information set for the target service domain name in the console. For example, the standard origin server scheduling configuration can be stored in a standard origin server configuration file, while the origin server scheduling configuration described in step S501 can be stored in a dynamic origin server configuration file. Configuration merging refers to the node loading two types of configuration records into the same queryable and valid configuration set, rather than requiring the two source files to be rewritten into one file.

[0090] The nodes parse both the standard origin-pull scheduling configuration and the origin-pull scheduling configuration issued in step S502, and construct a valid configuration mapping table based on the target service domain name. The nodes can either write the standard origin-pull scheduling configuration into the mapping table first, and then write the origin-pull scheduling configuration; or they can save the configuration source and priority for each configuration record, selecting the appropriate option based on priority during a query. Both methods allow configurations from two independent paths to be queried uniformly on the node side, while maintaining the isolation between the source files and the distribution channels.

[0091] Step S604: When both the origin routing configuration and the standard origin routing configuration contain the target service domain name, the origin routing configuration shall be used first for origin routing processing.

[0092] Both configurations include a target service domain name, indicating that both types of configurations contain a configuration record applicable to the target service domain name of the current request. Prioritizing the use of the origin-back scheduling configuration means that when two types of configurations for the same target service domain name conflict, the origin-back scheduling configuration generated by the origin domain name group configuration information and link probe results is used. The standard origin-back scheduling configuration serves as a backup configuration in case of a miss or an anomaly.

[0093] The node sets a higher source priority for the origin-back scheduling configuration than the standard origin-back scheduling configuration. When the composite lookup key matches the configuration issued in step S502, the target origin-back link is used directly; if not, the standard origin-back scheduling configuration is searched. If the dynamic origin-back link fails during operation and neither primary nor backup fail to complete the origin-back, the node can switch to the standard origin-back scheduling configuration according to preset fallback rules to ensure the continuity of request processing.

[0094] As can be seen from the above, this embodiment utilizes the full-site acceleration enabled state to limit the scope of use of the dynamic back-to-origin interface, and resolves the conflict when standard console configuration and programmable configuration coexist through node-side merged reading and source priority, which can ensure that the two types of configurations are issued independently while taking effect in an orderly manner.

[0095] In one possible implementation, a specific process for response-driven reclassification based on source server response information is described: Step S701: Obtain the source response information returned by the source station.

[0096] The origin server response information refers to the response data received by the target content delivery network node after accessing the origin server through the dynamic origin server interface. This response data may include the response status, response headers, and response content. The current request has already accessed the origin server using the dynamic origin server processing method before receiving this response information.

[0097] The node selects the target origin-back link based on the origin-back scheduling configuration determined in step S503, sends the current request to the corresponding origin server domain, and saves the response status, response headers, and response content in the processing context of the current request after receiving the response from the origin server. The system parses the cache control field in the response header before or simultaneously returning the response to the client.

[0098] Step S702: Obtain cache control information from the response header of the source server response information, and determine whether the source server response information is allowed to be cached on the target content distribution network node based on the cache control information.

[0099] The cache control information is data in the response header that indicates whether the response can be stored in the shared cache and the cache validity period. The cache control information may include public cache directives, maximum cache duration directives, no-storage directives, or private cache directives in the Cache-Control response header, and may also include an expiration time response header (Expires).

[0100] When the cache control information explicitly allows shared caching and does not include instructions to prohibit storage or only allow private caching, the system determines that the origin server's response information allows caching. When the cache control information includes instructions to prohibit storage, private caching instructions, or when the cache expiration date has expired, the system determines that caching is not allowed. The system can also perform basic checks based on the response status code and content integrity, but the cache control information is always one of the bases for determining whether node caching is allowed.

[0101] For example, if the origin server's response header includes an explicit cache directive and a maximum cache duration greater than zero, the system can determine that the response is allowed to be cached by the target content distribution network nodes; if the response header includes a prohibit cache directive, then caching is not allowed.

[0102] Step S703: If caching of the origin server response information is allowed, change the processing method of the current request from dynamic origin server processing to static caching processing, and cache the origin server response information; otherwise, maintain the dynamic origin server processing method of the current request.

[0103] The adjustment to static caching means writing the origin server response already obtained in this dynamic origin server pull to the cache, so that subsequent requests that meet the cache key and validity period conditions can retrieve the same content from the node cache, instead of resending the current request or changing the already completed origin server pull process. Maintaining dynamic origin server pull processing means not writing the origin server response to a shared cache that can be hit by subsequent requests; subsequent similar requests still need to access the origin server according to the dynamic origin server pull process.

[0104] The system generates a cache key based on the target service domain name, Uniform Resource Locator (URL), request method, and cache change fields. It then writes the origin server's response content, response headers, and expiration time to the node cache and updates the current request's category tag to static cache processing. If caching is not allowed, the system simply returns the origin server's response to the client without creating a cache object.

[0105] As can be seen from the above, this embodiment adopts dynamic origin retrieval and obtains the real origin server response during the request phase, and then uses the cache control information in the response header to correct the processing method. It can identify scenarios where the request form requires dynamic origin retrieval but the response content can actually be cached, so that subsequent requests directly hit the node cache, reducing the possibility of repeatedly occupying the dynamic origin retrieval link and origin server processing resources.

[0106] In one possible implementation, a dynamic-static classification process for multi-dimensional signal fusion can be set based on the embodiments corresponding to the above claims. Upon receiving the current request, the system obtains the Hypertext Transfer Protocol (HTTP) request method, Uniform Resource Locator (URL) path pattern, request header characteristics, and the caching configuration rules corresponding to the target service domain name. Different signals output static tendency, dynamic tendency, or pending results respectively. The system combines these signals according to preset priorities or configurable weights to obtain the initial request type of the current request. When the initial request type is a static request type, the node cache is queried first; when the initial request type is a dynamic request type, the processing flow corresponding to the dynamic origin interface is entered; if no clear result can be formed, the default processing method of the target service domain name can be executed.

[0107] Among them, static request type refers to the content corresponding to the request being suitable for caching at the target content distribution network nodes and being directly responded to by the nodes; dynamic request type refers to the content corresponding to the request needing to access the origin server and being suitable for link probing routing and dynamic acceleration; pending result refers to the existing request signal being insufficient to clearly choose static caching processing or dynamic origin server processing. The multi-dimensional signal fusion is not limited to a fixed mathematical model, and business users can set corresponding priorities or weights according to the request method, path pattern, and caching rules.

[0108] In one possible implementation, the weights corresponding to the multidimensional signals can be adaptively adjusted based on the classification results of historical requests. The system records the multidimensional signals corresponding to each historical request within a preset time period, the initial request type obtained based on the multidimensional signals, and the actual processing result determined based on the origin server response information. The weights corresponding to each dimension signal are then adjusted based on the consistency between the initial request type and the actual processing result.

[0109] Specifically, for any historical request, when the actual processing result determined based on the source server's response information matches the initial request type, the weight of the signal that positively influences the determination of that initial request type can be increased; when the actual processing result determined based on the source server's response information does not match the initial request type, the weight of the signal that caused that initial request type can be decreased, and the weight of the signal that matches the actual processing result can be increased. The system can update the weights of each dimension of the signals according to a preset period based on the classification of multiple historical requests within that preset period, and use the updated weights to perform weighted fusion of the multidimensional signals corresponding to subsequent requests.

[0110] For example, for a historical request initially identified as a dynamic request type, when the cache control information returned by the origin server determines that the corresponding origin server response allows caching, and the processing method of the request is adjusted to static caching, this request can be recorded as a classification correction sample. Based on the classification correction samples of various types within a preset time period, the system determines the degree of consistency between the classification results corresponding to different signals and the corrected request type, and adjusts the weights of the corresponding signals according to the degree of consistency, so that signals with a higher degree of consistency with the corrected request type have greater weight in subsequent dynamic / static classification processes.

[0111] In this way, the weights of the multi-dimensional signals do not need to remain fixed at all times. Instead, they can be adjusted according to the actual processing results of historical requests under different target service domains or different business scenarios. This allows the multi-dimensional signal fusion method to be updated as the characteristics of business requests change, thereby improving the matching degree between the dynamic and static classification results of subsequent requests and the actual cached characteristics.

[0112] In one possible implementation, the system supports conditional origin retrieval identifiers. Business users can set mandatory dynamic or mandatory static identifiers for specific Uniform Resource Locator (URL) path patterns. When the current request matches a conditional origin retrieval identifier, the system adopts the processing method corresponding to that identifier and prioritizes it over the automatic dynamic / static classification results. For example, a mandatory dynamic identifier can be set for real-time query interface paths, or a mandatory static identifier can be set for resource directories with fixed versions, to handle special business paths where automatic classification is not applicable.

[0113] In one possible implementation, the dynamic origin pull interface can serve as a unified entry point between the business layer and the static / dynamic separation logic layer. The target rule code is only responsible for calling the dynamic origin pull interface when business conditions are met. Internally, the interface sequentially performs admission verification, origin pull scheduling configuration query, configuration merging, target origin pull link determination, and exception handling. Therefore, the business layer does not need to directly perceive the configuration files, link detection results, and switching logic at different stages.

[0114] In one possible implementation, after determining that the current request needs dynamic acceleration, a node can enter the dynamic origin-fetching processing location via an internal jump and write an internal jump flag and a static / dynamic separation flag into the request context. The node reads the corresponding flag before each internal jump; when the number of jumps exceeds a preset number or the same processing location is detected to appear repeatedly, the node stops jumping and enters the standard origin-fetching process, thereby avoiding cyclical jumps between the rule code and the static / dynamic separation processing.

[0115] In one possible implementation, nodes can employ a three-level rule cache to store the static / dynamic classification rules and dynamic origin pull interface auxiliary configurations corresponding to the target service domain name. The first level is the Least Recently Used Cache (LRU Cache), used to store hot rules within the current process; the second level is Shared Memory (Shm), used to share rules among multiple processes on the same node; and the third level is a Remote Dictionary Server (Redis), used to provide distributed queries when the local cache is not found. The system can use consistent hashing to route the same target service domain name to a stable remote cache shard, and update the local cache through asynchronous scheduled tasks limited by concurrency, thereby reducing network input / output (I / O) and multi-process repeated query overhead.

[0116] In one possible implementation, when the target back-to-source link corresponding to the primary back-to-source scheduling configuration becomes unavailable, the node switches to the backup back-to-source scheduling configuration according to the switching rules set in step S403; when there is no backup back-to-source scheduling configuration or the backup link is also unavailable, the node reads the standard back-to-source scheduling configuration or the back-to-source information from the console to perform a standard back-to-source. This forms a multi-level fallback sequence of "primary source target link — backup source target link — standard back-to-source". The system can also reset the primary back-to-source scheduling configuration as the priority configuration after the detection results stabilize.

[0117] The above supplementary implementation methods can be used alone or in combination with the above implementation methods. Their purpose is to further improve the accuracy of static / dynamic classification, the controllability of interface calls, the efficiency of rule queries, and the business continuity under abnormal conditions, without changing the basic scheme of independent management of origin domain name groups, link detection and routing, configuration generation, and isolated distribution as defined in the claims.

[0118] Figure 2 A structural diagram of a back-to-source configuration device provided in this application embodiment includes: Module 21 is established to obtain the back-to-origin domain group configuration information and target rule code corresponding to the target service domain name, and to establish a mapping relationship between the target service domain name and the back-to-origin domain group configuration information. The back-to-origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name.

[0119] The determination module 22 is used to obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name, and to determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links based on the link detection results. The link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin link.

[0120] The generation module 23 is used to associate the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name according to the mapping relationship, and generate the back-to-origin scheduling configuration.

[0121] The distribution module 24 is used to distribute the back-to-origin scheduling configuration and the target rule code to the target content distribution network nodes through independent distribution channels. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

[0122] In one possible implementation, at least one origin domain name includes a primary origin domain name and an optional backup origin domain name; before obtaining the link detection results, the determining module is also used to obtain the primary origin domain name and the optional backup origin domain name carried in the interface parameters of the dynamic origin interface. Perform consistency checks between the primary source domain name and the backup source domain name carried in the interface parameters and the primary source domain name and the backup source domain name in the origin domain name group configuration information. If the consistency check passes, continue generating the back-to-source scheduling configuration; otherwise, stop generating the back-to-source scheduling configuration.

[0123] In one possible implementation, the determining module is specifically used to obtain the link delay and link status from the link detection results; From multiple candidate source links, determine the candidate source links whose link status is available; The candidate back-to-source link with the minimum link latency is selected from the available candidate back-to-source links and used as the target back-to-source link.

[0124] In one possible implementation, the generation module is specifically used to associate the target service domain name, the main source domain name, and the target back-to-origin link corresponding to the main source domain name according to the mapping relationship, and generate the main source back-to-origin scheduling configuration. When the back-to-origin domain group configuration information includes the backup domain, the target service domain, the backup domain, and the target back-to-origin link corresponding to the backup domain are associated to generate the backup back-to-origin scheduling configuration; Based on the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration, a back-to-source scheduling configuration is generated, and the switching rules between the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration are set.

[0125] In one possible implementation, the distribution module is specifically used to determine a first storage path in the target content distribution network node for storing the back-to-source scheduling configuration, and a second storage path for storing the target rule code; The origin scheduling configuration is distributed and stored in the first storage path of the target content distribution network node through the first distribution channel, and the target rule code is distributed and stored in the second storage path of the target content distribution network node through the second distribution channel. When executing the target rule code and calling the dynamic origin interface, based on the target service domain name corresponding to the current request and the origin domain name carried in the interface parameters of the dynamic origin interface, the matching origin scheduling configuration is searched from the first storage path, and the found origin scheduling configuration is determined as the origin scheduling configuration for the dynamic origin interface call.

[0126] In one possible implementation, the control module 25 is used to obtain the site-wide acceleration activation status corresponding to the target service domain name; When the "Site-wide acceleration is enabled" status indicates that site-wide acceleration is enabled, the dynamic origin server interface is allowed to load the found origin server scheduling configuration; when the "Site-wide acceleration is disabled" status indicates that site-wide acceleration is not enabled, the dynamic origin server interface is stopped from being called, and origin server processing is performed according to the origin server information set for the target service domain name in the console. When dynamic origin interface loading of origin scheduling configuration is allowed, and the target content delivery network node also stores standard origin scheduling configuration, the origin scheduling configuration is merged with the standard origin scheduling configuration. The standard origin scheduling configuration is a configuration generated based on the origin information set for the target service domain name in the console. When both the origin routing configuration and the standard origin routing configuration contain the target service domain name, the origin routing configuration shall be used first for origin routing processing.

[0127] In one possible implementation, the control module is further configured to acquire source station response information returned by the source station; Obtain cache control information from the response header of the origin server's response information, and determine whether the origin server's response information is allowed to be cached on the target content distribution network node based on the cache control information; If the origin server's response information is allowed to be cached on the target content distribution network node, the current request processing method is changed from dynamic origin server processing to static caching processing, and the origin server's response information is cached; otherwise, the current request's dynamic origin server processing method is maintained.

[0128] The source-following configuration device provided in this embodiment can execute the corresponding steps in the above method embodiments and achieve the corresponding technical effects. For the specific implementation process of each module, please refer to the foregoing method embodiments; it will not be repeated here.

[0129] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 3The computer device 300 shown includes at least one processor 301, a memory 302, at least one network interface 304, and other user interfaces 303. The various components in the computer device 300 are coupled together via a bus system 305. It is understood that the bus system 305 is used to implement communication between these components. In addition to a data bus, the bus system 305 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3 The general designated all buses as Bus System 305.

[0130] The user interface 303 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0131] It is understood that the memory 302 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 302 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0132] In some implementations, memory 302 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 3021 and application program 3022.

[0133] The operating system 3021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 3022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 3022.

[0134] In this embodiment of the invention, by calling the program or instructions stored in the memory 302, specifically the program or instructions stored in the application program 3022, the processor 301 executes the method steps provided in each method embodiment, including, for example: Obtain the origin domain group configuration information and target rule code corresponding to the target service domain name, and establish a mapping relationship between the target service domain name and the origin domain group configuration information. The origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. Obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name. Based on the link detection results, determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links. The link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin links. Based on the mapping relationship, the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name are associated to generate the back-to-origin scheduling configuration; Through independent distribution channels, the back-to-origin scheduling configuration and target rule code are distributed to the target content distribution network nodes respectively. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

[0135] The methods disclosed in the above embodiments of the present invention can be applied to processor 301, or implemented by processor 301. Processor 301 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 301 or by instructions in the form of software. The processor 301 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 302. Processor 301 reads the information in memory 302 and, in conjunction with its hardware, completes the steps of the above method.

[0136] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0137] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0138] The computer device provided in this embodiment may be as follows: Figure 3 The computer device shown can execute all the steps of the method in the above embodiments, thereby achieving the technical effects of the method in the above embodiments. For the sake of brevity, it will not be elaborated here.

[0139] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.

[0140] When one or more programs in the storage medium can be executed by one or more processors to achieve the above-described method of execution on the device side.

[0141] The processor is used to execute a program stored in memory to implement the steps of the method performed on the device side: Obtain the origin domain group configuration information and target rule code corresponding to the target service domain name, and establish a mapping relationship between the target service domain name and the origin domain group configuration information. The origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. Obtain the link detection results of multiple candidate back-to-origin links corresponding to each origin domain name. Based on the link detection results, determine the target back-to-origin link corresponding to each origin domain name from the multiple candidate back-to-origin links. The link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin links. Based on the mapping relationship, the target service domain name, each origin domain name, and the target back-to-origin link corresponding to the origin domain name are associated to generate the back-to-origin scheduling configuration; Through independent distribution channels, the back-to-origin scheduling configuration and target rule code are distributed to the target content distribution network nodes respectively. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

[0142] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0143] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0144] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for back-to-origin configuration, characterized in that, include: Obtain the origin domain group configuration information and target rule code corresponding to the target service domain name, and establish a mapping relationship between the target service domain name and the origin domain group configuration information. The origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. Obtain the link detection results of multiple candidate back-to-origin links corresponding to each of the origin domain names, and determine the target back-to-origin link corresponding to each of the origin domain names from the multiple candidate back-to-origin links based on the link detection results, wherein the link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin link; Based on the mapping relationship, the target service domain name, each of the origin domain names, and the target back-to-origin link corresponding to the origin domain name are associated to generate a back-to-origin scheduling configuration; The origin scheduling configuration and target rule code are distributed to the target content distribution network nodes through independent distribution channels. The target rule code includes a dynamic origin interface for calling the origin scheduling configuration.

2. The method according to claim 1, characterized in that, The at least one origin domain name includes a primary origin domain name and an optional backup origin domain name; before obtaining the link detection results, the method further includes: Obtain the primary source domain name and optional backup source domain name carried in the interface parameters of the dynamic origin interface; The primary source domain name and backup source domain name carried in the interface parameters are respectively checked for consistency with the primary source domain name and backup source domain name in the origin domain name group configuration information. If the consistency check passes, continue generating the source-back scheduling configuration; otherwise, stop generating the source-back scheduling configuration.

3. The method according to claim 2, characterized in that, The step of determining the target back-to-origin link corresponding to each origin domain name from multiple candidate back-to-origin links based on the link detection results includes: Obtain the link latency and link status from the link detection results; From the plurality of candidate source links, determine the candidate source links whose link status is available; The candidate back-to-source link with the minimum link latency is determined from the candidate back-to-source links in the available state and selected as the target back-to-source link.

4. The method according to claim 2, characterized in that, The generation of the source-back scheduling configuration includes: Based on the mapping relationship, the target service domain name, the main source domain name, and the target back-to-origin link corresponding to the main source domain name are associated to generate the main source back-to-origin scheduling configuration; When the back-to-origin domain group configuration information includes a backup domain, the target service domain, the backup domain, and the target back-to-origin link corresponding to the backup domain are associated to generate a backup back-to-origin scheduling configuration; Based on the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration, the back-to-source scheduling configuration is generated, and the switching rules between the primary source back-to-source scheduling configuration and the backup source back-to-source scheduling configuration are set.

5. The method according to claim 1, characterized in that, The step of distributing the origin scheduling configuration and target rule code to the target content distribution network nodes through independent distribution channels includes: Determine a first storage path in the target content distribution network node for storing the origin scheduling configuration, and a second storage path for storing the target rule code; The source scheduling configuration is distributed and stored in the first storage path of the target content distribution network node through the first distribution channel, and the target rule code is distributed and stored in the second storage path of the target content distribution network node through the second distribution channel. When executing the target rule code and calling the dynamic origin interface, based on the target service domain name corresponding to the current request and the origin domain name carried in the interface parameters of the dynamic origin interface, a matching origin scheduling configuration is searched from the first storage path, and the found origin scheduling configuration is determined as the origin scheduling configuration called by the dynamic origin interface.

6. The method according to claim 5, characterized in that, When invoking the dynamic origin interface, the method further includes: Obtain the site-wide acceleration activation status corresponding to the target service domain name; When the "Site-wide acceleration enabled" status indicates that site-wide acceleration is enabled, the dynamic origin pull interface is allowed to load the found origin pull scheduling configuration; when the "Site-wide acceleration enabled" status indicates that site-wide acceleration is not enabled, the dynamic origin pull interface is stopped from being called, and origin pull processing is performed according to the origin pull information set in the console for the target service domain name. When the dynamic origin interface is allowed to load the origin scheduling configuration, and the target content delivery network node also stores the standard origin scheduling configuration, the origin scheduling configuration is merged with the standard origin scheduling configuration, wherein the standard origin scheduling configuration is a configuration generated based on the origin information set in the console for the target service domain name; When both the origin routing configuration and the standard origin routing configuration contain the target service domain name, the origin routing configuration shall be used first for origin routing processing.

7. The method according to claim 6, characterized in that, After performing origin pull processing through the dynamic origin pull interface, the method further includes: Obtain the response information returned by the origin server; Obtain cache control information from the response header of the source server response information, and determine whether the source server response information is allowed to be cached on the target content distribution network node based on the cache control information; When the origin server response information is allowed to be cached on the target content distribution network node, the processing method of the current request is changed from dynamic origin server processing to static caching processing, and the origin server response information is cached; otherwise, the dynamic origin server processing method of the current request is maintained.

8. A source return configuration device, characterized in that, include: A module is established to obtain the back-to-origin domain group configuration information and target rule code corresponding to the target service domain name, and to establish a mapping relationship between the target service domain name and the back-to-origin domain group configuration information. The back-to-origin domain group configuration information is stored independently of the target rule code and includes at least one origin domain name. The determination module is used to obtain the link detection results of multiple candidate back-to-origin links corresponding to each of the origin domain names, and to determine the target back-to-origin link corresponding to each of the origin domain names from the multiple candidate back-to-origin links based on the link detection results, wherein the link detection results are used to characterize the link latency and link status of the corresponding candidate back-to-origin link; The generation module is used to associate the target service domain name, each of the origin domain names, and the target back-to-origin links corresponding to the origin domain names according to the mapping relationship, and generate a back-to-origin scheduling configuration; The distribution module is used to distribute the back-to-origin scheduling configuration and the target rule code to the target content distribution network nodes through independent distribution channels. The target rule code includes a dynamic back-to-origin interface for calling the back-to-origin scheduling configuration.

9. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a program stored in the memory to implement the back-to-source configuration method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the back-to-source configuration method according to any one of claims 1 to 7.