Industrial Internet Identifier Resolution Caching Method, Public Recursive Nodes and Devices

By combining in-memory and disk databases, and dynamically scheduling data based on update time and query frequency, the problems of excessive load on recursive nodes and low caching efficiency are solved, achieving more efficient data storage and retrieval.

CN116881212BActive Publication Date: 2026-04-03CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, the differences in application load among recursive nodes lead to problems such as excessive load on some recursive nodes and low caching efficiency.

Method used

A caching method combining in-memory databases and disk databases is adopted. A sorting factor is set according to the arrival time and hit count of the identified data, and the data is dynamically scheduled between the two. Data with more recent update time and more frequent queries is stored in the in-memory database first, so as to improve query speed and caching efficiency.

Benefits of technology

By dynamically scheduling data storage, the cache query speed is improved, the load pressure on recursive nodes is reduced, and the problem of low cache efficiency caused by application load differences is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116881212B_ABST
    Figure CN116881212B_ABST
Patent Text Reader

Abstract

This invention provides an industrial internet identifier resolution caching method, a public recursive node, a device, and a medium, relating to the field of network technology. The method includes: responding to the arrival of first identifier data, determining whether the in-memory database has free space; if so, storing it in both the in-memory database and the disk database; otherwise, storing it directly in the disk database; recording the arrival time of the first identifier data in the disk database and setting the hit count to a preset initial value; responding to an identifier data query request and finding the requested second identifier data in the disk database, updating the arrival time of the second identifier data to the current time and incrementing the hit count by one; sorting all identifier data based on a set sorting factor; and selecting a corresponding number of identifier data from the disk database and writing them to the in-memory database according to the sorting result and the current free space size of the in-memory database. This invention can solve the current technical problems of excessive load on recursive nodes and low caching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network technology, and in particular to an industrial internet identifier resolution caching method, a public recursive node, a computer device, and a computer-readable storage medium. Background Technology

[0002] The Industrial Internet Identifier Resolution System is an important component of the Industrial Internet network system and serves as the nerve center supporting the interconnection of the Industrial Internet. Its function is similar to that of the Domain Name System (DNS) in the Internet field.

[0003] In the identifier resolution system, the common recursive node provides the common query and access entry point, serving as a crucial entry point for the system. It enhances service performance through caching and other technologies. When a client sends an identifier resolution request, the recursive node first checks its local cache for results. If not, it queries through the response path returned by the identifier resolution server until it finds the address or information associated with the identifier, returns it to the client, and caches the result. However, in real-world applications, the application load on each recursive node varies due to differences in regional characteristics and user distribution. For example, some regions have a large number of industrial enterprises, naturally leading to greater business demands for identifier resolution. This can cause some recursive nodes to experience overload and low caching efficiency. Summary of the Invention

[0004] This invention was completed to at least partially solve the technical problem in the prior art where the application load of each recursive node is different, resulting in some recursive nodes being overloaded and having low caching efficiency.

[0005] According to one aspect of the present invention, an industrial internet identifier resolution caching method is provided, applied to a public recursive node, the method comprising:

[0006] In response to the arrival of the first identifier data, determine whether the in-memory database has free space;

[0007] If so, the first identifier data will be stored in the memory database and the disk database respectively;

[0008] If not, the first identifier data is directly stored in the disk database;

[0009] In response to the fact that the first identifier data has been stored in the disk database, the arrival time of the storage of the first identifier data in the disk database is recorded, and the number of hits of the first identifier data is set to a preset initial value;

[0010] In response to the identification data query request and after finding the requested second identification data in the disk database, update the arrival time of the second identification data to the current time and increment the hit count of the second identification data by one;

[0011] A sorting factor is set based on the arrival time and hit count of all identified data in the disk database, and all identified data are sorted based on the sorting factor.

[0012] Based on the sorting results and the current free space in the memory database, select a corresponding number of identifier data from the disk database; and,

[0013] The identifier data selected from the disk database is written to the in-memory database.

[0014] Optionally, after storing the first identifier data into the in-memory database, the method further includes:

[0015] Record the arrival time of the first identifier data being stored in the in-memory database; and,

[0016] In response to the identification data query request and after retrieving the requested second identification data from the in-memory database, update the arrival time of the second identification data to the current time;

[0017] Before setting a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sorting all identified data based on the sorting factor, the method further includes:

[0018] Set the first storage validity period for storing each identifier data in the in-memory database;

[0019] Every preset period, the validity period of all identifier data in the in-memory database is checked, and identifier data in the in-memory database whose difference between the current time and the expected time exceeds the first storage validity period is deleted; and,

[0020] Determine whether space has been released in the memory database. If so, set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor.

[0021] Optionally, the step of selecting a corresponding number of identifier data from the disk database based on the sorting result and the current free space size of the memory database specifically involves:

[0022] Based on the sorting results and the amount of space released after the memory database completes the validity period verification, select identifier data from the disk database whose data volume does not exceed the amount of space released by the memory database.

[0023] Optionally, the method further includes:

[0024] In response to the identification data query request, the second identification data requested by the identification data query request is first queried from the memory database;

[0025] In response to finding the requested second identifier data in the in-memory database, the second identifier data is returned directly.

[0026] If the requested second identifier data is not found in the memory database, the system continues to search for the requested second identifier data in the disk database.

[0027] In response to finding the requested second identifier data in the disk database, the second identifier data is returned.

[0028] Optionally, the ranking factor is calculated using the following formula:

[0029] F = a * timein + b * hit

[0030] Where F is the sorting factor; timein is the arrival time of the identifier data. If the identifier data has not been queried, then timein is the arrival time when the identifier data is stored in the disk database. If the identifier data has been queried, then timein is the arrival time after the identifier data was last queried and updated. hit is the number of times the identifier data has been hit. If the identifier data has not been queried, then hit is the preset initial value. If the identifier data has been queried, then hit is the number of hits after the last query and update.

[0031] Optionally, the method further includes:

[0032] Set a second storage expiration period for storing each identifier data in the disk database;

[0033] Determine if the remaining space of the disk database is lower than the preset value;

[0034] If so, delete the identifier data in the disk database where the difference between the current time and the arrival time exceeds the second storage validity period.

[0035] According to another aspect of the present invention, a public recursive node is provided, comprising:

[0036] The judgment module is configured to determine whether the memory database has free space when the first identifier data arrives;

[0037] The control module is configured to store the first identifier data into the memory database and the disk database respectively when the judgment result of the judgment module is that the memory database has free space; and to directly store the first identifier data into the disk database when the judgment result of the judgment module is that the memory database does not have free space.

[0038] The recording module is configured to record the arrival time of the first identifier data being stored in the disk database when the first identifier data has been stored in the disk database, and to set the number of hits of the first identifier data to a preset initial value.

[0039] The recording module is further configured to, in response to an identification data query request and after querying the requested second identification data in the disk database, update the arrival time of the second identification data to the current time, and increment the hit count of the second identification data by one;

[0040] A sorting module is configured to set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor; and,

[0041] The selection module is configured to select a corresponding number of identifier data from the disk database based on the sorting results and the current free space size of the memory database.

[0042] The control module is also configured to write the identification data selected from the disk database into the memory database.

[0043] Optionally, the recording module is further configured to record the arrival time of the first identifier data being stored in the memory database; and, in response to an identifier data query request and after the requested second identifier data is found in the memory database, update the arrival time of the second identifier data to the current time.

[0044] The common recursive node also includes:

[0045] The verification module is configured to set the first storage validity period for each identifier data stored in the memory database; and to perform validity period verification on all identifier data in the memory database every preset period, and delete identifier data in the memory database whose current time and arrival time difference exceeds the first storage validity period.

[0046] The judgment module is also configured to determine whether space has been released in the memory database;

[0047] The sorting module is further configured to, when the judgment module determines that space has been released in the memory database, set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor.

[0048] According to another aspect of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the aforementioned Industrial Internet identifier resolution caching method.

[0049] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the processor performs the aforementioned Industrial Internet Identifier Resolution Caching Method.

[0050] The technical solution provided by this invention may include the following beneficial effects:

[0051] The industrial internet identifier resolution caching method provided by this invention, when a public recursive node receives first identifier data, if the in-memory database has free space, stores the first identifier data simultaneously in both the in-memory database and the disk database to ensure data storage reliability while improving query speed; if the in-memory database does not have free space, it stores only the first identifier data in the disk database to at least ensure data storage reliability. Then, it records the arrival time of the first identifier data in the disk database and sets the hit count of the first identifier data to a preset initial value. In response to an identifier data query request and upon finding the requested second identifier data in the disk database, it updates the arrival time of the second identifier data to the current time and increments the hit count of the second identifier data by one. It sets a sorting factor based on the arrival time and hit count of all identifier data in the disk database and sorts all identifier data based on the sorting factor. Based on the sorting result and the current free space size of the in-memory database, it selects a corresponding number of identifier data from the disk database and writes the selected identifier data from the disk database into the in-memory database. This new caching mechanism effectively solves the technical problem in existing technologies where the application load of each recursive node is different, leading to excessive load on some recursive nodes and low caching efficiency.

[0052] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description

[0053] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.

[0054] Figure 1 A schematic diagram of the public recursive node caching architecture provided in an embodiment of the present invention;

[0055] Figure 2 A flowchart illustrating an industrial internet identifier resolution and caching method provided in an embodiment of the present invention;

[0056] Figure 3This is a schematic diagram of the structure of a common recursive node provided in an embodiment of the present invention;

[0057] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the specific implementation methods of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific implementation methods described herein are for illustration and explanation only and are not intended to limit the present invention.

[0059] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence; furthermore, in the absence of conflict, the embodiments and features in the embodiments of this invention can be arbitrarily combined with each other.

[0060] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0061] Figure 1 This is a schematic diagram of the public recursive node caching architecture provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the caching architecture of the common recursive node is divided into two parts: memory database 101 and disk database 102. The memory database has the characteristics of relatively fast query speed and small storage volume, while the disk database has the characteristics of relatively slow query speed but large storage volume. Figure 2 This is a flowchart illustrating an industrial internet identifier resolution and caching method provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the Industrial Internet Identifier Resolution Caching Method is applied to a public recursive node and includes the following steps S201 to S208.

[0062] S201. In response to the arrival of the first identifier data, determine whether the memory database has free space. If yes, proceed to step S202; otherwise, proceed to step S203.

[0063] In this step, the first identifier data refers to the identifier data of newly arrived public recursive nodes. The identifier data of each newly arrived public recursive node can be called the first identifier data; it does not specifically refer to a particular type of identifier data. Each time a public recursive node receives newly arrived identifier data, it needs to determine whether the in-memory database has free space. One way to determine whether the in-memory database has free space is to set a first percentage based on actual needs. If the remaining space in the in-memory database exceeds this first percentage, it is determined that the in-memory database has free space; otherwise, it is determined that the in-memory database does not have free space, i.e., the in-memory database is full.

[0064] S202. Store the first identifier data into the memory database and the disk database respectively, and then execute step S204.

[0065] In this step, if the memory database has free space, the first identifier data received this time will be stored in both the memory database and the disk database.

[0066] S203. Directly store the first identifier data into the disk database, and then execute step S204.

[0067] In this step, if the memory database does not have free space for the first identifier data received this time, then only the first identifier data received this time will be stored in the disk database.

[0068] In this embodiment, when the common recursive node receives the first identifier data, if the memory database has free space, the first identifier data is stored in both the memory database and the disk database simultaneously to ensure data storage reliability while improving query speed; if the memory database does not have free space, the first identifier data is stored only in the disk database to at least ensure data storage reliability.

[0069] S204. In response to the fact that the first identification data has been stored in the disk database, record the arrival time of the storage of the first identification data in the disk database, and set the number of hits of the first identification data to a preset initial value.

[0070] In this step, the preset initial value can be set to 1.

[0071] S205. In response to the identification data query request and after retrieving the requested second identification data from the disk database, update the arrival time of the second identification data to the current time, and increment the hit count of the second identification data by one.

[0072] In this step, the identifier data query request carries the identifier code of the second identifier data. The second identifier data refers to the identifier data retrieved by the public recursive node after receiving the identifier data query request. Any identifier data retrieved by a user through the public recursive node can be called the second identifier data, and it does not specifically refer to a certain type of identifier data.

[0073] It should be noted that each time a certain identifier data stored in the disk database is queried, its arrival time is updated to the current time. In other words, the arrival time of the identifier data in the disk database is the arrival time updated after its most recent query. Similarly, each time a certain identifier data in the disk database is queried, its hit count is incremented by one. That is, the hit count of the identifier data in the disk database is the hit count updated after its most recent query.

[0074] S206. Set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor.

[0075] In this step, sorting all the identifier data in the disk database specifically involves sorting the identifier data according to the update time and the number of times it has been queried.

[0076] S207. Select the appropriate number of identifier data from the disk database based on the sorting results and the current free space size of the memory database.

[0077] In this step, the identifier data that has been updated more recently and queried more frequently is filtered out. The number of identifier data to be filtered out can be determined based on the current free space of the memory database. Specifically, the amount of identifier data selected from the disk database = the current free space of the memory database - the reserved margin.

[0078] S208. Write the identification data selected from the disk database to the in-memory database.

[0079] Of course, the identifier data selected from the disk database may or may not exist in the memory database. If the identifier data exists in the memory database, the arrival time of the identifier data in the memory database is updated, and it is not necessary to store the same identifier data repeatedly; if the identifier data does not exist in the memory database, the identifier data is stored in the memory database, and the arrival time of the identifier data being stored in the memory database is recorded.

[0080] In this embodiment, a new caching mechanism is used to store a portion of the identification data that was originally stored only in the local disk database into the memory database according to certain rules. Since new identification data and identification data that has been updated recently and queried many times are more likely to be queried again, storing this part of the identification data into the memory database can significantly improve the query speed and reduce the storage pressure on the memory database. This effectively solves the technical problem in the prior art where the application load of each recursive node is different, resulting in some recursive nodes being overloaded and having low caching efficiency.

[0081] In one specific embodiment, after step S202, the following steps S209 and S210 are further included.

[0082] S209. Record the arrival time of the first identifier data being stored in the memory database.

[0083] S210. In response to the identification data query request and after retrieving the requested second identification data from the memory database, update the arrival time of the second identification data to the current time.

[0084] It should be noted that each time a certain identifier in the in-memory database is queried, the arrival time of that identifier is updated to the current time. In other words, the arrival time of that identifier in the in-memory database is the arrival time updated after its most recent query.

[0085] Before step S206, the following steps S211 to S213 are also included.

[0086] S211. Set the first storage validity period for each identifier data stored in the in-memory database.

[0087] S212. At each preset period, the validity period of all identifier data in the memory database is checked, and the identifier data in the memory database whose difference between the current time currenttime and the arrival time timein exceeds the first storage validity period tt1 is deleted.

[0088] S213. Determine whether space has been released in the memory database. If yes, proceed to step S206; otherwise, end the current process.

[0089] Specifically, when performing validity period verification, the arrival time of the identifier data in the in-memory database refers to: if the identifier data has not been queried, the arrival time is the time recorded when the identifier data was stored in the in-memory database; if the identifier data has been queried, the arrival time is the time updated after the most recent query. The value of the first storage validity period tt1 can be set and adjusted by those skilled in the art according to actual needs.

[0090] In this embodiment, a timer is pre-created in the caching system. Every fixed time period (e.g., 1 day, 5 days, 10 days, 15 days, etc., the present invention does not limit this) the validity period of all the identifier data in the memory database. When the validity period of a certain identifier data expires, that is, when the currenttime-timein>tt1 of the identifier data, the identifier data is directly deleted from the memory database.

[0091] One method to determine whether space has been released in the memory database is to set a second percentage based on actual needs, calculate the difference between the remaining space of the memory database before and after the validity period verification of all identified data in the memory database, and determine that the memory database has released new space as long as the difference in remaining space exceeds the second percentage; otherwise, determine that the memory database has not released new space.

[0092] In this embodiment, when the memory database releases space, all the identifier data in the disk database is sorted. Specifically, a sorting factor is set according to the arrival time and hit count of all the identifier data in the disk database, and then all the identifier data is sorted based on the sorting factor. After sorting, a corresponding number of identifier data are selected from the disk database and written into the memory database in descending order of the sorting factor.

[0093] In one specific implementation, step S207 is as follows: based on the sorting results and the size of the space released after the memory database completes the validity period verification, select identification data from the disk database whose data volume does not exceed the size of the space released by the memory database.

[0094] In this embodiment, the number of identifier data selected from the disk database is related to the amount of space released from the memory database. It can be set so that the total amount of identifier data selected from the disk database exactly matches the amount of space released from the memory database.

[0095] In one specific embodiment, steps a) to d) are included before steps S205 and S210.

[0096] a) In response to an identification data query request, first query the memory database for the second identification data requested by the identification data query request;

[0097] b) In response to finding the requested second identifier data in the in-memory database, directly return the second identifier data;

[0098] c) In response to the failure to find the requested second identifier data in the memory database, the search for the requested second identifier data continues in the disk database;

[0099] d) In response to finding the requested second identifier data in the disk database, return the second identifier data.

[0100] In this embodiment, when a public recursive node receives an identifier data query request (also known as an Industrial Internet identifier resolution request), it first queries the memory database for the requested identifier data. If the data exists, it directly returns the identifier data retrieved from the memory database. If the data does not exist, it continues the query in the disk database and returns the identifier data retrieved from the disk database. The retrieved identifier data is then returned to the client, which refers to the device that initiated the Industrial Internet identifier resolution request. Alternatively, if the requested identifier data is also not found in the disk database, the public recursive node can recursively query the enterprise node, secondary node, or top-level node on behalf of the client to obtain the identifier data or the address associated with the identifier and return it to the client. Simultaneously, depending on the available space in the memory database, the retrieved identifier data may be stored in both the memory database and the disk database, or only in the disk database.

[0101] In one specific embodiment, the ranking factor is calculated using the following formula:

[0102] F = a * timein + b * hit

[0103] Where F is the sorting factor; timein is the arrival time of the identifier data. If the identifier data has not been queried, then timein is the arrival time when the identifier data is stored in the disk database. If the identifier data has been queried, then timein is the arrival time after the identifier data was last queried and updated. hit is the number of times the identifier data has been hit. If the identifier data has not been queried, then hit is the preset initial value. If the identifier data has been queried, then hit is the number of hits after the last query and update.

[0104] In this embodiment, both a and b are adjustable items. In practical applications, they can be adjusted according to business needs. If more accurate identification data is needed to enter the memory database, the value of b can be increased and the value of a can be decreased. If the memory database needs to be more stable and the frequency of identification data entering and leaving needs to be reduced, the value of a can be increased and the value of b can be decreased.

[0105] In one specific embodiment, the method further includes the following steps S214 to S216.

[0106] S214. Set the second storage validity period tt2 for storing each identifier data in the disk database;

[0107] S215. Determine whether the remaining space of the disk database is lower than the preset value. If yes, proceed to step S216; otherwise, end the current process.

[0108] S216. Delete the identifier data in the disk database where the difference between the current time (currenttime) and the arrival time (timein) exceeds the second storage validity period.

[0109] The value of the second storage validity period tt2 can be set and adjusted by those skilled in the art according to actual needs. The preset value can be set to a range of 0% to 10%.

[0110] When cleaning up the disk database, the arrival time of the identified data in the disk database refers to: if the identified data has not been queried, the arrival time of the identified data is the arrival time recorded when the identified data was stored in the disk database; if the identified data has been queried, the arrival time of the identified data is the arrival time after the last query when the identified data was updated.

[0111] In this embodiment, when the remaining space of the disk database is lower than a preset value, that is, when the used space of the disk database is close to full (reaching 90% or more), a disk cleanup process is initiated. This process iterates through all the identifier data in the disk database and deletes the identifier data where currenttime - timein > tt2. If the disk database still lacks space after cleanup, it can be expanded.

[0112] It should be noted that the order of the above steps is only a specific example to illustrate the embodiments of the present invention. The present invention does not limit the order of the above steps, and those skilled in the art can adjust them as needed in practical applications; moreover, the order of execution is not limited by the number of the above steps.

[0113] The industrial internet identifier resolution caching method provided in this invention, when the first identifier data arrives, first determines whether the memory database has free space. If free space is available, the first identifier data is stored in both the memory database and the disk database. If no free space is available, only the first identifier data is stored in the disk database. When an identifier data query request is received, the method first queries the memory database for the requested second identifier data. If found, the second identifier data is returned directly. If not found, the method continues to query the disk database and returns the found second identifier data. Simultaneously, the validity period of all identifier data in the memory database is periodically verified. If the memory database releases space after all identifier data verification is completed, all identifier data in the disk database is sorted, and some identifier data is written to the memory database according to the sorting result. When the used space of the disk database is close to full, a disk cleanup process is initiated. This invention, by designing a new caching technology mechanism, can solve the technical problem in the prior art where the application load of each recursive node is different, resulting in excessive load and low caching efficiency for some recursive nodes.

[0114] Figure 3 This is a schematic diagram of a common recursive node provided in an embodiment of the present invention. Figure 3 As shown, the common recursive node includes: a judgment module 301, a control module 302, a recording module 303, a sorting module 304, and a selection module 305.

[0115] The system includes the following components: The judgment module 301 determines whether the memory database has free space when the first identifier data arrives. The control module 302 stores the first identifier data in both the memory database and the disk database when the judgment module determines that the memory database has free space; and directly stores the first identifier data in the disk database when the judgment module determines that the memory database does not have free space. The recording module 303 records the arrival time of the first identifier data in the disk database and sets the hit count of the first identifier data to a preset initial value when the first identifier data has been stored in the disk database. The recording module 303 is also configured to update the arrival time of the second identifier data to the current time and increment the hit count of the second identifier data in response to an identifier data query request and upon finding the requested second identifier data in the disk database. The sorting module 304 sets a sorting factor based on the arrival time and hit count of all identifier data in the disk database and sorts all identifier data based on the sorting factor. The selection module 305 selects a corresponding number of identifier data from the disk database based on the sorting result and the current free space size of the memory database. The control module 302 is further configured to write the identification data selected from the disk database into the memory database.

[0116] In one specific implementation, the common recursive node further includes a verification module 306.

[0117] The recording module 303 is further configured to record the arrival time of the first identifier data being stored in the memory database; and, in response to an identifier data query request and after finding the requested second identifier data in the memory database, update the arrival time of the second identifier data to the current time. The verification module 306 is configured to set a first storage validity period for each identifier data stored in the memory database; and, at preset intervals, perform validity period verification on all identifier data in the memory database, deleting identifier data in the memory database whose difference between the current time and the arrival time exceeds the first storage validity period. The judgment module 301 is further configured to determine whether space has been released in the memory database. The sorting module 304 is further configured to, when the judgment module determines that space has been released in the memory database, set a sorting factor based on the arrival time and hit count of all identifier data in the disk database, and sort all identifier data based on the sorting factor.

[0118] In one specific implementation, the selection module 305 is specifically configured to: select identification data from the disk database whose data volume does not exceed the size of the space released by the memory database, based on the sorting results and the size of the space released after the memory database completes the validity period verification.

[0119] In one specific implementation, the public recursive node further includes a query module 307.

[0120] The query module 307 is configured to, in response to an identifier data query request, first query the second identifier data requested by the identifier data query request in the memory database; in response to finding the requested second identifier data in the memory database, directly return the second identifier data; in response to not finding the requested second identifier data in the memory database, continue to query the requested second identifier data in the disk database; in response to finding the requested second identifier data in the disk database, return the second identifier data.

[0121] In one specific embodiment, the ranking factor is calculated using the following formula:

[0122] F = a * timein + b * hit

[0123] Where F is the sorting factor; timein is the arrival time of the identifier data. If the identifier data has not been queried, then timein is the arrival time when the identifier data is stored in the disk database. If the identifier data has been queried, then timein is the arrival time after the identifier data was last queried and updated. hit is the number of times the identifier data has been hit. If the identifier data has not been queried, then hit is the preset initial value. If the identifier data has been queried, then hit is the number of hits after the last query and update.

[0124] In one specific implementation, the common recursive node further includes a deletion module 308.

[0125] The deletion module 308 is configured to set a second storage validity period for each identifier data stored in the disk database, and determine whether the remaining space of the disk database is lower than a preset value. If it is lower, the identifier data in the disk database whose difference between the current time and the arrival time exceeds the second storage validity period will be deleted.

[0126] The public recursive node provided in this embodiment of the invention, when the first identifier data arrives, first determines whether the memory database has free space. If free space is available, the first identifier data is stored in both the memory database and the disk database. If no free space is available, the first identifier data is stored only in the disk database. When an identifier data query request is received, the node first queries the memory database for the requested second identifier data. If found, the second identifier data is returned directly. If not found, the node continues to query the disk database and returns the second identifier data. At the same time, the node periodically verifies the validity period of all identifier data in the memory database. If the memory database releases space after all identifier data verification is completed, all identifier data in the disk database is sorted, and some identifier data is written to the memory database according to the sorting result. The node also initiates a disk cleanup process when the used space in the disk database is nearly full. This invention, by designing a new caching technology mechanism, can solve the technical problem in the prior art where some recursive nodes are overloaded and have low caching efficiency due to differences in the application load of each recursive node.

[0127] Based on the same technical concept, embodiments of the present invention also provide a computer device, such as... Figure 4 As shown, the computer device includes a memory 41 and a processor 42. The memory 41 stores a computer program. When the processor 42 runs the computer program stored in the memory 41, the processor 42 executes the aforementioned industrial internet identifier resolution caching method.

[0128] Based on the same technical concept, this embodiment of the invention also provides a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, the processor executes the aforementioned industrial internet identifier resolution caching method.

[0129] In summary, the industrial internet identifier resolution caching method, apparatus, computer equipment, and storage medium provided in this embodiment of the invention, by designing a new caching technology mechanism, can solve the technical problem in the prior art where the application load of each recursive node is different, resulting in excessive load on some recursive nodes and low caching efficiency.

[0130] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An industrial internet identifier resolution and caching method, characterized in that, Applied to public recursive nodes, the caching architecture of public recursive nodes is divided into two parts: an in-memory database and a disk database. The method includes: In response to the arrival of the first identifier data, determine whether the memory database has free space. The first identifier data refers to the identifier data of the newly arrived common recursive node. If so, the first identifier data will be stored in the memory database and the disk database respectively; If not, the first identifier data is directly stored in the disk database; In response to the fact that the first identifier data has been stored in the disk database, the arrival time of the storage of the first identifier data in the disk database is recorded, and the number of hits of the first identifier data is set to a preset initial value; In response to the identification data query request and after finding the requested second identification data in the disk database, the arrival time of the second identification data is updated to the current time, and the hit count of the second identification data is incremented by one. The second identification data refers to the identification data that the public recursive node finds after receiving the identification data query request. A sorting factor is set based on the arrival time and hit count of all identified data in the disk database, and all identified data are sorted in descending order based on the sorting factor. Based on the sorting results and the current free space in the memory database, a corresponding number of identifier data are selected from the disk database, including new identifier data and identifier data that has been updated recently and queried frequently; and, The identifier data selected from the disk database is written to the in-memory database.

2. The method according to claim 1, characterized in that, After storing the first identifier data into the in-memory database, the following is also included: Record the arrival time of the first identifier data being stored in the in-memory database; and, In response to the identification data query request and after retrieving the requested second identification data from the in-memory database, update the arrival time of the second identification data to the current time; Before setting a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sorting all identified data based on the sorting factor, the method further includes: Set the first storage validity period for storing each identifier data in the in-memory database; Every preset period, the validity period of all identifier data in the in-memory database is checked, and identifier data in the in-memory database whose difference between the current time and the expected time exceeds the first storage validity period is deleted; and, Determine whether space has been released in the memory database. If so, set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor.

3. The method according to claim 2, characterized in that, The step of selecting a corresponding number of identifier data from the disk database based on the sorting results and the current free space size of the memory database is as follows: Based on the sorting results and the amount of space released after the memory database completes the validity period verification, select identifier data from the disk database whose data volume does not exceed the amount of space released by the memory database.

4. The method according to claim 1 or 2, characterized in that, Also includes: In response to the identification data query request, the second identification data requested by the identification data query request is first queried from the memory database; In response to finding the requested second identifier data in the in-memory database, the second identifier data is returned directly. If the requested second identifier data is not found in the memory database, the system continues to search for the requested second identifier data in the disk database. In response to finding the requested second identifier data in the disk database, the second identifier data is returned.

5. The method according to claim 1, characterized in that, The ranking factor is calculated using the following formula: F = a timein + b hit Where F is the sorting factor; timein is the arrival time of the identifier data. If the identifier data has not been queried, then timein is the arrival time when the identifier data is stored in the disk database. If the identifier data has been queried, then timein is the arrival time after the identifier data was last queried and updated. hit is the number of times the identifier data has been hit. If the identifier data has not been queried, then hit is the preset initial value. If the identifier data has been queried, then hit is the number of hits after the last query and update.

6. The method according to claim 1, characterized in that, Also includes: Set a second storage expiration period for storing each identifier data in the disk database; Determine if the remaining space of the disk database is lower than the preset value; If so, delete the identifier data in the disk database where the difference between the current time and the arrival time exceeds the second storage validity period.

7. A common recursive node, characterized in that, The caching architecture of the common recursive nodes is divided into two parts: an in-memory database and a disk database. The common recursive nodes include: The judgment module is set to determine whether the memory database has free space when the first identification data arrives. The first identification data refers to the identification data of the newly arrived common recursive node. The control module is configured to store the first identifier data into the memory database and the disk database respectively when the judgment result of the judgment module is that the memory database has free space; and to directly store the first identifier data into the disk database when the judgment result of the judgment module is that the memory database does not have free space. The recording module is configured to record the arrival time of the first identifier data being stored in the disk database when the first identifier data has been stored in the disk database, and to set the number of hits of the first identifier data to a preset initial value. The recording module is further configured to, in response to an identification data query request and after querying the requested second identification data in the disk database, update the arrival time of the second identification data to the current time, and increment the hit count of the second identification data by one. The second identification data refers to the identification data queried by the public recursive node after receiving the identification data query request. A sorting module is configured to set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data in descending order based on the sorting factor; and, The selection module is set to select a corresponding number of identifier data from the disk database based on the sorting results and the current free space of the memory database, in order to select new identifier data as well as identifier data that has been updated recently and queried many times. The control module is also configured to write the identification data selected from the disk database into the memory database.

8. The common recursive node according to claim 7, characterized in that, The recording module is further configured to record the arrival time of the first identifier data being stored in the memory database; and, in response to an identifier data query request and after the requested second identifier data is found in the memory database, to update the arrival time of the second identifier data to the current time. The common recursive node also includes: The verification module is configured to set the first storage validity period for each identifier data stored in the in-memory database; In addition, the validity period of all identifier data in the memory database is checked every preset period, and identifier data in the memory database whose difference between the current time and the arrival time exceeds the first storage validity period is deleted; The judgment module is also configured to determine whether space has been released in the memory database; The sorting module is further configured to, when the judgment module determines that space has been released in the memory database, set a sorting factor based on the arrival time and hit count of all identified data in the disk database, and sort all identified data based on the sorting factor.

9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the Industrial Internet Identifier Resolution Caching Method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the processor executes the Industrial Internet Identifier Resolution Caching Method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for optimizing performance of disk database by memory database technology

    CN102945251A

  • Data storage method and device, and storage medium

    CN108829344A

  • Data storage method and device, data query method and device, electronic equipment and storage medium

    CN112540984A