Response method and device of data packet, electronic equipment and storage medium

By using a round-robin algorithm to select the target response message from multiple response messages, the problem of low response efficiency when the data volume exceeds the maximum processing capacity of the Domain Name System is solved, and stable and efficient DNS queries are achieved.

CN116074282BActive Publication Date: 2026-06-02BEIJING YOUZHUJU NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YOUZHUJU NETWORK TECH CO LTD
Filing Date
2023-01-17
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, when the data volume exceeds the maximum processing capacity of the Domain Name System during the data packet response process, truncation or re-initiating of TCP requests is usually adopted, resulting in low query efficiency or response failure, which affects user experience.

Method used

A round-robin algorithm is used to select a first predetermined number of target response messages from multiple response messages for response, ensuring that each response message has an equal probability of being selected, avoiding truncation and improving response efficiency.

Benefits of technology

When dealing with large amounts of data, the round-robin algorithm is used to select the target response message, ensuring the stability and efficiency of the response, avoiding truncation, and improving the efficiency and reliability of DNS queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116074282B_ABST
    Figure CN116074282B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for responding to data packets. The method includes: receiving request information and searching for multiple response packets corresponding to the request information; performing a response process based on the multiple response packets, the response process including: determining whether the data volume of the multiple response packets is greater than the first threshold; determining that the data volume of the multiple response packets is greater than the first threshold, and using a round-robin algorithm to select a first predetermined number of target response packets from the multiple response packets for response, wherein the first predetermined number is less than the total number of response packets. This eliminates the need for truncation of response packets when the data volume is large, and instead uses a round-robin selection method for response processing, ensuring that each response packet has an equal probability of being selected, thus guaranteeing the response efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data message response method, apparatus, electronic device, and storage medium. Background Technology

[0002] The data length of the data packet corresponding to the user's request may exceed the maximum amount that the Domain Name System can process at one time (e.g., 512 bytes). In such cases, if the data packet is large, it will be truncated or the client will be prompted to re-initiate a request that adapts to the format of the larger data packet.

[0003] However, this method of request query is relatively inefficient. In addition, some domain name systems cannot respond to requests with large data volumes, resulting in response failures, which can cause inconvenience to users. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a data message response method, apparatus, electronic device and storage medium to solve or partially solve the above-mentioned technical problems.

[0005] To achieve the above objectives, a first aspect of this application provides a method for responding to data packets, comprising:

[0006] Receive request information and locate multiple response messages corresponding to the request information;

[0007] Execute a response process based on the plurality of response messages, the response process including:

[0008] Determine whether the data volume of the multiple response messages exceeds a first threshold;

[0009] If the data volume of the plurality of response messages is determined to be greater than a first threshold, a round-robin algorithm is used to select a first predetermined number of target response messages from the plurality of response messages for response, wherein the first predetermined number is less than the total number of response messages.

[0010] Based on the same concept, a second aspect of this application proposes a data message response device, comprising:

[0011] The receiving module is configured to receive request information and search for multiple response messages corresponding to the request information.

[0012] The response module is configured to perform a response process based on the plurality of response messages. The response process includes: determining whether the data volume of the plurality of response messages is greater than a first threshold; determining that the data volume of the plurality of response messages is greater than the first threshold, and using a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response, wherein the first predetermined number is less than the total number of response messages.

[0013] Based on the same concept, a third aspect of this application proposes an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0014] Based on the same concept, a fourth aspect of this application provides a non-transitory computer-readable storage medium that stores computer instructions for causing a computer to perform the method described in the first aspect.

[0015] As can be seen from the above, the response method, apparatus, electronic device, and storage medium provided in this application, if the data volume of the response message searched based on the received request information is greater than a first threshold, it proves that the data volume of the response message is large. Therefore, a round-robin algorithm is needed to select a first predetermined number of target response messages from these response messages for response processing. In this way, when the data volume of the response message is large, there is no need to truncate the response message; instead, a round-robin selection method is used for response processing, ensuring that the probability of each response message being selected is the same, thus guaranteeing the response efficiency of the response message. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this application;

[0018] Figure 2A This is a flowchart illustrating a data packet response method according to an embodiment of this application.

[0019] Figure 2B This is an example diagram illustrating the determination of a first predetermined number in an embodiment of this application;

[0020] Figure 2C This is an example diagram illustrating the process of executing a response using an authoritative domain name system, as described in an embodiment of this application.

[0021] Figure 2D This is an example diagram illustrating the response process using the recursive domain name system in an embodiment of this application.

[0022] Figure 3 This is a structural block diagram of a data packet response device according to an embodiment of this application;

[0023] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0024] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0025] The principles and spirit of this application will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement this application, and are not intended to limit the scope of this application in any way. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0026] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0027] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.

[0028] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0029] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0030] In this article, it is important to understand that any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.

[0031] Based on the above background description, the following situations also exist in the related technologies:

[0032] DNS (Domain Name System) lookup / DNS resolution: A standard protocol that maps domain names to IP (Internet Protocol) addresses.

[0033] In DNS queries, UDP (User Datagram Protocol) is generally used as the default query protocol. However, UDP-based DNS specifies a maximum DNS packet length of 512 bytes. In certain scenarios, some DNS response data may exceed 512 bytes. For example, if you want to resolve a domain name to 100 IP addresses, and each IP address is expected to be able to handle some traffic.

[0034] In this situation, the usual practice is for the DNS server not to directly respond to the query packet, but instead to set the truncated flag in the response packet. Upon receiving this response packet, the client will re-initiate a TCP (Transmission Control Protocol) DNS query. TCP-based DNS queries can overcome the 512-byte limit.

[0035] However, this method has several drawbacks:

[0036] 1. TCP-based DNS lookups are relatively inefficient, and in the above scenario, two lookups are actually performed.

[0037] 2. Some DNS servers / clients do not support TCP well. When they detect a response exceeding 512 bytes, they may be unable to initiate / receive TCP-based queries. This can lead to resolution failures.

[0038] There is also an extended protocol called EDNS0 (DNS extension mechanism), which allows the return of 4096 bytes. However, this length is still limited, and many DNS devices on the Internet do not support this protocol, which will cause the protocol resolution to fail and be unable to respond to the corresponding request.

[0039] Explanation of technical terms:

[0040] Authoritative DNS:

[0041] Authoritative DNS servers are servers that are authorized by a higher-level DNS provider to resolve domain names. They can also delegate this authority to others. For example, a .com top-level server can authorize ns.bytedns.com as the authoritative server for the domain byedns.com. Furthermore, ns.bytedns.com can delegate the authority for the subdomain a.bytedns.com to ns.bbb.com, making ns.bbb.com the de facto authoritative server for a.bytedns.com. Normally, the results of domain name resolution ultimately come from authoritative DNS servers.

[0042] Recursive DNS:

[0043] Recursive DNS is responsible for accepting user queries for any domain name and returning the results to the user. It can cache results to avoid repeated upward queries. This is the type of DNS most commonly used by users; it is a publicly available service, usually provided by network operators. A reliable internet connection is required to use recursive DNS. Examples include Google's 8.8.8.8 and 8.8.4.4, and 114's 114.114.114.114 and 114.114.115.115. The DNS set up on your local computer is of this type.

[0044] Based on the above description, the principles and spirit of this application will be explained in detail below with reference to several representative embodiments.

[0045] refer to Figure 1 This is a schematic diagram illustrating an application scenario of the data packet response method provided in this application embodiment. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, server 102, and data storage system 103 can all be connected via wired or wireless communication networks. The terminal device 101 includes, but is not limited to, desktop computers, mobile phones, mobile computers, tablets, media players, smart wearable devices, personal digital assistants (PDAs), or other electronic devices capable of performing the aforementioned functions. The server 102 and data storage system 103 can both be independent physical servers, server clusters composed of multiple physical servers, or distributed systems. They can also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0046] Terminal device 101 initiates a request through a client, sending the request information to server 102. Upon receiving the request, server 102 searches for multiple response messages corresponding to the request (each response message corresponds to an IP address). Server 102 determines the total data volume of these response messages. If the total data volume exceeds a first threshold (e.g., 512 bytes), it uses a round-robin algorithm to select a first predetermined number of target response messages to respond to, and then sends the corresponding data to the client in terminal device 101 for display. The data storage system 103 stores the program code that server 102 needs to execute, as well as the response messages corresponding to various request messages for later querying.

[0047] The following is combined Figure 1 The application scenarios described above illustrate the data packet response method according to exemplary embodiments of this application. It should be noted that the above application scenarios are merely shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this regard. Rather, the embodiments of this application can be applied to any applicable scenario.

[0048] This application provides a data packet response method, which is applied to a server.

[0049] like Figure 2A As shown, the method includes:

[0050] Step 201: Receive request information and locate multiple response messages corresponding to the request information.

[0051] In practice, the corresponding request information is a data request initiated by the user through a client installed on the terminal device, based on the user's needs. For example, it may be at least one of the following: query request, call request, search request, or calculation processing request.

[0052] After receiving the corresponding request information, the server will analyze the request information and determine multiple response messages that meet the requirements of the request information. Each response message corresponds to a response IP.

[0053] Step 202: Execute a response process based on the plurality of response messages, the response process including:

[0054] Step 2021: Determine whether the data volume of the plurality of response messages is greater than the first threshold.

[0055] Step 2022: Determine that the data volume of the plurality of response messages is greater than a first threshold, and use a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response, wherein the first predetermined number is less than the total number of response messages.

[0056] In practice, the first threshold can be selected and set according to actual needs; in this embodiment, 512 bytes is preferred. Here, the data volume of multiple response messages refers to the total number of bytes in the multiple response messages.

[0057] If the total number of bytes in the response message is less than or equal to the first threshold, the server can continue to query and respond using UDP without needing a round-robin algorithm. If the total number of bytes in the response message is greater than the first threshold, it cannot directly query and respond using UDP. Instead, a round-robin algorithm is used to select a first predetermined number of target response messages from multiple response messages before continuing to query and respond using UDP. This avoids the need for truncation or other unfriendly formats (such as TCP or EDNS0), ensuring the stability of the response.

[0058] With the above scheme, when the data volume of the response message is large, there is no need to truncate the response message. Instead, a round-robin selection method is used for response processing, which can ensure that each response message has the same probability of being selected, thus ensuring the response efficiency of the response message.

[0059] In some embodiments, the process of determining the first predetermined number before performing step 202 includes:

[0060] Step A1: Determine that the data volume of the plurality of response messages is greater than a first threshold, and repeatedly execute the process of reducing the number of the plurality of response messages by a second predetermined number until it is determined that the data volume of the remaining response messages is less than or equal to the first threshold.

[0061] The corresponding second predetermined number can be a fixed value, or it can be a value that decreases or increases sequentially, or a value that decreases first and then increases sequentially, or increases first and then decreases sequentially. In this embodiment, the second predetermined number is preferably a fixed value of 1.

[0062] Step A2: Determine the number of remaining response messages as the first predetermined number.

[0063] The above scheme can accurately determine the first predetermined number of targets that meet the first threshold, thereby ensuring that when the round-robin algorithm is used for selection, the data size of the first predetermined number of target response messages selected in each round is less than or equal to the first threshold. In this way, the target response messages selected in each round can be queried and responded using UDP format, which effectively improves the response efficiency.

[0064] For example, Figure 2B As shown, for a DNS request, the process of determining the first predetermined number includes:

[0065] Step a1: Find the DNS request response content (i.e., the response message) / IP.

[0066] Step a2: Determine if the data size of the response message is greater than 512 bytes. If so, proceed to step a3; otherwise, proceed to step a4.

[0067] Step a3: Decrease the total number of IPs corresponding to the response message by 1, and then return to step a2.

[0068] Step a4: Determine the number of IPs corresponding to the remaining response messages as the first predetermined number (i.e., C).

[0069] In some embodiments, step 2022, which involves using a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response, includes:

[0070] Step 20221: Determine the number M of the response messages and arrange the M response messages in sequence.

[0071] In practice, since each response message corresponds to an IP address, the order of arrangement can be sorted in ascending or descending order according to the IP address, and then numbered sequentially starting from 0.

[0072] Step 20222: Determine the current request count N of the request information, and use a round-robin algorithm to select the response messages corresponding to the sorting interval (N-1)%M to (N-1+C-1)%M from the M response messages, and use them as the target response messages for response; where % is the modulo operation, and C is the first predetermined number.

[0073] The number of requests refers to the number of times the same request information is requested multiple times.

[0074] In practice, following the algorithm formula for the sorting interval in step 20222 above, C sequential numbers of the IP addresses corresponding to the current request count N are selected. This allows responses to the selected C response packets. If the selection reaches the end of the sorting interval by request count, the selection can continue by connecting to the beginning of the sorting interval using the short-send formula described above. This ensures the cyclical connection of each response packet while maintaining an equal probability of selection for each response packet.

[0075] For example: a user configures example.com to resolve to 100 IP addresses from 10.10.10.1 to 10.10.10.100. Suppose that when we look at the response data, we find that the response packet exceeds 512 bytes whenever there are more than 10 IP addresses. In this case, the data from each DNS request response would look like this:

[0076] First request, response: 10.10.10.1~10.10.10.10;

[0077] Second request, response: 10.10.10.2~10.10.10.11;

[0078] 3rd request, response: 10.10.10.3~10.10.10.12; ......

[0080] Request 92, responses: 10.10.10.92 to 10.10.10.100 and 10.10.10.1; ......

[0082] 100th request, responses: 10.10.10.100 and 10.10.10.1 to 10.10.10.9;

[0083] 101st request, response: 10.10.10.1~10.10.10.10.

[0084] The example above illustrates that DNS queries only return a partial IP address each time, preventing DNS truncation. Ultimately, this achieves load balancing, ensuring that each IP address has an equal probability of being retrieved by the client.

[0085] In some embodiments, the schemes corresponding to steps 201 and 202 in the above embodiments can be executed in the authoritative domain name system, in the recursive domain name system, or in both the authoritative domain name system and the recursive domain name system.

[0086] The following is a specific description using the execution of the response process in an authoritative domain name system as an example:

[0087] Figure 2C An example diagram is shown illustrating the execution of the response process using the authoritative domain name system.

[0088] Step A1: Utilize the authoritative domain name system to receive request information sent by the client through the recursive domain name system.

[0089] In some embodiments, step A1 includes:

[0090] The authoritative domain name system receives a request message in User Datagram Format (UDP) from the recursive domain name system, wherein the request message in User Datagram Format is the request message in User Datagram Format sent by the client to the recursive domain name system.

[0091] In practice, after each client generates the corresponding request information (i.e., DNS request), it will be forwarded through the recursive domain name system (i.e., recursive DNS) to the corresponding authoritative domain name system (i.e., authoritative DNS) for processing in the response process.

[0092] In the above process, the recursive domain name system centrally distributes the UDP-formatted DNS requests from various clients. After converting the UDP-formatted DNS requests into UDP-formatted request information, it distributes this converted UDP-formatted request information to the corresponding authoritative domain name system. At least one corresponding recursive domain name system can be set, and the authoritative domain name system receives the converted UDP-formatted request information from each recursive domain name system. This allows the subsequent processing of the response information by the authoritative domain name system.

[0093] Step A2: Locate multiple response messages corresponding to the request information through the authoritative domain name system.

[0094] Therefore, step 202 above is also executed using the authoritative domain name system. The specific execution process is the same as the specific scheme of step 202 above, and will not be repeated here.

[0095] In practical implementation, since recursive DNS servers all use UDP format for processing, when the authoritative DNS server adopts the response process of this embodiment, it can also use UDP format for processing. This way, all network-wide DNS resolutions can use UDP for response processing. Because UDP format has a faster data processing speed, this improves the overall speed and efficiency of network-wide request and response.

[0096] For recursive DNS, each recursive DNS server receives a portion of the IP address from the response messages of all DNS requests sent by clients. Since each recursive DNS server requests the resolution result from the authoritative DNS server separately, the results from each recursive DNS server are obtained in a round-robin fashion, resulting in different outcomes.

[0097] The ultimate result is that even if 1000 IPs / nodes are configured to correspond to the request information and provide online services, each IP can distribute traffic evenly, achieving global load balancing. This is achieved without the need for TCP or other complex protocols; end-to-end UDP DNS is sufficient.

[0098] The following is a detailed description of the response process in both the recursive domain name system and the authoritative domain name system:

[0099] Step B1: Receive the request information sent by the client using the recursive domain name system, and search for multiple response messages corresponding to the request information using the recursive domain name system.

[0100] In practice, after each client generates the corresponding request information (i.e., DNS request), it sends it to the recursive domain name system, which then determines the corresponding response message based on the request information.

[0101] Step B2: Execute the response process of the multiple response messages using the recursive domain name system, generate response result information based on the response process, and send the response result information to the authoritative domain name system.

[0102] In practice, if the number of response messages found in the request information sent by the client to the recursive domain name system is large, and the recursive domain name system cannot complete the response process using UDP format files, the corresponding response process can be executed by the round-robin algorithm according to the scheme in step 202 above on the recursive domain name system side. In this way, the response process can be completed using UDP format files. The specific execution process is the same as above, and will not be repeated here.

[0103] After execution, a UDP-formatted response result will be obtained. This UDP-formatted response result will then be sent to the authoritative domain name system to perform the resolution process based on the response message in the response result.

[0104] Step B3: Receive the response result information sent by the recursive domain name system using the authoritative domain name system.

[0105] Step B4: Locate multiple response messages corresponding to the response result information through the authoritative domain name system.

[0106] Step B5: The response process of the multiple response messages corresponding to the response result information is executed using the authoritative domain name system.

[0107] In practice, if the amount of data in the received UDP format response information is large, the authoritative domain name system can continue to use the round-robin algorithm in step 202 above to process multiple response packets in the response information. The specific execution process is the same as step 202 above, and will not be repeated here.

[0108] With the above scheme, the response process of the corresponding round-robin algorithm can be executed simultaneously on both the recursive DNS and authoritative DNS sides. This ensures the speed and effectiveness of the response processing on both sides. As a result, the entire network can use UDP format for response message processing. UDP format response messages are processed quickly and have high accuracy, thus improving the overall network response effect.

[0109] The following is a detailed description using the execution of the response process in a recursive domain name system as an example:

[0110] Figure 2D An example diagram is shown illustrating the execution of a response process using the recursive domain name system.

[0111] Step C1: Receive the request information sent by the client using the recursive domain name system, and search for multiple response messages corresponding to the request information using the recursive domain name system.

[0112] In practice, after each client generates the corresponding request information, it sends it to the recursive domain name system. The recursive domain name system determines the corresponding response message for the DNS request in UDP format sent by each client.

[0113] Step C2: The response process of the multiple response messages is executed using the recursive domain name system.

[0114] In practice, if the number of response messages found in the request information sent by the client to the recursive domain name system is large, and the recursive domain name system cannot complete the response process using UDP format files, the corresponding response process can be executed by the round-robin algorithm according to the scheme in step 202 above on the recursive domain name system side. In this way, the response process can be completed using UDP format files. The specific execution process is the same as above, and will not be repeated here.

[0115] Step C3: After the recursive domain name system completes the response process, it generates response result information based on the response process and sends the response result information to the authoritative domain name system so that the authoritative domain name system can respond based on the response result information.

[0116] In some embodiments, sending the response result information to the authoritative domain name system in step C3 includes:

[0117] The response result information is sent to the authoritative domain name system in either user data message format or transmission control protocol format.

[0118] In practice, if the data size of the response information obtained after the recursive domain name system is small (less than or equal to 512 bytes), it can be sent to the authoritative domain name system in UDP format. If the data size is large (greater than 512 bytes), it needs to be sent to the authoritative domain name system in TCP format. This allows the authoritative domain name system to parse the response information and then return the parsing result to the client through the recursive domain name system, so that the client can know the request result.

[0119] In the above scheme, when the recursive DNS side implements the round-robin algorithm response process of this embodiment, client requests can all be made via UDP, and the recursive DNS to the authoritative DNS side will proceed according to the standard DNS protocol. Since the recursive DNS has a caching function, most DNS requests across the entire network are from the client to the recursive DNS. Therefore, this embodiment utilizes the recursive DNS side to execute the round-robin algorithm response process, which can significantly improve the efficiency of DNS requests.

[0120] For example, if a domain's TTL (Time To Live) is configured to be 60 seconds, then the number of requests from the client to the recursive DNS server for that domain is approximately 60:1 compared to the number of requests from the recursive DNS server to the authoritative DNS server, thus improving the efficiency of DNS queries.

[0121] Since recursive DNS can perform a round-robin response process and needs to resolve a large number of IPs, the probability of the client obtaining each IP is actually the same.

[0122] This implementation method requires attention to the following: recursive DNS must support TCP anti-truncation functionality, that is, it must support TCP DNS queries.

[0123] In summary, this application solves the problem of low TCP transmission efficiency after UDP truncation without introducing complex methods. It also addresses the issue of some DNS devices on the Internet not supporting TCP queries / EDNS0. Furthermore, for scheduling systems (recursive DNS and / or authoritative DNS) in Internet CDN (Content Delivery Network) scenarios, they are unaffected by IP truncation; the scheduling system only needs to determine available IPs and distinguish the IP addresses on the network. Implementing the recursive DNS and / or authoritative DNS scheme of this application reduces the complexity of the response process and significantly reduces DNS query failures caused by truncation.

[0124] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0125] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] Based on the same concept, corresponding to the data packet response method of any of the above embodiments, this application also provides a data packet response device.

[0127] refer to Figure 3 The device includes:

[0128] The receiving module is configured to receive request information and search for multiple response messages corresponding to the request information.

[0129] The response module is configured to perform a response process based on the plurality of response messages. The response process includes: determining whether the data volume of the plurality of response messages is greater than a first threshold; determining that the data volume of the plurality of response messages is greater than the first threshold, and using a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response, wherein the first predetermined number is less than the total number of response messages.

[0130] In some embodiments, the apparatus further includes a quantity determination module configured to:

[0131] If the data volume of the plurality of response messages is determined to be greater than a first threshold, the process of reducing the number of the plurality of response messages by a second predetermined number is repeatedly executed until the data volume of the remaining response messages is determined to be less than or equal to the first threshold; the number of remaining response messages is determined to be the first predetermined number.

[0132] In some embodiments, the response module includes:

[0133] The sorting unit is configured to determine the number M of the response messages and sort the M response messages sequentially.

[0134] The response unit is configured to determine the current request count N of the request information, and use a round-robin algorithm to select the response message corresponding to the sorting interval (N-1)%M to (N-1+C-1)%M from M response messages as the target response message; where % is the modulo operation and C is the first predetermined number.

[0135] In some embodiments, the receiving module is further configured to:

[0136] The system utilizes an authoritative domain name system to receive request information from clients via a recursive domain name system; and uses the authoritative domain name system to find multiple response messages corresponding to the request information.

[0137] Therefore, the response module is set in the authoritative domain name system, and the response process of the multiple response messages is executed using the authoritative domain name system.

[0138] In some embodiments, the receiving module is further configured to:

[0139] The authoritative domain name system is used to receive request information in the format of user data packets sent by the recursive domain name system, wherein the request information in the format of user data packets is the request information in the format of user data packets sent by the client to the recursive domain name system.

[0140] In some embodiments, the receiving module is further configured to:

[0141] The system uses the recursive domain name system to receive request information from the client and then uses the recursive domain name system to find multiple response messages corresponding to the request information.

[0142] The response module is set up in the recursive domain name system, and the response module is configured as follows:

[0143] The recursive domain name system is used to execute the response process of the multiple response messages, and response result information is generated according to the response process and sent to the authoritative domain name system.

[0144] The receiving module is also configured to: receive response result information sent from the recursive domain name system using the authoritative domain name system;

[0145] The response module is set up in the recursive domain name system, and the response module is configured as follows:

[0146] The authoritative domain name system is used to find multiple response messages corresponding to the response result information; and the response process of the multiple response messages corresponding to the response result information is executed using the authoritative domain name system.

[0147] In some embodiments, the receiving module is further configured to:

[0148] The system uses the recursive domain name system to receive request information from the client and then uses the recursive domain name system to find multiple response messages corresponding to the request information.

[0149] Therefore, the response module is set in the recursive domain name system, and the response module is also configured as follows:

[0150] The response process of the multiple response messages is executed using the recursive domain name system; after the recursive domain name system completes the response process, response result information is generated based on the response process, and the response result information is sent to the authoritative domain name system so that the authoritative domain name system can respond based on the response result information.

[0151] In some embodiments, the response module is further configured to send the response result information to the authoritative domain name system via a user data message format or a transmission control protocol format.

[0152] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0153] The apparatus of the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0154] Based on the same concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the methods described in any of the above embodiments.

[0155] Figure 4 This illustration shows a more specific hardware structure diagram of an electronic device provided in this embodiment. The device may include: a processor 410, a memory 420, an input / output interface 430, a communication interface 440, and a bus 450. The processor 410, memory 420, input / output interface 430, and communication interface 440 are interconnected internally via the bus 450.

[0156] The processor 410 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0157] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.

[0158] Input / output interface 430 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0159] The communication interface 440 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).

[0160] Bus 450 includes a pathway for transmitting information between various components of the device (e.g., processor 410, memory 420, input / output interface 430, and communication interface 440).

[0161] It should be noted that although the above-described device only shows the processor 410, memory 420, input / output interface 430, communication interface 440, and bus 450, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0162] The electronic devices described above are used to implement the corresponding data packet response methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding data packet response method embodiments, which will not be repeated here.

[0163] Based on the same concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to perform the methods described in any of the above embodiments.

[0164] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0165] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the methods described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0166] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0167] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0168] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0169] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method for responding to a data packet, characterized in that, Applied to the Domain Name System, including: Receive request information and locate multiple response messages corresponding to the request information; Execute a response process based on the plurality of response messages, the response process including: Determine whether the data volume of the multiple response messages exceeds a first threshold; If the data volume of the plurality of response messages is determined to be greater than a first threshold, a round-robin algorithm is used to select a first predetermined number of target response messages from the plurality of response messages for response, wherein the first predetermined number is less than the total number of response messages. For each request, the first predetermined number of target response messages are selected in a round-robin manner so that each response message has an equal probability of being selected in the round-robin. After the round-robin selection is performed according to the number of requests until the end of the sorted plurality of response messages, the round-robin selection is continued according to the sorted interval of the plurality of response messages connected to the head of the sorted order. The step of using a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response includes: Determine the number of response messages and arrange the response messages in order according to the number of messages; The current request count of the request information is determined, and a round-robin algorithm is used to select a first predetermined number of response messages from the number of response messages as the target response messages.

2. The method according to claim 1, characterized in that, The process of determining the first predetermined number includes: If the data volume of the plurality of response messages is determined to be greater than a first threshold, the process of reducing the number of the plurality of response messages by a second predetermined number is repeatedly executed until the data volume of the remaining response messages is determined to be less than or equal to the first threshold. The number of remaining response messages is determined to be the first predetermined number.

3. The method according to claim 1, characterized in that, The step of using a round-robin algorithm to select a first predetermined number of target response messages from the plurality of response messages for response includes: Determine the number M of the response messages, and arrange the M response messages in order; Determine the current request count N of the request information, and use a round-robin algorithm to select the response message corresponding to the sorting interval (N-1)%M to (N-1+C-1)%M from the M response messages, and use it as the target response message for response; where % is the modulo operation, and C is the first predetermined number.

4. The method according to any one of claims 1 to 3, characterized in that, The process of receiving request information and searching for multiple response messages corresponding to the request information includes: Utilize authoritative domain name systems to receive request information from clients via recursive domain name systems; The authoritative domain name system is used to locate multiple response messages corresponding to the request information; The response process for the multiple response messages is then executed using the authoritative domain name system.

5. The method according to claim 4, characterized in that, The method of receiving request information from the client via the recursive domain name system using the authoritative domain name system includes: The authoritative domain name system receives a request information in the format of a user data packet from the recursive domain name system, wherein the request information in the format of a user data packet is the request information in the format of a user data packet sent by the client to the recursive domain name system.

6. The method according to claim 4, characterized in that, The method of receiving request information from the client via the recursive domain name system using the authoritative domain name system includes: The system uses the recursive domain name system to receive request information from the client and then uses the recursive domain name system to find multiple response messages corresponding to the request information. The recursive domain name system is used to execute the response process of the multiple response messages, and response result information is generated according to the response process and sent to the authoritative domain name system. Utilize the authoritative domain name system to receive response result information sent from the recursive domain name system; The step of searching for multiple response messages corresponding to the request information through the authoritative domain name system includes: The authoritative domain name system is used to locate multiple response messages corresponding to the response result information; Furthermore, the response process of the multiple response messages corresponding to the response result information is executed using the authoritative domain name system.

7. The method according to any one of claims 1 to 3, characterized in that, The process of receiving request information and searching for multiple response messages corresponding to the request information includes: The system uses a recursive domain name system to receive request information from clients and then uses the recursive domain name system to find multiple response messages corresponding to the request information. Then, the response process of the multiple response messages is executed using the recursive domain name system; After the recursive domain name system completes the response process, it generates response result information based on the response process and sends the response result information to the authoritative domain name system so that the authoritative domain name system can respond based on the response result information.

8. The method according to claim 7, characterized in that, Sending the response result information to the authoritative domain name system includes: The response result information is sent to the authoritative domain name system in either user data message format or transmission control protocol format.

9. A data packet response device, characterized in that, Configured in the Domain Name System, including: The receiving module is configured to receive request information and search for multiple response messages corresponding to the request information. The response module is configured to execute a response process based on the plurality of response messages. The response process includes: determining whether the data volume of the plurality of response messages is greater than a first threshold; determining that the data volume of the plurality of response messages is greater than the first threshold, determining the number of response messages, and arranging the response messages in order according to the number of messages; determining the current request count of the request information, and using a round-robin algorithm to select a first predetermined number of response messages from the number of response messages as target response messages for response. The first predetermined number is less than the total number of response messages. For each request information, the first predetermined number of target response messages are selected in a round-robin manner so that each response message has an equal probability of being selected in the round-robin. After selecting the response messages in a round-robin manner until the end of the sorted plurality of response messages, the sorted interval of the plurality of response messages is connected to the head of the sorted order to continue the round-robin selection.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method as described in any one of claims 1 to 8.