Network request sending method and apparatus, computer device, and readable storage medium
By configuring a wildcard domain database and domain rewriting rules, the problem of a surge in the number of configuration files in CDN network requests with multiple domains and dynamic domains is solved, improving configuration efficiency and stability, supporting flexible domain name processing, and meeting the needs of multiple services.
Patent Information
- Application Number
- CN202411782288.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-12-05
AI Technical Summary
Existing CDN network request sending methods face a surge in the number of configuration files when dealing with multiple domains and dynamic domains, leading to increased difficulty and cost in operation and maintenance. Traditional channel configuration cannot meet dynamically changing needs.
It adopts a wildcard domain configuration database, obtains the specified level of the target domain, uses domain rewriting rules to search and modify the domain name in the database to obtain the request path, and supports sending network requests in scenarios with multiple domains and dynamic domains.
It improves the efficiency and stability of network information configuration, reduces the number of configuration files, saves maintenance workload, supports single customer multi-domain and dynamic domain scenarios, realizes one-to-many mapping between configuration files and domain names, and flexibly handles new or updated domain name configurations.
Smart Images

Figure CN119583658B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a network request sending method and device, computer equipment and a computer readable storage medium. BACKGROUND
[0002] A content delivery network (CDN) is a technology for accelerating network information transmission by deploying multiple nodes globally. When a user issues a network request, the request will first reach the gateway of the CDN edge node. The gateway, as a key part of the CDN system, will select the optimal node for the user according to the user's location, network conditions, and CDN caching and load balancing strategies to provide the corresponding content.
[0003] At present, CDN has been applied in many fields. For example, in the field of video live streaming, CDN can reduce network delay and improve the smoothness of live streaming. However, with the rapid development of the video live streaming industry and CDN business, the traditional frequency channel configuration parsing method gradually exposes some problems. On the one hand, with the increase of business types of live streaming manufacturers, a manufacturer may have numerous domain names, and the use of the frequency channel configuration method will result in an explosive increase in the number of configuration files, increasing the difficulty and cost of operation and maintenance. On the other hand, some manufacturers use HTTPDNS (HTTP Domain Name Resolution Service) technology and dynamic domain name method, so that each user request corresponds to a separate domain name, and the frequency channel configuration cannot meet the needs of such dynamic changes.
[0004] Therefore, there is an urgent need for a network request sending method that can improve the efficiency of network information configuration. SUMMARY
[0005] Therefore, it is necessary to provide a network request sending method, device, computer equipment, computer readable storage medium and computer program product that can improve the efficiency of network information configuration.
[0006] In a first aspect, the present application provides a network request sending method, comprising:
[0007] obtaining a target domain name of a network request and a generic domain name configuration database;
[0008] determining a specified level in the target domain name;
[0009] if the generic domain name configuration database matches the specified level, finding a domain name rewriting rule matching the specified level in the generic domain name configuration database;
[0010] In a case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, the target domain name is modified based on the domain name rewriting rule, and a request path corresponding to the modified target domain name is obtained.
[0011] The network request is sent based on the request path.
[0012] In one of the embodiments, the specified level is determined in the target domain name, including:
[0013] The target domain name is searched in the dynamic configuration database.
[0014] In a case where the target domain name is not searched in the dynamic configuration database, the specified level is determined in the target domain name.
[0015] In one of the embodiments, after the target domain name is modified based on the domain name rewriting rule in a case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, and the request path corresponding to the modified target domain name is obtained, the method further includes:
[0016] The modified target domain name is searched in the dynamic configuration database.
[0017] In a case where the modified target domain name is searched in the dynamic configuration database, the request path is obtained.
[0018] In one of the embodiments, the specified level is determined in the target domain name, including:
[0019] A second-level domain name and / or a top-level domain name are determined in the target domain name.
[0020] In one of the embodiments, in a case where the specified level is matched in the generic domain name configuration database, the domain name rewriting rule matching the specified level is searched in the generic domain name configuration database, including:
[0021] A regular expression of the generic domain name configuration database is obtained.
[0022] The specified level is matched in the generic domain name configuration database based on the specified level and the regular expression.
[0023] In one of the embodiments, in a case where the specified level is matched in the generic domain name configuration database, the domain name rewriting rule matching the specified level is searched in the generic domain name configuration database, including:
[0024] In a case where the domain name rewriting rule matching the specified level is not found in the generic domain name configuration database, domain name resolution failure information is sent.
[0025] In a second aspect, the present application provides a network request sending device, the device comprising:
[0026] an acquisition module configured to acquire a target domain name of a network request and a generic domain name configuration database;
[0027] a determination module configured to determine a specified level in the target domain name;
[0028] a matching module configured to, in the case that the generic domain name configuration database matches the specified level, search the generic domain name configuration database for a domain name rewriting rule matching the specified level;
[0029] a modification module configured to, in the case that the generic domain name configuration database finds the domain name rewriting rule matching the specified level, modify the target domain name based on the domain name rewriting rule and acquire a request path corresponding to the modified target domain name;
[0030] a sending module configured to send the network request based on the request path.
[0031] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0032] acquiring a target domain name of a network request and a generic domain name configuration database;
[0033] determining a specified level in the target domain name;
[0034] in the case that the generic domain name configuration database matches the specified level, searching the generic domain name configuration database for a domain name rewriting rule matching the specified level;
[0035] in the case that the generic domain name configuration database finds the domain name rewriting rule matching the specified level, modifying the target domain name based on the domain name rewriting rule and acquiring a request path corresponding to the modified target domain name;
[0036] sending the network request based on the request path.
[0037] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the following steps:
[0038] acquiring a target domain name of a network request and a generic domain name configuration database;
[0039] determining a specified level in the target domain name;
[0040] In a case where the specified level matches the generic domain name configuration database, a domain name rewriting rule matching the specified level is found in the generic domain name configuration database;
[0041] In a case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, the target domain name is modified based on the domain name rewriting rule, and a request path corresponding to the modified target domain name is obtained;
[0042] The network request is sent based on the request path.
[0043] In a fifth aspect, the present application further provides a computer program product, comprising a computer program which, when executed by a processor, implements the following steps:
[0044] obtaining a target domain name of a network request and a generic domain name configuration database;
[0045] determining a specified level in the target domain name;
[0046] In a case where the specified level matches the generic domain name configuration database, a domain name rewriting rule matching the specified level is found in the generic domain name configuration database;
[0047] In a case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, the target domain name is modified based on the domain name rewriting rule, and a request path corresponding to the modified target domain name is obtained;
[0048] The network request is sent based on the request path.
[0049] The network request sending method, device, computer device, computer readable storage medium and computer program product described above, first, by setting the generic domain name configuration database, the corresponding configuration file of the target domain name can be quickly located, the efficiency and stability of configuration parsing are improved. Moreover, by setting the generic domain name configuration database, multiple business domain names can be quickly covered, the number of configuration files is reduced, thereby saving the workload and work difficulty of operation and maintenance personnel, and improving the efficiency of the overall process. Then, the present application can meet the scenario of single customer existing multiple domain names, and also supports the scenario of using dynamic domain names, realizing the one-to-many mapping relationship of configuration files and domain names. Finally, in the present application, new domain name configurations or existing configurations can be conveniently added in the generic domain name configuration database, without the need for separate processing of each domain name, so that the processing mode of the target domain name is more flexible, and more business needs can be met. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained from these drawings without creative labor.
[0051] Figure 1 The sending method of network request provided for the first embodiment is shown in the schematic diagram.
[0052] Figure 2 The sending method of network request provided for the second embodiment is shown in the schematic diagram.
[0053] Figure 3 The sending method of network request provided for the third embodiment is shown in the schematic diagram.
[0054] Figure 4 The sending method of network request provided for the fourth embodiment is shown in the schematic diagram.
[0055] Figure 5 The sending method of network request provided for the fifth embodiment is shown in the schematic diagram.
[0056] Figure 6 The sending method of network request provided for the sixth embodiment is shown in the schematic diagram.
[0057] Figure 7 The structural block diagram of the sending device of network request in an embodiment is shown in the schematic diagram.
[0058] Figure 8 The internal structure diagram of the computer device in an embodiment is shown in the schematic diagram. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0060] In an embodiment, a sending method of network request is provided, and the present embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through the interaction of the terminal and the server. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and Internet of Things devices. The server can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0061] Please refer toFigure 1 In this embodiment, the sending method of network request comprises the following steps:
[0062] Step S100: Obtain the target domain name of the network request and the generic domain name configuration database.
[0063] In step S100, as an example, a user can initiate a network request from a browser or a client. The network request can include a target domain name. The target domain name can be the domain name of the website that the network request hopes to access. As an example, in CDN live streaming, the target domain name can be related to the subdomain name of the service that the user actually wants to access, but the target domain name can not directly correspond to the real service domain name. As an example, the target domain name can be a1b2.abc.com.
[0064] The generic domain name configuration database can contain all possible generic domain name matching rules and corresponding domain name rewriting rules. The matching rules and rewriting rules can be used to convert the target domain name into the real service domain name. As an example, the generic domain name configuration database can include a global configuration file.
[0065] Step S200: Determine the specified level in the target domain name.
[0066] In step S200, the target domain name can include multiple levels. As an example, the target domain name can include a subdomain name, a second-level domain name, and a top-level domain name, etc. Specifically, the subdomain name can include the leftmost part of the domain name. The subdomain name can be used to distinguish different services or functions under the same top-level domain name. The second-level domain name can be used to represent the name of an organization, a company, or a brand. The top-level domain name can include the rightmost part of the domain name, and the top-level domain name can be used to indicate the top-level category to which the domain name belongs, etc. As an example, in a1b2.abc.com, the subdomain name can be a1b2, the second-level domain name can be abc, and the top-level domain name can be com.
[0067] After obtaining the target domain name, the specified level in the domain name can be determined, so that the matching rule in the generic domain name configuration database can be found. As an example, the specified level can include the second-level domain name and / or the top-level domain name in the target domain name. For example, in a1b2.abc.com, the specified level can include abc.com.
[0068] Step S300: In the case that the generic domain name configuration database matches the specified level, find the domain name rewriting rule that matches the specified level in the generic domain name configuration database.
[0069] In step S300, the rule that matches the level can be found in the generic domain name configuration database. This matching process can be based on regular expression matching, or based on other string matching algorithms.
[0070] After the matching is successful, the domain name rewriting rule corresponding to the specified level can be determined in the generic domain name configuration database.
[0071] Step S400: In the case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, the target domain name is modified based on the domain name rewriting rule, and the request path corresponding to the modified target domain name is obtained.
[0072] In step S400, after the matching domain name rewriting rule is found, the target domain name can be modified according to the rules. This modification process can include replacing a part of the domain name, adding or deleting some characters, etc. The modified target domain name can include a real business domain name. Then, the corresponding request path can be obtained according to the modified target domain name. This request path can be the path part in the network request, or it can be a new path generated according to the domain name rewriting rule. As an example, the path (URI) of the original request can be “ / a1b2.abc.com / real_domain / app / stream / …”, after splitting the path, the target domain name a1b2.abc.com is identified. Correspondingly, the target domain name is modified (deleted, etc.), and the request path corresponding to the modified target domain name is “ / real_domain / app / stream / …”.
[0073] Step S500: Based on the request path, a network request is sent.
[0074] In step S500, the network request can be sent according to the modified target domain name and the request path. As an example, the network request can be sent to the address corresponding to the real business domain name on the CDN or server, so as to obtain the content that the user wants to access. Of course, in this process, the CDN or server can find and return the corresponding resource according to the domain name and path in the network request.
[0075] In this embodiment, first, by setting the generic domain name configuration database, the configuration file corresponding to the target domain name can be quickly located, and the efficiency and stability of configuration parsing are improved. Moreover, by setting the generic domain name configuration database, multiple business domain names can be quickly covered, the number of configuration files is reduced, thereby saving the workload and work difficulty of the operation and maintenance personnel during configuration, and improving the efficiency of the overall process. Then, this embodiment can meet the scenario where a single customer has multiple domain names, and also supports the scenario of using dynamic domain names, realizing the one-to-many mapping relationship between the configuration file and the domain name. Finally, in this embodiment, new domain name configurations or existing configurations can also be conveniently added in the generic domain name configuration database, without the need to handle each domain name individually, so that the processing mode of the target domain name is more flexible, and more business needs can be met.
[0076] In one embodiment, referring to Figure 2 , step S200 can include:
[0077] Step S210: searching the target domain name in the dynamic configuration database.
[0078] In step S210, the dynamic configuration database can include a database storing domain names and corresponding configuration information, which can include request forwarding paths, load balancing strategies, etc. Of course, the dynamic configuration database can be updated regularly to meet the needs of business development. By searching the target domain name in the dynamic configuration database, it can be quickly determined whether there is configuration information directly matched with the target domain name.
[0079] Step S220: determining the specified level in the target domain name in the case that the target domain name is not found in the dynamic configuration database.
[0080] In step S220, in the case that the configuration information directly matched with the target domain name is not found in the dynamic configuration database, it indicates that the target domain name may need to be matched with a generic domain name. Therefore, at this time, the specified level in the target domain name can be determined.
[0081] Of course, if the target domain name is found in the dynamic configuration database, indicating that there is a configuration file with the target domain name, the configuration file is read and the processing step is performed.
[0082] In this embodiment, the target domain name is searched in the dynamic configuration database, so that it can be quickly judged whether the target domain name exists in the database. If the target domain name exists, its corresponding configuration information can be directly obtained without the need to perform subsequent steps, thereby improving the parsing efficiency.
[0083] In one embodiment, referring to Figure 3 , step S400 can include:
[0084] Step S600: searching the modified target domain name in the dynamic configuration database.
[0085] In step S400, the target domain name can be modified based on the domain name rewriting rule. At this time, in step S600, the modified target domain name can be searched in the dynamic configuration database.
[0086] Step S610: obtaining the request path in the case that the modified target domain name is found in the dynamic configuration database.
[0087] In step S610, if there is a corresponding dynamic configuration, subsequent processing is performed according to the configuration. In addition, if there is no corresponding dynamic configuration, it is confirmed that the domain name configuration resolution fails. As an example, the domain name configuration resolution failure can include that the configuration file does not exist, the configuration file is damaged, or the domain name rewriting rule is invalid, etc.
[0088] In this embodiment, the modified target domain name is found in the dynamic configuration database, thereby improving the correctness of domain name rewriting and ensuring that the subsequent processing flow can proceed normally. At the same time, the dynamic configuration database can be updated in real time, thereby allowing flexible domain name processing according to different domain name configurations and request scenarios, which helps to meet different business needs and user requests.
[0089] In one embodiment, referring to Figure 4 , step S300 includes:
[0090] Step S310: Obtain the regular expression of the generic domain name configuration database.
[0091] In step S310, the configuration of each group of generic domain names in the generic domain name configuration database can include a regular expression and a corresponding domain name configuration file. This embodiment does not limit the specific form of the regular expression.
[0092] Step S320: Match the specified level in the generic domain name configuration database based on the specified level and the regular expression.
[0093] In step S320, the regular expression set can be traversed to determine whether there is a rule matching the specified level. If a matching item is found in the generic domain name configuration database matching the specified level, the configuration information or domain name rewriting rule can be read and applied.
[0094] In addition, if no matching item is found, an error message can be returned or other measures can be taken to process the domain name request. As an example, referring to Figure 5 , step S300 can further include:
[0095] Step S330: In the case where no domain name rewriting rule matching the specified level is found in the generic domain name configuration database, send domain name resolution failure information.
[0096] In this embodiment, the matching is performed by using regular expressions, and a plurality of different generic domain name patterns can be used, thereby improving the flexibility and adaptability of the configuration. Moreover, as the business develops and changes, new regular expression rules can be added to the generic domain name configuration database to support new domain name patterns and processing logic. Secondly, by matching the specified level and regular expression, the domain name request that meets the generic domain name rule can be more accurately identified and processed, and the possibility of configuration errors and parsing failures is reduced.
[0097] Please refer to Figure 6The following exemplary describes a network request sending method provided by one or more embodiments of the present application. It can be understood that the network request sending method provided by one or more embodiments of the present application can be applied to the scene of requesting to use the same multi-domain name as the primary domain name and the dynamic domain name. First, when the network request reaches the gateway, the gateway parses the request domain name of the user. For example, the domain name can be a1b2.abc.com. At this time, the original default logic can be used to search in the dynamic configuration directory whether there is a corresponding subchannel configuration. If there is a corresponding configuration file a1b2.abc.com.conf under the dynamic configuration directory, subsequent processing is performed according to the subchannel configuration. If there is no corresponding configuration, it is determined whether it is a generic domain name. Then, when there is no corresponding configuration file under the dynamic configuration directory, the global configuration file containing all supported configurable generic domain names is read, and the domain name a1b2.abc.com is matched with the generic domain name in the configuration. A regular expression and a corresponding domain name configuration file are included in the configuration of each group of generic domain names. If the original domain name successfully matches one of the configurations, the corresponding domain name configuration file under the dynamic configuration directory is searched again. If all the generic domain name configurations recorded in the global configuration file fail to match, it means that there is no corresponding configuration for the domain name, and the domain name resolution fails. Then, the corresponding domain name configuration file under the dynamic configuration directory is read. Since the domain name in this configuration file is only used for Secure Sockets Layer (SSL) decryption, not the specific business domain name, only SSL-related configurations and the configuration of the new domain name rewriting module are performed in this file. In the application scenario of the present application, the real business domain name is located at the next level of the original domain name, and the URI of the original request can be “ / a1b2.abc.com / real_domain / app / stream / …”. The domain name rewriting module can split the request URI to identify the domain name a1b2.abc.com that needs to be rewritten and the rewritten URI “ / real_domain / app / stream / …”. If the reading of the domain name configuration file under the dynamic configuration directory fails, it means that there is no corresponding domain name configuration, and the domain name resolution fails. Further, after obtaining the rewritten URI, the URI is used as the request URI for subsequent business process processing, the domain name real_domain can be identified, the corresponding real_domain.conf subchannel configuration under the dynamic configuration directory is read, and the gateway operation and processing are performed according to the configuration. If there is no subchannel configuration, it means that the domain name rewriting is incorrect or lacks configuration, and the domain name resolution fails. It can be seen that, in the present application, the live configuration parsing method based on the generic domain name can solve the scene that is difficult to support by the original subchannel configuration method, improve the efficiency of gateway configuration parsing, and enrich the applicable scene of the live gateway.
[0098] It should be understood that although each step in the flowchart involved in the embodiments described above is shown in sequence according to the arrow, the steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of the steps has no strict order limitation, and the steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0099] Based on the same inventive concept, the embodiments of the present application also provide a network request sending device for implementing the network request sending method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more network request sending device embodiments provided below can refer to the limitations of the network request sending method described above, and will not be repeated here.
[0100] In an exemplary embodiment, as shown in Figure 7 A network request sending device is provided, comprising: an acquisition module, a determination module, a matching module, a modification module, and a sending module, wherein:
[0101] The acquisition module is configured to acquire a target domain name of a network request and a generic domain name configuration database.
[0102] The determination module is configured to determine a specified level in the target domain name.
[0103] The matching module is configured to, in the case that the generic domain name configuration database matches the specified level, find a domain name rewriting rule matching the specified level in the generic domain name configuration database.
[0104] The modification module is configured to, in the case that the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, modify the target domain name based on the domain name rewriting rule, and acquire a request path corresponding to the modified target domain name.
[0105] The sending module is configured to send the network request based on the request path.
[0106] In an embodiment, the determination module is configured to find the target domain name in the dynamic configuration database; and in the case that the target domain name is not found in the dynamic configuration database, determine the specified level in the target domain name.
[0107] In an embodiment, the modifying module is configured to find the modified target domain name in the dynamic configuration database; and in a case that the modified target domain name is found in the dynamic configuration database, acquire the request path.
[0108] In an embodiment, the determining module is configured to determine a second-level domain name and / or a top-level domain name in the target domain name.
[0109] In an embodiment, the matching module is configured to acquire a regular expression of the generic domain name configuration database; and match the specified level in the generic domain name configuration database based on the specified level and the regular expression.
[0110] In an embodiment, the matching module is configured to, in a case that no domain name rewriting rule matching the specified level is found in the generic domain name configuration database, send domain name resolution failure information.
[0111] The modules in the network request sending apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the modules.
[0112] In addition, the network request sending apparatus can further include a first module, a second module, and the like, to implement other method steps provided by one or more embodiments of the present application.
[0113] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 8 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store network request sending data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a network request sending method.
[0114] Those skilled in the art can understand that, Figure 8The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] In one exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0116] Step S100: Obtain a target domain name of a network request and a generic domain name configuration database.
[0117] Step S200: Determine a specified level in the target domain name.
[0118] Step S300: In the case where the generic domain name configuration database matches the specified level, find a domain name rewriting rule matching the specified level in the generic domain name configuration database.
[0119] Step S400: In the case where the domain name rewriting rule matching the specified level is found in the generic domain name configuration database, modify the target domain name based on the domain name rewriting rule, and obtain a request path corresponding to the modified target domain name.
[0120] Step S500: Send the network request based on the request path.
[0121] In one embodiment, the processor further implements the following steps when executing the computer program:
[0122] Step S210: Find the target domain name in the dynamic configuration database.
[0123] Step S220: In the case where the target domain name is not found in the dynamic configuration database, determine a specified level in the target domain name.
[0124] In one embodiment, the processor further implements the following steps when executing the computer program:
[0125] Step S600: Find the modified target domain name in the dynamic configuration database.
[0126] Step S610: In the case where the modified target domain name is found in the dynamic configuration database, obtain a request path.
[0127] In one embodiment, the processor further implements the following steps when executing the computer program:
[0128] Step S310: Obtain a regular expression of the generic domain name configuration database.
[0129] Step S320: matching the specified level in the generic domain name configuration database based on the specified level and the regular expression.
[0130] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0131] Step S330: sending a domain name resolution failure information in the case that no domain name rewriting rule matching the specified level is found in the generic domain name configuration database.
[0132] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program, when executed by the processor, implements the following steps:
[0133] Step S100: obtaining a target domain name of a network request and a generic domain name configuration database.
[0134] Step S200: determining a specified level in the target domain name.
[0135] Step S300: finding a domain name rewriting rule matching the specified level in the generic domain name configuration database in the case that the specified level is matched in the generic domain name configuration database.
[0136] Step S400: modifying the target domain name based on the domain name rewriting rule and obtaining a request path corresponding to the modified target domain name in the case that the domain name rewriting rule matching the specified level is found in the generic domain name configuration database.
[0137] Step S500: sending the network request based on the request path.
[0138] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0139] Step S210: finding the target domain name in the dynamic configuration database.
[0140] Step S220: determining the specified level in the target domain name in the case that the target domain name is not found in the dynamic configuration database.
[0141] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0142] Step S600: finding the modified target domain name in the dynamic configuration database.
[0143] Step S610: obtaining the request path in the case that the modified target domain name is found in the dynamic configuration database.
[0144] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0145] Step S310: Obtain the regular expression of the universal domain name configuration database.
[0146] Step S320: Match the specified level in the universal domain name configuration database based on the specified level and the regular expression.
[0147] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0148] Step S330: In the case that no domain name rewriting rule matching the specified level is found in the universal domain name configuration database, send domain name resolution failure information.
[0149] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by the processor, implements the following steps:
[0150] Step S100: Obtain the target domain name of a network request and a universal domain name configuration database.
[0151] Step S200: Determine the specified level in the target domain name.
[0152] Step S300: In the case that the specified level is matched in the universal domain name configuration database, find the domain name rewriting rule matching the specified level in the universal domain name configuration database.
[0153] Step S400: In the case that the domain name rewriting rule matching the specified level is found in the universal domain name configuration database, modify the target domain name based on the domain name rewriting rule, and obtain the request path corresponding to the modified target domain name.
[0154] Step S500: Send the network request based on the request path.
[0155] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0156] Step S210: Find the target domain name in the dynamic configuration database.
[0157] Step S220: In the case that the target domain name is not found in the dynamic configuration database, determine the specified level in the target domain name.
[0158] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0159] Step S600: Find the modified target domain name in the dynamic configuration database.
[0160] Step S610: In the case that the modified target domain name is found in the dynamic configuration database, obtain the request path.
[0161] In one embodiment, the computer program which is executed by the processor further implements the following steps:
[0162] Step S310: Obtain the regular expression of the generic domain name configuration database.
[0163] Step S320: Match the specified level in the generic domain name configuration database based on the specified level and the regular expression.
[0164] In one embodiment, the computer program which is executed by the processor further implements the following steps:
[0165] Step S330: In the case that no domain name rewriting rule matching the specified level is found in the generic domain name configuration database, send domain name resolution failure information.
[0166] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0167] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0168] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for sending a network request, characterized in that, include: Obtain the target domain name and wildcard domain configuration database for the network request; Determine the specified level within the target domain name; If the specified level is matched in the wildcard domain configuration database, the domain name rewriting rule matching the specified level is searched in the wildcard domain configuration database. If a domain name rewriting rule matching the specified level is found in the wildcard domain name configuration database, the target domain name is modified based on the domain name rewriting rule, and the request path corresponding to the modified target domain name is obtained. Based on the requested path, the network request is sent.
2. The method for sending a network request according to claim 1, characterized in that, Determining the specified level within the target domain name includes: Search for the target domain name in the dynamic configuration database; If the target domain name is not found in the dynamic configuration database, a specified level is determined from the target domain name.
3. The method for sending a network request according to claim 2, characterized in that, When a domain rewriting rule matching the specified level is found in the wildcard domain configuration database, the target domain name is modified based on the domain rewriting rule, and the request path corresponding to the modified target domain name is obtained, including: The modified target domain name is searched in the dynamic configuration database; If the modified target domain name is found in the dynamic configuration database, the request path is obtained.
4. The method for sending a network request according to claim 1, characterized in that, Determining the specified level within the target domain name includes: Determine the second-level domain and / or top-level domain from the target domain.
5. The method for sending a network request according to claim 1, characterized in that, When the specified level is matched in the wildcard domain configuration database, the step of searching the wildcard domain configuration database for a domain rewriting rule that matches the specified level includes: Obtain the regular expression for the wildcard domain configuration database; Based on the specified level and the regular expression, the specified level is matched in the wildcard domain configuration database.
6. The method for sending a network request according to claim 1, characterized in that, When the specified level is matched in the wildcard domain configuration database, the step of searching the wildcard domain configuration database for a domain rewriting rule that matches the specified level includes: If no domain name rewriting rule matching the specified level is found in the wildcard domain configuration database, a domain name resolution failure message is sent.
7. A device for sending network requests, characterized in that, The device includes: The acquisition module is used to obtain the target domain name of the network request and the wildcard domain configuration database; The determination module is used to determine a specified level within the target domain name; The matching module is used to search for domain name rewriting rules that match the specified level in the wildcard domain configuration database when the specified level is matched in the wildcard domain configuration database. The modification module is used to modify the target domain name based on the domain name rewriting rule when a domain name rewriting rule matching the specified level is found in the wildcard domain name configuration database, and to obtain the request path corresponding to the modified target domain name. The sending module is used to send the network request based on the request path.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Domain name identification method and device, equipment and medium
CN109995886A
Data proxy method and system, and proxy server
CN112272158A