Scheduling method and device of CDN network request, electronic equipment and storage medium

CN116233127BActive Publication Date: 2026-09-29BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310121205.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-03
Publication Date
2026-09-29
Estimated Expiration
2043-02-03

AI Technical Summary

Technical Problem

[0003]虽然上述两种方案都能够将用户流量转发到不同的机房单元,但是都无法完全满足复杂的业务场景需求

Benefits of technology

[0036]本公开实施例提供的上述技术方案与现有技术相比具有如下优点:本公开实施例提供的方法,通过客户端根据目标归属信息的域名改写规则,将网络请求中的原始域名改写成携带有CDN服务商标识以及机房标识的目标域名,并将目标域名携带在网络请求并发送,实现了在不同区域均能够针对不同网络请求的精准调度,相比现有技术不会出现因CDN服务器无法得知转发地址导致调度错误或调度失效的问题,能更好的适配CDN的使用场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233127B_ABST
    Figure CN116233127B_ABST
Patent Text Reader

Abstract

The disclosure discloses a CDN network request scheduling method and device, electronic equipment and storage medium. Including: obtaining the original network request generated by the client for the target service; obtaining the first domain name rewriting rule corresponding to the target home information, and rewriting the original domain name by using the first domain name rewriting rule to obtain the first domain name; updating the original domain name in the original network request by using the first domain name to obtain the target network request; sending the target network request to the target CDN server corresponding to the target CDN service provider, so that the target CDN server obtains the target scheduling path corresponding to the target machine room identifier, and forwards the target network request to the target machine room according to the target scheduling path. The method provided by the disclosure can meet the scheduling requirements in various scenes, realize accurate scheduling for different network requests, and solve the problems of scheduling error or scheduling failure caused by the CDN server being unable to obtain the forwarding address, and can better adapt to the use scene of the CDN.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to a method, apparatus, electronic device and storage medium for scheduling CDN network requests. Background Technology

[0002] To forward traffic from different users to different data center units, the industry generally adopts two solutions: (1) Domain Name System (DNS) resolution: Returning different data center unit IPs based on the user's geographical location, allowing users in different regions to access the corresponding data center unit via the IP. (2) Forwarding and redirection based on access gateway: Carrying unit-specific information in the user request header, and setting up traffic allocation services at the data center traffic entry point, forwarding or redirecting user traffic from the same unit to the corresponding data center unit according to the unit mapping rules.

[0003] Although both of the above solutions can forward user traffic to different data center units, neither can fully meet the needs of complex business scenarios. For example, solution (1) cannot guarantee that the user's access request will land in the corresponding data center unit. When the forwarding path of solution (2) passes through the Content Delivery Network (CDN) node, the CDN node does not know how to handle unitized forwarding, resulting in the traffic not being forwarded to the correct data center. Therefore, solution (2) is also not suitable for integrated CDN. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method, apparatus, electronic device, and storage medium for scheduling CDN network requests.

[0005] According to one aspect of the present disclosure, a method for scheduling CDN network requests is provided, applied to a client, the method comprising:

[0006] Obtain the original network request generated by the client for the target service, wherein the original network request includes the target attribution information corresponding to the client, and the original domain name used to access the target service;

[0007] Obtain the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier;

[0008] The original domain name in the original network request is updated using the first domain name to obtain the target network request;

[0009] The target network request is sent to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server obtains the target scheduling path corresponding to the target data center identifier and forwards the target network request to the target data center according to the target scheduling path.

[0010] According to another aspect of the embodiments of this disclosure, a method for scheduling CDN network requests is also provided, applied to a CDN server, the method comprising:

[0011] Receive a target network request from a client, wherein the target network request includes a first domain name, and the first domain name includes: a target data center identifier;

[0012] Based on the pre-defined correspondence between the origin address and the data center identifier, the target origin address corresponding to the target data center identifier is determined;

[0013] Obtain the access path and target data center corresponding to the target origin address;

[0014] The target network request is forwarded to the target data center based on the access path.

[0015] According to another aspect of the embodiments of this disclosure, a method for scheduling CDN network requests is also provided, applied to a cloud network control system, the method comprising:

[0016] Receive a first query request from a client, wherein the first query request includes target attribution information corresponding to the client;

[0017] In response to the first query request, the first domain name rewriting rule corresponding to the target attribution information is obtained from multiple domain name rewriting rules. The domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio.

[0018] The first domain name rewriting rule is sent to the client so that the client can rewrite the domain name based on the first domain name rewriting rule.

[0019] According to another aspect of the embodiments of this disclosure, a CDN network request scheduling apparatus is also provided, comprising:

[0020] The first acquisition module is used to acquire the original network request generated by the client for the target service, wherein the original network request includes the target attribution information corresponding to the client and the original domain name used to access the target service;

[0021] The second acquisition module is used to acquire the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier;

[0022] The update module is used to update the original domain name in the original network request using the first domain name to obtain the target network request;

[0023] The sending module is used to send the target network request to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server obtains the target scheduling path corresponding to the target data center identifier and forwards the target network request to the target data center according to the target scheduling path.

[0024] According to another aspect of the embodiments of this disclosure, a CDN network request scheduling apparatus is also provided, comprising:

[0025] A receiving module is used to receive a target network request from a client, wherein the target network request includes a first domain name, and the first domain name includes: a target data center identifier;

[0026] The determination module is used to determine the target origin address corresponding to the target data center identifier based on the preset correspondence between the origin address and the data center identifier;

[0027] The acquisition module is used to acquire the access path and target data center corresponding to the target source address;

[0028] The forwarding module is used to forward the target network request to the target data center based on the access path.

[0029] According to another aspect of the embodiments of this disclosure, a CDN network request scheduling apparatus is also provided, comprising:

[0030] A receiving module is used to receive a query request from a client, wherein the query request includes target attribution information corresponding to the client;

[0031] The response module is used to respond to the query request and obtain the first domain name rewriting rule corresponding to the target attribution information from multiple domain name rewriting rules. The domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio.

[0032] The sending module is used to send the first domain name rewriting rule to the client, so that the requesting client can rewrite the domain name based on the first domain name rewriting rule.

[0033] According to another aspect of the embodiments of this disclosure, a storage medium is also provided, the storage medium including a stored program that executes the above steps when the program is run.

[0034] According to another aspect of the present disclosure, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the programs stored in the memory.

[0035] This disclosure also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the above-described method.

[0036] Compared with the prior art, the above-mentioned technical solution provided by the embodiments of this disclosure has the following advantages: The method provided by the embodiments of this disclosure rewrites the original domain name in the network request into a target domain name carrying the CDN service provider identifier and the data center identifier according to the domain name rewriting rules of the target home information by the client, and sends the target domain name in the network request. This achieves accurate scheduling for different network requests in different regions. Compared with the prior art, there will be no scheduling error or scheduling failure due to the CDN server not knowing the forwarding address. It can better adapt to the use cases of CDN. Attached Figure Description

[0037] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0038] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating a CDN network request scheduling method provided in this embodiment of the disclosure;

[0040] Figure 2 A schematic diagram illustrating the network request scheduling process provided in an embodiment of this disclosure;

[0041] Figure 3 A flowchart illustrating a CDN network request scheduling method provided in another embodiment of this disclosure;

[0042] Figure 4A flowchart illustrating a CDN network request scheduling method provided in another embodiment of this disclosure;

[0043] Figure 5 A flowchart illustrating a CDN network request scheduling method provided in another embodiment of this disclosure;

[0044] Figure 6 A block diagram of a CDN network request scheduling device provided in an embodiment of this disclosure;

[0045] Figure 7 A block diagram of a CDN network request scheduling apparatus provided in another embodiment of this disclosure;

[0046] Figure 8 A block diagram of a CDN network request scheduling apparatus provided in another embodiment of this disclosure;

[0047] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. The illustrative embodiments and their descriptions are used to explain this disclosure and do not constitute an improper limitation of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0049] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0050] This disclosure provides a method, apparatus, electronic device, and storage medium for scheduling CDN network requests. The method provided in this disclosure can be applied to any electronic device as needed, such as a server, terminal, or other electronic device; no specific limitation is made here, and for ease of description, it will be referred to as an electronic device below.

[0051] According to one aspect of the present disclosure, a method embodiment of a CDN network request scheduling method is provided. Figure 1 A flowchart illustrating a CDN network request scheduling method provided in this embodiment of the disclosure is shown below. Figure 1 As shown, the method includes:

[0052] Step S11: Obtain the original network request generated by the client for the target service. The original network request includes the target attribution information corresponding to the client and the original domain name used to access the target service.

[0053] The method provided in this disclosure is applied to a client. When a user needs to access a service through the client, the client first obtains the current target attribution information, then determines the target service to be accessed, and obtains the original domain name used to access the target service. For example, if the target service the client currently wants to access is X, the original domain name is X-aaa.com. Finally, an original network request is generated based on the original domain name and the target attribution information.

[0054] It should be noted that the target attribution information is determined based on the client's current state. When the client is currently in an installed but unregistered state, the target attribution information is the client's own attribution information, which can be generated based on the client's installation environment and carrier information. When the client is currently registered but not logged in, the target attribution information is the device's attribution information, which can be generated based on device information and carrier information. When the client is currently logged in, the target attribution information is the client's own attribution information, which can be the account information of the user's registered account. Among these, user attribution information has higher priority than device attribution information, and device attribution information has higher priority than client attribution information. The process for obtaining each attribution information is as follows:

[0055] (1) After the client is installed, the server will assign client ownership information (i.e., app_local) to the client based on the client's installation environment and carrier environment.

[0056] (2) After installation, the client initiates a device registration request based on the preset access policy. The device registration request carries the client's ownership information and device information, such as the device serial number.

[0057] (3) When the server receives a device registration request from the client, the server determines whether its own ownership information matches the client's. If the server's ownership information matches the client's, the server will further determine whether the client's device is a registered device. If it is a registered device, the server will send the device ownership information back to the client. If it is an unregistered device, the server will use the device information to register the device ownership information of the client's device and send the device ownership information back to the client.

[0058] For example, if the client's location information is A, and the location where the device registration request is initiated is also A, then after the client is installed, it will initiate a device registration request to the server A corresponding to A based on the preset access policy. After server A confirms that the client's location information matches its own, it will send the device location information back to the client.

[0059] (4) When the server determines that your own attribution information does not match the client's attribution information, the server will query the access address of the attribution server corresponding to the client's attribution information and send the access address to the client. The client will then resend the device registration request to the attribution server using the access address. The attribution server will further determine whether the client's device is a registered device. If it is a registered device, it will send the device attribution information and device identifier (device ID) back to the client. If it is an unregistered device, it will use the device information to register the device attribution information and device identifier (device ID) of the client's device and send the device attribution information and device identifier (device ID) back to the client.

[0060] For example, if the client's location information is in location A, but the location initiating the device registration request is in location B, then after installation, the client will initiate a device registration request to server B corresponding to location B based on a preset access policy. If server B confirms that the client's location information does not match its own, it will return the access address of its home server A to the client. The client will then re-initiate the device registration request to server A based on this access address. If server A confirms that the client's location information matches its own, it will return the device location information and device identifier (device ID) to the client.

[0061] (5) After obtaining the device ownership information, the client can send an account registration request to the server through the account registration operation triggered by the user on the client. The account registration request carries the user's identity information, etc. The server will generate account ownership information based on the user's identity information and feed the account ownership information back to the client.

[0062] Step S12: Obtain the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier.

[0063] In this embodiment of the disclosure, obtaining the first domain name rewriting rule corresponding to the target attribution information can be achieved by directly obtaining the first domain name rewriting rule corresponding to the target attribution information from the domain name rewriting rules stored locally on the client. It should be noted that the domain name rewriting rule stored locally on the client is obtained by the client sending a query request to the cloud network control system based on a preset query mechanism. The domain name rewriting rule is generated by the cloud network control system based on a preset first mapping relationship between attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio. The preset query mechanism can be a periodic query or a query performed when the attribution information is updated.

[0064] Specifically, the process by which the client obtains the domain name rewriting rules is as follows:

[0065] Step A1: Generate a first query request based on a preset query mechanism, wherein the first query request carries the target attribution information of the client.

[0066] In this embodiment of the disclosure, a first query request is generated based on a preset query mechanism, including the following steps A101-A102:

[0067] Step A101: Detect whether the target attribution information has been updated relative to the initial attribution information, and obtain the detection result. The initial attribution information is the attribution information stored by the client before receiving the original network request.

[0068] In this embodiment, the system detects whether the target attribution information has been updated relative to the initial attribution information. For example, if the client is not logged in before receiving the original network request, the corresponding initial attribution information is the device attribution information. After receiving the original network request, the client detects the target attribution information it carries. If the target attribution information is user attribution information, it is determined that the target attribution information has been updated relative to the initial attribution information, and the detection result indicates that the client has changed from an unlogged-in state to a logged-in state. If the target attribution information is device attribution information, it is determined that the target attribution information has not been updated relative to the initial attribution information, and the detection result indicates that the client is still in an unlogged-in state.

[0069] Step A102: Generate the first query request based on the request generation strategy corresponding to the detection result.

[0070] In this embodiment of the disclosure, generating a first query request based on a request generation strategy corresponding to the detection result includes: if the detection result is not updated, obtaining a preset time interval, and generating a first query request based on the preset time interval and target attribution information.

[0071] In this embodiment of the disclosure, if the detection result is not updated, the client will generate a first query request according to a preset time interval and the target attribution information, thereby realizing the periodic generation of query requests.

[0072] Alternatively, if the detection result is updated, a first query request can be generated based on the target attribution information.

[0073] In this embodiment of the disclosure, if the detection result is updated, the client does not need to generate a query request according to a preset time interval, and can directly generate a first query request based on the target attribution information. Specifically, the client calls the Passport service to perform login verification, the Passport service queries the target attribution information (since the current client is logged in, the target attribution information is the user's attribution information), and the Passport service requests the generation of a first query request based on the target attribution information.

[0074] Step A2: Send a first query request to the cloud network control system so that the cloud network control system can obtain the first domain name rewriting rule that matches the target attribution information from multiple domain name rewriting rules and send the first domain name rewriting rule to the client. The domain name rewriting rule is generated based on the first mapping relationship between the preset attribution information and the data center identifier, the second mapping relationship between the data center identifier and the domain name, and the preset traffic ratio.

[0075] Step A3: Receive the first domain name rewriting rule sent by the cloud network control system and store the first domain name rewriting rule.

[0076] The method provided in this disclosure sends query requests to the cloud network control system through different query mechanisms, thereby enabling the client to obtain the latest domain name rewriting rules in different scenarios.

[0077] In this embodiment of the disclosure, step S12, rewriting the original domain name using the first domain name rewriting rule to obtain the first domain name, includes the following steps B1-B2:

[0078] Step B1: Obtain the target data center identifier corresponding to the target attribution information from the first mapping relationship, and obtain the candidate domain name corresponding to the target data center identifier from the second mapping relationship.

[0079] In this embodiment of the disclosure, the first mapping relationship includes:

[0080] store_region_uid=CD→CD_unit.

[0081] store_region_uid=AB→AB_unit.

[0082] The aforementioned `store_region_uid=CD` and `store_region_uid=AB` are preset attribution information, while `CD_unit` and `AB_unit` are data center identifiers. Based on this, the target data center identifier with which it is mapped can be obtained from the first mapping relationship using the target attribution information. Then, the corresponding candidate domain name can be obtained from the second mapping relationship using the target data center identifier. The second mapping relationship includes:

[0083] (CD_unit, service X main domain) → [A_CD_X.com, B_CD_X.com].

[0084] (AB_unit, service X main domain) → [A_AB_X.com, B_AB_X.com].

[0085] (CD_unit, service Y main domain) → [A_CD_Y.com, B_CD_Y.com].

[0086] (AB_unit, service Y main domain) → [A_AB_X.com, B_AB_X.com].

[0087] The domains A_CD_X.com, B_CD_X.com, and A_CD_Y.com, B_CD_Y.com mentioned above are all domain names. For example, if the target data center is identified as CD_unit, its corresponding candidate domain names are A_CD_X.com and B_CD_X.com, where A and B are the CDN service provider identifiers for the CDN server.

[0088] Step B2: Obtain the preset traffic ratio and determine the candidate domain name that matches the preset traffic ratio as the first domain name.

[0089] In this embodiment, the preset traffic ratio includes: cloud-integrated CDN traffic ratio and data center traffic ratio. A preset range is determined according to the preset traffic ratio, for example: [1-40] corresponds to CDN service provider identifier A, and [41-100] corresponds to CDN service provider identifier B. Then, a modulo operation is performed using the device identifier of the client's device to obtain the calculation result. The preset range into which the calculation result falls is determined, and the CDN service provider identifier corresponding to this range is taken as the target CDN service provider identifier. The candidate domain name carrying the target CDN service provider identifier is determined as the first domain name.

[0090] As an example, the target data center is identified as CD_unit, and its corresponding candidate domains are A_CD_X.com and B_CD_X.com. The result of the modulo operation on the device identifier is 32. 32 falls within the range [1-40]. Based on this, the CDN service provider identifier A corresponding to [1-40] is taken as the target CDN service provider identifier. Simultaneously, the candidate domain "A_CD_X.com" carries the CDN service provider identifier A. Therefore, A_CD_X.com is the final first domain name obtained.

[0091] Step S13: Update the original domain name in the original network request using the first domain name to obtain the target network request.

[0092] In this embodiment of the disclosure, after obtaining the rewritten first domain name, the client replaces the original domain name in the original network request with the first domain name, thereby obtaining the target network request.

[0093] It should be noted that, based on the domain name rewriting rules of the target attribution information, the client rewrites the original domain name in the network request into a target domain name carrying the CDN service provider identifier and the data center identifier, and then includes the first domain name in the target network request. This allows the server to use the data center identifier to route the network request to the correct data center after it is sent to the server.

[0094] Step S14: Send the target network request to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server can obtain the target scheduling path corresponding to the target data center identifier and forward the target network request to the target data center according to the target scheduling path.

[0095] In this embodiment, since the first domain name in the target network request carries the target CDN service provider identifier and the target data center identifier, the client first sends the target network request to the service access layer. The service access layer forwards the target network request to the target CDN server based on the target CDN service provider identifier. The target CDN server selects the target scheduling path corresponding to the target data center identifier and forwards the target network request to the target data center based on the target scheduling path.

[0096] As an example, such as Figure 2 As shown, the first domain name carried in the target network request sent by the client is AM-xxx.com, where A is the target CDN service provider identifier and M is the target data center identifier. The client forwards the target network request to CDN server A through the business access layer. CDN server A determines the target origin address corresponding to M based on the pre-configured mapping between origin addresses and data center identifiers, and determines the access path and target data center based on the target origin address. Finally, it sends the target network request to the target data center M through the access path.

[0097] The method provided in this disclosure rewrites the original domain name in the network request into a target domain name carrying the CDN service provider identifier and the data center identifier according to the domain name rewriting rules of the target attribution information by the client, and sends the target domain name in the network request. This achieves accurate scheduling for different network requests in different regions. Compared with the prior art, it avoids the problem of scheduling errors or scheduling failures caused by the CDN server not knowing the forwarding address, and can better adapt to the use cases of CDN.

[0098] In this embodiment of the disclosure, after sending the target network request to the target CDN server corresponding to the first domain name, as follows: Figure 3 As shown, the method also includes the following steps:

[0099] Step S21: Receive response information from the service access layer, where the service access layer is used to forward the target network request.

[0100] In this embodiment, when the client sends a target network request, it first sends the request to the service access layer. The service access layer uses its stored probe information to determine whether the domain name rewriting rules corresponding to the client's target attribution information have been updated. If an update has occurred, it sends response information carrying the target identifier to the client. It should be noted that the probe information of the service access layer is sent after the domain name rewriting rules within the cloud network control system have been updated.

[0101] As an example: The domain name rewriting rules within the cloud network control system include: domain name rewriting rule P1 for ownership information Q1, domain name rewriting rule P2 for ownership information Q2, and domain name rewriting rule P3 for ownership information Q3. The updated domain name rewriting rules include: domain name rewriting rule P1' for ownership information Q1 and domain name rewriting rule P2' for ownership information Q2. The probe information sent to the service access layer at this time includes ownership information Q1 and ownership information Q2. If the target ownership information in the target network request matches the ownership information in the probe information, it is determined that the domain name rewriting rule corresponding to the target ownership information has been updated. A response is then sent to the client, carrying a target identifier, which indicates that the cloud network control system has updated the domain name rewriting rule corresponding to the target ownership information. Conversely, if the target ownership information in the target network request does not match the ownership information in the probe information, it is determined that the domain name rewriting rule corresponding to the target ownership information has not been updated. A normal response is then sent to the client, without carrying the target identifier.

[0102] Step S22: If the response information carries a target identifier, a second query request is generated using the target attribution information. The target identifier is used to indicate that the domain name rewriting rule corresponding to the target attribution information has been updated in the cloud network control system.

[0103] In this embodiment of the disclosure, after receiving the response information, the client determines whether the domain name rewriting rule corresponding to the target attribution information has been updated by judging whether the response information carries a target identifier.

[0104] In this embodiment of the disclosure, when the response information carries a target identifier, the client uses the target attribution information to generate a second query request in order to obtain the updated domain name rewriting rules.

[0105] Step S23: Send a second query request to the cloud network control system so that the cloud network control system can issue the second domain name rewriting rule corresponding to the target ownership information, wherein the second domain name rewriting rule is the domain name rewriting rule updated from the first domain name rewriting rule.

[0106] In this embodiment of the disclosure, the client sends a second query request to the cloud network control system, and the cloud network control system queries the corresponding updated second domain name rewriting rules based on the target attribution information in the second query request.

[0107] Step S24: Receive the second domain name rewriting rule and use the second domain name rewriting rule to regenerate the second domain name corresponding to the original domain name.

[0108] In this embodiment, after receiving the second domain name rewriting rule from the cloud network control system, the client regenerates the second domain name corresponding to the original domain name using the second domain name rewriting rule, and carries the second domain name in the original network request to obtain a new network request. Finally, the new network request is sent to the server corresponding to the CDN service provider identifier carried by the second domain name, so that the server selects the appropriate access path based on the data center identifier carried by the second domain name, and sends the request to the data center corresponding to the data center identifier through the access path.

[0109] The method provided in this embodiment determines whether the domain name rewriting rules have been updated when the domain name rewriting rules of the cloud network control system are updated by using probe information from the service access layer. This achieves synchronous configuration of the domain name rewriting rules and prevents network request forwarding errors.

[0110] According to another aspect of the embodiments of this disclosure, a method for scheduling CDN network requests is also provided. Figure 4 A flowchart illustrating a CDN network request scheduling method provided in this embodiment of the disclosure is shown below. Figure 4 As shown, the method may include the following steps:

[0111] Step S31: Receive a target network request from the client, wherein the target network request includes a first domain name, and the first domain name includes: target data center identifier.

[0112] Step S32: Based on the correspondence between the preset origin address and the data center identifier, determine the target origin address corresponding to the target data center identifier.

[0113] Step S33: Obtain the access path and target data center corresponding to the target source address.

[0114] Step S34: Forward the target network request to the target data center based on the access path.

[0115] The method provided in this embodiment is applied to a CDN server. After receiving a target network request from a client, the CDN server first extracts a first domain name from the target network request. The first domain name includes a target CDN service provider identifier (i.e., the CDN service provider identifier of the current CDN server) and a target data center identifier. Secondly, it queries a pre-configured mapping between preset origin addresses and data center identifiers to find a target origin address that matches the target data center identifier. Specifically, the CDN server can first obtain the mapping between domain names and origin addresses, for example: A_AB_X.com: AB_unit.com. Based on this mapping, it determines the preset origin address and data center identifier, i.e., AB: AB_unit.com. At this point, the target origin address is determined to be AB_unit.com.

[0116] In this embodiment of the disclosure, after determining the target origin address, the CDN server obtains the access path and target data center corresponding to the target origin address, and finally forwards the target network request to the target data center based on the access path.

[0117] According to another aspect of the embodiments of this disclosure, a method for scheduling CDN network requests is also provided. Figure 5 A flowchart illustrating a CDN network request scheduling method provided in this embodiment of the disclosure is shown below. Figure 5 As shown, the method may include the following steps:

[0118] Step S41: Receive a first query request from the client, wherein the first query request includes the target attribution information corresponding to the client.

[0119] The method provided in this embodiment is applied to a cloud network control system. The first query request received by the cloud network control system is generated by the client based on a preset query mechanism. The preset query mechanism can be a periodic query or a query performed when the attribution information is updated. The first query request carries the target attribution information corresponding to the client.

[0120] Step S42: In response to the first query request, obtain the first domain name rewriting rule corresponding to the target attribution information from multiple domain name rewriting rules. The domain name rewriting rule is generated based on the first mapping relationship between the preset attribution information and the data center identifier, the second mapping relationship between the data center identifier and the domain name, and the preset traffic ratio.

[0121] In this embodiment, the cloud network control system responds to a first query request and obtains a first domain name rewriting rule corresponding to the target attribute information from multiple domain name rewriting rules. The domain name rewriting rule within the cloud network control system is generated based on a pre-configured first mapping relationship between preset attribution information and data center identifiers, such as: store_region_uid = CD → CD_unit, etc., a second mapping relationship between data center identifiers and domain names, such as: CD_unit (service X main domain name) → [A_CD_X.com, B_CD_X.com], etc., and a preset traffic ratio. Specifically, the cloud network control system receives configuration information uploaded by the administrator and parses the configuration information to obtain the first mapping relationship between preset attribution information and data center identifiers, and the second mapping relationship between data center identifiers and domain names. Then, it obtains the traffic ratio control policy uploaded by the administrator and determines the preset traffic ratio based on the traffic ratio control policy. For example, in the current case including CDN server A and CDN server B, the traffic sent to CDN server A accounts for 40%, and the traffic sent to CDN server B accounts for 60%. Finally, the first mapping relationship, the second mapping relationship, and the preset traffic ratio generate the domain name rewriting rule.

[0122] Step S43: Send the first domain name rewriting rule to the client so that the client can rewrite the domain name based on the first domain name rewriting rule.

[0123] In this embodiment of the disclosure, the cloud network control system sends a first domain name rewriting rule to the client. After receiving the first domain name rewriting rule, the client stores it locally and uses the first domain name rewriting rule to rewrite the domain name.

[0124] In this embodiment of the disclosure, the method further includes the following steps C1-C4:

[0125] Step C1: Obtain the update information that applies to the domain name rewriting rules, and update the domain name rewriting rules based on the update information to obtain the updated domain name rewriting rules.

[0126] In this embodiment of the application, when the administrator needs to update the domain name rewriting rules, the cloud network control system can also obtain the update information uploaded by the administrator, update the domain name rewriting rules based on the update information, and obtain the updated domain name rewriting rules, such as updating the first mapping relationship, the second mapping relationship and / or the preset traffic ratio in the domain name rewriting rules.

[0127] Step C2: Generate probe information based on the updated domain name rewriting rules and send the probe information to the service access layer. This enables the service access layer to determine whether the domain name rewriting rules corresponding to the target attribution information of the client have been updated based on the probe information when it receives the target network request sent by the client. If an update has occurred, the service access layer sends response information carrying the target identifier to the client.

[0128] Step C3: Receive a second query request sent from the client, wherein the second query request carries target attribution information.

[0129] Step C4: Use the target attribution information to obtain the second domain name rewriting rule corresponding to the target attribution information from the updated domain name rewriting rules, and send the second domain name rewriting rule to the client.

[0130] In this embodiment, since the response information carries a target identifier, the client generates a second query request based on the target identifier and target attribution information. The cloud network control system uses the target attribution information to obtain the second domain name rewriting rule corresponding to the target attribution information from the updated domain name rewriting rules and sends the second domain name rewriting rule to the client. Subsequently, after receiving the second domain name rewriting rule from the cloud network control system, the client uses the second domain name rewriting rule to regenerate the second domain name corresponding to the original domain name and carries the second domain name in the original network request to obtain a new network request. Finally, the new network request is sent to the server corresponding to the CDN service provider identifier carried by the second domain name.

[0131] Figure 6 This is a block diagram of a CDN network request scheduling device provided in an embodiment of the present disclosure. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 6 As shown, the device includes:

[0132] The first acquisition module 61 is used to acquire the original network request generated by the client for the target service, wherein the original network request includes the target attribution information corresponding to the client and the original domain name used to access the target service;

[0133] The second acquisition module 62 is used to acquire the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier;

[0134] Update module 63 is used to update the original domain name in the original network request using the first domain name to obtain the target network request;

[0135] The sending module 64 is used to send the target network request to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server can obtain the target scheduling path corresponding to the target data center identifier and forward the target network request to the target data center according to the target scheduling path.

[0136] In this embodiment of the disclosure, the CDN network request scheduling device further includes: a generation module, configured to generate a first query request based on a preset query mechanism, wherein the first query request carries the target attribution information of the client; send the first query request to the cloud network control system, so that the cloud network control system obtains a first domain name rewriting rule matching the target attribution information from multiple domain name rewriting rules, and sends the first domain name rewriting rule to the client, wherein the domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio; receive the first domain name rewriting rule sent by the cloud network control system, and store the first domain name rewriting rule.

[0137] In this embodiment of the disclosure, the generation module is used to detect whether the target attribution information has been updated relative to the initial attribution information, and obtain a detection result, wherein the initial attribution information is the attribution information stored by the client before receiving the original network request; and to generate a first query request based on the request generation strategy corresponding to the detection result.

[0138] In this embodiment of the disclosure, the generation module is used to obtain a preset time interval and generate a first query request based on the preset time interval and the target attribution information when the detection result is not updated; or, when the detection result is updated, generate a first query request based on the target attribution information.

[0139] In this embodiment of the disclosure, the second acquisition module 62 is used to acquire the target data center identifier corresponding to the target attribution information from the first mapping relationship, and to acquire the candidate domain name corresponding to the target data center identifier from the second mapping relationship; acquire a preset traffic ratio, and determine the candidate domain name that matches the preset traffic ratio as the first domain name.

[0140] In this embodiment of the disclosure, the CDN network request scheduling device further includes: an update module, configured to receive response information from the service access layer, wherein the service access layer is used to forward the target network request; if the response information carries a target identifier, generate a second query request using the target attribution information, wherein the target identifier is used to indicate that the domain name rewriting rule corresponding to the target attribution information has been updated in the cloud network control system; send the second query request to the cloud network control system so that the cloud network control system issues a second domain name rewriting rule corresponding to the target attribution information, wherein the second domain name rewriting rule is the updated domain name rewriting rule of the first domain name rewriting rule; receive the second domain name rewriting rule, and regenerate the second domain name corresponding to the original domain name using the second domain name rewriting rule.

[0141] Figure 7 This is a block diagram of a CDN network request scheduling device provided in an embodiment of the present disclosure. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 7 As shown, the device includes:

[0142] The receiving module 71 is used to receive a target network request from the client, wherein the target network request includes a first domain name, and the first domain name includes: the target data center identifier;

[0143] The determination module 72 is used to determine the target origin address corresponding to the target data center identifier based on the preset correspondence between the origin address and the data center identifier;

[0144] Module 73 is used to obtain the access path corresponding to the target source address and the target data center;

[0145] Forwarding module 74 is used to forward target network requests to the target data center based on the access path.

[0146] Figure 8 This is a block diagram of a CDN network request scheduling device provided in an embodiment of the present disclosure. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 8 As shown, the device includes:

[0147] The receiving module 81 is used to receive a query request from the client, wherein the query request includes the target attribution information corresponding to the client;

[0148] The response module 82 is used to respond to query requests and obtain the first domain name rewriting rule corresponding to the target attribution information from multiple domain name rewriting rules. The domain name rewriting rule is generated based on the first mapping relationship between the preset attribution information and the data center identifier, the second mapping relationship between the data center identifier and the domain name, and the preset traffic ratio.

[0149] The sending module 83 is used to send the first domain name rewriting rule to the client so that the requesting client can rewrite the domain name based on the first domain name rewriting rule.

[0150] In this embodiment of the disclosure, the CDN network request scheduling device further includes: an update module, configured to obtain update information acting on the domain name rewriting rules, and update the domain name rewriting rules based on the update information to obtain updated domain name rewriting rules; generate probe information based on the updated domain name rewriting rules, and send the probe information to the service access layer, so that when the service access layer receives a target network request sent by the client, it determines whether the domain name rewriting rules corresponding to the target attribution information of the client have been updated based on the probe information, and if an update has occurred, sends response information carrying a target identifier to the client; receives a second query request sent by the client, wherein the second query request carries target attribution information; obtains a second domain name rewriting rule corresponding to the target attribution information from the updated domain name rewriting rules using the target attribution information, and sends the second domain name rewriting rule to the client.

[0151] This disclosure also provides an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.

[0152] Memory 1503 is used to store computer programs;

[0153] When the processor 1501 executes the computer program stored in the memory 1503, it implements the steps of the above embodiments.

[0154] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0155] The communication interface is used for communication between the aforementioned terminal and other devices.

[0156] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0157] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0158] In yet another embodiment provided in this disclosure, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the CDN network request scheduling method described in any of the above embodiments.

[0159] In yet another embodiment provided in this disclosure, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the CDN network request scheduling method described in any of the above embodiments.

[0160] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).

[0161] The above description is merely a preferred embodiment of this disclosure and is not intended to limit the scope of protection of this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure are included within the scope of protection of this disclosure.

[0162] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for scheduling CDN network requests, characterized in that, Applied to a client, the method includes: Obtain the original network request generated by the client for the target service, wherein the original network request includes the target attribution information corresponding to the client, and the original domain name used to access the target service; Obtain the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier; The original domain name in the original network request is updated using the first domain name to obtain the target network request; The target network request is sent to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server obtains the target scheduling path corresponding to the target data center identifier and forwards the target network request to the target data center according to the target scheduling path.

2. The method according to claim 1, characterized in that, Before obtaining the first domain name rewriting rule corresponding to the target attribution information, the method further includes: A first query request is generated based on a preset query mechanism, wherein the first query request carries the target attribution information of the client; The first query request is sent to the cloud network control system, so that the cloud network control system obtains a first domain name rewriting rule that matches the target attribution information from multiple domain name rewriting rules, and sends the first domain name rewriting rule to the client. The domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio. Receive the first domain name rewriting rule sent by the cloud network control system and store the first domain name rewriting rule.

3. The method according to claim 2, characterized in that, The generation of the first query request based on the preset query mechanism includes: The detection result is obtained by detecting whether the target attribution information has been updated relative to the initial attribution information, wherein the initial attribution information is the attribution information stored by the client before receiving the original network request; The first query request is generated based on the request generation strategy corresponding to the detection result.

4. The method according to claim 3, characterized in that, The step of generating the first query request based on the request generation strategy corresponding to the detection result includes: If the detection result is not updated, a preset time interval is obtained, and the first query request is generated based on the preset time interval and the target attribution information; Alternatively, if the detection result is updated, the first query request is generated based on the target attribution information.

5. The method according to claim 2, characterized in that, The step of rewriting the original domain name using the first domain name rewriting rule to obtain the first domain name includes: Obtain the target data center identifier corresponding to the target attribution information from the first mapping relationship, and obtain the candidate domain name corresponding to the target data center identifier from the second mapping relationship; Obtain a preset traffic ratio, and determine the candidate domain name that matches the preset traffic ratio as the first domain name.

6. The method according to claim 1, characterized in that, After sending the target network request to the target CDN server corresponding to the first domain name, the method further includes: Receive response information from the service access layer, wherein the service access layer is used to forward the target network request; If the response information carries a target identifier, a second query request is generated using the target attribution information, wherein the target identifier is used to indicate that the domain name rewriting rule corresponding to the target attribution information has been updated in the cloud network control system; Send the second query request to the cloud network control system so that the cloud network control system issues the second domain name rewriting rule corresponding to the target attribution information, wherein the second domain name rewriting rule is the domain name rewriting rule updated from the first domain name rewriting rule; Receive the second domain name rewriting rule, and use the second domain name rewriting rule to regenerate the second domain name corresponding to the original domain name.

7. A method for scheduling CDN network requests, characterized in that, Applied to CDN servers, the method includes: Receive a target network request from a client, wherein the target network request includes a first domain name, the first domain name includes a target data center identifier, and the target network request is generated by the CDN network request scheduling method according to any one of claims 1-6; Based on the pre-defined correspondence between the origin address and the data center identifier, the target origin address corresponding to the target data center identifier is determined; Obtain the access path and target data center corresponding to the target origin address; The target network request is forwarded to the target data center based on the access path.

8. A method for scheduling CDN network requests, characterized in that, Applied to a cloud network control system, the method includes: Receive a first query request from a client, wherein the first query request includes target attribution information corresponding to the client; In response to the first query request, the first domain name rewriting rule corresponding to the target attribution information is obtained from multiple domain name rewriting rules. The domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio. The first domain name rewriting rule is sent to the client so that the client can rewrite the domain name based on the first domain name rewriting rule.

9. The method according to claim 8, characterized in that, The method further includes: Obtain update information applied to the domain name rewriting rule, and update the domain name rewriting rule based on the update information to obtain the updated domain name rewriting rule; Based on the updated domain name rewriting rules, probe information is generated and sent to the service access layer. This enables the service access layer to determine whether the domain name rewriting rules corresponding to the target home information of the client have been updated based on the probe information when it receives the target network request sent by the client. If an update has occurred, the service access layer sends response information carrying the target identifier to the client. Receive a second query request sent from the client, wherein the second query request carries the target attribution information; Using the target attribution information, obtain the second domain name rewriting rule corresponding to the target attribution information from the updated domain name rewriting rules, and send the second domain name rewriting rule to the client.

10. A scheduling device for CDN network requests, characterized in that, include: The first acquisition module is used to acquire the original network request generated by the client for the target service, wherein the original network request includes the target attribution information corresponding to the client and the original domain name used to access the target service; The second acquisition module is used to acquire the first domain name rewriting rule corresponding to the target attribution information, and rewrite the original domain name using the first domain name rewriting rule to obtain the first domain name, wherein the first domain name includes the target CDN service provider identifier and the target data center identifier; The update module is used to update the original domain name in the original network request using the first domain name to obtain the target network request; The sending module is used to send the target network request to the target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server obtains the target scheduling path corresponding to the target data center identifier and forwards the target network request to the target data center according to the target scheduling path.

11. A scheduling device for CDN network requests, characterized in that, include: A receiving module is configured to receive a target network request from a client, wherein the target network request includes a first domain name, the first domain name includes a target data center identifier, and the target network request is generated by the CDN network request scheduling device according to claim 10; The determination module is used to determine the target origin address corresponding to the target data center identifier based on the preset correspondence between the origin address and the data center identifier; The acquisition module is used to acquire the access path and target data center corresponding to the target source address; The forwarding module is used to forward the target network request to the target data center based on the access path.

12. A scheduling device for CDN network requests, characterized in that, include: A receiving module is used to receive a query request from a client, wherein the query request includes target attribution information corresponding to the client; The response module is used to respond to the query request and obtain the first domain name rewriting rule corresponding to the target attribution information from multiple domain name rewriting rules. The domain name rewriting rule is generated based on a first mapping relationship between preset attribution information and data center identifier, a second mapping relationship between data center identifier and domain name, and a preset traffic ratio. The sending module is used to send the first domain name rewriting rule to the client, so that the requesting client can rewrite the domain name based on the first domain name rewriting rule.

13. A storage medium, characterized in that, The storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 9 when it is run.

14. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, communication interface, and memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor for performing the method of any one of claims 1 to 9 by running a program stored in memory.

Citation Information

Patent Citations

  • Data proxy method and system, and proxy server

    CN112272158A