Domain name information management method and device, storage medium and router
By customizing the domain name lifespan settings, the problem of frequent queries for high-frequency domain names and long-term memory occupation of low-frequency domain names in routing devices is solved, thereby improving the reliability of domain name information management and reducing energy consumption.
Patent Information
- Application Number
- CN202511266302.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional routing devices suffer from domain name information management strategies that lead to frequent queries for high-frequency access domains, resulting in latency, lag, and high energy consumption, while low-frequency access domains occupy memory for extended periods.
By analyzing the domain name request records of the terminal, we can obtain domain name access habit data, personalize the domain name lifespan settings, cache high-frequency domain names for a longer time, and low-frequency domain names for a shorter time, to avoid frequent queries and long-term occupation.
It effectively improves the reliability of domain name information management, reduces the probability of domain name queries, reduces energy consumption and memory usage, and improves network response speed.
Smart Images

Figure CN120980011A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, specifically to a domain name information management method, device, storage medium, and router. Background Technology
[0002] With the surge in the number of smart terminal devices and the diversification of network application scenarios, the efficiency of domain name lookup (DNS lookup) has become a key factor affecting user experience. To this end, routing devices usually cache the domain name information of domains accessed by the terminal so that the cached domain name information can be sent directly to the terminal on the next access, thereby ensuring the efficiency of domain name information lookup.
[0003] However, in traditional technical means, routing devices usually use a fixed lifecycle (TTL, Time to Live) mechanism or a uniform caching strategy to cache domain name information. After the lifecycle expires, the cached domain name information will be removed and become invalid.
[0004] For some frequently accessed domains, after the domain information expires, the frequent need for terminals to access the domain will trigger the routing device to re-query the domain. The re-query will cause delays and stuttering in terminal services (such as 4K video streaming, online conferencing, etc.), and the frequent queries will also lead to higher additional power consumption. For some infrequently accessed domains, the routing device will cache their domain information for a long time, thus occupying memory for an extended period. Summary of the Invention
[0005] This application provides a domain name information management scheme that can effectively improve the reliability of domain name information management, reduce the probability of repeated domain name queries, and reduce energy consumption and memory usage.
[0006] To avoid duplicate domain name queries, which could cause delays and lag in terminal services.
[0007] The embodiments of this application provide the following technical solutions:
[0008] According to one embodiment of this application, a domain name information management method includes: obtaining domain name request records of a terminal; analyzing the domain name request records to obtain domain name access habit data of the terminal; determining the time-to-live (TTL) of each domain name accessed by the terminal based on the TTL of the domain name access habit data; and caching the domain name information of each domain name based on the TTL of each domain name.
[0009] In some embodiments of this application, the domain name access habit data includes high-frequency access periods; determining the lifetime of each domain name accessed by the terminal based on the domain name access habit data includes: determining the high-frequency domain names accessed during the high-frequency access periods; increasing the base time of the high-frequency domain names by a delay time to obtain the lifetime of the high-frequency domain names.
[0010] In some embodiments of this application, the domain name access habit data further includes the domain name query rate; the method further includes: determining low-frequency domain names accessed during periods other than the high-frequency access period; calculating an adjustment coefficient for the low-frequency domain name based on the domain name query rate of the low-frequency domain name; and multiplying the adjustment coefficient of the low-frequency domain name by the base time of the low-frequency domain name to obtain the lifespan of the low-frequency domain name.
[0011] In some embodiments of this application, the step of calculating the adjustment coefficient of the low-frequency domain name based on the domain name query rate includes: according to formula T 调 The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio, where T 调 The adjustment coefficient refers to the frequency of access to the low-frequency domain name per unit time within the predetermined query duration, freq refers to the total access frequency of the low-frequency domain name within the predetermined query duration, α and β are the preset first weight and preset second weight, respectively, and A is a preset parameter.
[0012] In some embodiments of this application, after analyzing the domain name request records to obtain the domain name access habit data of the terminal, the method further includes: determining the domain name that meets the preloading timing based on the domain name access habit data, and obtaining the preloaded domain name; and preloading the domain name information of the preloaded domain name.
[0013] In some embodiments of this application, obtaining the domain name request record of the terminal includes: obtaining terminal information of the terminal; obtaining the identity information of the terminal based on the terminal information; and obtaining the domain name request record corresponding to the identity information.
[0014] In some embodiments of this application, the terminal information includes the terminal physical address; obtaining the terminal's identity information based on the terminal information includes: concatenating the terminal physical address with the router serial number to obtain concatenated information; performing hash processing on the concatenated information to obtain a hash value; encoding the connection protocol between the terminal and the router to obtain an encoded value; and concatenating the hash value with the encoded value to obtain the identity information.
[0015] According to one embodiment of this application, a domain name information management device includes: an acquisition module, configured to: acquire domain name request records of a terminal; an analysis module, configured to: analyze the domain name request records to obtain domain name access habit data of the terminal; a determination module, configured to: determine the time-to-live (TTL) of each domain name accessed by the terminal based on the TTL of the domain name access habit data; and a caching module, configured to: cache the domain name information of each domain name based on the TTL of each domain name.
[0016] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by the processor of a router, causes the router to perform the methods described in the embodiments of this application.
[0017] According to another embodiment of this application, a router may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.
[0018] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A router's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the router to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0019] In this embodiment of the application, the router can: obtain the domain name request records of the terminal; analyze the domain name request records to obtain the domain name access habit data of the terminal; determine the time to live of each domain name accessed by the terminal based on the domain name access habit data; and cache the domain name information of each domain name based on the time to live of each domain name.
[0020] In this embodiment of the application, by analyzing the domain name request records of the terminal, the domain name access habit data of the terminal is obtained. Based on the domain name access habit data, the life-time of each domain name accessed by the terminal is determined in a personalized manner. The domain name information of each domain name is cached according to the life-time of each domain name. This can effectively avoid frequently triggering the routing device to re-query the domain name and avoid long-term invalid memory occupation. Overall, it can effectively improve the reliability of domain name information management, reduce the probability of repeated domain name queries, and reduce energy consumption and memory occupation. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart of a domain name information management method according to an embodiment of this application is shown.
[0023] Figure 2 An information processing flowchart according to an embodiment of this application is shown.
[0024] Figure 3 A flowchart illustrating the time-to-survival determination process according to one embodiment of this application is shown.
[0025] Figure 4 A block diagram of a domain name information management apparatus according to an embodiment of this application is shown.
[0026] Figure 5 A block diagram of a router according to one embodiment of this application is shown. Detailed Implementation
[0027] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, the embodiments provided below are some embodiments for implementing the present disclosure, and not all embodiments for implementing the present disclosure. Unless otherwise specified, the technical solutions described in the embodiments of the present disclosure can be implemented in any combination.
[0028] It should be noted that, in the embodiments of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.
[0029] For example, the domain name information management method provided in this disclosure includes a series of steps, but the domain name information management method provided in this disclosure is not limited to the steps described. Similarly, the domain name information management device provided in this disclosure includes a series of units, but the device provided in this disclosure is not limited to the units explicitly described, but may also include units that need to be set up for obtaining relevant information or processing based on information.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure.
[0031] It is understood that in the specific implementation of this application, relevant data is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0032] DNS lookup efficiency has become a key factor affecting user experience. Therefore, routing devices typically cache domain information for domains accessed by the terminal, so that the cached information can be directly sent to the terminal on subsequent visits, thus ensuring efficient DNS lookup. However, traditional techniques often use fixed lifecycle (TTL, Time to Live) mechanisms or uniform caching strategies to cache domain information. After the TTL expires, the cached domain information is removed and becomes invalid.
[0033] For some frequently accessed domains, after the domain information expires, the frequent need for terminals to access the domain (such as domains for instant messaging, short video, etc.) will trigger the routing device to frequently re-query the domain. These re-queries will cause delays and stuttering in terminal services (such as 4K video streaming, online conferencing, etc.), and frequent queries will also lead to higher energy consumption. For some infrequently accessed domains (such as domains for online banking, ticketing, etc.), the routing device will cache their domain information for a long time, thus occupying memory indefinitely.
[0034] To address these issues, this application provides a domain name information management solution that can resolve the aforementioned technical problems, effectively improve the reliability of domain name information management, reduce the probability of re-querying domain names, and reduce energy consumption and invalid memory usage.
[0035] The following provides a detailed description of the relevant embodiments of the domain name information management scheme provided in this application.
[0036] first, Figure 1A flowchart illustrating a domain name information management method according to an embodiment of this application is shown. The entity executing this domain name information management method can be a routing device, such as a home router or an enterprise-level router, or other devices with network routing capabilities.
[0037] like Figure 1 As shown, the domain name information management method may include steps S110 to S140.
[0038] Step S110: Obtain the domain name request record of the terminal;
[0039] Step S120: Analyze the domain name request records to obtain the terminal's domain name access habit data;
[0040] Step S130: Determine the lifespan of each domain name accessed by the terminal based on the domain name access habit data;
[0041] Step S140: Cache the domain information of each domain according to the corresponding lifetime of each domain.
[0042] The routing device can retrieve domain name request records from a predetermined storage location within a predetermined statistical period (e.g., 30 days or 45 days). The domain name request records include relevant information such as the domain names accessed by the terminal within the predetermined period and the access time of the domain names.
[0043] The routing device can further analyze the domain name request records to obtain the terminal's domain name access habit data. The domain name access habit data is used to reflect the terminal's access habits for domain names. The domain name access habit data can include high-frequency access periods (i.e. concentrated access periods) or domain name query rate, etc.
[0044] Then, based on domain access habit data, the lifetime of each domain accessed by the terminal can be determined in a personalized way (the lifetime is equal to the caching time of the domain information). For example, a longer lifetime can be determined for some high-frequency access domains, and a shorter lifetime can be determined for some low-frequency access domains.
[0045] Finally, the domain information is cached according to the corresponding time-to-live (TTL) of each domain. For frequently accessed domains, setting a longer TTL effectively avoids frequent cache invalidation of domain information. When terminals frequently access domains (such as domains for instant messaging, short video, etc.), it also avoids frequently triggering the routing device to re-query the domain, preventing delays and stuttering in terminal services (such as 4K video streaming, online conferencing, etc.) caused by re-queries, and avoiding the extra energy consumption of frequent queries. In addition, for some infrequently accessed domains (such as domains for online banking, ticketing, etc.), setting a shorter TTL can also prevent the routing device from caching their domain information for a long time, thereby avoiding long-term invalid memory occupation.
[0046] In summary, by analyzing the domain name request records of the terminal to obtain the terminal's domain name access habit data, and by determining the lifetime of each domain name accessed by the terminal in a personalized manner based on the domain name access habit data, and by caching the domain name information of each domain name according to the lifetime of each domain name, it is possible to effectively avoid frequently triggering the routing device to re-query the domain name and avoid long-term invalid memory occupation. Overall, it can effectively improve the reliability of domain name information management, reduce the probability of repeated domain name queries, and reduce energy consumption and memory occupation.
[0047] The following description Figure 1 Further optional specific embodiments for each step performed when managing domain name information in the example.
[0048] In one embodiment, step S110, obtaining the domain name request record of the terminal, includes: obtaining terminal information of the terminal; obtaining the identity information of the terminal based on the terminal information; and obtaining the domain name request record corresponding to the identity information.
[0049] After a terminal connects to a router, the router can obtain the terminal information through network protocols. The terminal information is used to identify the terminal and may include information such as the terminal's physical address (MAC address) or terminal serial number.
[0050] The router can obtain the terminal's identity information based on the terminal information, thereby authenticating the terminal. Furthermore, the router can obtain the domain name request record corresponding to the identity information, thus accurately obtaining the domain name request record corresponding to the terminal.
[0051] In one approach, the router can store domain name request records using a ring buffer. A ring buffer is an efficient data storage structure that can save domain name request records in chronological order. The router can then query the ring buffer for domain name request records within a predetermined statistical period (e.g., 30 or 45 days) corresponding to the identity information.
[0052] Furthermore, in one embodiment, obtaining the terminal's identity information based on the terminal information may include: using the terminal information as the terminal's identity information. For example, the terminal's physical address (MAC address) may be directly used as the terminal's identity information.
[0053] For further details, please refer to [link / reference]. Figure 2 In one embodiment, the terminal information includes the terminal physical address; obtaining the terminal's identity information based on the terminal information may include: step S210, concatenating the terminal physical address with the router serial number to obtain concatenated information; step S220, performing hash processing on the concatenated information to obtain a hash value; step S230, encoding the connection protocol between the terminal and the router to obtain an encoded value; and step S240, concatenating the hash value with the encoded value to obtain the identity information.
[0054] In this embodiment, the terminal's physical address (MAC address) is first concatenated with the router's serial number (SN) to obtain concatenated information. Then, the concatenated information is hashed using a hash algorithm (such as SHA-256) to obtain a hash value. The connection protocol between the terminal and the router (such as Wi-Fi or Bluetooth) is then encoded to obtain an encoded value. For example, Wi-Fi 6 is encoded as 0b01 using binary encoding, and Bluetooth is encoded as 0b10. Ideally, the hash value and the encoded value are concatenated to obtain identity information. This identity information is associated with relevant information about the terminal and the router, and this information is encrypted. This avoids directly exposing terminal information while accurately identifying the terminal's identity, further improving the reliability of the domain name information management process.
[0055] In one embodiment, the domain name access habit data may include high-frequency access periods. In step S120, the domain name request records are analyzed to obtain the terminal's domain name access habit data, including: dividing the predetermined query duration into multiple sub-periods (each sub-period may be a day or several hours, etc.); calculating the ratio of the number of times the domain name is accessed in each sub-period to the total number of times the domain name is accessed within the predetermined query duration; and identifying the sub-periods with a ratio exceeding a predetermined value as high-frequency access periods. The predetermined query duration may be equal to or not equal to the aforementioned predetermined statistical duration, and the values of the predetermined query duration, sub-periods, and predetermined value can be set according to actual circumstances.
[0056] Furthermore, in one embodiment, the domain name access habit data may further include the unit time access frequency and total access frequency of low-frequency domain names within a predetermined query duration, wherein the low-frequency domain name may be a domain name accessed during periods outside of high-frequency access periods; in step S120, the domain name request records are analyzed to obtain the terminal's domain name access habit data, including: calculating the number of times the low-frequency domain name A is accessed (C1) within the i-th unit time period (e.g., one hour or half an hour). iCompared to the total number of visits to low-frequency domain A within the scheduled query period (C2) i The ratio of (C1) i / C2 i ), to obtain the unit time access frequency (C1) of low-frequency domain name A within the i-th unit time period. i / C2 i ); Calculate the total number of visits to the low-frequency domain name A within the predetermined query duration (C2) i Compared to the total number of visits to all domains within the scheduled query period (C) 总 The ratio of (C2) i / C 总 ), to obtain the total access frequency (C2) of low-frequency domain name A within the predetermined query duration. i / C 总 ).
[0057] In one embodiment, the domain name access habit data includes high-frequency access periods; in step S130, determining the lifetime of each domain name accessed by the terminal based on the domain name access habit data may include: determining the high-frequency domain names accessed during the high-frequency access periods; increasing the base time of the high-frequency domain names by a delay time to obtain the lifetime of the high-frequency domain names.
[0058] Each domain accessed during a high-frequency access period can be identified as a high-frequency domain. For each high-frequency domain, the corresponding base time (T) can be determined. 基1 Increase the delay time (T) 延 ), to obtain the time to life (T) of high-frequency domain names. 基1 +T 延 Each high-frequency domain name can have a pre-set standard lifetime as a base time, and the delay time can be set according to actual conditions. For example, the base time (T) of a high-frequency domain name... 基1 The delay time (T) can be 300 seconds. 延 The time to live (T) can be 300 seconds, thus the final time to live (T) of this high-frequency domain name is... 基1 +T 延 = 600 seconds.
[0059] For further details, please refer to [link / reference]. Figure 3 In one embodiment, the domain name access habit data also includes the domain name query rate; the method further includes: step S310, determining the low-frequency domain name accessed during periods other than high-frequency access periods; step S320, calculating the adjustment coefficient of the low-frequency domain name based on the domain name query rate of the low-frequency domain name; step S330, multiplying the adjustment coefficient of the low-frequency domain name by the base time of the low-frequency domain name to obtain the lifespan of the low-frequency domain name.
[0060] For each low-frequency domain name, an adjustment coefficient is calculated based on its domain name query rate; the adjustment coefficient (T) of the low-frequency domain name is then used to calculate the adjustment coefficient. 调 ) and the base time (T) of low-frequency domain names 基2 Multiply by , and get the lifetime (T) of low-frequency domain names. 盛 =T 调 *T 基2 In this way, an adjustment coefficient is calculated based on the domain query rate of low-frequency domains to adjust the base time (T). 基2 Dynamic adjustment can further reliably avoid long-term invalid memory occupation.
[0061] Furthermore, in one embodiment, the adjustment coefficient for low-frequency domain names is calculated based on the domain name query rate of low-frequency domain names, and may include:
[0062] According to formula T 调 The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio, where T 调 The adjustment coefficient is freq, which is the average access frequency of low-frequency domains per unit time within the predetermined query duration. Hist_ratio refers to the total access frequency of low-frequency domains within the predetermined query duration. α and β are the preset first weight and preset second weight, respectively. A is a preset parameter.
[0063] The applicant discovered that according to formula T 调 The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio. This adjustment coefficient is used to adjust the base time (T). 基2 Dynamic adjustment can further reliably avoid long-term invalid memory occupation. Here, freq is the average access frequency of low-frequency domain names over N time periods within a predetermined query duration.
[0064] In one embodiment, after analyzing the domain name request records to obtain the domain name access habit data of the terminal, the method may further include: determining the domain name that meets the preloading timing based on the domain name access habit data, and obtaining the preloaded domain name; and preloading the domain name information of the preloaded domain name.
[0065] Routers can determine which domains meet the preloading timing criteria based on domain access habits data, and then preload the domain information of these domains. This allows for the early loading of domain information, enabling the router to quickly retrieve the domain information from the preloaded data when a terminal needs to access it. This, in turn, allows for timely and efficient delivery of the domain information to the terminal, further improving network response speed. For example, a router can preload the domain information of high-frequency domains from its circular buffer at 18:50, before the peak access period (19:00-20:00), and then efficiently retrieve and deliver the information to the terminal when needed.
[0066] To facilitate better implementation of the domain name information management method provided in this application, this application also provides a domain name information management device based on the above-described domain name information management method. The meanings of the terms used are the same as in the domain name information management method described above, and specific implementation details can be found in the descriptions within the method embodiments. Figure 4 A block diagram of a domain name information management apparatus according to an embodiment of this application is shown.
[0067] like Figure 4 As shown, the domain name information management device 400 may include: an acquisition module 410 for acquiring domain name request records of a terminal; an analysis module 420 for analyzing the domain name request records to obtain domain name access habit data of the terminal; a determination module 430 for determining the lifetime of each domain name accessed by the terminal based on the domain name access habit data; and a caching module 440 for caching the domain name information of each domain name based on the lifetime of each domain name.
[0068] In some embodiments of this application, the domain name access habit data includes high-frequency access periods; the determining module 430 can be used to: determine the high-frequency domain names accessed during the high-frequency access periods; and increase the base time of the high-frequency domain names by a delay time to obtain the lifespan corresponding to the high-frequency domain names.
[0069] In some embodiments of this application, the domain name access habit data further includes the domain name query rate; the determining module 430 can be used to: determine low-frequency domain names accessed during periods other than the high-frequency access period; calculate the adjustment coefficient of the low-frequency domain name based on the domain name query rate of the low-frequency domain name; and multiply the adjustment coefficient of the low-frequency domain name by the base time of the low-frequency domain name to obtain the lifespan of the low-frequency domain name.
[0070] In some embodiments of this application, the determining module 430 may be used to: determine according to formula T 调The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio, where T 调 The adjustment coefficient refers to the frequency of access to the low-frequency domain name per unit time within the predetermined query duration, freq refers to the total access frequency of the low-frequency domain name within the predetermined query duration, α and β are the preset first weight and preset second weight, respectively, and A is a preset parameter.
[0071] In some embodiments of this application, after analyzing the domain name request records to obtain the domain name access habit data of the terminal, the device may further include a preloading module for: determining a domain name that meets the preloading timing based on the domain name access habit data, obtaining a preloaded domain name; and preloading the domain name information of the preloaded domain name.
[0072] In some embodiments of this application, the acquisition module can be used to: acquire terminal information of the terminal; obtain identity information of the terminal based on the terminal information; and acquire the domain name request record corresponding to the identity information.
[0073] In some embodiments of this application, the terminal information includes the terminal physical address; the acquisition module can be used to: concatenate the terminal physical address with the router serial number to obtain concatenated information; perform hash processing on the concatenated information to obtain a hash value; encode the connection protocol between the terminal and the router to obtain an encoded value; and concatenate the hash value with the encoded value to obtain the identity information.
[0074] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0075] Furthermore, embodiments of this application also provide a router, such as... Figure 5 As shown, Figure 5 A block diagram of a router according to an embodiment of this application is shown, specifically:
[0076] The router may include components such as a processor 501 with one or more processing cores, and a memory 502 with one or more computer-readable storage media. Those skilled in the art will understand that... Figure 5 The router structure shown does not constitute a limitation on the router and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Wherein:
[0077] The processor 501 is the control center of the router, connecting various parts of the computer device via various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 502, and by calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 501.
[0078] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the router, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0079] Although not shown, the router may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 501 in the router can load the executable files corresponding to the processes of one or more computer programs into the memory 502, and the processor 501 runs the computer programs stored in the memory 502, thereby realizing the various functions in the foregoing embodiments of this application.
[0080] For example, processor 501 can perform the following: obtain the domain name request records of the terminal; analyze the domain name request records to obtain the domain name access habit data of the terminal; determine the time to live of each domain name accessed by the terminal according to the domain name access habit data; and cache the domain name information of each domain name according to the time to live of each domain name.
[0081] In some embodiments of this application, the domain name access habit data includes high-frequency access periods; determining the lifetime of each domain name accessed by the terminal based on the domain name access habit data includes: determining the high-frequency domain names accessed during the high-frequency access periods; increasing the base time of the high-frequency domain names by a delay time to obtain the lifetime of the high-frequency domain names.
[0082] In some embodiments of this application, the domain name access habit data further includes the domain name query rate; it can also perform the following: determine the low-frequency domain names accessed during periods other than the high-frequency access period; calculate the adjustment coefficient of the low-frequency domain name based on the domain name query rate of the low-frequency domain name; multiply the adjustment coefficient of the low-frequency domain name by the base time of the low-frequency domain name to obtain the lifespan of the low-frequency domain name.
[0083] In some embodiments of this application, the step of calculating the adjustment coefficient of the low-frequency domain name based on the domain name query rate includes: according to formula T 调 The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio, where T 调 The adjustment coefficient refers to the frequency of access to the low-frequency domain name per unit time within the predetermined query duration, freq refers to the total access frequency of the low-frequency domain name within the predetermined query duration, α and β are the preset first weight and preset second weight, respectively, and A is a preset parameter.
[0084] In some embodiments of this application, after analyzing the domain name request records to obtain the domain name access habit data of the terminal, the following can also be performed: determining the domain name that meets the preloading timing based on the domain name access habit data, obtaining the preloaded domain name; and preloading the domain name information of the preloaded domain name.
[0085] In some embodiments of this application, obtaining the domain name request record of the terminal includes: obtaining terminal information of the terminal; obtaining the identity information of the terminal based on the terminal information; and obtaining the domain name request record corresponding to the identity information.
[0086] In some embodiments of this application, the terminal information includes the terminal physical address; obtaining the terminal's identity information based on the terminal information includes: concatenating the terminal physical address with the router serial number to obtain concatenated information; performing hash processing on the concatenated information to obtain a hash value; encoding the connection protocol between the terminal and the router to obtain an encoded value; and concatenating the hash value with the encoded value to obtain the identity information.
[0087] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0088] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the methods provided in embodiments of this application.
[0089] The storage medium can be a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0090] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0091] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A router's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the router to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0092] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0093] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.
Claims
1. A domain name information management method, characterized in that, include: Obtain the domain name request records of the terminal; The domain name request records are analyzed to obtain the domain name access habit data of the terminal; The lifetime of each domain name accessed by the terminal is determined based on the domain name access habit data. Based on the time-to-live (TTL) of each domain name, cache the domain name information of each domain name.
2. The method according to claim 1, characterized in that, The domain name access habit data includes high-frequency access periods; determining the lifetime of each domain name accessed by the terminal based on the domain name access habit data includes: Determine the high-frequency domain names accessed during the high-frequency access period; The time to live of the high-frequency domain name is obtained by increasing the base time of the high-frequency domain name by a delay time.
3. The method according to claim 2, characterized in that, The domain name access habit data also includes the domain name query rate; the method further includes: Identify low-frequency domain names accessed outside of the high-frequency access period; The adjustment coefficient of the low-frequency domain name is calculated based on the domain name query rate of the low-frequency domain name. The lifespan of the low-frequency domain name is obtained by multiplying the adjustment coefficient of the low-frequency domain name by the base time of the low-frequency domain name.
4. The method according to claim 3, characterized in that, The step of calculating the adjustment coefficient of the low-frequency domain name based on the domain name query rate includes: According to formula T 调 The adjustment coefficient is calculated as A + α * log2(freq) + β * hist_ratio, where T 调 The adjustment coefficient refers to the frequency of access to the low-frequency domain name per unit time within the predetermined query duration, freq refers to the total access frequency of the low-frequency domain name within the predetermined query duration, α and β are the preset first weight and preset second weight, respectively, and A is a preset parameter.
5. The method according to claim 1, characterized in that, After analyzing the domain name request records to obtain the domain name access habit data of the terminal, the method further includes: Based on the domain access habit data, domains that meet the preloading timing are determined, and preloading domains are obtained; The domain name information of the preloaded domain name is preloaded.
6. The method according to any one of claims 1 to 5, characterized in that, The process of obtaining the domain name request record of the terminal includes: Obtain the terminal information of the terminal; The identity information of the terminal is obtained based on the terminal information; Obtain the domain name request record corresponding to the identity information.
7. The method according to claim 6, characterized in that, The terminal information includes the terminal's physical address; obtaining the terminal's identity information based on the terminal information includes: The terminal's physical address is concatenated with the router's serial number to obtain the concatenated information; The concatenated information is hashed to obtain a hash value; The connection protocol between the terminal and the router is encoded to obtain the encoded value; The identity information is obtained by concatenating the hash value and the encoded value.
8. A domain name information management device, characterized in that, include: The acquisition module is used to: acquire the domain name request records of the terminal; The analysis module is used to: analyze the domain name request records to obtain the domain name access habit data of the terminal; The determination module is used to: determine the lifetime of each domain name accessed by the terminal based on the domain name access habit data; The caching module is used to cache the domain name information of each domain name according to the time to live of each domain name.
9. A storage medium, characterized in that, It stores a computer program that, when executed by the router's processor, causes the router to perform the method described in any one of claims 1 to 7.
10. A router, characterized in that, include: Memory, which stores computer programs; A processor reads a computer program stored in memory to perform the method described in any one of claims 1 to 7.