CDN network request scheduling method, device, electronic device, and storage medium
The method addresses the challenge of routing user traffic to the correct machine room units in complex service scenarios by obtaining and rewriting domain names to ensure accurate CDN network request scheduling, enhancing the efficiency and accuracy of traffic distribution in converged CDNs.
Patent Information
- Application Number
- JP2025512612
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-02-03
- Filing Date
- 2024-01-30
- Publication Date
- 2025-11-17
- Estimated Expiration
- 2044-01-30
AI Technical Summary
Existing methods for routing user traffic to different machine room units fail to address the needs of complex service scenarios, particularly in converged CDNs, and existing methods for routing user traffic to different machine room units fail to meet the needs of complex service scenarios, such as ensuring that a user's access request enters the correct regional machine room units, and existing methods fail to address the needs of complex service scenarios, particularly in converged CDNs, and existing methods fail to address the issue of routing user traffic to different machine room units fail to meet the needs of complex service scenarios, particularly in converged CDNs, and existing methods fail to address the needs of complex service scenarios, such as ensuring that a user's access request enters the correct regional machine room unit.
A method for scheduling CDN network requests involves obtaining an original network request with domain name rewriting rules, and using the first domain name rewriting rules to rewrite the original domain name to obtain a target network request, and forwarding the target network request to the target CDN server corresponding to the target CDN service provider identifier, and the target CDN server obtains a target scheduling path, and forwarding the target machine room identifier, and the target scheduling path.
A method for scheduling CDN network requests involves obtaining an original network request with domain name rewriting rules, and forwarding the target network request to the target CDN server corresponding to the target CDN service provider identifier, and the target CDN server obtains a target scheduling path corresponding to the target machine room identifier, and forwarding the target network request to the target machine room according to the target scheduling path.
Smart Images

Figure 0007771472000001 
Figure 0007771472000002 
Figure 0007771472000003
Abstract
Description
[Technical Field]
[0001] This application claims priority from Chinese Patent Application No. 2023101212054, filed on February 3, 2023, and the entire contents of the above Chinese patent application are hereby incorporated by reference into this application.
[0002] Technical Field SUMMARY OF THE INVENTION Embodiments of the present disclosure relate to a method, an apparatus, an electronic device, and a storage medium for scheduling CDN network requests. [Background technology]
[0003] Currently, the industry generally adopts two methods to forward traffic from different users to different machine room units: (1) Domain Name System (DNS)-based analysis: different machine room unit IPs are returned based on the user's geographic location, and users in different regions access the machine room units in the corresponding regions through IP access; (2) Access Gateway-based forwarding and redirection: the user request header carries unitized information, and a traffic distribution service is configured in the machine room traffic entry, so that all user traffic from the same unit is forwarded or redirected to the corresponding machine room unit according to the unit mapping rules.
[0004] Although both of the above solutions can route user traffic to different machine room units, neither can fully meet the needs of complex service scenarios. For example, solution (1) cannot guarantee that a user's access request will enter the corresponding regional machine room unit. When the transmission path of solution (2) passes through a content delivery network (CDN) node, the CDN node does not know how to handle unitized transmission, preventing traffic from being routed to the correct machine room. Therefore, solution (2) cannot be applied to converged CDNs. Summary of the Invention
[0005] To solve or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, an electronic device, and a storage medium for scheduling CDN network requests.
[0006] According to one aspect of an embodiment of the present disclosure, there is provided a method for scheduling CDN network requests for use in a client, the method comprising: Obtaining an original network request generated by the client for a target service, the original network request including target attribution information corresponding to the client and an original domain name for accessing the target service; Obtain a first domain name rewriting rule corresponding to the target attribution information, and use the first domain name rewriting rule to rewrite the original domain name to obtain a first domain name including a target CDN service provider identifier and a target machine room identifier; performing an update to the original domain name in the original network request using the first domain name to obtain a target network request; The target network request is sent to a target CDN server corresponding to the target CDN service provider identifier, and the target CDN server obtains a 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.
[0007] According to yet another aspect of the embodiment of the present disclosure, there is further provided a CDN network request scheduling method for use in a CDN server, the method comprising: receiving a target network request from a client, the target network request including a first domain name including a target machine room identifier; Determine a target back-to-source address corresponding to the target machine room identifier according to a correspondence relationship between a pre-defined back-to-source address and a machine room identifier; Obtaining an access path and a target machine room corresponding to the target back-to-source address; and forwarding the target network request to the target machine room based on the access route.
[0008] According to yet another aspect of the embodiment of the present disclosure, there is further provided a CDN network request scheduling method for use in a cloud network control system, the method comprising: receiving a first search request from a client, the first search request including target belonging information corresponding to the client; In response to the first search request, obtain a first domain name rewriting rule corresponding to the target attribution information from a plurality of domain name rewriting rules, wherein the domain name rewriting rule is generated based on a first mapping relationship between a preset attribution information and a machine room identifier, a second mapping relationship between a machine room identifier and a domain name, and a preset traffic ratio; and transmitting the first domain name rewriting rule to the client, and causing the client to perform domain name rewriting based on the first domain name rewriting rule.
[0009] According to yet another aspect of the embodiment of the present disclosure, there is further provided a CDN network request scheduling device, the device comprising: a first acquisition module for acquiring an original network request generated by the client for a target service, the original network request including target attribution information corresponding to the client and an original domain name for accessing the target service; a second obtaining module for obtaining a first domain name rewriting rule corresponding to the target attribution information, and using the first domain name rewriting rule to perform rewriting on the original domain name to obtain a first domain name including a target CDN service provider identifier and a target machine room identifier; an update module for updating the original domain name in the original network request using the first domain name to obtain a target network request; a sending module for sending the target network request to a target CDN server corresponding to the target CDN service provider identifier, causing the target CDN server to obtain a target scheduling path corresponding to the target machine room identifier, and forwarding the target network request to the target machine room according to the target scheduling path.
[0010] According to yet another aspect of the embodiment of the present disclosure, there is further provided a CDN network request scheduling device, the device comprising: a receiving module for receiving a target network request from a client, the target network request including a first domain name including a target machine room identifier; a determining module for determining a target back-to-source address corresponding to the target machine room identifier according to a correspondence relationship between a pre-defined back-to-source address and a machine room identifier; an acquisition module for acquiring an access path and a target machine room corresponding to the target back-to-source address; a forwarding module for forwarding the target network request to the target machine room based on the access path.
[0011] According to yet another aspect of the embodiment of the present disclosure, there is further provided a CDN network request scheduling device, the device comprising: a receiving module for receiving a search request from a client, the search request including target affiliation information corresponding to the client; a response module for responding to the search request and obtaining a first domain name rewriting rule corresponding to the target attribution information from a plurality of domain name rewriting rules, the domain name rewriting rule being generated based on a first mapping relationship between a preset attribution information and a machine room identifier, a second mapping relationship between a machine room identifier and a domain name, and a preset traffic ratio; a sending module for sending the first domain name rewriting rule to the client and causing the requesting client to perform domain name rewriting based on the first domain name rewriting rule.
[0012] According to another aspect of an embodiment of the present disclosure, there is further provided a storage medium, the storage medium including a program stored therein, the program performing the above steps when executed.
[0013] According to another aspect of an embodiment of the present disclosure, there is further provided an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication between each other via the communication bus, wherein the memory is used to store a computer program, and the processor is used to perform the steps of the above method by executing the program stored on the memory.
[0014] An embodiment of the present disclosure further provides a computer program product including instructions, which, when executed on a computer, cause the computer to perform the steps in the above method. [Brief explanation of the drawings]
[0015] The drawings herein, which are incorporated in and constitute a part of this specification, illustrate preferred embodiments of the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0016] In order to more clearly describe the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly describes the drawings that need to be used to describe the embodiments or the prior art, and obviously, those skilled in the art can further obtain other drawings based on these drawings without any creative efforts.
[0017] [Figure 1] 1 is a flowchart of a method for scheduling CDN network requests according to an embodiment of the present disclosure. [Figure 2] FIG. 2 is a schematic diagram of a network request scheduling process according to an embodiment of the present disclosure. [Figure 3] 4 is a flowchart of a method for scheduling CDN network requests according to another embodiment of the present disclosure. [Figure 4] 4 is a flowchart of a method for scheduling CDN network requests according to another embodiment of the present disclosure. [Figure 5] 4 is a flowchart of a method for scheduling CDN network requests according to another embodiment of the present disclosure. [Figure 6] FIG. 2 is a block diagram of a CDN network request scheduling device according to an embodiment of the present disclosure. [Figure 7] FIG. 10 is a block diagram of a CDN network request scheduling device according to another embodiment of the present disclosure. [Figure 8] FIG. 10 is a block diagram of a CDN network request scheduling device according to another embodiment of the present disclosure. [Figure 9]1 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0018] In order to make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some embodiments of the present disclosure, not all embodiments. The exemplary embodiments of the present disclosure and their description are for the purpose of interpreting the present disclosure and do not unduly limit the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without any creative efforts fall within the scope of protection of the present disclosure.
[0019] It should be understood that, as used herein, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another, similar entity or operation, and do not necessarily require or imply the existence of any such actual relationship or ordering between those entities or operations. Furthermore, terms such as "comprise," "comprises," or any other variation thereof are intended to cover non-exclusive inclusions, such that a process, method, article, or device that includes a set of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent in such process, method, article, or device. Unless further limited, an element qualified by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0020] The embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for scheduling CDN network requests. The method according to the embodiments of the present disclosure may be used in any necessary electronic device, such as a server, a terminal, or the like. For convenience of description, the method is not limited to the electronic device, and will be hereinafter referred to as the electronic device.
[0021] According to one aspect of the present disclosure, there is provided an embodiment of a method for scheduling CDN network requests. Figure 1 is a flowchart of the method for scheduling CDN network requests according to the embodiment of the present disclosure. As shown in Figure 1, the method includes:
[0022] Step S11: Obtain an original network request generated by a client for a target service, where the original network request includes target belonging information corresponding to the client and an original domain name for accessing the target service.
[0023] The method according to the embodiment of the present disclosure is used in a client. When a user needs to access a service through the client, the client first obtains current target attribution information, then determines the target service to be accessed, and obtains an original domain name for accessing the target service, for example, the target service that the client currently wants to access is X, and the original domain name is X-aaa.com. Finally, the client generates an original network request based on the original domain name and the target attribution information.
[0024] It should be noted that the target attribution information is determined based on the current state of the client. When the client is currently in an installed but unregistered state, the target attribution information is client attribution information, which may be generated based on the client's installation environment and operator information. When the client is currently in a registered but unlogged-in state, the target attribution information is device attribution information of a device to which the client belongs, which may be generated based on device information and operator information. When the client is currently in a logged-in state, the target attribution information is client attribution information, which may be account information of an account registered by a user. Here, the priority of the user attribution information is higher than the device attribution information, which is higher than the client attribution information. The process of obtaining each attribution information is as follows:
[0025] (1) After the client is installed, the server assigns client home information (i.e., app_local) for the client according to the client's installation environment and operator environment.
[0026] (2) After the installation is complete, the client initiates a device registration request based on a pre-set access policy. The device registration request carries client attribution information and device information, which may include the device serial number, etc.
[0027] (3) After the server receives the device registration request sent by the client, the server determines whether it matches the client's belonging information. If the server matches the client's belonging information, the server further determines whether the device to which the client belongs is a registered device. If it is a registered device, the server feeds back the device belonging information to the client. If it is an unregistered device, the server uses the device belonging information of the device to which the device information registration client belongs and feeds back the device belonging information to the client.
[0028] For example, since the client attribution information is site A and the location where the device registration request is initiated is also site A, after the client completes installation, it initiates a device registration request to server A corresponding to site A based on a pre-set access policy, and after server A confirms that the client attribution information matches its own, it feeds back the device attribution information to the client.
[0029] (4) If the server determines that it does not match the client belonging information, it searches for the access address of the belonging server corresponding to the client belonging information and sends the access address to the client. The client resends a device registration request to the belonging server using the access address. The belonging server further determines whether the device to which the client belongs is a registered device. If it is a registered device, it feeds back the device belonging information and device identifier (device ID) to the client. If it is an unregistered device, it uses the device belonging information and device identifier (device ID) of the device to which the device information registration client belongs and feeds back the device belonging information and device identifier (device ID) to the client.
[0030] For example, if the client belonging information is site A and the location where the device registration request was initiated is site B, after the client completes installation, it initiates a device registration request to server B corresponding to site B based on a preset access policy, and after server B confirms that the client belonging information does not match its own, it feeds back to the client the access address of its own server A. The client re-initiates a device registration request to server A based on the access address, and after server A confirms that the client belonging information matches its own, it feeds back to the client the device belonging information and a device identifier (device ID).
[0031] (5) After obtaining the device attribution information, the client may send an account registration request to the server through an account registration operation triggered by the user on the client, where the account registration request carries user identity information, etc., and the server generates account attribution information based on the user identity information and feeds the account attribution information back to the client.
[0032] Step S12: obtain a first domain name rewriting rule corresponding to the target attribution information, and use the first domain name rewriting rule to rewrite the original domain name to obtain a first domain name including the target CDN service provider identifier and the target machine room identifier.
[0033] In the embodiments of the present disclosure, obtaining the first domain name rewrite rule corresponding to the target attribution information may be directly obtaining the first domain name rewrite rule corresponding to the target attribution information from the domain name rewrite rule locally stored in the client. It should be noted that the domain name rewrite rule locally stored in the client is obtained by the client sending a search request to the cloud network control system based on a preset search mechanism, and the domain name rewrite rule is generated by the cloud network control system based on the preset first mapping relationship between the attribution information and the machine room identifier, the second mapping relationship between the machine room identifier and the domain name, and the preset traffic ratio. The preset search mechanism may be a periodic search, and may also be performed when the attribution information is updated.
[0034] Specifically, the process by which a client obtains domain name rewriting rules is as follows:
[0035] Step A1: generating a first search request carrying target belonging information of a client based on a preset search mechanism;
[0036] In an embodiment of the present disclosure, generating a first search request based on a preset search mechanism includes the following steps A101 to A102.
[0037] Step A101: detect whether the target belonging information has been updated relative to the initial belonging information, and obtain a detection result, where the initial belonging information is the belonging information stored by the client before receiving the original network request.
[0038] In an embodiment of the present disclosure, it is detected whether the target attribute information has been updated relative to the initial attribute information. For example, before receiving the original network request, the client is in a non-logged-in state and the corresponding initial attribute information is device attribute information. Then, after receiving the original network request, the client detects the target attribute information carried therein. If the target attribute information is user attribute information, it is determined that the target attribute information has been updated relative to the initial attribute information. In this case, the detection result indicates that the client is currently changed from a non-logged-in state to a logged-in state. If the target attribute information is device attribute information, it is determined that the target attribute information has not been updated relative to the initial attribute information. In this case, the detection result indicates that the client is currently still in a non-logged-in state.
[0039] Step A102: Generate a first search request based on a request generation policy corresponding to the detection result.
[0040] In an embodiment of the present disclosure, generating a first search request based on a request generation policy corresponding to the detection result includes: if the detection result is not updated, obtaining a preset time interval, and generating a first search request based on the preset time interval and target attribution information.
[0041] In an embodiment of the present disclosure, if the detection result has not been updated, the client generates a first search request according to a preset time interval and target belonging information, thereby realizing periodic generation of the search request.
[0042] Alternatively, if the detection result is an update, a first search request is generated based on the target attribution information.
[0043] In the embodiment of the present disclosure, if the detection result is an update, the client does not need to generate a search request according to a preset time interval, but can directly generate a first search request based on the target attribution information. Specifically, the client calls the Passport service to perform login verification, and the Passport service searches for the target attribution information (because the current client is logged in, the target attribution information at this time is user attribution information), and requests the Passport service to generate a first search request based on the target attribution information.
[0044] Step A2: send a first search request to the cloud network control system, causing the cloud network control system to obtain a first domain name rewrite rule that matches the target attribution information from the multiple domain name rewrite rules, and send the first domain name rewrite rule to the client, where the domain name rewrite rule is generated based on a first mapping relationship between the preset attribution information and the machine room identifier, a second mapping relationship between the machine room identifier and the domain name, and a preset traffic ratio.
[0045] Step A3: receiving the first domain name rewriting rule sent by the cloud network control system, and storing the first domain name rewriting rule;
[0046] The method provided in the embodiments of the present disclosure facilitates clients to obtain the latest domain name rewriting rules in different scenarios by sending search requests to the cloud network control system through different search mechanisms.
[0047] In the embodiment of the present disclosure, step S12 of rewriting the original domain name using the first domain name rewriting rule to obtain the first domain name includes the following steps B1 to B2.
[0048] Step B1: obtain a target machine room identifier corresponding to the target belonging information from the first mapping relationship, and obtain a candidate domain name corresponding to the target machine room identifier from the second mapping relationship.
[0049] In an embodiment of the present disclosure, the first mapping relationship includes:
[0050] store_region_uid=CD→CD_unit.
[0051] store_region_uid=AB→AB_unit.
[0052] The above store_region_uid=CD and store_region_uid=AB are preset attribution information, and CD_unit and AB_unit are machine room identifiers. Therefore, the target attribution information can be used to obtain a target machine room identifier having a mapping relationship with the target attribution information from a first mapping relationship. Then, the target machine room identifier can be used to obtain a corresponding candidate domain name from a second mapping relationship, where the second mapping relationship includes the following:
[0053] (CD_unit, service X primary domain name) → [A_CD_X.com, B_CD_X.com].
[0054] (AB_unit, service X primary domain name) → [A_AB_X.com, B_AB_X.com].
[0055] (CD_unit, service Y primary domain name) → [A_CD_Y.com, B_CD_Y.com].
[0056] (AB_unit, service Y primary domain name) → [A_AB_X.com, B_AB_X.com].
[0057] The above A_CD_X.com, B_CD_X.com, A_CD_Y.com, and B_CD_Y.com are all domain names. For example, the target machine room identifier is CD_unit, and the corresponding candidate domain names are A_CD_X.com and B_CD_X.com, where A and B are CDN service provider identifiers of the CDN server.
[0058] Step B2: Obtain a preset traffic ratio, and determine a candidate domain name that matches the preset traffic ratio as a first domain name.
[0059] In an embodiment of the present disclosure, the preset traffic ratio includes a cloud-integrated CDN traffic ratio and a machine room 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 device to which the client belongs to obtain the operation result, and a preset range that the operation result falls into is determined. The CDN service provider identifier corresponding to the range is determined as the target CDN service provider identifier, and the candidate domain name carrying the target CDN service provider identifier is determined as the first domain name.
[0060] For example, the target machine room identifier is CD_unit, and the corresponding candidate domain names are A_CD_X.com and B_CD_X.com. In this case, the result of performing modulo operation on the device identifier is 32. 32 falls within the range [1-40], and thus the CDN service provider identifier A corresponding to [1-40] is taken as the target CDN service provider identifier. At the same time, the candidate domain name "A_CD_X.com" carries the CDN service provider identifier A, so A_CD_X.com is the first domain name finally obtained.
[0061] Step S13: Use the first domain name to update the original domain name in the original network request to obtain a target network request.
[0062] In an embodiment of the present disclosure, after obtaining the rewritten first domain name, the client obtains the target network request by replacing the original domain name in the original network request with the first domain name.
[0063] Illustratively, the client rewrites the original domain name in the network request into a target domain name carrying the CDN service provider identifier and the machine room identifier according to the domain name rewriting rules of the target attribution information, and makes the first domain name carry in the target network request, so that after the target network request is sent to the server, the server can easily use the machine room identifier to schedule the network request to a correct machine room.
[0064] Step S14: Send the target network request to a target CDN server corresponding to the target CDN service provider identifier, so that the target CDN server obtains a 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.
[0065] In the embodiment of the present disclosure, the first domain name in the target network request carries a target CDN service provider identifier and a target machine room identifier, so that the client first sends the target network request to the service access layer, and the service access layer forwards the target network request to the target CDN server according to the target CDN service provider identifier, and the target CDN server selects a 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.
[0066] For example, as shown in Figure 2, 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 machine room identifier. The client forwards the target network request to the CDN server A through the service access layer, and the CDN server A determines the target back-to-source address corresponding to M based on the pre-configured correspondence between the back-to-source address and the machine room identifier, determines the access path and the target machine room based on the target back-to-source address, and finally sends the target network request to the target machine room M via the access path.
[0067] In the method according to the embodiment of the present disclosure, the client rewrites the original domain name in the network request into a target domain name carrying the CDN service provider identifier and the machine room identifier based on the domain name rewriting rules of the target attribution information, and then sends the target domain name carried in the network request, thereby realizing accurate scheduling for different network requests in different regions. Compared with the prior art, there is no problem of scheduling errors or scheduling invalidation caused by the CDN server not knowing the forwarding address, and it is better adapted to CDN usage scenarios.
[0068] In an embodiment of the present disclosure, after sending the target network request to the target CDN server corresponding to the first domain name, as shown in FIG. 3, the method further includes the following steps:
[0069] Step S21: receiving response information fed back from the service access layer for forwarding the target network request;
[0070] In an embodiment of the present disclosure, when a client sends a target network request, it first sends the target network request to the service access layer, and the service access layer uses the probe information stored therein to determine whether the domain name rewriting rule corresponding to the client's target attribution information has been updated, and if so, delivers response information carrying the target identifier to the client. It should be noted that the probe information of the service access layer is delivered after the domain name rewriting rule in the cloud network control system has been updated.
[0071] For example, the domain name rewriting rules in the cloud network control system include a domain name rewriting rule P1 for attribution information Q1, a domain name rewriting rule P2 for attribution information Q2, and a domain name rewriting rule P3 for attribution information Q3. The updated domain name rewriting rules include a domain name rewriting rule P1' for attribution information Q1 and a domain name rewriting rule P2' for attribution information Q2. At this time, the probe information delivered to the service access layer includes the attribution information Q1 and the attribution information Q2. If the target attribution information in the target network request matches the attribution information in the probe information, it is determined that the domain name rewriting rule corresponding to the target attribution information has been updated. At this time, response information is fed back to the client, and the response information carries a target identifier, which 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. Conversely, if the target attribution information in the target network request does not match the attribution information in the probe information, it is determined that the domain name rewriting rule corresponding to the target attribution information has not been updated. In this case, the response information is normally fed back to the client, and the response information does not carry the target identifier.
[0072] Step S22: if a target identifier is carried in the response information, generate a second search request using the target attribution information, where 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.
[0073] In an embodiment of the present disclosure, after the client receives the response information, it determines whether the domain name rewriting rule corresponding to the target attribution information has been updated by determining whether the target identifier is carried in the response information.
[0074] In an embodiment of the present disclosure, if the response information carries a target identifier, the client obtains the updated domain name rewriting rules by generating a second search request using the target attribution information.
[0075] Step S23: sending a second search request to the cloud network control system to have the cloud network control system distribute a second domain name rewriting rule corresponding to the target attribution information, where the second domain name rewriting rule is the domain name rewriting rule after the first domain name rewriting rule is updated.
[0076] In an embodiment of the present disclosure, the client sends a second search request to the cloud network control system, and the cloud network control system searches for a corresponding updated second domain name rewrite rule based on the target attribution information in the second search request.
[0077] Step S24: receiving a second domain name rewriting rule, and regenerating a second domain name corresponding to the original domain name using the second domain name rewriting rule;
[0078] In an embodiment of the present disclosure, after receiving the second domain name rewriting rule fed back by the cloud network control system, the client regenerates a second domain name corresponding to the original domain name using the second domain name rewriting rule, carries the second domain name in the original network request, obtains a new network request, and finally sends the new network request to a server corresponding to the CDN service provider identifier carried in the second domain name, so that the server selects a corresponding access path based on the machine room identifier carried in the second domain name, and sends the new network request to the machine room corresponding to the machine room identifier via the access path.
[0079] In the method according to the embodiment of the present disclosure, when the domain name rewrite rules of the cloud network control system are updated, the method uses the probe information of the service access layer to determine whether the domain name of the attribution information carried in the current network request has been updated, thereby realizing synchronous configuration of the domain name rewrite rules and preventing errors in forwarding the network request.
[0080] According to yet another aspect of an embodiment of the present disclosure, a method for scheduling a CDN network request is further provided. FIG. 4 is a flowchart of a method for scheduling a CDN network request according to an embodiment of the present disclosure. As shown in FIG. 4, the method may include the following steps:
[0081] Step S31: receiving a target network request from a client, where the target network request includes a first domain name including a target machine room identifier.
[0082] Step S32: Determine a target back-to-source address corresponding to the target machine room identifier according to the correspondence relationship between the pre-defined back-to-source address and the machine room identifier.
[0083] Step S33: obtain the access path and the target machine room corresponding to the target back-to-source address.
[0084] Step S34: forward the target network request to the target machine room based on the access route.
[0085] A method according to an embodiment of the present disclosure is used in a CDN server. After receiving a target network request sent by a client, the CDN server first extracts a first domain name from the target network request, where 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 machine room identifier. Next, the CDN server searches for a target back-to-source address that matches the target machine room identifier from a pre-configured correspondence between pre-set back-to-source addresses and machine room identifiers. Specifically, the CDN server may first obtain the correspondence between domain names and back-to-source addresses, for example, A_AB_X.com:AB_unit.com, and then determine the pre-set back-to-source address and machine room identifier, i.e., AB:AB_unit.com, based on the correspondence. In this case, the target back-to-source address is determined to be AB_unit.com.
[0086] In an embodiment of the present disclosure, after determining the target back-to-source address, the CDN server obtains the access path and the target machine room corresponding to the target back-to-source address, and finally forwards the target network request to the target machine room based on the access path.
[0087] According to yet another aspect of an embodiment of the present disclosure, a method for scheduling a CDN network request is further provided. FIG. 5 is a flowchart of a method for scheduling a CDN network request according to an embodiment of the present disclosure. As shown in FIG. 5, the method may include the following steps:
[0088] Step S41: receiving a first search request from a client, where the first search request includes target belonging information corresponding to the client.
[0089] A method according to an embodiment of the present disclosure is used in a cloud network control system, and a first search request received by the cloud network control system is generated by a client based on a preset search mechanism, where the preset search mechanism may be a scheduled search or may be a search performed when attribution information is updated, and the first search request carries target attribution information corresponding to the client.
[0090] Step S42: in response to the first search request, obtain a first domain name rewriting rule corresponding to target attribution information from the plurality of domain name rewriting rules, where the domain name rewriting rule is generated based on a first mapping relationship between the preset attribution information and the machine room identifier, a second mapping relationship between the machine room identifier and the domain name, and a preset traffic ratio.
[0091] In an embodiment of the present disclosure, a cloud network control system responds to a first search request and obtains a first domain name rewriting rule corresponding to target attribute information from a plurality of domain name rewriting rules, and the domain name rewriting rule in the cloud network control system is generated based on a first mapping relationship between pre-configured attribution information and machine room identifiers, such as store_region_uid=CD→CD_unit, a second mapping relationship between machine room identifiers and domain names, such as (CD_unit, service X primary domain name)→[A_CD_X.com, B_CD_X.com], and a pre-configured traffic ratio. Specifically, the cloud network control system receives configuration information uploaded by an administrator, analyzes the configuration information, and obtains the pre-configured first mapping relationship between attribution information and machine room identifiers and the second mapping relationship between machine room identifiers and domain names. Then, the traffic ratio control policy uploaded by the administrator is obtained, and a preset traffic ratio is determined based on the traffic ratio control policy. For example, if the current CDN server includes CDN server A and CDN server B, traffic to CDN server A accounts for 40%, and traffic to CDN server B accounts for 60%. Finally, a domain name rewriting rule is generated based on the first mapping relationship, the second mapping relationship, and the preset traffic ratio.
[0092] Step S43: Send the first domain name rewriting rule to the client, and have the client rewrite the domain name based on the first domain name rewriting rule.
[0093] In an embodiment of the present disclosure, the cloud network control system sends a first domain name rewrite rule to a client, and the client locally stores the first domain name rewrite rule after receiving it, and uses the first domain name rewrite rule to perform domain name rewrite.
[0094] In an embodiment of the present disclosure, the method further includes the following steps C1 to C4.
[0095] Step C1: Obtain update information that affects the domain name rewriting rules, and update the domain name rewriting rules based on the update information to obtain updated domain name rewriting rules.
[0096] In an embodiment of the present application, when an administrator needs to update a domain name rewrite rule, the cloud network control system may further obtain update information uploaded by the administrator, and update the domain name rewrite rule according to the update information to obtain an updated domain name rewrite rule, for example, updating the first mapping relationship, the second mapping relationship and / or the preset traffic ratio in the domain name rewrite rule.
[0097] Step C2: generate probe information according to the updated domain name rewriting rule, and send the probe information to the service access layer. When the service access layer receives the target network request sent by the client, determine whether the domain name rewriting rule corresponding to the client's target attribution information has been updated according to the probe information; if so, send response information carrying the target identifier to the client; Step C3, receiving a second search request sent from the client, where the second search request carries target belonging information.
[0098] Step C4: Using the target attribution information, obtain a second domain name rewriting rule corresponding to the target attribution information from the updated domain name rewriting rule, and send the second domain name rewriting rule to the client.
[0099] In an embodiment of the present disclosure, since the response information carries a target identifier, the client generates a second search request using the target attribution information based on the target identifier, and the cloud network control system uses the target attribution information to obtain 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. Subsequently, after receiving the second domain name rewriting rule fed back from the cloud network control system, the client uses the second domain name rewriting rule to regenerate a second domain name corresponding to the original domain name, carries the second domain name in the original network request, and obtains a new network request. Finally, the new network request is sent to a server corresponding to the CDN service provider identifier carried in the second domain name.
[0100] 6 is a block diagram of a CDN network request scheduling device according to an embodiment of the present disclosure, which can be implemented as part or all of an electronic device using software, hardware, or a combination of both. As shown in FIG. 6, the device: a first obtaining module 61 for obtaining an original network request generated by a client for a target service, the original network request including target attribution information corresponding to the client and an original domain name for accessing the target service; a second obtaining module 62 for obtaining a first domain name rewriting rule corresponding to the target attribution information, and using the first domain name rewriting rule to perform rewriting on the original domain name to obtain a first domain name including a target CDN service provider identifier and a target machine room identifier; an updating module 63 for updating the original domain name in the original network request using the first domain name to obtain a target network request; and a sending module 64 for sending the target network request to a target CDN server corresponding to the target CDN service provider identifier, causing the target CDN server to obtain a target scheduling path corresponding to the target machine room identifier, and forwarding the target network request to the target machine room according to the target scheduling path.
[0101] In an embodiment of the present disclosure, the CDN network request scheduling device further includes a generating module for generating a first search request carrying target attribution information of a client based on a preset search mechanism, and sending the first search request to a cloud network control system to cause the cloud network control system to obtain a first domain name rewrite rule that matches the target attribution information from a plurality of domain name rewrite rules, and send the first domain name rewrite rule to the client, wherein the domain name rewrite rule is generated based on a first mapping relationship between the preset attribution information and a machine room identifier, a second mapping relationship between the machine room identifier and a domain name, and a preset traffic ratio; and receiving the first domain name rewrite rule sent by the cloud network control system and storing the first domain name rewrite rule.
[0102] In an embodiment of the present disclosure, the generation module is used to detect whether the target belonging information has been updated relative to the initial belonging information, obtain a detection result, where the initial belonging information is the belonging information stored by the client before receiving the original network request, and generate a first search request based on a request generation policy corresponding to the detection result.
[0103] In an embodiment of the present disclosure, the generation module is used to obtain a predetermined time interval when the detection result is not updated, and generate a first search request based on the predetermined time interval and the target attribution information, or to generate a first search request based on the target attribution information when the detection result is updated.
[0104] In an embodiment of the present disclosure, the second acquisition module 62 is used to acquire a target machine room identifier corresponding to the target attribution information from the first mapping relationship, acquire a candidate domain name corresponding to the target machine room 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.
[0105] In an embodiment of the present disclosure, the CDN network request scheduling device further includes an update module that is used to: receive response information fed back from the service access layer for forwarding the target network request; and, if a target identifier is carried in the response information, generate a second lookup request using the target attribution information, where the target identifier is used to indicate that the domain name rewrite rule corresponding to the target attribution information has been updated in the cloud network control system; send the second lookup request to the cloud network control system to have the cloud network control system distribute the second domain name rewrite rule corresponding to the target attribution information, where the second domain name rewrite rule is the domain name rewrite rule after the first domain name rewrite rule is updated; receive the second domain name rewrite rule, and use the second domain name rewrite rule to regenerate a second domain name corresponding to the original domain name.
[0106] 7 is a block diagram of a CDN network request scheduling device according to an embodiment of the present disclosure, which can be implemented as part or all of an electronic device using software, hardware, or a combination of both. As shown in FIG. 7, the device: a receiving module 71 for receiving a target network request from a client, the target network request including a first domain name including a target machine room identifier; a determining module 72 for determining a target back-to-source address corresponding to the target machine room identifier according to a correspondence relationship between a pre-defined back-to-source address and a machine room identifier; an acquisition module 73 for acquiring an access path corresponding to a target back-to-source address and a target machine room; and a forwarding module 74 for forwarding the target network request to the target machine room based on the access path.
[0107] 8 is a block diagram of a CDN network request scheduling device according to an embodiment of the present disclosure, which can be implemented as part or all of an electronic device using software, hardware, or a combination of both. As shown in FIG. 8, the device includes: a receiving module 81 for receiving a search request from a client, the search request including target belonging information corresponding to the client; a response module 82 for responding to a search request and obtaining a first domain name rewriting rule corresponding to target attribution information from a plurality of domain name rewriting rules, wherein the domain name rewriting rule is generated based on a first mapping relationship between a preset attribution information and a machine room identifier, a second mapping relationship between the machine room identifier and a domain name, and a preset traffic ratio; and a sending module 83 for sending the first domain name rewriting rule to the client to cause the requesting client to perform domain name rewriting based on the first domain name rewriting rule.
[0108] In an embodiment of the present disclosure, the CDN network request scheduling device further includes an update module for obtaining update information for the domain name rewrite rule, updating the domain name rewrite rule according to the update information, and obtaining an updated domain name rewrite rule; generating probe information according to the updated domain name rewrite rule, and sending the probe information to the service access layer, so that when the service access layer receives a target network request sent by a client, the service access layer determines whether the domain name rewrite rule corresponding to the target attribution information of the client has been updated according to the probe information; and if so, delivering response information carrying the target identifier to the client; receiving a second lookup request sent by the client, where the second lookup request carries the target attribution information; using the target attribution information to obtain a second domain name rewrite rule corresponding to the target attribution information from the updated domain name rewrite rule, and sending the second domain name rewrite rule to the client.
[0109] An embodiment of the present disclosure further provides an electronic device, which may include a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504, as shown in FIG. 9, where the processor 1501, the communication interface 1502, and the memory 1503 complete communication between each other via the communication bus 1504.
[0110] The memory 1503 is used to store computer programs. The processor 1501, when executing a computer program stored on the memory 1503, is used to implement the steps of the above embodiments.
[0111] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For convenience of illustration, a single thick line is shown in the drawing, but this does not mean that there is only one bus or only one type of bus.
[0112] The communication interface is used for communication between the terminal and other devices.
[0113] The memory may include random access memory (RAM) or non-volatile memory, such as at least one magnetic disk memory. Optionally, the memory may be at least one storage device remote from the processor.
[0114] The processor may be a general-purpose processor, including a central processing unit (abbreviated as CPU), a network processor (abbreviated as NP), etc., and may also be a digital signal processor (abbreviated as DSP), an application specific integrated circuit (abbreviated as ASIC), a field-programmable gate array (abbreviated as FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware assembly, etc.
[0115] In yet another embodiment of the present disclosure, a computer-readable storage medium is further provided, storing instructions that, when executed on a computer, cause the computer to perform the method for scheduling CDN network requests described in any one of the above embodiments.
[0116] In yet another embodiment of the present disclosure, a computer program product is further provided, the computer program product including instructions, which, when executed on a computer, cause the computer to perform the method for scheduling CDN network requests described in any one of the above embodiments.
[0117] The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded into a computer and executed, they generate, in whole or in part, the flows or functions described in the embodiments of the present disclosure. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, radio, microwave, etc.) method. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device, such as a server or data center, in which one or more available media are integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk).
[0118] The above description is merely a preferred embodiment of the present disclosure and is not intended to limit the scope of protection of the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure are all included in the scope of protection of the present disclosure.
[0119] The above descriptions are merely specific embodiments of the present disclosure, enabling those skilled in the art to understand or realize the present disclosure. Various modifications to these examples will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other examples without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the examples shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. 1. A method for scheduling CDN network requests for use by a client, comprising: Obtaining an original network request generated by the client for a target service, the original network request including target attribution information corresponding to the client and an original domain name for accessing the target service; Obtain a first domain name rewriting rule corresponding to the target attribution information, and use the first domain name rewriting rule to rewrite the original domain name to obtain a first domain name including a target CDN service provider identifier and a target machine room identifier; performing an update to the original domain name in the original network request using the first domain name to obtain a target network request; A method for scheduling a CDN network request, comprising: sending the target network request to a target CDN server corresponding to the target CDN service provider identifier, causing the target CDN server to obtain a target scheduling path corresponding to the target machine room identifier, and forwarding the target network request to the target machine room according to the target scheduling path.
2. Before obtaining a first domain name rewriting rule corresponding to the target attribution information, the method includes: generating a first search request carrying target membership information for the client based on a pre-configured search mechanism; sending the first search request to a cloud network control system, causing the cloud network control system to obtain a first domain name rewriting rule that matches the target attribution information from a plurality of domain name rewriting rules, and sending 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 a machine room identifier, a second mapping relationship between a machine room identifier and a domain name, and a preset traffic ratio; The method of claim 1 , further comprising: receiving the first domain name rewriting rule sent by the cloud network control system; and storing the first domain name rewriting rule.
3. generating the first search request based on the preset search mechanism; Detecting whether the target belonging information has been updated with respect to initial belonging information, and obtaining a detection result, wherein the initial belonging information is belonging information stored by the client before receiving the original network request; and generating the first search request based on a request generation policy corresponding to the detection result.
4. generating the first search request based on a request generation policy corresponding to the detection result, If the detection result has not been updated, acquiring a predetermined time interval, and generating the first search request based on the predetermined time interval and the target attribution information; Alternatively, if the detection result is an update, the method of claim 3 further comprises generating the first search request based on the target attribution information.
5. Rewriting the original domain name using the first domain name rewriting rule to obtain the first domain name, Obtaining a target machine room identifier corresponding to the target attribution information from the first mapping relationship, and obtaining a candidate domain name corresponding to the target machine room identifier from the second mapping relationship; 3. The method of claim 2, further comprising: obtaining a predetermined traffic ratio; and determining a candidate domain name that meets the predetermined traffic ratio as the first domain name.
6. After sending the target network request to a target CDN server corresponding to the first domain name, the method includes: receiving response information fed back from a service access layer for forwarding the target network request; If the response information carries a target identifier, generating a second search request using the target attribution information, wherein the target identifier is used to indicate that a domain name rewriting rule corresponding to the target attribution information has been updated in a cloud network control system; and sending the second search request to a cloud network control system to cause the cloud network control system to distribute a second domain name rewriting rule corresponding to the target attribution information, wherein the second domain name rewriting rule is a domain name rewriting rule after the first domain name rewriting rule has been updated; 2. The method of claim 1, further comprising: receiving the second domain name rewriting rule; and regenerating a second domain name corresponding to the original domain name utilizing the second domain name rewriting rule.
7. 1. A method for scheduling CDN network requests for use in a CDN server, comprising: receiving a target network request from a client, the target network request including a first domain name including a target machine room identifier; Determine a target back-to-source address corresponding to the target machine room identifier according to a correspondence relationship between a pre-defined back-to-source address and a machine room identifier; Obtaining an access path and a target machine room corresponding to the target back-to-source address; and forwarding the target network request to the target machine room based on the access path.
8. A method for scheduling CDN network requests for use in a cloud network control system, comprising: receiving a first search request from a client, the first search request including target belonging information corresponding to the client; In response to the first search request, obtain a first domain name rewriting rule corresponding to the target attribution information from a plurality of domain name rewriting rules, wherein the domain name rewriting rule is generated based on a first mapping relationship between a preset attribution information and a machine room identifier, a second mapping relationship between a machine room identifier and a domain name, and a preset traffic ratio; sending the first domain name rewriting rule to the client and causing the client to perform domain name rewriting based on the first domain name rewriting rule.
9. obtaining update information that affects the domain name rewriting rule, updating the domain name rewriting rule based on the update information, and obtaining an updated domain name rewriting rule; generating probe information based on the updated domain name rewriting rule, and sending the probe information to a service access layer, so that when the service access layer receives a target network request sent by the client, it determines based on the probe information whether the domain name rewriting rule corresponding to the target attribution information of the client has been updated; and if so, it delivers response information carrying a target identifier to the client; receiving a second search request sent from the client, the second search request carrying the target belonging information; 9. The method of claim 8, further comprising: obtaining a second domain name rewrite rule corresponding to the target attribution information from the updated domain name rewrite rule using the target attribution information; and sending the second domain name rewrite rule to the client.
10. An apparatus for scheduling CDN network requests, comprising: a first acquisition module configured to acquire an original network request generated by a client for a target service, the original network request including target attribution information corresponding to the client and an original domain name configured to access the target service; a second obtaining module configured to obtain a first domain name rewriting rule corresponding to the target attribution information, and use the first domain name rewriting rule to perform rewriting on the original domain name to obtain a first domain name including a target CDN service provider identifier and a target machine room identifier; an update module configured to use the first domain name to update an original domain name in the original network request to obtain a target network request; a sending module configured to send the target network request to a target CDN server corresponding to the target CDN service provider identifier, causing the target CDN server to obtain a target scheduling path corresponding to the target machine room identifier, and forward the target network request to the target machine room according to the target scheduling path.
11. An apparatus for scheduling CDN network requests, comprising: a receiving module configured to receive a target network request from a client, the target network request including a first domain name including a target machine room identifier; A determination module configured to determine a target back-to-source address corresponding to the target machine room identifier according to a correspondence relationship between a pre-defined back-to-source address and a machine room identifier; an acquisition module configured to acquire an access path and a target machine room corresponding to the target back-to-source address; a forwarding module configured to forward the target network request to the target machine room based on the access path.
12. An apparatus for scheduling CDN network requests, comprising: a receiving module configured to receive a search request from a client, the search request including target belonging information corresponding to the client; a response module configured to respond to the search request and obtain a first domain name rewriting rule corresponding to the target attribution information from a plurality of domain name rewriting rules, the domain name rewriting rule being generated based on a first mapping relationship between a preset attribution information and a machine room identifier, a second mapping relationship between a machine room identifier and a domain name, and a preset traffic ratio; a sending module configured to send the first domain name rewriting rule to the client and cause the client to perform domain name rewriting based on the first domain name rewriting rule.
13. A storage medium containing a program stored thereon, the program being adapted to perform the steps of the method of any one of claims 1 to 9 when executed.
14. An electronic device comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication among each other via the communication bus, and wherein: the memory is configured to store a computer program; 10. An electronic device, wherein the processor is configured to perform the steps of the method according to any one of claims 1 to 9 by executing a program stored on the memory.
Citation Information
Patent Citations
Configurable, adaptive wide-area traffic control and management
JP2005537687A
Method, Apparatus, and System for Location-Based Uniform Resource Locator
JP2008533847A
Route information search system and method
JP2015002378A
Method, system, and apparatus for identifying a geographical location using route tracing
JP2018521610A
Data synchronization method and system
US20210176310A1