Request processing method and apparatus, storage medium, and electronic device

CN117834736BActive Publication Date: 2026-09-15HILLSTONE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311862652.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-09-15
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

[0004]本发明实施例提供了一种请求处理方法、装置、存储介质及电子设备,以至少解决相关技术中分布式设备无法提供DNS业务的技术问题

Benefits of technology

[0014] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to run the programs, wherein the programs are configured to execute the above-described request processing method during runtime.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117834736B_ABST
    Figure CN117834736B_ABST
Patent Text Reader

Abstract

The application discloses a request processing method and device, a storage medium and electronic equipment. The method comprises the following steps: obtaining a resource file from a target domain name system server, wherein the resource file comprises a plurality of corresponding relationships between domain names and IP addresses; generating a service card configuration file according to the resource file, and sending the service card configuration file and the resource file to a plurality of service cards in a distributed device, wherein each service card loads the service card configuration file and the resource file, and in the case that a domain name system request of a client is received, the domain name system request is processed according to the service card configuration file and the resource file, and the service card configuration file is used for indicating the content of the resource file required when the domain name system request is processed. The application solves the technical problem that the distributed device cannot provide the DNS service in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed systems, and more specifically, to a request processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] Zone transfer involves sending zone resource records from the primary DNS (Domain Name System) server to a secondary DNS server, enabling the secondary DNS server to provide the same DNS services as the primary DNS server. In centralized devices, this is widely used as a secondary DNS server to handle DNS services; such devices typically have a single card that handles configuration, zone transfer, and DNS services. However, in distributed devices, there is a primary control card and multiple service cards. The coordination of these cards' functions is difficult, leading to the current problem where distributed devices cannot provide DNS services.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a request processing method, apparatus, storage medium, and electronic device to at least solve the technical problem in the related art that distributed devices cannot provide DNS services.

[0005] According to one aspect of the present invention, a request processing method is provided, comprising: obtaining a resource file from a target Domain Name System (DNS) server, wherein the resource file includes a mapping relationship between multiple domain names and IP addresses; generating a service card configuration file based on the resource file, and sending the service card configuration file and the resource file to multiple service cards in a distributed device, wherein each service card loads the service card configuration file and the resource file, and processes the DNS request based on the service card configuration file and the resource file upon receiving a DNS request from a client, wherein the service card configuration file is used to indicate the resource file content required for processing the DNS request.

[0006] Furthermore, the request processing method also includes: upon receiving a configuration instruction, obtaining the IP address of the target domain name system server and the identifier of at least one domain from the configuration instruction; generating a master control card configuration file based on the IP address of the target domain name system server and the identifier of at least one domain; loading the master control card configuration file, and obtaining resource files from the target domain name system server based on the IP address in the master control card configuration file, wherein the multiple domain names in the resource files include the domain name of at least one domain.

[0007] Furthermore, the request processing method also includes: retrieving resource files from the target domain name system server according to the IP address in the main control card configuration file according to a preset time period, or, upon receiving a notification request, retrieving resource files from the target domain name system server according to the IP address in the main control card configuration file, wherein the notification request is forwarded to the main control card by the service card upon receiving a notification request from the target domain name system server.

[0008] Furthermore, the request processing method also includes: obtaining the request, wherein the request is a Domain Name System (DNS) request or a notification request; determining whether a target field exists in the content of the request, wherein the target field indicates that the request is a notification request; if the target field exists, determining that the request is a notification request; if the target field does not exist, determining that the request is a DNS request.

[0009] Furthermore, the request processing method also includes: obtaining an initial service card configuration file, wherein the initial service card configuration file contains an identifier of at least one domain; determining a file path in a resource file that matches at least one domain, wherein the file path that matches the domain stores the correspondence between the domain's domain name and its IP address; and loading the file path into the initial service card configuration file to obtain the service card configuration file.

[0010] Furthermore, the request processing method also includes: upon receiving a configuration instruction, obtaining the identifier of at least one domain from the configuration instruction; and generating an initial service card configuration file based on the identifier of at least one domain and the service card configuration file template.

[0011] Furthermore, the request processing method also includes: extracting the domain name of the domain to be resolved by the client request from the Domain Name System request to obtain the target domain name; determining the IP address matching the target domain name from the resource file based on the target domain name and the file path recorded in the business card configuration file; generating the request processing result based on the IP address matching the target domain name, and feeding back the request processing result to the client.

[0012] According to another aspect of the present invention, a request processing apparatus is also provided, comprising: an acquisition module, configured to acquire a resource file from a target domain name system server, wherein the resource file includes a mapping relationship between multiple domain names and IP addresses; and a sending module, configured to generate a service card configuration file based on the resource file, and send the service card configuration file and the resource file to multiple service cards in a distributed device, wherein each service card loads the service card configuration file and the resource file, and processes the domain name system request based on the service card configuration file and the resource file upon receiving a domain name system request from a client, wherein the service card configuration file is used to indicate the resource file content required for processing the domain name system request.

[0013] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described request processing method at runtime.

[0014] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to run the programs, wherein the programs are configured to execute the above-described request processing method during runtime.

[0015] In this embodiment of the invention, a method is adopted in which the main control card implements regional transmission and the service cards implement DNS service processing. By obtaining resource files from the target domain name system server, a service card configuration file is generated based on the resource files. The service card configuration file and the resource files are then sent to multiple service cards in the distributed device. The resource files include the mapping relationship between multiple domain names and IP addresses. Each service card loads the service card configuration file and the resource files, and processes the domain name system request based on the service card configuration file and the resource files when it receives a domain name system request from a client. The service card configuration file is used to indicate the resource file content required when processing the domain name system request.

[0016] In the above process, zone transfer is achieved by the master control card obtaining resource files from the target domain name system server. The master control card sends service card configuration files and resource files to multiple service cards, which then process domain name system requests based on these files, enabling DNS service processing. This separates zone transfer and DNS service in the distributed device, allowing it to effectively provide DNS services. Furthermore, the target domain name system server can only perceive zone transfers with one device, avoiding redundant data interaction. Additionally, multiple service cards can process DNS services simultaneously, improving the efficiency of DNS service processing.

[0017] Therefore, the solution provided in this application achieves the goal of enabling regional transmission through the main control card and DNS service processing through the service card, thereby realizing the technical effect of providing DNS services based on distributed devices and solving the technical problem that distributed devices cannot provide DNS services in related technologies. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0019] Figure 1 This is a schematic diagram of an optional request processing method according to an embodiment of the present invention;

[0020] Figure 2 This is a schematic diagram of an optional distributed device application process according to an embodiment of the present invention;

[0021] Figure 3 This is a schematic diagram of an optional request processing apparatus according to an embodiment of the present invention;

[0022] Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation

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

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0026] Example 1

[0027] According to an embodiment of the present invention, an embodiment of a request processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0028] Figure 1 This is a schematic diagram of an optional request processing method according to an embodiment of the present invention, such as... Figure 1 As shown, this method is applied to the master control card of a distributed device and includes the following steps:

[0029] Step S101: Obtain resource files from the target domain name system server, wherein the resource files include the correspondence between multiple domain names and IP addresses.

[0030] Optionally, in this embodiment, both the main control card and the service card are CPUs (Central Processing Units). The target domain name system server refers to the main DNS server used to process DNS services. The distributed device is used to perform zone transmission with the main DNS server and, after zone transmission, acts as a secondary DNS server to provide DNS services to the client. DNS services refer to DNS resolution services.

[0031] The main control card may include a DNS configuration module, a first DNS service module, and a file transfer module. The main control card can obtain resource files from the target domain name system server through the first DNS service module.

[0032] Step S102: Generate a service card configuration file based on the resource file, and send the service card configuration file and resource file to multiple service cards in the distributed device. Each service card loads the service card configuration file and resource file, and processes the domain name system request based on the service card configuration file and resource file when it receives a domain name system request from a client. The service card configuration file is used to indicate the content of the resource file required to process the domain name system request.

[0033] The DNS configuration module in the main control card can generate service card configuration files based on resource files. For example, the correspondence between domain names and IP addresses of different domains is stored in different file paths in the resource files. The DNS configuration module can determine the matching relationship between each domain and the file path based on the resource files, and then generate service card configuration files based on the matching relationship between each domain and the file path.

[0034] Furthermore, after the service card configuration file is generated, the first DNS service module in the main control card can notify the service card to obtain and load it. Then, the service card interacts with the file transfer module in the main control card. The file transfer module sends the service card configuration file and resource file to each service card, so that each service card loads the service card configuration file and resource file.

[0035] Optionally, a Domain Name System (DNS) request is used to request the resolution of a specific domain name within a specific domain. DNS resolution refers to converting a domain name into its corresponding IP address. Therefore, upon receiving a DNS request, the service card can determine the file path required to process the DNS request based on the matching relationship between each domain and file path in the service card configuration file. This means determining the required resource file content, and then retrieving the corresponding request processing result from the resource file based on the file path, and feeding it back to the client. The service card includes a second DNS service module. In this embodiment, the service card configuration file can be loaded through the second DNS service module, and the above process can be executed.

[0036] Based on the scheme defined in steps S101 to S102 above, it can be understood that in this embodiment of the invention, the main control card implements regional transmission and the service card implements DNS service processing. By obtaining resource files from the target domain name system server, a service card configuration file is generated based on the resource files, and the service card configuration file and resource files are sent to multiple service cards in the distributed device. The resource files include the correspondence between multiple domain names and IP addresses. Each service card loads the service card configuration file and resource files, and processes the domain name system request based on the service card configuration file and resource files when it receives a domain name system request from a client. The service card configuration file is used to indicate the resource file content required when processing the domain name system request.

[0037] It is noteworthy that in the above process, zone transfer is achieved by the master control card obtaining resource files from the target domain name system server. Furthermore, by the master control card sending service card configuration files and resource files to multiple service cards, and the service cards processing domain name system requests based on these files, DNS service processing is achieved. This separates zone transfer and DNS service in the distributed device, enabling the distributed device to effectively provide DNS services. On the one hand, the target domain name system server can only perceive one device conducting zone transfers with it, avoiding redundant data interaction. On the other hand, multiple service cards can process DNS services simultaneously, improving the efficiency of DNS service processing.

[0038] Therefore, the solution provided in this application achieves the goal of enabling regional transmission through the main control card and DNS service processing through the service card, thereby realizing the technical effect of providing DNS services based on distributed devices and solving the technical problem that distributed devices cannot provide DNS services in related technologies.

[0039] In an optional embodiment, during the process of obtaining resource files from the target DNS server, the master control card can, upon receiving a configuration instruction, obtain the IP address of the target DNS server and the identifier of at least one domain from the configuration instruction, and then generate a master control card configuration file based on the IP address of the target DNS server and the identifier of at least one domain, thereby loading the master control card configuration file, and obtaining resource files from the target DNS server based on the IP address in the master control card configuration file, wherein the multiple domain names in the resource file include the domain name of at least one domain.

[0040] The configuration command can be issued manually or triggered based on preset conditions. The configuration command contains the IP address of the target domain name system server and the identifier of at least one domain. The at least one domain is a domain that the distributed device is allowed to perform DNS resolution. The configuration command is used to instruct the master control card to generate the master control card configuration file.

[0041] Upon receiving a configuration command, the DNS configuration module in the main control card can import the IP address of the target Domain Name System server and the identifier of at least one domain into the main control card configuration file template, thereby obtaining the main control card configuration file. The main control card configuration file template may also define a first field, which indicates that the configuration file implements the zone transfer function.

[0042] After the master control card configuration file is generated, the DNS configuration module can notify the first DNS service module to load the master control card configuration file. Then, the first DNS service module loads the master control card configuration file and finds the target domain name system server based on the IP address in the master control card configuration file. In this way, it obtains the resource file corresponding to at least one domain from the target domain name system server based on the identifier of at least one domain.

[0043] It should be noted that by generating and loading the master control card configuration file based on the IP address of the target domain name system server and the identifier of at least one domain, the information required to obtain resource files is effectively loaded, and the resource files are effectively obtained by obtaining them based on the master control card configuration file.

[0044] In one optional embodiment, during the process of retrieving resource files from the target DNS server based on the IP address in the main control card configuration file, the main control card may retrieve resource files from the target DNS server based on the IP address in the main control card configuration file according to a preset time period, or, upon receiving a notification request, retrieve resource files from the target DNS server based on the IP address in the main control card configuration file. The notification request is forwarded to the main control card by the service card upon receiving a notification request from the target DNS server.

[0045] For example, the preset time period could be once a day, allowing the master control card to retrieve resource files from the target DNS server at a fixed time each day. This preset time period can be determined by the SOA (Start of Authority) record in the resource files provided by the target DNS server. For instance, when the master control card is first configured with the target DNS server, it will immediately retrieve the resource files; subsequently, it will synchronize the resource files according to the time period recorded in the SOA record within the resource files.

[0046] For example, when a resource file in the target DNS server is updated, the target DNS server can generate a notification request and send the notification request to the second DNS service module in the service card. The second DNS service module then sends the notification request to the first DNS service module in the main control card, so that the first DNS service module can retrieve the resource file from the target DNS server upon receiving the notification request.

[0047] It should be noted that obtaining resource files through either of the two methods described above facilitates effective resource file retrieval. Specifically, the method of retrieving resource files according to a preset time period eliminates the need for prior information exchange with the target domain name system server, thus avoiding the inability to obtain new resource files in the event of a failed notification request transmission, ensuring the stability of resource file retrieval. The method of retrieving resource files based on notification requests ensures that the master control card can always obtain resource files promptly when they are updated, thereby improving the accuracy of DNS service processing.

[0048] In one optional embodiment, the service card can distinguish between Domain Name System (DNS) requests and notification requests by: acquiring the request, and then determining whether a target field exists in the request content. If the target field exists, the request is determined to be a notification request; otherwise, the request is determined to be a DNS request. Here, the request is either a DNS request or a notification request, and the target field indicates that the request is a notification request.

[0049] Since both the Domain Name System (DNS) requests sent by the client and the notification requests sent by the target DNS server are received by the second DNS service module in the service card, the service card needs to distinguish between DNS requests and notification requests so that the distributed device can provide DNS services normally.

[0050] Optionally, after the first DNS service module in the main control card loads the main control card configuration file, the second DNS service module in the service card automatically enables the DNS request message pre-resolution function. Upon receiving a request, the second DNS service module determines whether the target field exists in the request content. For example, it checks whether the OPCode (Operation Code) in the request is "notify," where "notify" is the target field.

[0051] Furthermore, if the OPCode is "notify", that is, if the target field exists, the second DNS service module can determine that the request is a notification request and send the notification request to the first DNS service module. If the OPCode is not "notify", that is, if the target field does not exist, the second DNS service module will handle the domain name system request.

[0052] It should be noted that the above process facilitates the effective differentiation between Domain Name System (DNS) requests and notification requests, thereby enabling distributed devices to provide DNS services normally.

[0053] In an optional embodiment, during the process of generating a service card configuration file based on a resource file, the main control card can obtain an initial service card configuration file, then determine at least one file path that matches a domain in the resource file, thereby loading the file path into the initial service card configuration file to obtain the service card configuration file. The initial service card configuration file contains the identifier of at least one domain, and the file path that matches the domain stores the correspondence between the domain's domain name and IP address.

[0054] The initial service card configuration file can be generated based on the service card configuration file template, and at least one domain in the initial service card configuration file is the domain that the distributed device is allowed to perform DNS resolution.

[0055] Optionally, the resource file also records the identifiers of each domain and the correspondence between each domain and the domain name. The DNS configuration module can determine the file path matched by each domain from the resource file based on the identifier of each domain.

[0056] Furthermore, the DNS configuration module can load the file path into the initial service card configuration file to obtain the service card configuration file.

[0057] It should be noted that, through the above process, the information required for processing Domain Name System (DNS) requests is recorded in the service card configuration file, thereby enabling the service card with the service card configuration file loaded to effectively provide DNS services.

[0058] In an optional embodiment, during the process of obtaining the initial service card configuration file, the main control card can obtain the identifier of at least one domain from the configuration instruction upon receiving the configuration instruction, and generate the initial service card configuration file based on the identifier of at least one domain and the service card configuration file template.

[0059] The configuration instructions not only instruct the main control card to generate a main control card configuration file, but also to generate an initial service card configuration file. Upon receiving the configuration instructions, the DNS configuration module can import the identifier of at least one domain into the service card configuration file template to obtain the initial service card configuration file, and then determine the service card configuration file based on the initial service card configuration file. The service card configuration file template may also define a second field, which indicates that the configuration file implements the function of processing DNS services.

[0060] It should be noted that the above process enables the accurate generation of the initial business card configuration file.

[0061] In an optional embodiment, during the process of processing Domain Name System (DNS) requests based on the service card configuration file and resource file, the service card can extract the domain name of the domain requested by the client from the DNS request to obtain the target domain name. Then, based on the target domain name and the file path recorded in the service card configuration file, the service card determines the IP address matching the target domain name from the resource file, thereby generating a request processing result based on the IP address matching the target domain name and feeding back the request processing result to the client.

[0062] Optionally, a Domain Name System (DNS) request is used to request the resolution of a specific domain name within a specific domain. Therefore, after the second DNS service module obtains the DNS request, it can extract the domain name of the domain requested by the client from the DNS request, thus obtaining the target domain name. Further, the second DNS service module can determine the file path matching the target domain name based on the matching relationship between each domain and file path in the service card configuration file, and then find the IP address matching the target domain name from that file path in the resource file. Next, the second DNS service module can generate a request processing result based on the IP address matching the target domain name and send the request processing result back to the client, thereby achieving effective processing of the DNS service.

[0063] It should be noted that by finding the IP address matching the target domain name from the resource file based on the information recorded in the service card configuration file, the accuracy of the found IP address is ensured, thereby enabling the provision of effective DNS services through the service card.

[0064] Optional, Figure 2 This is a schematic diagram illustrating an optional application process of a distributed device according to an embodiment of the present invention, such as... Figure 2 As shown, an optional application process of the distributed device in this embodiment is described. The distributed device includes a main control card and multiple service cards. Figure 2 The image shows only one of multiple service cards; all service cards operate in the same way, such as... Figure 2 As shown, the main control card includes a DNS configuration module, a first DNS service module, and a file transfer module, while the service card includes a second DNS service module. Upon receiving a configuration command, the DNS configuration module in the main control card generates a main control card configuration file and an initial service card configuration file. Then, the DNS configuration module instructs the first DNS service module to load the main control card configuration file. After loading the main control card configuration file, the first DNS service module instructs the second DNS service module to obtain and load the initial service card configuration file. Further, the service card obtains and loads the initial service card configuration file through the file transfer module.

[0065] After that, as Figure 2 As shown, the first DNS service module performs zone transfer, retrieves resource files from the target DNS server, and notifies the DNS configuration module to determine the service card configuration file based on the initial service card configuration file. After the DNS configuration module generates the service card configuration file, the first DNS service module retrieves the service card configuration file from the DNS configuration module and notifies the second DNS service module to retrieve and load the service card configuration file. The second DNS service module interacts with the file transfer module in the main control card. The file transfer module sends the service card configuration file and resource files to the service card, which then loads the service card configuration file and processes the DNS requests according to the service card configuration file.

[0066] Therefore, the solution provided in this application achieves the goal of enabling regional transmission through the main control card and DNS service processing through the service card, thereby realizing the technical effect of providing DNS services based on distributed devices and solving the technical problem that distributed devices cannot provide DNS services in related technologies.

[0067] Example 2

[0068] According to an embodiment of the present invention, an embodiment of a request processing apparatus is provided, wherein, Figure 3This is a schematic diagram of an optional request processing apparatus according to an embodiment of the present invention, such as... Figure 3 As shown, the device includes:

[0069] The acquisition module 301 is used to acquire resource files from the target domain name system server, wherein the resource files include multiple mapping relationships between domain names and IP addresses;

[0070] The sending module 302 is used to generate a service card configuration file based on the resource file, and send the service card configuration file and the resource file to multiple service cards in the distributed device. Each service card loads the service card configuration file and the resource file, and processes the domain name system request based on the service card configuration file and the resource file when it receives a domain name system request from a client. The service card configuration file is used to indicate the content of the resource file required to process the domain name system request.

[0071] Optionally, in this embodiment, both the main control card and the service card are CPUs (Central Processing Units). The target domain name system server refers to the primary DNS server used to process DNS services. The distributed device is used for zone transfer with the primary DNS server and, after zone transfer, acts as a secondary DNS server to provide DNS services to clients. DNS services refer to DNS resolution services. The main control card may include a DNS configuration module, a first DNS service module, and a file transfer module. The main control card can obtain resource files from the target domain name system server through the first DNS service module.

[0072] The DNS configuration module in the main control card can generate service card configuration files based on resource files. For example, the correspondence between domain names and IP addresses of different domains is stored in different file paths in the resource files. The DNS configuration module can determine the matching relationship between each domain and the file path based on the resource files, and then generate service card configuration files based on the matching relationship between each domain and the file path.

[0073] Furthermore, after the service card configuration file is generated, the first DNS service module in the main control card can notify the service card to obtain and load it. Then, the service card interacts with the file transfer module in the main control card. The file transfer module sends the service card configuration file and resource file to each service card, so that each service card loads the service card configuration file and resource file.

[0074] Optionally, a Domain Name System (DNS) request is used to request the resolution of a specific domain name within a specific domain. DNS resolution refers to converting a domain name into its corresponding IP address. Therefore, upon receiving a DNS request, the service card can determine the file path required to process the DNS request based on the matching relationship between each domain and file path in the service card configuration file. This means determining the required resource file content, and then retrieving the corresponding request processing result from the resource file based on the file path, and feeding it back to the client. The service card includes a second DNS service module. In this embodiment, the service card configuration file can be loaded through the second DNS service module, and the above process can be executed.

[0075] In the above process, by obtaining resource files from the target domain name system server by the master control card, zone transmission is realized through the master control card. By sending the service card configuration files and resource files to multiple service cards by the master control card, and by having the service cards process domain name system requests according to the service card configuration files and resource files, DNS service processing is realized through the service cards. Thus, on the one hand, the distributed device can effectively provide DNS services, and on the other hand, the zone transmission and DNS services are separated in the distributed device, improving the efficiency of DNS service processing.

[0076] Therefore, the solution provided in this application achieves the goal of enabling regional transmission through the main control card and DNS service processing through the service card, thereby realizing the technical effect of providing DNS services based on distributed devices and solving the technical problem that distributed devices cannot provide DNS services in related technologies.

[0077] It should be noted that the above-mentioned acquisition module 301 and sending module 302 correspond to steps S101 to S102 in the above embodiments. The two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in the above embodiment 1.

[0078] Optionally, the acquisition module 301 further includes: a first acquisition submodule, used to acquire the IP address of the target domain name system server and the identifier of at least one domain from the configuration instruction when a configuration instruction is received; a generation submodule, used to generate a master control card configuration file based on the IP address of the target domain name system server and the identifier of at least one domain; and a second acquisition submodule, used to load the master control card configuration file and acquire resource files from the target domain name system server based on the IP address in the master control card configuration file, wherein the multiple domain names in the resource files include the domain name of at least one domain.

[0079] The configuration command can be issued manually or triggered based on preset conditions. The configuration command contains the IP address of the target domain name system server and the identifier of at least one domain. The at least one domain is a domain that the distributed device is allowed to perform DNS resolution. The configuration command is used to instruct the master control card to generate the master control card configuration file.

[0080] Upon receiving a configuration command, the DNS configuration module in the main control card can import the IP address of the target Domain Name System server and the identifier of at least one domain into the main control card configuration file template, thereby obtaining the main control card configuration file. The main control card configuration file template may also define a first field, which indicates that the configuration file implements the zone transfer function.

[0081] After the master control card configuration file is generated, the DNS configuration module can notify the first DNS service module to load the master control card configuration file. Then, the first DNS service module loads the master control card configuration file and finds the target domain name system server based on the IP address in the master control card configuration file. In this way, it obtains the resource file corresponding to at least one domain from the target domain name system server based on the identifier of at least one domain.

[0082] It should be noted that by generating and loading the master control card configuration file based on the IP address of the target domain name system server and the identifier of at least one domain, the information required to obtain resource files is effectively loaded, and the resource files are effectively obtained by obtaining them based on the master control card configuration file.

[0083] Optionally, the second acquisition submodule further includes: a first acquisition unit, used to acquire resource files from the target domain name system server according to the IP address in the main control card configuration file according to a preset time period; or, a second acquisition unit, used to acquire resource files from the target domain name system server according to the IP address in the main control card configuration file when a notification request is received, wherein the notification request is forwarded to the main control card by the service card when it receives a notification request from the target domain name system server.

[0084] For example, the preset time period can be once a day, and the master control card can obtain resource files from the target domain name system server at a fixed time every day.

[0085] For example, when a resource file in the target DNS server is updated, the target DNS server can generate a notification request and send the notification request to the second DNS service module in the service card. The second DNS service module then sends the notification request to the first DNS service module in the main control card, so that the first DNS service module can retrieve the resource file from the target DNS server upon receiving the notification request.

[0086] It should be noted that obtaining resource files through either of the two methods described above facilitates effective resource file retrieval. Specifically, the method of retrieving resource files according to a preset time period eliminates the need for prior information exchange with the target domain name system server, thus avoiding the inability to obtain new resource files in the event of a failed notification request transmission, ensuring the stability of resource file retrieval. The method of retrieving resource files based on notification requests ensures that the master control card can always obtain resource files promptly when they are updated, thereby improving the accuracy of DNS service processing.

[0087] Optionally, the service card distinguishes between Domain Name System (DNS) requests and notification requests in the following ways: obtaining the request, where the request is either a DNS request or a notification request; determining whether a target field exists in the content of the request, where the target field indicates that the request is a notification request; if the target field exists, determining that the request is a notification request; if the target field does not exist, determining that the request is a DNS request.

[0088] Since both the Domain Name System (DNS) requests sent by the client and the notification requests sent by the target DNS server are received by the second DNS service module in the service card, the service card needs to distinguish between DNS requests and notification requests so that the distributed device can provide DNS services normally.

[0089] Optionally, after the first DNS service module in the main control card loads the main control card configuration file, the second DNS service module in the service card automatically enables the DNS request message pre-resolution function. Upon receiving a request, the second DNS service module determines whether the target field exists in the request content. For example, it checks whether the OPCode (Operation Code) in the request is "notify," where "notify" is the target field.

[0090] Furthermore, if the OPCode is "notify", that is, if the target field exists, the second DNS service module can determine that the request is a notification request and send the notification request to the first DNS service module. If the OPCode is not "notify", that is, if the target field does not exist, the second DNS service module will handle the domain name system request.

[0091] It should be noted that the above process facilitates the effective differentiation between Domain Name System (DNS) requests and notification requests, thereby enabling distributed devices to provide DNS services normally.

[0092] Optionally, the sending module 302 further includes: a third acquisition submodule, used to acquire an initial service card configuration file, wherein the initial service card configuration file contains an identifier of at least one domain; a determination submodule, used to determine a file path in a resource file that matches at least one domain, wherein the file path that matches the domain stores a correspondence between the domain name and the IP address; and a loading submodule, used to load the file path into the initial service card configuration file to obtain the service card configuration file.

[0093] The initial service card configuration file can be generated based on the service card configuration file template, and at least one domain in the initial service card configuration file is the domain that the distributed device is allowed to perform DNS resolution.

[0094] Optionally, the resource file also records the identifiers of each domain and the correspondence between each domain and the domain name. The DNS configuration module can determine the file path matched by each domain from the resource file based on the identifier of each domain.

[0095] Furthermore, the DNS configuration module can load the file path into the initial service card configuration file to obtain the service card configuration file.

[0096] It should be noted that, through the above process, the information required for processing Domain Name System (DNS) requests is recorded in the service card configuration file, thereby enabling the service card with the service card configuration file loaded to effectively provide DNS services.

[0097] Optionally, the third acquisition submodule further includes: a third acquisition unit, used to acquire the identifier of at least one domain from the configuration instruction upon receiving the configuration instruction; and a generation unit, used to generate an initial service card configuration file based on the identifier of at least one domain and the service card configuration file template.

[0098] The configuration instructions not only instruct the main control card to generate a main control card configuration file, but also to generate an initial service card configuration file. Upon receiving the configuration instructions, the DNS configuration module can import the identifier of at least one domain into the service card configuration file template to obtain the initial service card configuration file, and then determine the service card configuration file based on the initial service card configuration file. The service card configuration file template may also define a second field, which indicates that the configuration file implements the function of processing DNS services.

[0099] It should be noted that the above process enables the accurate generation of the initial business card configuration file.

[0100] Optionally, the Domain Name System (DNS) request is processed based on the service card configuration file and resource file, including: extracting the domain name of the domain requested by the client from the DNS request to obtain the target domain name; determining the IP address matching the target domain name from the resource file based on the target domain name and the file path recorded in the service card configuration file; generating the request processing result based on the IP address matching the target domain name, and feeding back the request processing result to the client.

[0101] Optionally, a Domain Name System (DNS) request is used to request the resolution of a specific domain name within a specific domain. Therefore, after the second DNS service module obtains the DNS request, it can extract the domain name of the domain requested by the client from the DNS request, thus obtaining the target domain name. Further, the second DNS service module can determine the file path matching the target domain name based on the matching relationship between each domain and file path in the service card configuration file, and then find the IP address matching the target domain name from that file path in the resource file. Next, the second DNS service module can generate a request processing result based on the IP address matching the target domain name and send the request processing result back to the client, thereby achieving effective processing of the DNS service.

[0102] It should be noted that by finding the IP address matching the target domain name from the resource file based on the information recorded in the service card configuration file, the accuracy of the found IP address is ensured, thereby enabling the provision of effective DNS services through the service card.

[0103] Optionally, an optional application process of the distributed device in this embodiment will be described. The distributed device includes a main control card and multiple service cards. The main control card includes a DNS configuration module, a first DNS service module, and a file transfer module. Each service card includes a second DNS service module. When the DNS configuration module in the main control card receives a configuration command, it can generate a main control card configuration file and an initial service card configuration file. Then, the DNS configuration module notifies the first DNS service module to load the main control card configuration file. After loading the main control card configuration file, the first DNS service module notifies the second DNS service module to obtain and load the initial service card configuration file. Further, each service card obtains and loads the initial service card configuration file through the file transfer module.

[0104] Subsequently, the first DNS service module performs zone transfer, retrieves resource files from the target DNS server, and notifies the DNS configuration module to determine the service card configuration file based on the initial service card configuration file. After the DNS configuration module generates the service card configuration file, the first DNS service module retrieves the configuration file from the DNS configuration module and notifies the second DNS service module to retrieve and load the configuration file. The second DNS service module interacts with the file transfer module in the main control card. The file transfer module sends the service card configuration file and resource files to the service card, which then loads the configuration file and processes the DNS requests accordingly.

[0105] Therefore, the solution provided in this application achieves the goal of enabling regional transmission through the main control card and DNS service processing through the service card, thereby realizing the technical effect of providing DNS services based on distributed devices and solving the technical problem that distributed devices cannot provide DNS services in related technologies.

[0106] Example 3

[0107] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described request processing method at runtime.

[0108] Example 4

[0109] According to another aspect of the present invention, an electronic device is also provided, wherein, Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as... Figure 4 As shown, the electronic device includes one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to run the programs, wherein the programs are configured to execute the request processing method described above during runtime.

[0110] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0111] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0112] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0113] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0114] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0116] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A request processing method characterized by comprising: The method is applied to the master control card of a distributed device, and the method includes: Obtain resource files from the target Domain Name System server, wherein the resource files include multiple mappings between domain names and IP addresses; A service card configuration file is generated based on the resource file, and the service card configuration file and the resource file are sent to multiple service cards in the distributed device. Each service card loads the service card configuration file and the resource file, and processes the domain name system request based on the service card configuration file and the resource file when it receives a domain name system request from a client. The service card configuration file is used to indicate the resource file content required to process the domain name system request.

2. The method according to claim 1, characterized in that, Obtain resource files from the target DNS server, including: Upon receiving a configuration instruction, the IP address of the target Domain Name System server and the identifier of at least one domain are obtained from the configuration instruction; Based on the IP address of the target Domain Name System server and the identifier of at least one domain, a master control card configuration file is generated; The main control card configuration file is loaded, and the resource file is obtained from the target domain name system server based on the IP address in the main control card configuration file, wherein the multiple domain names in the resource file include the domain name of the at least one domain.

3. The method according to claim 2, characterized in that, The resource file is obtained from the target Domain Name System server based on the IP address in the main control card configuration file, including: According to a preset time period, the resource file is obtained from the target domain name system server based on the IP address in the main control card configuration file, or... Upon receiving a notification request, the resource file is retrieved from the target domain name system server based on the IP address in the main control card configuration file. The notification request is forwarded to the main control card by the service card upon receiving a notification request from the target domain name system server.

4. The method according to claim 3, characterized in that, The service card distinguishes between the Domain Name System request and the notification request in the following ways: A request is received, wherein the request is either the Domain Name System request or the notification request; Determine whether a target field exists in the content of the request, wherein the target field indicates that the request is the notification request; If the target field exists, the request is determined to be the notification request; If the target field does not exist, the request is determined to be a Domain Name System (DNS) request.

5. The method according to any one of claims 1 to 4, characterized in that, Generate a service card configuration file based on the resource file, including: Obtain the initial service card configuration file, wherein the initial service card configuration file contains the identifier of at least one field; Determine the file path in the resource file that matches the at least one domain, wherein the file path that matches the domain stores the correspondence between the domain's domain name and its IP address; The file path is loaded into the initial service card configuration file to obtain the service card configuration file.

6. The method according to claim 5, characterized in that, Obtain the initial service card configuration file, including: Upon receiving a configuration instruction, the identifier of the at least one domain is obtained from the configuration instruction; The initial service card configuration file is generated based on the identifier of the at least one domain and the service card configuration file template.

7. The method according to claim 5, characterized in that, Processing the Domain Name System (DNS) request based on the service card configuration file and the resource file includes: Extract the domain name of the domain requested by the client from the Domain Name System request to obtain the target domain name; Based on the target domain name and the file path recorded in the service card configuration file, determine the IP address matching the target domain name from the resource file; The request processing result is generated based on the IP address matched by the target domain name, and the request processing result is fed back to the client.

8. A request processing apparatus, characterized in that, include: The acquisition module is used to acquire resource files from the target domain name system server, wherein the resource files include multiple mapping relationships between domain names and IP addresses; The sending module is used to generate a service card configuration file based on the resource file, and send the service card configuration file and the resource file to multiple service cards in the distributed device. Each service card loads the service card configuration file and the resource file, and processes the domain name system request based on the service card configuration file and the resource file when it receives a domain name system request from a client. The service card configuration file is used to indicate the resource file content required to process the domain name system request.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the request processing method according to any one of claims 1 to 7 when it is run.

10. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to be configured to run the programs, wherein the programs are configured to execute the request processing method as described in any one of claims 1 to 7 at runtime.

Citation Information

Patent Citations

  • DNS deployment method based on web management and terminal

    CN110324173A

  • Packet Sending Method and Device

    US20200252366A1