Resource record storage method and apparatus, storage medium, and electronic device
By uploading resource records to the InterPlanetary File System (IPFS) and generating a resource record tree, the problems of low storage space utilization and slow response speed in the DNS system are solved, achieving more efficient storage and querying.
Patent Information
- Application Number
- CN202110107063.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-26
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-01-26
AI Technical Summary
Existing DNS systems suffer from low storage space utilization, low bandwidth utilization, and slow response speed, failing to meet the demands of internet development.
Resource records are uploaded to the InterPlanetary File System (IPFS), and a resource record tree is generated through hash operations. This leverages IPFS's data block reuse feature to reduce storage space usage and redundant data.
By generating a resource record tree, storage space usage is reduced, while storage space utilization and response speed are improved.
Smart Images

Figure CN114791905B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a resource record storage method and device, storage medium and electronic equipment. BACKGROUND
[0002] At present, the domain name system (Domain Name System, DNS) is the most important basic resource of the Internet, and is the guarantee for the safe operation of other Internet services. The DNS system in the prior art is mainly composed of authoritative servers, recursive servers and clients. The authoritative servers store the information of one or more zones and are the source of DNS resource records. The recursive servers are responsible for accepting requests sent by clients, then issuing query requests to authoritative servers at all levels to obtain the query results required by users, and finally returning the resolver of the client. The recursive servers can cache various records returned by the authoritative servers to reduce the number of queries and improve query efficiency, so they are also called cache servers. The clients generally query various resource records through the recursive servers. With the development of Internet technology, the number of domain names and their corresponding resource records on the Internet is becoming more and more huge. The current technology has problems such as low storage space utilization, low bandwidth effective utilization, and slow response speed, which cannot meet the existing demand. SUMMARY
[0003] The embodiments of the present application provide a resource record storage method, device, storage medium and electronic equipment. By uploading the resource record to the interstellar file system, the space occupation can be reduced. The data block multiplexing feature of the interstellar file system greatly reduces the occupation of the storage space and reduces the technical problems of redundant data. The technical solution is as follows:
[0004] In a first aspect, the embodiments of the present application provide a resource record storage method, comprising:
[0005] Obtaining total resource records and parsing the total resource records to obtain a plurality of resource records;
[0006] Calculating the storage addresses of the resource records. For a first resource record located in a leaf node, the first resource record is subjected to a hash operation to obtain a storage address. For a second resource record located in a non-leaf node, the resource records of the child nodes of the second resource record are obtained, and the storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain the storage address of the second resource record.
[0007] Generating a resource record tree according to the domain name hierarchical information of the plurality of resource records and the storage addresses of the resource records. The resource record tree has at least two layers, and each layer includes node information corresponding to at least one resource record.
[0008] store each resource record to IPFS according to the storage address.
[0009] In a second aspect, the embodiments of the present application provide a storage device of resource records, the device comprising:
[0010] a obtaining module, configured to obtain a total resource record and parse the total resource record to obtain a plurality of resource records;
[0011] a calculating module, configured to calculate a storage address of each resource record; wherein, for a first resource record located at a leaf node, the first resource record is subjected to a hash operation to obtain the storage address; for a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and the storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain the storage address of the second resource record;
[0012] a generating module, configured to generate a resource record tree according to the domain name hierarchical information of the plurality of resource records and the storage addresses of the resource records; wherein, the resource record tree has at least two layers, and each layer comprises node information corresponding to at least one resource record;
[0013] a storage module, configured to store each resource record to IPFS according to the storage address.
[0014] In a third aspect, the embodiments of the present application provide a computer storage medium, which stores a plurality of instructions, the instructions being suitable for being loaded by a processor and performing the method steps described above.
[0015] In a fourth aspect, the embodiments of the present application provide an electronic device, comprising a memory and a processor; wherein, the memory stores a computer program, the computer program being suitable for being loaded by the processor and performing the method steps described above.
[0016] The technical solutions provided by some embodiments of the present application have at least the following beneficial effects:
[0017] The storage method, device, storage medium and electronic equipment of the resource record work as follows: a total resource record is acquired, a plurality of resource records are parsed from the total resource record, the storage address of each resource record is calculated, a resource record tree is generated according to the domain name hierarchy information of the plurality of resource records and the storage address of each resource record, and each resource record is stored in an IPFS according to the storage address. The DNS resolution platform server uploads the resource record to the IPFS system to generate a resource record tree to save the domain name information and the storage address, thereby reducing the space occupation, greatly reducing the occupation of the storage space through the data block reuse feature of the IPFS, and reducing the technical problems such as redundant data. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0019] Figure 1 is a resource record storage system architecture schematic diagram provided by an embodiment of the present application;
[0020] Figure 2 is a flowchart of a resource record storage method provided by an embodiment of the present application;
[0021] Figure 3 is another flowchart of a resource record storage method provided by an embodiment of the present application;
[0022] Figure 4 is a structural schematic diagram of a resource record storage device provided by an embodiment of the present application;
[0023] Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will further describe the embodiments of the present application in combination with the drawings.
[0025] In the following description of the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0026] In the description of the present application, it should be understood that the terms "first", "second" and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. The term "and / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the front and rear associated objects are a kind of "or" relationship.
[0027] In order to solve the above-mentioned problems that with the development of Internet technology, the number of domain names and their corresponding resource records on the Internet is becoming more and more huge, the current technology has the problems of low storage space utilization, low bandwidth effective utilization and slow response speed, etc., a resource record storage method is proposed, the method can be realized by relying on a computer program, and can be run on a computer system based on von Neumann architecture and installed with a camera or a rotatable camera. The computer system can be a computer system of a smart phone, a notebook computer, a tablet computer and the like.
[0028] In the following method embodiment, for the convenience of description, only the execution subject of each step is introduced and described as a DNS resolution platform server.
[0029] The following will be combined with the accompanying drawings Figures 2-3 The resource record storage method provided by the embodiment of the present application will be described in detail.
[0030] Please refer to Figure 1 The architecture schematic diagram of a resource record storage system provided by the embodiment of the present application is shown in the figure. Figure 1 As shown, the resource record storage system mainly includes a DNS server, a DNS resolution platform server and an InterPlanetary File System (IPFS) server, the DNS resolution platform server mainly receives the adding, querying and updating instructions (carrying domain name information) from the user, and returns the instruction result, the DNS server is used for the DNS resolution platform server to obtain the DNS record corresponding to the domain name information, and the IPFS server is mainly used to store the DNS record and return the storage address information.
[0031] Please refer to Figure 2 The flowchart of a resource record storage method provided by the embodiment of the present application is shown in the figure. The method can include the following steps:
[0032] S201, obtaining total resource records, and parsing the total resource records to obtain a plurality of resource records.
[0033] Generally, the resource record refers to a data file used to store information about domain name and IP address. The DNS resolution platform server sends a query message to a domain name system DNS server in response to a user upload instruction, wherein the query message carries multiple domain name information, receives an answer message returned by the DNS server in response to the query message, parses the answer message to obtain total resource records, and then the DNS resolution platform server parses the total resource records to obtain multiple resource records.
[0034] S202, calculate the storage address of each resource record.
[0035] Generally, for a first resource record located at a leaf node, the first resource record is subjected to a hash operation to obtain a storage address; for a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and the storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain the storage address of the second resource record. In one embodiment, the DNS resolution platform server obtains multiple sub-hash values by dividing the first resource record based on a preset threshold, numbering the multiple sub-files, uploading the numbered multiple sub-files to multiple nodes of the IPFS system, and combining the multiple sub-hash values to obtain the storage address corresponding to the first resource record.
[0036] S203, generate a resource record tree according to the domain name hierarchy information of the multiple resource records and the storage addresses of the respective resource records.
[0037] Generally, the resource record tree has at least two layers, and each layer includes node information corresponding to at least one resource record. After the DNS resolution platform server calculates the storage addresses of the respective resource records, it determines the domain name hierarchy information corresponding to each domain name information, obtains the storage addresses corresponding to each domain name information, generates corresponding node information based on the respective domain name information and the storage addresses, wherein the node information includes domain name information, storage addresses, and the corresponding relationship of all domain name information and storage addresses of the lower child node information, and generates a resource record tree according to the domain name hierarchy information and all node information.
[0038] S204, store each resource record to an interplanetary file system IPFS according to the storage address.
[0039] Generally, the IPFS system is a peer-to-peer distributed file system, aiming to supplement (even replace) the current dominant hypertext transfer protocol of the Internet, connecting all computing devices with the same file system together. After the DNS resolution platform server generates the resource record tree, each resource record is stored in the IPFS according to the storage address, for example: the DNS resolution platform server calculates the storage address of the resource record A corresponding to l1.com, and the hash value is 9c0faf9c1569871ffc58846f2373814b. Then the resource record A is uploaded to the IPFS system at the storage address.
[0040] In one embodiment, the query instruction from the user is parsed to obtain domain name information and domain name hierarchy information corresponding to the domain name information, the target storage address corresponding to the domain name information is queried in the resource record tree according to the domain name hierarchy information corresponding to the domain name information, and a query request is sent to the IPFS system, wherein the query request carries the target storage address, and the target resource record queried by the IPFS system according to the target storage address is received. When the target resource record includes multiple IP addresses, the DNS resolution platform server monitors the link quality of the communication link corresponding to each IP address, and sends the IP address with the best link quality to the user terminal. In one embodiment, the DNS resolution platform server sends an update request to the IPFS based on the user's update instruction, wherein the update request includes an updated resource record, the update request is used to instruct the IPFS system to update the resource record corresponding to the domain name information, and to generate an updated storage address corresponding to the updated resource record. The DNS resolution platform server receives the updated storage address of the updated resource record from the IPFS system, and updates the node information corresponding to the domain name information based on the updated storage address.
[0041] From the above, the total resource record is obtained, and the total resource record is parsed to obtain multiple resource records, the storage address of each resource record is calculated, the resource record tree is generated according to the domain name hierarchy information of the multiple resource records and the storage address of each resource record, and each resource record is stored in the IPFS according to the storage address. The DNS resolution platform server saves the domain name information and the storage address by uploading the resource record to the IPFS system to generate the resource record tree, which can reduce the space occupation, greatly reduce the occupation of the storage space through the data block reuse characteristics of the IPFS, and reduce the technical problems such as redundant data.
[0042] See Figure 3Another flowchart of a resource record storage method is provided for the embodiments of the present application. The resource record storage method can include the following steps:
[0043] S301, in response to a user's upload instruction, sending a query message to a domain name system (DNS) server and receiving an answer message returned by the DNS server in response to the query message.
[0044] Generally, the query message carries multiple domain name information. In response to a user's upload instruction, the DNS resolution platform server sends a query message to a domain name system (DNS) server, which carries multiple domain name information, such as w21.com and w31.com. Then the DNS resolution platform server receives an answer message returned by the DNS server in response to the query message, which contains the resource records corresponding to w21.com and w31.com.
[0045] S302, parsing the answer message to obtain total resource records and parsing the total resource records to obtain multiple resource records.
[0046] Generally, after receiving the answer message, the DNS resolution platform server parses the answer message to obtain total resource records, such as total resource records including IP addresses 192.123.001.1 and 192.123.001.2, and other data such as DNS servers specified for domain name or subdomain name resolution and mail servers specified for receiving information. Then the DNS resolution platform server parses the total resource records to obtain multiple resource records, such as parsing the total resource records to obtain single resource records with domain name information w21.com corresponding to IP address 192.123.001.1, and single resource records with domain name information w31.com corresponding to IP address 192.123.001.2.
[0047] S303, obtaining multiple sub-files by segmenting the first resource record based on a preset threshold, and numbering the multiple sub-files.
[0048] Generally, the DNS resolution platform server obtains multiple resource records, and then calculates storage addresses of the resource records, wherein the storage addresses are represented by hash values. For a first resource record located at a leaf node, the first resource record is subjected to hash operation to obtain a storage address. For a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and storage addresses of the resource records of the child nodes are subjected to hash operation to obtain a storage address of the second resource record. First, the DNS resolution platform server divides the first resource record of a leaf node with a three-level domain name y.e.s.com and a data size of 8M based on a preset threshold to obtain multiple sub-files, and numbers the multiple sub-files. For example, the first resource record of a leaf node with a three-level domain name y.e.s.com and a data size of 8M is divided into four sub-files with a size of 2M and numbered as No. 1, No. 2, No. 3 and No. 4, by setting the preset threshold as 2M.
[0049] S304, the numbered multiple sub-files are uploaded to multiple nodes of the IPFS system to obtain multiple sub-hash values, and the multiple sub-hash values are combined to calculate a storage address corresponding to the first resource record.
[0050] Generally, after the DNS resolution platform server numbers the multiple sub-files, the DNS resolution platform server uploads the numbered multiple sub-files to multiple nodes of the IPFS system to obtain multiple sub-hash values, and the multiple sub-hash values are combined to calculate a storage address corresponding to the first resource record. For example, after the DNS resolution platform server uploads the sub-files No. 1, No. 2, No. 3 and No. 4 to nodes a, b, c and d of the IPFS system, the DNS resolution platform server receives four sub-hash values 167f14b5, cf5957b8, 784496bc and 7d14d1a2 from the IPFS system, and then calculates a storage address corresponding to the three-level domain name y.e.s.com as 07218ad6 by hash value combination. The hash value can be used to query the corresponding first resource record on the IPFS system.
[0051] S305, resource records of child nodes of the second resource record are obtained, and storage addresses of the resource records of the child nodes are subjected to hash operation to obtain a storage address of the second resource record.
[0052] Generally, after the DNS resolution platform server obtains the storage addresses of all leaf nodes, the DNS resolution platform server obtains the resource records of the child nodes of the second resource record, performs a hash operation on the storage addresses of the resource records of the child nodes to obtain the storage address of the second resource record, for example: the DNS resolution platform server determines that the storage addresses of the leaf nodes corresponding to the third-level domain names y.e.s1.com, y.e.s2.com and y.e.s3.com are 93bac5a2, d41abf72 and e97a96c2 respectively, and the DNS resolution platform server calculates the storage address of the second-level domain name y.e.com to be 4fa66ab3 according to the storage addresses of all third-level domain names, and calculates the storage address of the first-level domain name y.com to be 154404b1 according to the storage addresses of all second-level domain names.
[0053] In S306, domain name hierarchy information corresponding to each domain name information is determined, a storage address corresponding to each domain name information is obtained, and node information corresponding to each domain name information and the storage address is generated.
[0054] Generally, the node information includes domain name information, a storage address and a corresponding relationship between sub-node information and the storage address. After the DNS resolution platform server calculates the storage address, domain name hierarchy information corresponding to each domain name information is determined, a storage address corresponding to each domain name information is obtained, and node information corresponding to each domain name information and the storage address is generated, for example: for the second-level domain name y.e.com, the DNS resolution platform server generates a data structure to fill in the node information, including domain name information: y.e.com; storage address (hash value): 4fa66ab3; and a corresponding relationship between sub-node information and the storage address (Links): y.e.s1.com-9cb393ea, y.e.s2.com-3d345df1,...; then all second-level domain names are counted to generate a data structure corresponding to the first-level domain name y.com to fill in the node information, including domain name information: y.com; storage address (hash value): cfb9d882; and a corresponding relationship between sub-node information and the storage address (Links): y.e1.com-b52c85de, y.e2.com-750e1e05,...
[0055] In S307, a resource record tree is generated according to the domain name hierarchy information and all node information, and each resource record is stored in an IPFS according to the storage address.
[0056] Generally, the DNS resolution platform server generates corresponding node information, generates a resource record tree according to the domain name hierarchy information and all node information, and stores each resource record in the IPFS according to the storage address. For example, the DNS resolution platform server calculates the storage address of the first-level domain name y.com and all subordinate subdomain names, and then generates the resource record tree of the first-level domain name y.com based on all data structures. Then, the 1st resource record corresponding to the domain name y.com with the domain name hierarchy information, the 2nd resource record corresponding to y.e.com with the domain name hierarchy information of the second level, and the 3rd resource record corresponding to y.e.s.com with the domain name hierarchy information of the third level are determined, and the corresponding storage addresses are 08150250, 10980355, and 213904c5, respectively. Then, each resource record is uploaded to the IPFS system at the corresponding storage address through multiple nodes.
[0057] In S308, the domain name information and the domain name hierarchy information corresponding to the domain name information are obtained by analyzing the query instruction from the user, and the target storage address corresponding to the domain name information is queried in the resource record tree according to the domain name hierarchy information corresponding to the domain name information.
[0058] Generally, after the DNS resolution platform server stores each resource record in the IPFS according to the storage address, the storage of the resource record is completed. The present application also includes query and update operations. In S308, the domain name information and the domain name hierarchy information corresponding to the domain name information are obtained by analyzing the query instruction from the user, and the target storage address corresponding to the domain name information is queried in the resource record tree according to the domain name hierarchy information corresponding to the domain name information. For example, if the target domain name information is y.e.s.com, the corresponding first-level domain name y.com is determined first, the corresponding node information is found in the resource record tree, the node information corresponding to the second-level domain name y.e.com is determined in the corresponding data structure, and the node information corresponding to the target domain name information (third-level domain name) y.e.s.com is determined in the corresponding data structure. The storage address is represented by a hash value 6922a82b in the corresponding data structure.
[0059] In S309, a query request is sent to the IPFS system, and the target resource record queried by the IPFS system according to the target storage address is received.
[0060] Generally, the query request carries the target storage address. The DNS resolution platform server queries the target storage address corresponding to the domain name information, sends a query request to the IPFS system, receives the target resource record queried by the IPFS system according to the target storage address, for example, obtains a storage address represented by a hash value as 6922a82b, queries the corresponding target resource record in the IPFS system according to the hash value, and the resource record carries information such as an IP address 190.123.100.99.
[0061] S310, when the target resource record includes multiple Internet Protocol (IP) addresses, monitoring link quality of communication links corresponding to each IP address and sending the IP address with the best link quality to the user terminal.
[0062] Generally, after the DNS resolution platform server receives the target resource record, the target resource record is parsed. When the target resource record includes multiple IP addresses, the link quality of the communication links corresponding to each IP address is monitored, and the IP address with the best link quality is sent to the user terminal, for example, the domain name information carried by the query instruction is l2.com, the target resource record is parsed, two IP addresses 191.100.101.1 and 191.100.101.2 are obtained, and the link quality of the communication links corresponding to the two IP addresses is monitored as 57DBm and 90DBm respectively. Then, 191.100.101.2 is sent to the user terminal. In one embodiment, the DNS resolution platform server sends a HyperText Transfer Protocol (HTTP) access request to each IP address, receives an access response message sent by a server corresponding to each IP address in response to the access request message, determines the reachable IP address among the IP addresses based on the access response message, then sends a probe request message based on a Ping protocol to each reachable IP address, receives a probe response message sent by a server corresponding to each IP address in response to the probe request message, and parses the probe request message to determine the link quality.
[0063] S311, based on the update instruction of the user, an update request is sent to the IPFS, an updated storage address of the updated resource record from the IPFS system is received, and the node information corresponding to the domain name information is updated based on the updated storage address.
[0064] Generally, the update request includes an update resource record, the update request is used to instruct the IPFS system to update the resource record corresponding to the domain name information, and an update storage address corresponding to the update resource record is generated. The DNS resolution platform server can also perform an update operation, such as sending an update request to the IPFS based on a user's update instruction, receiving an update storage address of the updated resource record from the IPFS system, updating node information corresponding to the domain name information based on the update storage address, for example: the resource record corresponding to l3.com is changed from resource record A (carrying an IP address of 191.100.101.101) to resource record B (carrying an IP address of 191.100.101.102), first, update the DNS record stored in the IPFS system, get the address information represented by the hash value from dc3849d324800e to eb2ae2e57b667d, then update the node information in the resource record tree, including updating the storage address in the data structure corresponding to l3.com from dc3849d324800e to eb2ae2e57b667d, etc., determine the domain name hierarchy information corresponding to l3.com, determine the path information corresponding to the domain name hierarchy information, and update the node information of all nodes on the path information according to the data structure.
[0065] When the scheme of the embodiment of the application is executed, the total resource record is obtained, and a plurality of resource records are obtained by parsing the total resource record. The storage addresses of the resource records are calculated, a resource record tree is generated according to the domain name hierarchy information of the plurality of resource records and the storage addresses of the resource records, and each resource record is stored in an interplanetary file system (IPFS) according to the storage address. The DNS resolution platform server can reduce the space occupation by uploading the resource record to the IPFS system to generate a resource record tree to save the domain name information and the storage address. The occupation of the storage space is greatly reduced by the data block reuse feature of the IPFS, and the technical problems such as redundant data are reduced.
[0066] The following is an embodiment of the application device, which can be used to execute the method embodiment of the application. For details not disclosed in the device embodiment of the application, please refer to the method embodiment of the application.
[0067] Please refer to Figure 4 which shows a structure diagram of a resource record storage device provided by an example embodiment of the application, hereinafter referred to as storage device 4. The storage device 4 can be realized by software, hardware or a combination of the two to become all or part of the terminal. It includes:
[0068] The acquisition module 401 is configured to acquire a total resource record, and parse the total resource record to obtain a plurality of resource records.
[0069] The computing module 402 is configured to calculate storage addresses of the resource records; for a first resource record located at a leaf node, the first resource record is subjected to a hash operation to obtain a storage address; for a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain a storage address of the second resource record.
[0070] The generating module 403 is configured to generate a resource record tree according to domain name hierarchy information of the plurality of resource records and the storage addresses of the resource records; the resource record tree has at least two layers, and each layer includes node information corresponding to at least one resource record.
[0071] The storage module 404 is configured to store the resource records in an IPFS according to the storage addresses.
[0072] Optionally, the obtaining module 401 further includes:
[0073] The parsing unit is configured to send a query packet to a DNS server in response to an upload instruction of a user; the query packet carries a plurality of domain name information; receive an answer packet returned by the DNS server in response to the query packet; and parse the answer packet to obtain total resource records.
[0074] Optionally, the generating module 403 further includes:
[0075] The obtaining unit is configured to determine domain name hierarchy information corresponding to each domain name information; obtain storage addresses corresponding to each domain name information; generate corresponding node information based on the domain name information and the storage addresses; the node information includes domain name information, storage addresses, and a correspondence relationship between all domain name information and storage addresses of lower child nodes; and generate a resource record tree according to the domain name hierarchy information and all node information.
[0076] The querying unit is configured to parse a query instruction from a user to obtain domain name information and domain name hierarchy information corresponding to the domain name information; query a target storage address corresponding to the domain name information in the resource record tree according to the domain name hierarchy information corresponding to the domain name information; send a query request to the IPFS system; the query request carries the target storage address; and receive target resource records queried by the IPFS system according to the target storage address.
[0077] The monitoring unit is configured to, when the target resource records include a plurality of IP addresses, monitor link quality of communication links corresponding to each IP address; and send an IP address with the best link quality to a user terminal.
[0078] An updating unit is configured to send an updating request to the IPFS based on an updating instruction of a user, wherein the updating request comprises an updating resource record, the updating request is configured to instruct the IPFS system to update a resource record corresponding to the domain name information, and generate an updating storage address corresponding to the updating resource record; receive the updating storage address of the updating resource record from the IPFS system; and update node information corresponding to the domain name information based on the updating storage address.
[0079] The method embodiments of the application and Figures 2-3 The method embodiments of the application and Figures 2-3 The method embodiments of the application and
[0080] The device 4 can be a field-programmable gate array (FPGA), an application-specific integrated chip, a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processing circuit, a micro controller unit (MCU), and can also be a programmable logic device (PLD) or other integrated chip.
[0081] In the scheme of the embodiment of the application, the total resource record is acquired, and a plurality of resource records are obtained by parsing the total resource record, the storage address of each resource record is calculated, a resource record tree is generated according to the domain name hierarchical information of the plurality of resource records and the storage address of each resource record, and each resource record is stored in an interplanetary file system (IPFS) according to the storage address. The DNS resolution platform server can reduce the space occupation by uploading the resource record to the IPFS system and generating the resource record tree to save the domain name information and the storage address, greatly reduce the occupation of the storage space by the data block reuse feature of the IPFS, and reduce the technical problems such as redundant data.
[0082] The embodiment of the application further provides a computer storage medium, which can store a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to perform the method steps as described above, and the specific execution process can refer to the specific description of the embodiments shown in Figure 2 or Figure 3 The specific execution process can refer to the specific description of the embodiments shown in
[0083] The application further provides a computer program product, which stores at least one instruction loaded and executed by the processor to implement the control method of the template according to various embodiments.
[0084] Please refer to Figure 5 An electronic device structure diagram is provided for the embodiments of the application. As shown in the figure, the electronic device 5 can include at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502. Figure 5
[0085] The communication bus 502 is used to realize the connection and communication between the components.
[0086] The user interface 503 can include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 can further include a standard wired interface and a wireless interface.
[0087] The network interface 504 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0088] The processor 501 can include one or more processing cores. The processor 501 connects various parts in the terminal 500 through various interfaces and lines, executes various functions of the terminal 500 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be realized in at least one of the hardware forms of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 501 can integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU is mainly used to process operating systems, user interfaces, and application programs. The GPU is used to render and draw the content to be displayed on the display screen. The modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 501, but can be realized by a separate chip.
[0089] The memory 505 can include a random access memory (RAM) and a read-only memory (ROM). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 505 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above various method embodiments, etc.; the data storage area can store data involved in the above various method embodiments, etc. The memory 505 can also be at least one storage device located away from the processor 501. As shown in Figure 5 The memory 505 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a storage application of a resource record.
[0090] In Figure 5 In the electronic device 500 shown, the user interface 503 is mainly used to provide an interface for user input and obtain data input by the user; and the processor 501 can be used to call the storage application of the resource record stored in the memory 505 and specifically perform the following operations:
[0091] Obtain a total resource record and parse the total resource record to obtain a plurality of resource records;
[0092] Calculate a storage address of each resource record; where, for a first resource record located at a leaf node, the first resource record is subjected to a hash operation to obtain the storage address; for a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and the storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain the storage address of the second resource record;
[0093] Generate a resource record tree according to domain name hierarchical information of the plurality of resource records and the storage addresses of the resource records; where, the resource record tree has at least two layers, and each layer includes node information corresponding to at least one resource record;
[0094] Store each resource record to an interplanetary file system (IPFS) according to the storage address.
[0095] In one embodiment, the processor 501 performs the obtaining of the total resource record, including:
[0096] In response to a user's upload instruction, a query message is sent to a domain name system (DNS) server; wherein the query message carries multiple domain name information;
[0097] An answer message returned by the DNS server in response to the query message is received;
[0098] Total resource records are parsed from the answer message.
[0099] In one embodiment, the processor 501 performs the generation of a resource record tree according to the domain name hierarchy information of the multiple resource records and the storage addresses of the respective resource records, including:
[0100] Domain name hierarchy information corresponding to each domain name information is determined;
[0101] Storage addresses corresponding to each domain name information are obtained;
[0102] Corresponding node information is generated based on the respective domain name information and the storage addresses; wherein the node information includes domain name information, storage addresses, and the corresponding relationship of all domain name information and storage addresses of the lower-level child node information;
[0103] The resource record tree is generated according to the domain name hierarchy information and all node information.
[0104] In one embodiment, after the processor 501 performs the storage of the respective resource records into the IPFS according to the storage addresses, it further includes:
[0105] Domain name information and domain name hierarchy information corresponding to the domain name information are parsed from a user's query instruction;
[0106] The target storage address corresponding to the domain name information is queried in the resource record tree according to the domain name hierarchy information corresponding to the domain name information;
[0107] A query request is sent to the IPFS system; wherein the query request carries the target storage address;
[0108] The target resource record queried by the IPFS system according to the target storage address is received.
[0109] In one embodiment, after the processor 501 performs the reception of the target resource record queried by the IPFS system according to the target storage address, it further includes:
[0110] When the target resource record includes multiple IP addresses, the link quality of the communication link corresponding to each IP address is monitored;
[0111] The IP address with the best link quality is sent to the user terminal.
[0112] In one embodiment, the processor 501 performs the receiving the target resource record queried by the IPFS system according to the target storage address, and further includes:
[0113] sending an update request to the IPFS based on a user's update instruction; wherein the update request includes an updated resource record, and the update request is used to instruct the IPFS system to update the resource record corresponding to the domain name information, and generate an updated storage address corresponding to the updated resource record;
[0114] receiving the updated storage address of the updated resource record from the IPFS system;
[0115] updating the node information corresponding to the domain name information based on the updated storage address.
[0116] The technical concept and Figure 2 or Figure 3 The technical concept is the same, and the specific process can refer to the method embodiments of Figure 2 or Figure 3 The method embodiments, which will not be described here.
[0117] In the embodiments of the present application, the total resource record is obtained, and the total resource record is parsed to obtain a plurality of resource records, the storage address of each resource record is calculated, the resource record tree is generated according to the domain name hierarchy information of the plurality of resource records and the storage address of each resource record, and each resource record is stored in the IPFS according to the storage address. The DNS resolution platform server saves the domain name information and the storage address by uploading the resource record to the IPFS system to generate the resource record tree, which can reduce the space occupation, greatly reduce the occupation of the storage space through the data block reuse characteristics of the IPFS, and reduce the technical problems such as redundant data.
[0118] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory or a random access memory.
[0119] The above only discloses the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.
Claims
1. A method of storing resource records, characterized by, The method comprises: obtaining total resource records, and parsing the total resource records to obtain a plurality of resource records; calculating storage addresses of the resource records; wherein, for a first resource record located at a leaf node, the first resource record is subjected to a hash operation to obtain a storage address; for a second resource record located at a non-leaf node, resource records located at child nodes of the second resource record are obtained, and storage addresses of the resource records of the child nodes are subjected to a hash operation to obtain a storage address of the second resource record; generating a resource record tree according to domain name hierarchical information of the plurality of resource records and the storage addresses of the resource records; wherein, the resource record tree has at least two layers, and each layer comprises node information corresponding to at least one resource record; storing each resource record into an IPFS (InterPlanetary File System) according to the storage address.
2. The method of claim 1, wherein, The obtaining of the total resource records comprises: sending a query message to a DNS (Domain Name System) server in response to an upload instruction of a user; wherein, the query message carries a plurality of domain name information; receiving an answer message returned by the DNS server in response to the query message; parsing the answer message to obtain total resource records.
3. The method of claim 1, wherein, The storage address of the first resource record is obtained by segmenting the first resource record based on a preset threshold to obtain a plurality of sub-files, numbering the plurality of sub-files, uploading the numbered plurality of sub-files into a plurality of nodes of the IPFS system to obtain a plurality of sub-hash values, and combining the plurality of sub-hash values to obtain the storage address corresponding to the first resource record.
4. The method of claim 1, wherein, The generation of the resource record tree according to the domain name hierarchical information of the plurality of resource records and the storage addresses of the resource records comprises: determining domain name hierarchical information corresponding to each domain name information; obtaining storage addresses corresponding to each domain name information; generating corresponding node information based on the domain name information and the storage addresses; wherein, the node information comprises domain name information, storage addresses, and a corresponding relationship between all domain name information and storage addresses of lower child nodes; generating a resource record tree according to the domain name hierarchical information and all node information.
5. The method of claim 1, wherein, After storing each resource record into an IPFS (InterPlanetary File System) according to the storage address, the method further comprises: parsing a query instruction from a user to obtain domain name information and domain name hierarchical information corresponding to the domain name information; querying a target storage address corresponding to the domain name information in the resource record tree according to the domain name hierarchical information corresponding to the domain name information; sending a query request to the IPFS system; wherein, the query request carries the target storage address; receiving a target resource record queried by the IPFS system according to the target storage address.
6. The method of claim 5, wherein, After receiving the target resource record queried by the IPFS system according to the target storage address, the method further comprises: when the target resource record comprises a plurality of IP (Internet Protocol) addresses, monitoring link quality of communication links corresponding to each IP address; sending an IP address with the best link quality to a user terminal.
7. The method of claim 5, wherein, The receiving the IPFS system according to the target storage address query target resource record, further comprises: Based on the user's update instruction to the IPFS sends update request;Wherein, the update request includes update resource record, the update request is used to indicate that the IPFS system updates the resource record corresponding to the domain name information, and generates the update storage address corresponding to the update resource record; Receive the update storage address of the updated resource record from the IPFS system; Based on the update storage address updates the node information corresponding to the domain name information.
8. A storage apparatus of a resource record, characterized by, Including: The acquisition module is used for acquiring total resource record, and obtaining a plurality of resource records by analyzing the total resource record; The calculation module is used for calculating the storage address of each resource record;Wherein, for the first resource record located in the leaf node, the first resource record is hashed to obtain the storage address;For the second resource record located in the non-leaf node, the resource record of the child node located in the second resource record is obtained, and the storage address of the child node resource record is hashed to obtain the storage address of the second resource record; The generation module is used for generating resource record tree according to the domain name hierarchy information of the plurality of resource records and the storage address of each resource record;Wherein, the resource record tree has at least two layers, and each layer includes at least one resource record corresponding node information; The storage module is used for storing each resource record to the IPFS according to the storage address.
9. The apparatus of claim 8, wherein, The acquisition module includes: The analysis unit is used for sending query message to domain name system (DNS) server in response to the user's upload instruction;Wherein, the query message carries a plurality of domain name information;Receive the answer message returned by the DNS server in response to the query message;The total resource record is obtained by analyzing the answer message.
10. The apparatus of claim 8, wherein, The storage address of the first resource record is obtained by splitting the first resource record based on a predetermined threshold to obtain a plurality of subfiles, numbering the plurality of subfiles, uploading the numbered plurality of subfiles to the plurality of nodes of the IPFS system to obtain a plurality of subhash values, and combining the plurality of subhash values to obtain the storage address corresponding to the first resource record.
11. The apparatus of claim 8, wherein, The generation module includes: The acquisition unit is used for determining the domain name hierarchy information corresponding to each domain name information;Acquire the storage address corresponding to each domain name information;Based on the each domain name information and the storage address, the corresponding node information is generated;Wherein, the node information includes domain name information, storage address and all domain name information and storage address corresponding relationship of lower child node information;According to the domain name hierarchy information and all node information, the resource record tree is generated.
12. The apparatus of claim 8, wherein, The device further includes: The query unit is configured to parse a query instruction from a user to obtain domain name information and domain name hierarchy information corresponding to the domain name information, query a target storage address corresponding to the domain name information in the resource record tree according to the domain name hierarchy information corresponding to the domain name information, send a query request to the IPFS system, where the query request carries the target storage address, and receive a target resource record queried by the IPFS system according to the target storage address.
13. The apparatus of claim 12, wherein, The apparatus further includes: The monitoring unit is configured to monitor link quality of a communication link corresponding to each IP address when the target resource record includes a plurality of IP addresses, and send an IP address with the best link quality to the user terminal.
14. The apparatus of claim 12, wherein, The apparatus further includes: The updating unit is configured to send an updating request to the IPFS based on an updating instruction of the user, where the updating request includes an updating resource record, the updating request is used to instruct the IPFS system to update a resource record corresponding to the domain name information, and generate an updating storage address corresponding to the updating resource record, receive an updating storage address of the updated resource record from the IPFS system, and update node information corresponding to the domain name information based on the updating storage address.
15. A computer storage medium, comprising, The computer storage medium stores a plurality of instructions, and the instructions are adapted to be loaded and executed by a processor to perform the method steps of any one of claims 1-7.
16. An electronic device, comprising: The apparatus includes: A memory and a processor, where the memory stores a computer program, and the computer program is adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-7.
Citation Information
Patent Citations
File storage method, terminal and storage medium
CN111104386A
Map data management and electronic map rollback method and device
CN111444163A