Multi-level proxy dynamic routing method, device and system based on extensive domain name
Through pan-domain name resolution rules and corresponding relationships, the proxy address and service address are dynamically determined, which solves the arduous problem of maintaining the corresponding relationship between domain names and IP addresses in the existing technology, realizes multi-level dynamic routing and request forwarding, and improves access flexibility and Work efficiency.
Patent Information
- Application Number
- CN202411180886.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-10-11
AI Technical Summary
When maintaining the correspondence between domain names and IP addresses, the existing technology leads to heavy configuration management and code modification burdens, and is not conducive to developer access. Especially in complex business scenarios, specific services cannot be accessed directly from domain names.
Using a multi-level proxy dynamic routing method based on pan-domain names, the gateway pre-stores pan-domain name resolution rules, the correspondence between the first domain name segment and proxy address information, and the correspondence between the second domain name segment and service address information, dynamically Determine the target proxy address and service address to implement request forwarding.
It simplifies the domain name configuration and routing process, improves access flexibility, reduces the burden on developers, enables request forwarding in multi-level business scenarios, and improves work efficiency and the efficiency of handling production problems.
Smart Images

Figure CN118764429A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a multi-level proxy dynamic routing method, device and system based on wildcard domain names. Background Art
[0002] The forwarding of service requests usually requires the proxy server to maintain the corresponding relationship between the domain name and the IP address for routing. For example, the patent document with publication number CN112637346A is cited here, which discloses a proxy method, device, proxy server and storage medium. When receiving an access request sent by a client, the proxy server obtains the target domain name carried by the access request, and obtains the target IP address corresponding to the target domain name based on the pre-stored correspondence between the domain name and the IP address; then, the access request is forwarded to the target business server corresponding to the target IP address, so that the target business server responds to the access request and returns the request result; the proxy server then feeds back the request result to the client.
[0003] However, domain names usually have long character strings. The existing technology for maintaining the correspondence between domain names and IP addresses will bring heavy configuration management or code modification burdens and is not conducive to access by developers. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a multi-level proxy dynamic routing method, device and system based on wildcard domain names that overcome the above problems or at least partially solve the above problems.
[0005] The present application discloses a multi-level proxy dynamic routing method based on wildcard domain names, the method involves a user end, a gateway end, a proxy end and a service end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The method comprises: When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; The gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; The gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; The gateway sends the access request and the target service address information to the proxy via the target proxy address information; the proxy sends the access request to the server via the target service address information; the server determines the request result based on the access request and returns the request result to the user.
[0006] Furthermore, the wildcard domain name resolution rules include domain name separators and domain name segment order; The step of determining the target first domain name segment and the target second domain name segment by the gateway according to the target wildcard domain name and the wildcard domain name resolution rule comprises: The gateway determines a valid information string according to the target wildcard domain name; The gateway determines the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order.
[0007] Furthermore, the step of determining a valid information string according to the target wildcard domain name by the gateway includes: The gateway removes the primary domain name information according to the target wildcard domain name, and intercepts a valid information character string.
[0008] Furthermore, the gateway determines the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order, including: The gateway divides the valid information string according to the domain name separator and arranges them in sequence to determine a string sequence; The gateway determines the target first domain name segment and the target second domain name segment according to the character string sequence and the order of the domain name segments.
[0009] Furthermore, the target first domain name segment includes a target computer room name; The step of determining the target proxy address information by the gateway according to the target first domain name segment and the first corresponding relationship includes: The gateway determines the target proxy address information according to the target computer room name and the first corresponding relationship.
[0010] Further, the target second domain name segment includes a target service name, a target environment name, and a target business line name; The step of determining the target service address information by the gateway according to the target second domain name segment and the second corresponding relationship includes: The gateway determines the target service address information according to the target service name, the target environment name, the target business line name and the second corresponding relationship.
[0011] Furthermore, the target second domain name segment includes: a target IP address and a target port number; The step of determining the target service address information by the gateway according to the target second domain name segment and the second corresponding relationship includes: The gateway determines the target service address information according to the target IP address, the target port number and the second corresponding relationship.
[0012] The present application also discloses a multi-level proxy dynamic routing device based on wildcard domain names, the device involves a user end, a gateway end, a proxy end and a service end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The device comprises: A wildcard domain name resolution module, used to determine a target first domain name segment and a target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; A proxy address information determination module, configured to determine target proxy address information according to the target first domain name segment and the first corresponding relationship; A service address information determination module, used to determine the target service address information according to the target second domain name segment and the second corresponding relationship; A sending module is used to send the access request and target service address information to the proxy end through the target proxy address information; the proxy end is used to send the access request to the server end through the target service address information; the server end is used to determine the request result based on the access request, and return the request result to the user end.
[0013] The present application also discloses a multi-level proxy dynamic routing system based on wildcard domain names, the system comprising a user end, a gateway end, a proxy end and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; The system comprises: The user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The gateway end is used to determine the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule, and determine the target proxy address information according to the target first domain name segment and the first corresponding relationship, and determine the target service address information according to the target second domain name segment and the second corresponding relationship, and send the access request and the target service address information to the proxy end through the target proxy address information; The proxy end is used to send the access request to the server end through the target service address information; The server is used to determine a request result according to the access request, and return the request result to the client.
[0014] Furthermore, the proxy terminals include at least two; the server terminals include at least two; the proxy terminals correspond to the server terminals one by one; The gateway end includes an OpenResty server, and the proxy end includes an OpenResty Proxy proxy server; the gateway end is connected to the proxy end through IP whitelist access or VPN access.
[0015] This application has the following advantages: In the embodiments of the present application, compared with the prior art, maintaining the correspondence between domain names and IP addresses will bring heavy configuration management or code modification burdens, and is not conducive to developer access. The present application provides a multi-level proxy dynamic routing method, device and system based on wildcard domain names, the method involving a user end, a gateway end, a proxy end and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; the method includes: when receiving When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; the gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; the gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; the gateway sends the access request and the target service address information to the proxy through the target proxy address information; the proxy is used to send the access request to the server through the target service address information; the server is used to determine the request result according to the access request, and return the request result to the user. This application solves the problem that the prior art maintains the correspondence between domain names and IP addresses, which is not conducive to developers' access, and achieves the technical effect of realizing request forwarding through multi-level dynamic routing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 This is a flowchart of a multi-level proxy dynamic routing method based on wildcard domain names provided by an embodiment of the present application; Figure 2 It is a structural diagram of a multi-level proxy dynamic routing device based on wildcard domain names provided by an embodiment of the present application; Figure 3 This is a first structural block diagram of a multi-level proxy dynamic routing system based on wildcard domain names provided by an embodiment of the present application; Figure 4 This is a second structural block diagram of a multi-level proxy dynamic routing system based on wildcard domain names provided by an embodiment of the present application; Figure 5This is a first data transmission structure diagram of a multi-level proxy dynamic routing method based on wildcard domain names provided by an embodiment of the present application; Figure 6 It is a second data transmission structure diagram of a multi-level proxy dynamic routing method based on wildcard domain names provided by an embodiment of the present application; Figure 7 It is a structural diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the objects, features and advantages of the present application more obvious and understandable, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0019] The inventors found through analyzing the prior art that domain names usually have long character strings, and maintaining the correspondence between domain names and IP addresses will bring about a heavy burden of configuration management or code modification, and is not conducive to developer access. At the same time, for more complex business scenarios, a single server (computer room) can have multiple environments, and an environment can have multiple business lines, so there are multiple target IP addresses under the same server. The prior art will select one from the multiple target IP addresses and forward the access request to the target server corresponding to the selected target IP address, and it is impossible to directly access the specific service from the domain name. The prior art has poor flexibility in domain name configuration and the routing process when performing access.
[0020] To solve the above technical problems, one of the core technical concepts of this application is to introduce a wildcard domain name mechanism in a multi-level business scenario, carrying multi-level routing information in the form of a wildcard domain name, thereby realizing service request forwarding. A wildcard domain name is a special Internet domain name that is used to refer to multiple sub-websites or pages in a specific field. For example, a company can use a wildcard domain name to group the web pages of its different products or services into a large category and establish their own subdomains under the wildcard domain name. The wildcard in the wildcard domain name can connect all related subdomains in series, making it easier for users to access and manage.
[0021] It should be noted that, in the embodiments disclosed in the present application, unless otherwise specified, any feature may be replaced by other alternative features that are equivalent or have similar purposes; the features and / or steps in the embodiments of the present application, except for mutually exclusive features and / or steps, may be combined in any way.
[0022] Reference Figure 1, shows a multi-level proxy dynamic routing method based on wildcard domain names provided by an embodiment of the present application, the method involves a user end, a gateway end, a proxy end and a service end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The method comprises: S110, when receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; S120, the gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; S130, the gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; S140, the gateway sends the access request and the target service address information to the proxy through the target proxy address information; the proxy sends the access request to the server through the target service address information; the server determines the request result based on the access request, and returns the request result to the user.
[0023] In the embodiments of the present application, compared with the prior art, maintaining the correspondence between domain names and IP addresses will bring heavy configuration management or code modification burdens, and is not conducive to developer access. The present application provides a multi-level proxy dynamic routing method, device and system based on wildcard domain names, the method involving a user end, a gateway end, a proxy end and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; the method includes: when receiving When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; the gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; the gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; the gateway sends the access request and the target service address information to the proxy through the target proxy address information; the proxy is used to send the access request to the server through the target service address information; the server is used to determine the request result according to the access request, and return the request result to the user. This application solves the problem that the prior art maintains the correspondence between domain names and IP addresses, which is not conducive to developers' access, and achieves the technical effect of realizing request forwarding through multi-level dynamic routing.
[0024] Next, a multi-level proxy dynamic routing method based on wildcard domain names in this exemplary embodiment will be further described.
[0025] It should be noted that the gateway end can be a web operation and maintenance platform developed based on the OpenResty framework, referred to as the OpenResty operation and maintenance platform. OpenResty is a high-performance Web platform based on Nginx and Lua, which integrates a large number of sophisticated Lua libraries, third-party modules and most dependencies. It is used to easily build dynamic Web applications, Web services and dynamic gateways that can handle ultra-high concurrency and high scalability. The OpenResty operation and maintenance platform allows users to add the correspondence between specific identifiers in the domain name and the backend service address, that is, the address of the backend service can be uniquely determined by these specific identifiers. The OpenResty operation and maintenance platform is equivalent to automatically generating a domain name for the corresponding specific service, and placing the routing information represented by these specific identifiers directly in a domain name under a standard rule (corresponding to the main domain name of the OpenResty operation and maintenance platform). The OpenResty operation and maintenance platform can quickly obtain routing information from the wildcard domain name before forwarding the request, and then complete the correct forwarding of the request. Therefore, the user end needs to initiate an access request to the OpenResty operation and maintenance platform with a wildcard domain name.
[0026] The server can be deployed in the same computer room as the gateway (intranet access) or in different computer rooms (public network access). When the server and the gateway are deployed in different computer rooms, for security reasons, the OpenResty operation and maintenance platform cannot directly access all services of the server. Therefore, a Proxy service (agent) based on OpenResty can be deployed in front of the server, and the gateway can perform network security control access to the agent through IP whitelist or VPN network access mode. All requests are first forwarded from the gateway to the agent, and then forwarded by the agent to the specific backend service of the server.
[0027] The first correspondence and the second correspondence represent the correspondence between a specific identifier in a domain name and address information, that is, the OpenResty operation and maintenance platform does not directly store the correspondence between the generated wildcard domain name and address information, but dynamically determines the corresponding service address after resolving the target wildcard domain name in the access request to achieve dynamic routing.
[0028] As described in step S110, when receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule.
[0029] It should be noted that the wildcard domain name resolution rule can be used to divide the wildcard domain name into a first domain name segment and a second domain name segment to further determine the proxy address information and the service address information.
[0030] As described in step S120 and step S130, the gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; the gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; It should be noted that the wildcard domain name may include a first domain name segment, a second domain name segment and a primary domain name. The first domain name segment may be used to determine the address used for the proxy end, the second domain name segment may be used to determine the address of the server end and its specific service, and the primary domain name may be the public domain name used by the user end to access the gateway end.
[0031] The first correspondence is the correspondence between the first domain name segment and the proxy address information; when the first domain name segment is the name of a computer room, the gateway can determine the proxy corresponding to the computer room (server) based on the name of the computer room and the first correspondence, that is, the gateway does not directly send an access request to the server, but first sends the access request to the proxy, which is then forwarded to the server. The server and the proxy correspond to each other.
[0032] The second correspondence is the correspondence between the second domain name segment and the service address information; the gateway can determine the address information of the specific service in the server room according to the service name and the second correspondence, and the proxy forwards it through the service address information.
[0033] The above steps S120~S130 are specific implementation methods under this embodiment. The order of steps S120~S130 can be adjusted according to actual needs. The order of the above steps should not be understood as a limitation on this application.
[0034] As described in step S140, the gateway sends the access request and the target service address information to the proxy via the target proxy address information; the proxy is used to send the access request to the server via the target service address information; the server is used to determine the request result based on the access request, and return the request result to the user.
[0035] It should be noted that all resolution of wildcard domain names can be performed on the gateway end, and the proxy end can only be responsible for forwarding the access request intact; the server end can return the request result to the user end through the proxy end and the gateway end in turn.
[0036] In one embodiment of the present application, the wildcard domain name resolution rule includes domain name separators and domain name segment order; The specific process of "the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule" in step S110 can be further explained in combination with the following description.
[0037] As described in the following steps, the gateway determines a valid information string according to the target wildcard domain name; The gateway determines the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order.
[0038] It should be noted that the valid information string can indicate that the wildcard domain name contains a valid part that can determine the proxy address information and the service address information; the domain name separator can indicate an identifier that separates the first domain name segment and the second domain name segment; the domain name segment order can indicate the rules for respectively determining the first domain name segment and the second domain name segment according to the order of arrangement.
[0039] In an embodiment of the present application, the specific process of "the gateway determines a valid information string according to the target wildcard domain name" can be further explained in combination with the following description.
[0040] As described in the following steps, the gateway removes the primary domain name information according to the target wildcard domain name and intercepts a valid information string.
[0041] It should be noted that when the wildcard domain name includes the primary domain name, the gateway may first remove the primary domain name information and then intercept the valid information string.
[0042] In one embodiment of the present application, the specific process of "the gateway determines the target first domain name segment and the target second domain name segment based on the valid information string, the domain name separator and the domain name segment order" can be further explained in combination with the following description.
[0043] As described in the following steps, the gateway divides the valid information string according to the domain name separator and arranges them in sequence to determine a string sequence; The gateway determines the target first domain name segment and the target second domain name segment according to the character string sequence and the order of the domain name segments.
[0044] It should be noted that the string sequence can represent different domain name segments that are segmented, or can directly represent the name of a segmented computer room or specific service.
[0045] As an example, when "server.idc.env.bu.moat.demo.com" is used as the wildcard domain name of the access request, "the gateway determines the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order" may specifically include the following steps: The gateway removes the primary domain name information ".moat.demo.com" from the wildcard domain name and intercepts the valid information string "server.idc.env.bu"; The gateway splits "server.idc.env.bu" by using "." as a domain name separator to obtain a string sequence of "server", "idc", "env" and "bu". The gateway determines the name of each domain name segment in the character string sequence in order of domain name segments: the "server" in the first position represents the service name, the "idc" in the second position represents the computer room name, the "env" in the third position represents the environment name, and the "bu" in the fourth position represents the business line name.
[0046] As an example, when "server.idc.env.bu.ip.port.moat.demo.com" is used as the wildcard domain name of the access request, it can be seen that compared with the wildcard domain name "server.idc.env.bu.moat.demo.com", the wildcard domain name "server.idc.env.bu.ip.port.moat.demo.com" adds two levels of "ip" and "port". The service address pointed to in the domain name segment can be determined by the order of the domain name segments: the "ip" in the fifth position represents the IP address, and the "idc" in the sixth position represents the port number.
[0047] As an example, when "idc.ip.port.moat.demo.com" is used as the wildcard domain name of the access request, the gateway can directly determine the proxy address corresponding to the server computer room through the domain name and the first correspondence, and then directly specify the corresponding IP address and port through the domain name. In this case, there is no need to pre-configure the correspondence between the service name, environment name, etc. and the real address.
[0048] It should be noted that in each of the wildcard domain name levels mentioned above, at least one level can be empty. For example, in the structure of "service name. computer room name. environment name. business line name. primary domain name", "environment name" and "business line name" can be empty, which means that there is only one environment and one business line in the computer room of the target server. For development and operation and maintenance personnel, they only need to remember the structure of the wildcard domain name and can directly access specific services through the corresponding name.
[0049] In one embodiment of the present application, the target first domain name segment includes the target computer room name; The specific process of "the gateway determines the target proxy address information based on the target first domain name segment and the first corresponding relationship" can be further explained in combination with the following description.
[0050] As described in the following steps, the gateway determines the target proxy address information according to the target computer room name and the first corresponding relationship.
[0051] It should be noted that the computer room name can be used to represent the server to which the access request is ultimately delivered, and the computer room name and the first correspondence are used to determine the address of the proxy corresponding to the server; the service address information is determined by the second domain name segment and the second correspondence, rather than directly determining the server address through the computer room name.
[0052] In one embodiment of the present application, the target second domain name segment includes a target service name, a target environment name, and a target business line name; The specific process of "the gateway determines the target service address information based on the target second domain name segment and the second corresponding relationship" can be further explained in combination with the following description.
[0053] As described in the following steps, the gateway determines the target service address information according to the target service name, the target environment name, the target business line name and the second corresponding relationship.
[0054] It should be noted that for more complex business scenarios, there may be multiple environments under the server computer room, and there may be multiple business lines within an environment, so the same server may contain multiple service addresses; through the target service name, target environment name and target business line name, the target service address information determined by the gateway end is the address information of the specific service under the server computer room, and the proxy end can directly access the specific service through the target service address information to achieve multi-level access.
[0055] In one embodiment of the present application, the target second domain name segment includes: a target IP address and a target port number; The specific process of "the gateway determines the target service address information based on the target second domain name segment and the second corresponding relationship" can be further explained in combination with the following description.
[0056] As described in the following steps, the gateway determines the target service address information according to the target IP address, the target port number and the second corresponding relationship.
[0057] It should be noted that in the case where the target service exists under multiple IPs, the gateway can directly determine the target service address information through the target IP address, target port number and the second correspondence, that is, the service address information can be directly specified by the IP address and port number, the domain name may not contain the service name, environment name and business line name, and there is no need to pre-configure the correspondence between the service name, environment name and business line name and the service address information.
[0058] In one embodiment of the present application, refer to Figure 4-6 , the proxy terminals may include at least two; the server terminals may include at least two; the proxy terminals and the server terminals may correspond one to one; the method may specifically include: The gateway sends the access request and target service address information to the target proxy via the target proxy address information; the target proxy is used to send the access request to the target server via the target service address information; the target server is used to determine the request result based on the access request, and return the request result to the user via the target proxy and the gateway.
[0059] It should be noted that when the proxy end and the server end each include at least two, the method can be used for cross-computer room access, and the wildcard domain name mechanism can enable all web services in cross-computer room scenarios to generate a set of unified domain names, thereby realizing centralized access management of multiple scattered web services under one or more servers. When development and operation personnel query or operate web services in different computer rooms and environments, they no longer need to frequently switch back and forth VPN networks, which greatly improves work efficiency and simplifies access and management; development and operation personnel no longer need to record various complicated web service addresses, and all web platform data additions, deletions, modifications and inquiries can be performed safely and independently according to pre-assigned different user permissions, eliminating the tediousness of having to seek assistance from operation and maintenance personnel every time a problem is investigated; when troubleshooting production business problems, service operation status data acquisition, log query, monitoring data viewing, etc. of all computer rooms can be completed on a web operation and maintenance platform, so that the tools and means for common problem analysis are concentrated on one operation and maintenance platform, greatly improving the efficiency of handling production problems.
[0060] In a specific implementation, referring to Figure 5 , the OpenResty operation and maintenance platform can be deployed in the core data center; users can initiate http / tcp access requests to the OpenResty operation and maintenance platform through wildcard domain names; for cross-computer room (multiple data centers) scenarios, the OpenResty operation and maintenance platform sends access requests to the corresponding platform Proxy proxy modules based on the computer room names of different data centers in the wildcard domain names: idc_a corresponds to the proxy of data center A, idc_b corresponds to the proxy of data center B, and idc_c corresponds to the proxy of data center C; for data center A, the platform Proxy proxy module accesses the backend service pool based on the service name server_m; for data center B, the platform Proxy proxy module accesses the backend service pool based on the service name server_n; for data center C, the platform Proxy proxy module accesses the backend service pool based on the IP address 10.0.0.1 and port number 8080.
[0061] In a specific implementation, referring to Figure 6The method may also involve a storage end, which may be Alibaba Cloud OSS (object storage service). The target wildcard domain name may include a control instruction domain name segment, which corresponds to a shell instruction and / or a service analysis component web request. After the gateway end parses the control instruction, it sends the access request and the control instruction to the proxy end. After the server end determines the request result based on the access request, it uploads the service operation status data to Alibaba Cloud OSS, and then the gateway end reads the service operation status data in Alibaba Cloud OSS, that is, the server end returns the request result to the gateway end through the storage end.
[0062] In a specific implementation, a user can use a standard wildcard domain name "http: / / rocketmq.alifin.moat.iboxpay.com" to initiate an http access request. The access request first reaches the OpenResty operation and maintenance platform gateway; the OpenResty operation and maintenance platform gateway forwards the access request to the OpenResty Proxy service of the target data center Alibaba Financial Cloud based on the service name rocketmq and the data center name alifin (Ali Financial Cloud) carried in the domain name; the OpenResty Proxy service of Alibaba Financial Cloud then proxies the access request intactly to the target service rocketmq.
[0063] The above is a description of the method embodiment of the present application. As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0064] Reference Figure 2 , shows a multi-level proxy dynamic routing device based on wildcard domain names provided by an embodiment of the present application, the device involves a user end, a gateway end, a proxy end and a service end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; the user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The device comprises: A wildcard domain name resolution module 210, configured to determine a target first domain name segment and a target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; A proxy address information determination module 220, configured to determine target proxy address information according to the target first domain name segment and the first corresponding relationship; A service address information determination module 230, configured to determine target service address information according to the target second domain name segment and the second corresponding relationship; The sending module 240 is used to send the access request and the target service address information to the agent end through the target agent address information; the agent end is used to send the access request to the server end through the target service address information; the server end is used to determine the request result based on the access request, and return the request result to the user end.
[0065] In an embodiment of the present application, the wildcard domain name resolution rule includes domain name separators and domain name segment order; the wildcard domain name resolution module 210 includes: A valid information string determination submodule, used to determine a valid information string according to the target wildcard domain name; The target domain name segment determination submodule is used to determine the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order.
[0066] In an embodiment of the present application, the valid information string determination submodule is used to remove the primary domain name information according to the target wildcard domain name and intercept the valid information string.
[0067] In one embodiment of the present application, the target domain name segment determination submodule includes: A character string segmentation and arrangement submodule, used to segment the valid information character string according to the domain name separator and arrange them in sequence to determine a character string sequence; The domain name segment order matching submodule is used to determine the target first domain name segment and the target second domain name segment according to the character string sequence and the domain name segment order.
[0068] In one embodiment of the present application, the target first domain name segment includes the target computer room name; The proxy address information determination module 220 is used to determine the target proxy address information according to the target computer room name and the first corresponding relationship.
[0069] In one embodiment of the present application, the target second domain name segment includes a target service name, a target environment name, and a target business line name; The service address information determination module 230 is used to determine the target service address information according to the target service name, the target environment name, the target business line name and the second corresponding relationship.
[0070] In one embodiment of the present application, the target second domain name segment includes: a target IP address and a target port number; The service address information determination module 230 is used to determine the target service address information according to the target IP address, the target port number and the second corresponding relationship.
[0071] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0072] Reference Figure 3 , shows a multi-level proxy dynamic routing system based on wildcard domain names provided by an embodiment of the present application, the system includes a user end, a gateway end, a proxy end and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first correspondence between a first domain name segment and proxy address information; the gateway end pre-stores a second correspondence between a second domain name segment and service address information; The system comprises: The user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The gateway end is used to determine the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule, and determine the target proxy address information according to the target first domain name segment and the first corresponding relationship, and determine the target service address information according to the target second domain name segment and the second corresponding relationship, and send the access request and the target service address information to the proxy end through the target proxy address information; The proxy end is used to send the access request to the server end through the target service address information; The server is used to determine a request result according to the access request, and return the request result to the client.
[0073] In one embodiment of the present application, refer to Figure 4 , the agent terminals include at least two; the server terminals include at least two; the agent terminals correspond to the server terminals one by one; The gateway end includes an OpenResty server, and the proxy end includes an OpenResty Proxy proxy server; the gateway end is connected to the proxy end through IP whitelist access or VPN access.
[0074] Reference Figure 7 , shows a block diagram of a computer device provided in an embodiment of the present application. The computer device 12 is suitable for implementing the embodiment of the present invention, and may specifically include the following: The computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16). The computer device 12 may be a device attached to the bus.
[0075] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0076] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0077] System memory 28 may include computer system readable media in the form of volatile memory, such as RAM 30 (random access memory) and / or cache 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0078] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0079] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an I / O interface 22 (input / output interface). Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network (e.g., Internet)) through a network adapter 20. Figure 7 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0080] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a multi-level proxy dynamic routing method based on wildcard domain names provided in any embodiment of the present invention.
[0081] That is, when the program is executed by the processor: When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; The gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; The gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; The gateway sends the access request and the target service address information to the proxy via the target proxy address information; the proxy sends the access request to the server via the target service address information; the server determines the request result based on the access request and returns the request result to the user.
[0082] The computer device 12 of this embodiment is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.
[0083] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multi-level proxy dynamic routing method based on wildcard domain names as provided in any embodiment of the present application.
[0084] That is, when the program is executed by the processor: When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; The gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; The gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; The gateway sends the access request and the target service address information to the proxy via the target proxy address information; the proxy sends the access request to the server via the target service address information; the server determines the request result based on the access request and returns the request result to the user.
[0085] Computer storage media can use any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0086] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0087] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0088] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a LAN or WAN, or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0089] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0090] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0091] The above is a detailed introduction to a multi-level proxy dynamic routing method, device and system based on wildcard domain names provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A multi-level proxy dynamic routing method based on wildcard domain names, characterized in that: The method involves a user end, a gateway end, an agent end, and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first corresponding relationship between a first domain name segment and agent address information; The gateway pre-stores a second correspondence between the second domain name segment and the service address information; The user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The method comprises: When receiving the access request, the gateway determines the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; The gateway determines the target proxy address information according to the target first domain name segment and the first corresponding relationship; The gateway determines the target service address information according to the target second domain name segment and the second corresponding relationship; The gateway sends the access request and the target service address information to the proxy via the target proxy address information; the proxy sends the access request to the server via the target service address information; the server determines the request result based on the access request and returns the request result to the user.
2. The method according to claim 1, characterized in that The wildcard domain name resolution rules include domain name separators and domain name segment order; The step of determining the target first domain name segment and the target second domain name segment by the gateway according to the target wildcard domain name and the wildcard domain name resolution rule comprises: The gateway determines a valid information string according to the target wildcard domain name; The gateway determines the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order.
3. The method according to claim 2, characterized in that The step of determining a valid information string according to the target wildcard domain name by the gateway includes: The gateway removes the primary domain name information according to the target wildcard domain name, and intercepts a valid information character string.
4. The method according to claim 2, characterized in that: The step of determining the target first domain name segment and the target second domain name segment according to the valid information string, the domain name separator and the domain name segment order by the gateway includes: The gateway divides the valid information string according to the domain name separator and arranges them in sequence to determine a string sequence; The gateway determines the target first domain name segment and the target second domain name segment according to the character string sequence and the order of the domain name segments.
5. The method according to claim 1, characterized in that The target first domain name segment includes the target computer room name; The step of determining the target proxy address information by the gateway according to the target first domain name segment and the first corresponding relationship includes: The gateway determines the target proxy address information according to the target computer room name and the first corresponding relationship.
6. The method according to claim 1, characterized in that The target second domain name segment includes a target service name, a target environment name, and a target business line name; The step of determining the target service address information by the gateway according to the target second domain name segment and the second corresponding relationship includes: The gateway determines the target service address information according to the target service name, the target environment name, the target business line name and the second corresponding relationship.
7. The method according to claim 1, characterized in that The target second domain name segment includes: a target IP address and a target port number; The step of determining the target service address information by the gateway according to the target second domain name segment and the second corresponding relationship includes: The gateway determines the target service address information according to the target IP address, the target port number and the second corresponding relationship.
8. A multi-level proxy dynamic routing device based on wildcard domain name, characterized in that: The device involves a user end, a gateway end, an agent end, and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first corresponding relationship between a first domain name segment and agent address information; The gateway pre-stores a second correspondence between the second domain name segment and the service address information; The user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The device comprises: A wildcard domain name resolution module, used to determine a target first domain name segment and a target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule; A proxy address information determination module, configured to determine target proxy address information according to the target first domain name segment and the first corresponding relationship; A service address information determination module, used to determine the target service address information according to the target second domain name segment and the second corresponding relationship; A sending module is used to send the access request and target service address information to the proxy end through the target proxy address information; the proxy end is used to send the access request to the server end through the target service address information; the server end is used to determine the request result based on the access request, and return the request result to the user end.
9. A multi-level proxy dynamic routing system based on wildcard domain names, characterized in that: The system includes a user end, a gateway end, an agent end, and a server end; the gateway end pre-stores a wildcard domain name resolution rule; the gateway end pre-stores a first corresponding relationship between a first domain name segment and agent address information; The gateway pre-stores a second correspondence between the second domain name segment and the service address information; The system comprises: The user end is used to send an access request to the gateway end; wherein the access request includes a target wildcard domain name; The gateway end is used to determine the target first domain name segment and the target second domain name segment according to the target wildcard domain name and the wildcard domain name resolution rule, and to determine the target proxy address information according to the target first domain name segment and the first corresponding relationship, and to determine the target service address information according to the target second domain name segment and the second corresponding relationship, and to send the access request and the target service address information to the proxy end through the target proxy address information; The proxy end is used to send the access request to the server end through the target service address information; The server is used to determine a request result according to the access request, and return the request result to the client.
10. The system according to claim 9, characterized in that The proxy terminals include at least two; the server terminals include at least two; the proxy terminals correspond to the server terminals one by one; The gateway end includes an OpenResty server, and the proxy end includes an OpenResty Proxy server; The gateway end is connected to the proxy end through IP whitelist access or VPN access.
Citation Information
Patent Citations
Proxy method and device, proxy server and storage medium
CN112637346A
Cited By
Network request sending method and device, computer equipment and readable storage medium
CN119583658A
