Handle identifier resolution caching method, query method and handle identifier resolution system
By arranging the handle identifier string, index value and type value to form a keyword value for hash query, establishing a hash table and caching data in different formats, the problems of low query efficiency and format conversion of the handle identifier resolution system are solved, and efficient handle identifier resolution is achieved.
Patent Information
- Application Number
- CN202111494101.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-02-10
- Filing Date
- 2021-12-08
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-12-08
AI Technical Summary
The existing handle identification resolution system is inefficient during querying, requiring multiple queries to locate the final result. In addition, queries for different protocols require data format conversion, which affects system performance.
A hash query is performed using a keyword value formed by the arrangement of a handle identification string, an index value, and a type value, a hash table is established, and data in binary format and a specified format are cached to reduce the number of queries and format conversion steps.
Through a single hash query, you can accurately obtain the handle identifier resolution result, improve query efficiency and accuracy, eliminate format conversion steps, and enhance the system's business processing capabilities.
Smart Images

Figure CN113946587B_ABST
Abstract
Description
[0001] This application claims priority to invention patent application with application date of February 10, 2021, application number 202110184379.6, and invention name "Handle identifier resolution caching method, query method and handle identifier resolution system thereof", and all contents of which are incorporated herein by reference. Technical Field
[0002] The present invention relates to the field of network communication technology, and in particular to a handle identifier resolution caching method, a handle identifier resolution query method and a handle identifier resolution system. Background Art
[0003] In 1994, Robert Kahn, the father of the Internet and co-inventor of the TCP / IP protocol, invented the handle identifier resolution system. The handle identifier resolution system is a (K, V) type distributed database system that uses a handle identifier string (including prefix, full identifier, secondary node identifier, enterprise node identifier, etc.) as a key value (key, K). After parsing it, a set of handle values (Value, V) is obtained. The index value (index) and type value (type) in the handle value can then be used as separate secondary keys to sequentially query the index value (index) and type value (type). This allows the retrieved handle value to continue to search for the handle value of a specific target. Once the handle value is finally determined, the data corresponding to that handle value can be accessed.
[0004] In order to achieve a high-performance identity resolution system, a high-speed cache system is usually matched to cache data in the prior art. When querying the resolution result of a handle identifier in the cache system in the above manner, even if the index value in the handle value has only one conditional value and the type value also has only one conditional value, at least three queries are required for the handle identifier string, index value, and type value corresponding results to obtain the specific target value. When there are multiple conditional values for the index value and the type value, the number of queries will be greater. This method of requiring multiple queries to locate the final handle identifier resolution result is less efficient and has a longer latency in querying the cache.
[0005] In addition, the handle identification resolution process is usually implemented based on multiple protocols, such as the UDP protocol, the TCP protocol, and the HTTP(S) protocol. The UDP and TCP protocols use stream-based binary format data, and the HTTP(S) protocol uses JSON format data. The query requests based on different protocols are processed differently. Specifically, when performing a handle identification query based on, for example, the TCP protocol, the first-level hash of the handle identification string and the second-level hash query of the type value and index value are traversed, and the binary format data is cached; when performing a handle identification query based on the HTTP(S) protocol, the multi-level hash query of the handle identification string, index value, and type value is traversed, and then the queried binary format data is converted into the JSON format data required by HTTP(S). Since each query based on HTTP(S) needs to go through the above conversion process, the work efficiency is low, which affects the system resolution performance.
[0006] Therefore, there is an urgent need for a technical solution that can reduce the number of cache queries for handle identifier resolution results, eliminate the data format conversion steps required when querying based on different protocols, improve cache efficiency, and reduce query cache latency, so as to achieve the effect of increasing the query rate per second (QPS) of the entire system business processing. Summary of the Invention
[0007] To address the above problems, the present invention provides a handle identifier resolution caching method, a query method and a corresponding handle identifier resolution system, which can effectively reduce the number of cache queries of handle identifier resolution results and eliminate the data format conversion steps required when querying based on different protocols.
[0008] The handle identifier resolution caching method provided by the present invention specifically includes: step S1, using a string formed by arranging a handle identifier string, an index value and a type value as a keyword value, calculating a hash address corresponding to the keyword value, and thus establishing a hash table; step S2, caching the handle identifier resolution result into a storage unit corresponding to the hash address, wherein the handle identifier resolution result includes at least binary format data and data in a specified format converted from the binary format data.
[0009] According to the above technical solution, a hash query is performed using a string consisting of a handle identifier string, an index value, and a type value as the key. This query method only requires a single hash query to accurately obtain the hash address corresponding to the key value, greatly reducing the number of queries and improving the efficiency and accuracy of the query cache. In addition, because the handle parsing result also stores data in a specified format converted from binary format data, the next query can directly call this specified format data, eliminating the data format conversion step required when querying based on different protocols, thereby effectively improving parsing efficiency.
[0010] In a preferred technical solution of the present invention, the index value in the keyword value is an index list value in an index list formed by sorting multiple index values; the type value in the keyword value is a type list value in a type list formed by sorting multiple type values.
[0011] According to the above technical solution, the index value and type value are converted and processed, and the list value is assigned after sorting. For the same index list value and type list value, even if the order is different when input, they can still correspond to a unique keyword value in the hash table through sorting.
[0012] In the preferred technical solution of the present invention, the specified format is JSON. According to the above technical solution, the handle identifier resolution caching method can be effectively applied to the handle identifier resolution system based on the HTTP(S) protocol. If there is a record in the local cache in JSON format during the query, it can be directly called, eliminating the format conversion step that is often required when querying based on different protocols (for example, when the same server needs to execute both TCP and HTTP(S) protocol queries), thereby effectively improving the resolution efficiency.
[0013] The present invention also provides a handle identifier resolution query method, including: step S3, using a string formed by arranging a handle identifier string, an index value, and a type value as a keyword value, and querying a hash address corresponding to the keyword value in a hash table; step S4, in response to a query based on a prescribed protocol, reading a handle identifier resolution result from a storage unit corresponding to the hash address, the handle identifier resolution result including pre-cached data in a prescribed format converted from binary data.
[0014] According to the above technical solution, a hash query is performed using a string consisting of a handle identifier string, an index value, and a type value as a key. This query method only requires a single hash query to accurately obtain the hash address of the handle identifier resolution result, greatly reducing the number of queries and improving the efficiency and accuracy of the query cache. In addition, since in step S4, in response to a query based on a specified protocol, the data in a specified format converted from binary data is called, there is no need to temporarily perform format conversion during the query phase, effectively improving query efficiency.
[0015] In a preferred technical solution of the present invention, the handle identifier resolution query method further includes: Step S5, determining whether the handle identifier resolution result is expired based on the expiration time value: if expired, deleting the handle identifier resolution result and returning a null value; if not expired, returning the handle identifier resolution result. According to the above preferred technical solution, the handle identifier resolution query method can effectively identify expired data and ensure the timeliness of the data.
[0016] In a preferred technical solution of the present invention, the prescribed protocol is the http / https protocol, and the prescribed format is the json format.
[0017] The handle identification resolution system provided by the present invention includes: a processor; a memory provided with a cache space and communicatively connected to the processor; a hash table is also stored in the memory, and the hash table is read and executed by the processor, and can convert a keyword value into a corresponding hash address, wherein the keyword value is configured as a string formed by arranging a handle identification string, an index value, and a type value, and the hash address is configured as the address where the handle identification resolution result is stored in the cache space. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is an overall structural diagram of a handle identification resolution system provided in one embodiment of the present invention;
[0019] Figure 2 yes Figure 1 The overall processing flow chart of handle identification resolution in the implementation method;
[0020] Figure 3 yes Figure 1 Flowchart of handle identifier resolution cache in implementation mode;
[0021] Figure 4 yes Figure 1 Flowchart of handle identifier resolution query in implementation mode;
[0022] Figure 5 yes Figure 1 A schematic structural diagram of a handle identification resolution system provided in an embodiment.
[0023] Figure numerals: 1-security policy subsystem, 2-tcp / http(s) subsystem, 3-cache system, 4-recursive forwarding subsystem, 5-recursive server, 6-cache self-check subsystem, 7-business management subsystem, 8-log subsystem, 9-hash table, 10-memory, 101, 102-storage units, 11-processor. DETAILED DESCRIPTION
[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0025]
System Architecture
[0026] In this embodiment, the overall structure of the handle identification resolution system is as follows: Figure 1 As shown. Preferably, the handle identifier resolution system includes a security policy subsystem 1, a tcp / http(s) subsystem 2, a cache system 3, a recursive forwarding subsystem 4, a buffer self-check subsystem 6, a business management subsystem 7 and a log subsystem 8. Among them, the security policy subsystem 1 is used to judge the security of information such as the handle identifier resolution request / response and the request / response user identity. Only information with a judgment result of no security issues can pass through the security policy subsystem 1 for the next transmission or resolution. There is information interaction between the security policy subsystem 1 and the business management subsystem 7 and the log subsystem 8 respectively. The security policy subsystem 1 can store information such as date, time, and user in the log subsystem 8 for subsequent call and query.
[0027] The TCP / HTTP(S) subsystem 2 converts information received from the security policy subsystem 1 into TCP / HTTP(S) protocol before transmitting it to the cache system 3 and recursive forwarding subsystem 4. Furthermore, the TCP / HTTP(S) subsystem 2 can also transmit backend return information to the security policy subsystem 1. Information exchange occurs between the TCP / HTTP(S) subsystem 2 and the service management subsystem 7. Furthermore, the TCP / HTTP(S) subsystem 2 can store information such as date, time, and parsing actions in the logging subsystem 8 for later access and query.
[0028] In this embodiment, the handle identifier resolution system based on the TCP protocol and the HTTP(S) protocol is used as an example for explanation, but those skilled in the art will understand that the handle identifier resolution caching method and query method provided by the present invention are also applicable to other handle identifier resolution systems that simultaneously include protocols based on binary format data (such as the UDP protocol) and other protocols using non-binary format data (such as the HTTP(S) protocol). Without departing from the main purpose of the present invention, the handle identifier resolution caching method, query method and corresponding handle identifier resolution system used in such systems do not exceed the protection scope of the present invention.
[0029] After responding to a query request, the response result can be cached in cache system 3, allowing it to directly respond the next time a substantially identical query request is received, thereby improving response speed. Cache system 3 communicates with service management subsystem 7 and TCP / HTTP(S) subsystem 2, facilitating querying and retrieving required information within cache system 3. Furthermore, cache system 3 interacts with cache self-check subsystem 6, allowing it to promptly update cache system 3 with new entries obtained through recursive queries.
[0030] The recursive forwarding subsystem 4 can recursively forward the information from the TCP / HTTP(S) subsystem 2 to the external recursive server 5, and can transmit the information returned by the recursive server 5 to the cache self-checking subsystem 6 for query and judgment.
[0031] Recursive server 5 can be located outside the system and is used for recursive queries when no local cached results are available. Specifically, upon receiving a query request from recursive forwarding subsystem 4, it performs a recursive query. If no response is received, the query request is recursively forwarded to the next-level recursive server 5 until a recursive server 5 returns a corresponding response. The response is then transmitted back to recursive forwarding subsystem 4. Information is exchanged between recursive server 5 and service management subsystem 7. Furthermore, recursive server 5 stores the recursive query log, including the server name, generated by the recursive query, in logging subsystem 8 for future access and query.
[0032] Cache self-check subsystem 6 is configured to receive the response result of the recursive query transmitted by recursive forwarding subsystem 4 and determine whether the response result needs to be cached in cache system 3. In some embodiments, if the corresponding response result is not cached in cache system 3 or the corresponding entry data has expired, and the response result meets pre-defined conditions, the response result may be cached in cache system 3. If the corresponding response result is already cached in cache system 3 or the response result does not meet the pre-defined conditions, the response result obtained from the recursive query is returned without updating cache system 3.
[0033] The business management subsystem 7 interacts with the above security policy subsystem 1, tcp / http(s) subsystem 2, cache system 3, recursive server 5 and cache self-check subsystem 6 so that the business management subsystem 7 can systematically manage and monitor each process in the entire handle identification resolution system.
[0034] The log subsystem 8 interacts with the security policy subsystem 1, tcp / http(s) subsystem 2 and recursive server 5, etc., and is used to record and store system log information such as date, time, and action of the security policy subsystem 1, tcp / http(s) subsystem 2 and recursive server 5, etc.
[0035]
Processing Flow
[0036] Furthermore, the overall processing flow of the handle identification resolution system in this embodiment is as follows: Figure 2 shown.
[0037] The handle identifier resolution system starts running, first initializing the system configuration. If the system configuration initialization fails, the resolution will exit; if the system configuration initialization succeeds, the resolution will continue. After the system configuration is successfully initialized, the log is initialized. If the log initialization fails, the resolution will exit; if the log initialization succeeds, the resolution will continue. After the log is successfully initialized, the cache is initialized. If the cache initialization fails, the resolution will exit; if the cache initialization succeeds, the resolution will continue. After the cache is successfully initialized, the log statistics are initialized. If the log statistics initialization fails, the resolution will exit; if the log statistics initialization succeeds, the resolution will continue. The above initialization steps are the process of assigning variables to default values and setting controls to default states, thereby ensuring the normal operation of the system.
[0038] After the above initialization steps are successfully completed, the system begins listening for incoming requests. The types of information being listened for are tcpListen, http(s)Listen, and realConfListen. TCP specifies transport layer data and connection methods; it does not carry data and is used only for communication. http(s) is the Hypertext Transfer Protocol Secure (Hypertext Transfer Protocol Secure), which is built on top of TCP connections and defines transmission content specifications and also transmits data. realConf is a configuration command used to add, delete, and modify configurations. The Listen command specifies which ports, or a combination of addresses and ports, the server should listen for incoming requests.
[0039] When the system monitors request information from a specific port or address, that is, when it receives external information trigger, the system can determine the type of external event.
[0040] When the external event type is a TCP-based handle identifier resolution query request, the TCP subsystem in the TCP / HTTP(S) subsystem 2 first performs TCP service packet reception and unpacking, and then performs a policy check. The policy check mentioned here refers to whether the corresponding hash address can be obtained after substituting the received keyword value (key) into a specific function. If the policy check fails, that is, the hash address corresponding to the keyword value is not found in the hash table, the resolution is terminated and the result of the policy check failure is returned to the user; if the policy check succeeds, that is, the hash address corresponding to the keyword value is found in the hash table, the storage unit corresponding to the hash address is searched in the cache database of the cache system 3. If the corresponding handle identifier resolution result is cached in the storage unit corresponding to the hash address in the cache database, the handle identifier resolution result is returned to the user; if the corresponding handle identifier resolution result is not cached in the storage unit corresponding to the hash address in the cache database or the corresponding handle identifier resolution result has expired, the recursive query continues. After one or more recursive queries, the recursive server obtains a handle identifier resolution result, returns the handle identifier resolution result to the user, and sends the handle identifier resolution result to the cache self-check subsystem 6. The cache self-check subsystem 6 determines whether the handle identifier resolution result needs to be cached. If the handle identifier resolution result is not cached in the cache database, it is cached in the cache database.
[0041] When the external event type is http(s), the http(s) subsystem in tcp / http(s) subsystem 2 is used to receive and de-packet the http(s) service.
[0042] When the external event type is realConf, the crm command is issued. Based on the specific content of the crm command, operations such as adding, deleting, and modifying information in the hash table and cache database can be implemented accordingly.
[0043] [Handle identification string, handle value]
[0044] A hash table is a data structure that is directly accessed based on (Key, Value). In other words, it uses a hash function to map the keyword value (key) to a hash address in the table to access records, thereby speeding up the search. In the handle identification resolution system of the prior art, the keyword value used when establishing a hash table is only the handle identification string. The handle identification string includes a prefix and a suffix, where the prefix includes the top-level national node identification, the second-level node identification, and the enterprise node identification. For example, the following string,
[0045] 10.1045.xxx / january99-bearman
[0046] Among them, 10 represents the top-level national node identifier; 1045 represents the second-level node identifier; xxx represents the enterprise node identifier; "." is the hierarchical separator, separating the node identifiers at each level; " / " is the prefix and suffix separator, the part before " / " is the prefix, and the part after " / " is the suffix; the handle identifier string does not include "." and " / ".
[0047] In the prior art, a set of handle values obtained by parsing the handle identification string is in the form of:
[0048]
[0049]
[0050] The above diagram only schematically shows the parsing result of one type of value (type) in a column of data. A set of handle values can actually contain multiple columns of data, and each column of data is indexed by an index value (index) to distinguish the data in this column from the data in other columns. Each column of data can also contain data of different types of values. Among them,
[0051] Index value (index), 4-byte unsigned integer;
[0052] Type value (type), a UTF8 string;
[0053] Data (data), used to describe the data resource identified by the handle;
[0054] Time to Live (TTL), which indicates how long the data is retained in the cache space;
[0055] Permission mask (permission), 8-bit permission mask, used for access permission control of handle;
[0056] Reference number (reference), indicating references to other handles.
[0057] Among them, the type value (type) specifically includes
[0058] Administrator (HS_ADMIN), which represents one or a group of administrators of the handle resolution service;
[0059] Service site (HS_SITE), which indicates the service site that provides handle resolution services;
[0060] Naming Authorization Proxy Service (HS_NA_DELEGATE), used to assign naming management authority to service sites;
[0061] Service (HS_SERV), which indicates the content of the service to be parsed by the handle;
[0062] Alias (HS_ALIAS), when the handle identifies an object with multiple names, it can be represented by an alias;
[0063] Primary site (HS_PRIMARY), specifies the primary service site;
[0064] List value (HS_VLIST), which represents a reference to another handle list value.
[0065] The handle identifier must specify a type value in its type field. Type values (type) include more than just the types listed above. The handle system also provides a type registration service that allows users or organizations to register new type values for their applications.
[0066] From the above data structure, it can be seen that if the query method in the existing technology is used, in order to accurately locate the specific handle identification resolution result, in addition to the mapping process of the above hash table, it is also necessary to use the index value and type value to further query in a set of handle values before a specific handle identification resolution result can be obtained.
[0067] [Cache method]
[0068] This embodiment provides a handle identifier resolution caching method, including the following steps: Figure 3 As shown:
[0069] Step S1: Using a string formed by arranging the handle identification string, the index value, and the type value as a keyword value, and calculating a hash address corresponding to the keyword value, thereby establishing a hash table;
[0070] Step S2: caching the handle identifier resolution result into a storage unit corresponding to the hash address, wherein the handle identifier resolution result at least includes binary format data and data in a specified format converted from the binary format data.
[0071] In this embodiment, since the index value and type value are used as part of the keyword value when establishing the hash table, the hash table established based on the keyword value of this encoding method can directly parse out the specific handle identifier resolution result without the need for multiple queries. The above-mentioned caching method greatly facilitates the subsequent query process, reduces the number of subsequent queries required, and improves the efficiency and accuracy of the query. Preferably, in the handle identifier resolution caching method proposed in this embodiment, the index value and the type value are both list values after sorting. In other words, the index value in the keyword value is an index list value in an index list formed by sorting multiple index values; the type value in the keyword value is a type list value in a type list formed by sorting multiple type values.
[0072] For example, for type values, available type values can be sorted according to pre-defined rules to form a type list, and each type value can be assigned a type list value. Available type values include not only the common type values listed above, but also user-defined type values. As long as they are added to the type list and assigned the corresponding list value, the query function can be applied. For example, the correspondence between type values and type list values can be seen in Table 1 below.
[0073] Table 1
[0074]
[0075]
[0076] The sorting rules assigned to type list values can be ordered, such as alphabetical order by name, type order, or any other suitable sorting method or combination thereof, or can be unordered, as long as there is a one-to-one correspondence between type values and type list values. Index values can also be implemented using the same or similar methods as described above and will not be further described here.
[0077] In the above manner, the index values and type values are sorted according to certain rules to obtain the index list value and the type list value; then the handle identification string is integrated with the index list value and the type list value to form the keyword value.
[0078] For example, if the handle identifier string is 10.1045.xxx / january99-bearman, the index value is 2, and the type value is HS_ADMIN, then when composing the keyword value, the index list value corresponding to the index value and the type list value corresponding to the type value are queried. By querying the above type list, it can be seen that the type list value corresponding to the type value of HS_ADMIN is 1. Similarly, the index list value corresponding to the index value of 2 is 2. Therefore, if the keyword value is encoded using the handle identifier string + indexList (index list value) + typeList (type list value), the keyword value should be 10.1045.xxx / january99-bearman 2 1.
[0079] By assigning list values after sorting, it is possible to ensure that, even if the order of input is different, the same index list value or type list value can still correspond to a unique keyword value in the hash table through sorting. Of course, in some embodiments, the index value or type value can be directly arranged with the handle identification string to form a keyword value to create or query the hash table. In addition, in other embodiments, the keyword value can also be allowed to have certain reasonable variations, as long as it contains information about the index value, type value, and handle identification string.
[0080] After determining the keyword value, the hash function can be used to determine the hash address corresponding to the keyword value. The calculation process of the hash function can directly map the keyword value to the hash address corresponding to the handle identifier resolution result, avoiding resource waste caused by multiple hash searches.
[0081] In addition, because the handle parsing result also saves the data in the specified format converted from the binary format data, the data in the specified format can be directly called during the next query, eliminating the data format conversion steps required when querying based on different protocols, thereby effectively improving the parsing efficiency.
[0082] Specifically, in this embodiment, regardless of whether the query is based on the TCP protocol or the HTTP(S) protocol, the recursive parsing results are stored as two copies of data in different formats: one in binary format, and the other in JSON format, converted from the binary format. In other words, when the cache is first established, two or more copies of data in different formats are stored. If a subsequent query request is received based on the TCP protocol, the binary format data is returned; if a subsequent query request is received based on the HTTP(S) protocol, the JSON format data is returned. In other words, based on the protocol type of the query request, the data with the matching format is selected from the multiple stored data copies and returned to the initiator of the query request.
[0083] When establishing a cache, the number of copies of data pre-stored in cache system 3 corresponds to the number of file format types of the system's compatible protocols. For example, if the system is compatible with TCP, UDP, and HTTP(S), and the file formats of these three protocols are binary and JSON, then the number of copies of the data should also be two. By caching data of different formats, when a query request based on a specified protocol is received, the data in the format corresponding to the specified protocol is simply returned to the initiator of the query request, eliminating the need for local format conversion, thereby effectively improving parsing efficiency.
[0084]
Query method
[0085] The handle identifier resolution cache query process proposed in this embodiment is as follows: Figure 4 shown.
[0086] First, step S3 is executed to use a string formed by arranging the handle identification string, the index value, and the type value as a key value, and to search the hash table for a hash address corresponding to the key value.
[0087] In this embodiment, step S3 further includes the steps of calling a query program (eg, hhdl_cache_get program) to query the keyword value, and calculating a corresponding hash address based on the keyword value.
[0088] Next, after step S3, step S4 is executed. In response to the query based on the specified protocol, the handle identifier resolution result is read from the storage unit corresponding to the hash address. The handle identifier resolution result includes pre-cached data in a specified format converted from binary data. In this embodiment, the specified protocol is the HTTP(S) protocol, and the specified format is the JSON format.
[0089] Specifically, based on the hash address, a query is made in the cache database of cache system 3 to determine whether the corresponding handle identifier resolution result is cached in the storage unit corresponding to the hash address. If the corresponding handle identifier resolution result is cached, the handle identifier resolution result is read. If the corresponding handle identifier resolution result is not cached in the storage unit corresponding to the hash address, a null value (NULL) is returned to the user.
[0090] According to the aforementioned caching method, in the process of establishing the cache, this embodiment prepares data in different formats in the cache system 3, such as binary format data and json format data. In step S4, in the process of reading the handle identifier parsing result from the storage unit corresponding to the hash address, the query request will be matched with data in the corresponding format according to the protocol type on which the query request is based. Specifically, when the received query request is based on the tcp protocol, the data read from the cache system and returned to the requester are all binary format data; when the received query request is based on the http(s) protocol, the data read from the cache system 3 and returned to the requester are all json format data. Because the above-mentioned binary format and json format data are pre-cached in the cache system 3, the process of reading from the cache system is direct reading without the need for format conversion, which can effectively improve the parsing efficiency.
[0091] After executing step S4, it also includes: step S5, judging whether the handle identifier resolution result corresponding to the hash address is expired according to the lifetime value: if expired, deleting the handle identifier resolution result and returning a null value; if not expired, returning the handle identifier resolution result.
[0092] Specifically, in step S5, if the corresponding handle identifier resolution result is cached in the storage unit corresponding to the hash address, the handle identifier resolution result is checked to see if it has expired based on the time-to-live value (TTL) corresponding to the handle identifier resolution result. If the handle identifier resolution result has expired, a null value (NULL) is returned to the user; if the handle identifier resolution result has not expired, the corresponding handle identifier resolution result is returned to the user.
[0093] In addition, when executing step S3, if the string formed by arranging the handle identification string, index value and type value is used as the keyword value to query the hash table, but the hash address corresponding to the keyword value is not found, a corresponding set of handle values can be found according to the handle identification string, and then the index value and type value can be used to further query in the set of handle values to obtain a specific handle identification resolution result.
[0094] Handle Identification Resolution System
[0095] In addition, this embodiment proposes a handle identification resolution system, the structure of which is as follows: Figure 5 As shown, it specifically includes a processor 11 and a memory 10 that is in communication with the processor 11 and is at least partially used to provide cache space. A hash table 9 is stored in the memory 10, and the hash table 9 is read and executed by the processor 11, and can convert the keyword value into a corresponding hash address. Among them, the keyword value is configured as a string formed by the arrangement of the handle identification string, the index value and the type value, and the hash address is configured as the address where the handle identification resolution result is stored in the cache system 3. The cache system 3 of the memory 10 includes a plurality of storage units 101 and 102 corresponding to the hash address, which are used to cache the handle identification resolution result.
[0096] In hash table 9, the corresponding hash address can be calculated from the keyword value, and the handle identifier resolution result can be cached in the storage unit 101, 102 corresponding to the hash address in the cache database of the cache system 3, or the corresponding handle identifier resolution result can be read from the storage unit 101, 102 corresponding to the hash address.
[0097] In summary, by caching and querying handle identifier resolution results in this manner, the corresponding hash address can be calculated using the keyword value during querying, and the corresponding handle identifier resolution result can be directly retrieved using the hash address. This requires only a single hash query to achieve the effect that would otherwise require three or more hash queries. This effectively reduces the number of cache queries for handle identifier resolution results, lowers query cache latency, and thus improves the query rate per second for the entire system's business processing.
[0098] In an embodiment of the present invention, the memory 10 and the processor 11 can be in the same storage medium such as a DNS server, a computer storage medium, etc., or they can be separated into different hardware, software or cloud networks. In other words, the above-mentioned handle identification resolution system can be composed of an independent DNS server, a computer and other devices, or it can be composed of one or more combinations of multiple hardware, software, hardware and software, and cloud networks.
[0099] In addition, it should be noted that the memory 10 may include non-volatile memory, such as read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash memory (FLASH), or any other device capable of storing program instructions or data with or without applied power. The memory 10 may also include volatile memory, such as random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), and synchronous dynamic random access memory (SDRAM). Other types of RAM may also be used to implement the memory 10. The memory 10 may be implemented using a single memory module or multiple memory modules. Although the memory 10 is depicted as being locally interconnected with the processor 11, those skilled in the art will recognize that the memory 10 may be provided separately from the processor 11 in a different computer without departing from the scope of the subject technology.
[0100] Processor 11 can be a general-purpose processor, a processor core, a multiprocessor, a reconfigurable processor, a microcontroller, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), a field-programmable gate array (FPGA), a programmable logic device (PLD), a controller, a state machine, gating logic, a discrete hardware component, or any other processing unit, as well as a combination of one or more of the above processors.
[0101] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A handle identifier resolution caching method, characterized in that: include: Step S1, using a string formed by arranging a handle identification string, an index value, and a type value as a keyword value, and calculating a hash address corresponding to the keyword value, thereby establishing a hash table, wherein the index value in the keyword value is an index list value in an index list formed by sorting a plurality of index values, and the type value in the keyword value is a type list value in a type list formed by sorting a plurality of type values, and the type value includes a user-defined type value; Step S2: caching the handle identifier resolution result into a storage unit corresponding to the hash address, wherein the handle identifier resolution result at least includes binary format data and data in a specified format converted from the binary format data.
2. The handle identifier resolution caching method according to claim 1, wherein: The specified format is json format.
3. A handle identification resolution query method, characterized in that: include: Step S3, using a string formed by arranging the handle identification string, the index value, and the type value as a keyword value, searching a hash table for a hash address corresponding to the keyword value, wherein the index value in the keyword value is an index list value in an index list formed by sorting a plurality of index values, and the type value in the keyword value is a type list value in a type list formed by sorting a plurality of type values, wherein the type value includes a user-defined type value; Step S4: In response to a query based on a prescribed protocol, a handle identifier resolution result is read from a storage unit corresponding to the hash address, wherein the handle identifier resolution result includes pre-cached data in a prescribed format converted from binary data.
4. The handle identification resolution query method according to claim 3, wherein: Also includes: Step S5: Determine whether the handle identifier resolution result is expired based on the lifetime value: If it is expired, the handle identification parsing result is deleted and a null value is returned; If it has not expired, the handle identifier resolution result is returned.
5. The handle identification resolution query method according to claim 3, wherein: The specified protocol is the http / https protocol, and the specified format is the json format.
6. A handle identification resolution system, characterized in that: include: processor; A memory with cache space is provided, communicatively connected to the processor; The memory also stores a hash table, which is read and executed by the processor and can convert the keyword value into a corresponding hash address, wherein: The keyword value is configured as a string formed by arranging a handle identifier string, an index value and a type value, the index value in the keyword value is an index list value in an index list formed by sorting multiple index values, the type value in the keyword value is a type list value in a type list formed by sorting multiple type values, the type value includes a user-defined type value, the hash address is configured as the address where the handle identifier resolution result is stored in the cache space, and the handle identifier resolution result includes at least binary format data and data in a specified format converted from the binary format data.
Citation Information
Patent Citations
Processing method and system for tree structured data
CN107092656A
HANDLE identifier analysis system and data query method
CN110716941A
Handle permission control method, device and system based on identification key
CN111917552A