WO2016177283A1 - 缓存目录刷新方法和装置 - Google Patents
缓存目录刷新方法和装置 Download PDFInfo
- Publication number
- WO2016177283A1 WO2016177283A1 PCT/CN2016/079816 CN2016079816W WO2016177283A1 WO 2016177283 A1 WO2016177283 A1 WO 2016177283A1 CN 2016079816 W CN2016079816 W CN 2016079816W WO 2016177283 A1 WO2016177283 A1 WO 2016177283A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- cache directory
- content
- refresh
- directory
- refresh task
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
Definitions
- the present invention belongs to the field of the Internet, and in particular, to a cache directory refresh method and apparatus.
- the dictionary tree (Trie tree) is an ordered tree that holds an associative array, where the keys are usually strings.
- the power of Trie lies in its time complexity. Its insertion and query time complexity are both O(k), where k is the length of the key, regardless of how many elements are stored in the Trie.
- a typical application of the dictionary tree is for counting and sorting large numbers of strings (but not just strings), so it is often used by search engine systems for text word frequency statistics.
- Hash is to input any length of input (also known as pre-map, pre-image), through the hash algorithm, into a fixed-length output, the output is the hash value .
- This conversion is a compression map.
- the space of the hash value is usually much smaller than the input space. Different inputs may be hashed to the same output, so it is impossible to uniquely determine the input value from the hash value. Simply put, it is a function that compresses messages of any length into a fixed-length message digest.
- CDN Content Delivery Network
- the key technologies of the CDN are mainly content storage and distribution technologies.
- the basic principle of CDN is to widely use various cache servers to distribute these cache servers to areas or networks where users are relatively concentrated. When users visit websites, they use global load technology to point users' access to the closest working cache. On the server, the cache server directly responds to user requests.
- Refresh is an indispensable function for CDN to clear dirty data.
- the CDN cache system performs a refresh operation for each url in the directory.
- the specific process includes: 1.
- the CDN cache system receives the directory refresh notification; 2.
- the URL of each directory stored, Perform multiple disk I/O and string comparisons; 3. Find all the URLs stored in the directory and do the refresh operations one by one. This kind of processing not only requires a large amount of disk storage, but also the timeliness and accuracy cannot be guaranteed.
- the present application provides a cache directory refresh method and apparatus, which solves the technical problem that a file directory refresh requires a large amount of disk storage space and has low immediacy and accuracy.
- the present application discloses a cache directory refresh method, including: receiving a data request from a client, the data request including a URL address; in a directory structure established by a hash table and a hash dictionary tree, Querying a cache directory corresponding to the URL address; determining whether a refresh task is mounted in the cache directory; and when a refresh task is mounted in the cache directory, determining whether the content of the cache directory is saved earlier At the time of sending the refresh task; when the save time of the content in the cache directory is earlier than the release time of the refresh task, triggering a return source request of the cache directory to the source station, from the source The station refreshes the contents of the cache directory.
- the method further includes: when the refresh task is not mounted in the cache directory, determining whether the content in the cache directory has expired; and when the content in the cache directory has expired, triggering the cache directory back The source requests to the source station; the content under the cache directory is refreshed from the source station.
- querying the cache directory corresponding to the URL address includes: matching the domain name in the URL address in the hash table, In the hash dictionary tree corresponding to the domain name, the cache directory under the domain name is queried.
- the method further includes: receiving a refresh task; in the directory structure established by the hash table and the hash dictionary tree, hanging in a cache directory corresponding to the refresh task The refresh task is loaded and the delivery time of the refresh task is recorded.
- the method further includes: performing data persistence processing on the refresh task, and saving the refresh task in a disk.
- the refresh task includes an effective time period.
- the method further includes: sending the refreshed content in the cache directory to the client;
- the storage time of the file in the cache directory is later than the delivery time of the refresh task, or when the content in the cache directory is not expired, the content in the cache directory is sent to the client.
- the method further includes: determining whether the refresh task includes the effective time period; and when the refresh task includes the effective time period, determining the cache directory Whether the saving time of the content under the content is within the effective time period; when the saving time of the content in the cache directory is not within the effective time period, sending the content in the cache directory to the client Determining whether the saving time of the content in the cache directory is early when the saving time of the content in the cache directory is within the effective time period, or when the refreshing task does not include the effective time period At the time of sending the refresh task.
- the method further includes: when restarting, determining a valid refresh task saved in the disk according to a current time; loading the valid refresh task in the directory structure.
- the method further includes: recording the refreshed content in the cache directory on the disk a first offset; determining, by a preset duration, whether a current offset when the disk performs a write operation is the same as the first offset; a current offset when the disk performs a write operation When the first offset is the same, the refresh task in the cache directory is deleted.
- the present application discloses a cache directory refresh method, including: receiving a data request from a client, the data request including a URL address; in a directory structure established by a hash table and a hash dictionary tree, Querying the cache directory corresponding to the URL address; determining whether the refresh task is mounted in the cache directory; and when the refresh task is not mounted in the cache directory, determining whether the content in the cache directory has expired; When the content under the cache directory has expired, the source request of the cache directory is triggered to the source station; and the content under the cache directory is refreshed from the source station.
- the present application further discloses a cache directory refreshing apparatus, including: a first receiving module, configured to receive a data request from a client, the data request includes a URL address; and a query module, configured to In the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the URL address is queried; the first determining module is configured to determine whether the refresh task is mounted in the cache directory; and the second determining module uses When the cache task is mounted in the cache directory Determining whether the storage time of the content in the cache directory is earlier than the delivery time of the refresh task; the first source module is configured to save the file at the cache directory earlier than the refresh task At the time of the issuance, the source request of the cache directory is triggered to the source station, and the content under the cache directory is refreshed from the source station.
- the device further includes: a third determining module, configured to determine whether the content in the cache directory has expired when the refresh task is not mounted in the cache directory; and the second source module is configured to be used as the cache When the content under the directory has expired, the source request of the cache directory is triggered to the source station; and the content under the cache directory is refreshed from the source station.
- a third determining module configured to determine whether the content in the cache directory has expired when the refresh task is not mounted in the cache directory
- the second source module is configured to be used as the cache
- the query module includes: a matching sub-module, configured to match a domain name in the URL address in the hash table, and a query sub-module, configured to query in a hash dictionary tree corresponding to the domain name The cache directory under the domain name.
- the device further includes: a second receiving module, configured to receive a refresh task; and a processing module, configured to: in the directory structure established by the hash table and the hash dictionary tree, a cache directory corresponding to the refresh task The refresh task is mounted and the time of sending the refresh task is recorded.
- the device further includes: a saving module, configured to perform data persistence processing on the refresh task, and save the refresh task on a disk.
- the refresh task includes an effective time period.
- the device further includes: a first sending module, configured to send the refreshed content in the cache directory to the client; and a second sending module, configured to: when the file in the cache directory is saved later than When the time of sending the task is refreshed, or when the content in the cache directory is not expired, the content in the cache directory is sent to the client.
- a first sending module configured to send the refreshed content in the cache directory to the client
- a second sending module configured to: when the file in the cache directory is saved later than When the time of sending the task is refreshed, or when the content in the cache directory is not expired, the content in the cache directory is sent to the client.
- the device further includes: a fourth determining module, configured to determine whether the refreshing task includes the effective time period; and a fifth determining module, configured to determine the cache when the refreshing task includes the effective time period Whether the saving time of the content in the directory is within the effective time period; the third sending module is configured to send the cache directory when the saving time of the content in the cache directory is not within the effective time period The content of the content is sent to the client; the sixth determining module is configured to: when the saving time of the content in the cache directory is within the effective time period, or when the refresh task does not include the effective time period At the same time, it is determined whether the storage time of the content in the cache directory is earlier than the delivery time of the refresh task.
- the device further includes: a determining module, configured to determine, according to a current time, a valid refresh task saved in the disk when restarting; loading the valid refresh task in the directory structure.
- a determining module configured to determine, according to a current time, a valid refresh task saved in the disk when restarting; loading the valid refresh task in the directory structure.
- the device further includes: a recording module, configured to record a first offset of the refreshed content in the cache directory in the disk; and a seventh determining module, configured to determine, by using a preset duration, that the disk performs writing Whether the current offset is the same as the first offset; and the deleting module is configured to delete the current offset when the disk performs a write operation and the first offset is the same The refresh task under the cache directory.
- a recording module configured to record a first offset of the refreshed content in the cache directory in the disk
- a seventh determining module configured to determine, by using a preset duration, that the disk performs writing Whether the current offset is the same as the first offset
- the deleting module is configured to delete the current offset when the disk performs a write operation and the first offset is the same The refresh task under the cache directory.
- the present application further discloses a cache directory refreshing apparatus, including: a first receiving module, configured to receive a data request from a client, the data request includes a URL address; and a query module, configured to In the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the URL address is queried; the first determining module is configured to determine whether the refresh task is mounted in the cache directory; and the third determining module uses When the refresh task is not mounted in the cache directory, it is determined whether the content in the cache directory has expired; and the second source module is configured to trigger the cache when the content in the cache directory has expired.
- the source of the directory is requested to the source station; the content under the cache directory is refreshed from the source station.
- the present application can obtain the following technical effects: reducing the number of simultaneous refresh tasks, reducing the occupation of disk space, and determining whether the corresponding cache directory needs to be refreshed according to the data request of the client, ensuring that Timeliness and accuracy of data refresh.
- FIG. 1 is a schematic flowchart of a method for refreshing a cache directory according to an embodiment of the present application
- FIG. 2 is a schematic diagram of a directory structure of an embodiment of the present application.
- FIG. 3 is a schematic flowchart of a cache directory refresh method according to an embodiment of the present application.
- FIG. 4 is a schematic flowchart of a cache directory refresh method according to an embodiment of the present application.
- FIG. 5 is a schematic flowchart of a method for refreshing a cache directory according to an embodiment of the present application
- FIG. 6 is a schematic flowchart of a process of eliminating an expired refresh task according to an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a cache directory refresh apparatus according to an embodiment of the present application.
- FIG. 1 is a cache directory refresh method provided by an embodiment of the present application, which is applicable to a cache server device, and the method includes the following steps.
- step S101 a data request of the client is received, and the data request includes a URL address.
- the URL address includes a domain name and a directory, and the structure is: domain name / primary directory / secondary directory / ... / n directory (ie domain / path1/path2 / ... / pathn), such as abcd.com / e / fg / h .
- step S102 in the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the URL address is queried.
- the directory structure is stored in the memory of the cache server device, including a hash table and a hash trie, wherein the hash table is used to store the domain name, and the hash dictionary tree is used to establish the cache. Directory, each domain name corresponds to a hash dictionary tree, and the hash dictionary tree stores the cache directory under the domain name.
- the cache server device first matches the domain name of the URL address in the data request in the hash table, determines the hash dictionary tree corresponding to the domain name, and queries the cache directory under the domain name in the hash dictionary tree corresponding to the domain name.
- the node representing the primary directory is the parent node of each secondary directory node, and the corresponding cache directory is queried in the hash dictionary tree according to the directory hierarchy of the URL address. For example, the directory structure diagram shown in FIG.
- the process of querying the cache directory corresponding to abcd.com/e/fg/h is as follows: A1, a hash table in memory according to the hash value of the domain name abcd.com 20 matching the storage location 201 of the domain name abcd.com; A2, determining a hash dictionary tree 211 corresponding to the storage location 201 of the domain name abcd.com; A3, querying the representative string in the first-level node of the hash dictionary tree 211 The node a2 of e queries the node b3 representing the character string fg in the child node of the node a2, and queries the node c2 representing the character string h in the child node of the node b3.
- the system occupied by the million-level cache directory can be less than 200M, and the response time is less than 1 millisecond, so that the cache server device maintains high processing efficiency.
- step S103 it is determined whether a refresh task has been mounted in the cache directory.
- step S104 is performed; when the refresh task is not mounted in the cache directory, step S107 is performed.
- the cache server device When receiving the refresh task delivered by the source station, the cache server device does not immediately request the source station to refresh the content in the corresponding cache directory, but mounts the refresh task to the corresponding cache directory in the memory, and receives the When the data request of the client is requested, it is determined whether the content of the cache directory needs to be refreshed. In the mount command, the time of sending the refresh task is recorded by parameter mode. The cache server device determines whether a refresh task has been mounted in the cache directory corresponding to the URL address.
- step S104 it is determined whether the storage time of the content in the cache directory is earlier than the delivery time of the refresh task.
- step S105 is performed, and when the storage time of the file in the cache directory is later than the delivery time of the refresh task, step S108 is performed.
- step S105 the source request of the cache directory is triggered to the source station, and the content under the cache directory is refreshed from the source station.
- the content under the cache directory is saved earlier than the delivery time of the refresh task, the content under the cache directory is not refreshed, and the content under the cache directory is currently dirty data.
- the source request of the cache directory is triggered to the source station, and the content under the cache directory is refreshed from the source station, thereby eliminating the original dirty data.
- step S106 the content that is refreshed in the cache directory is sent to the client.
- step S107 it is determined whether the content under the cache directory has expired. When the content in the cache directory has expired, step S105 is performed; when the content in the cache directory is not expired, the steps are performed. S108.
- the cache server device has an expiration time for the cached data.
- the refresh task is not mounted in the cache directory, it is determined whether the content under the cache directory has expired. If it has expired, the content under the cache directory is dirty data, and needs to be performed. Refresh, triggering the corresponding return source request to the source station, refreshing the contents of the cache directory.
- step S108 the content under the cache directory is sent to the client.
- the content under the cache directory is the latest content, and can be directly returned to the client.
- the active refresh mode of the cache server device is changed to a passive failure of the content in the cache directory, and the mode of the content is refreshed to trigger the content refresh, thereby reducing the number of simultaneous refresh tasks and reducing the occupation of the disk space.
- the data request of the client determines whether the corresponding cache directory needs to be refreshed, ensures the timeliness and accuracy of the data refresh, and introduces a directory structure composed of a hash table and a hash dictionary tree in the memory, so that the million-level cache directory is occupied.
- the system memory is below 200M, and the response time is less than 1 millisecond, which makes the cache server device maintain high processing efficiency.
- the cache server device Before receiving the data request from the client, the cache server device needs to map the contents of the local disk storage into the memory, and establish a corresponding mapping directory structure in the memory, and the directory structure is composed of a hash table and a hash dictionary tree.
- the cache server device receives a refresh task from the source station, and the refresh task also includes a URL address consisting of a domain name and a directory, a domain name/primary directory/secondary directory/.../n directory (ie, domain/path1/path2/... /pathn).
- the cache server device After receiving the refresh task, the cache server device does not immediately refresh the content in the corresponding cache directory to the source station, but mounts the refresh task in the cache directory corresponding to the refresh task and records the delivery time of the refresh task.
- the mount command includes information such as parameters, device names, and mount points (that is, corresponding cache directories).
- the cache server device mounts the received refresh task to the corresponding cache directory, and records the delivery time of the refresh task in the form of parameters, thereby storing the data of the refresh task into the memory.
- the cache server performs data persistence processing on the data of the directory structure in the memory. Record the data of the directory structure to prevent data loss caused by abnormal restart of the cache server Lost.
- the cache server is abnormally down or restarted, and the memory data is lost, the data of the directory structure can be reloaded from the disk.
- a cache directory refresh method as shown in FIG. 3 is applicable to a cache server device, and the method includes the following steps.
- step S301 a refresh task is received, the refresh task including a first URL address.
- step S302 in the directory structure established by the hash table and the hash dictionary tree, the refresh task is mounted under the cache directory corresponding to the first URL address and the delivery time of the refresh task is recorded.
- step S303 a data request of the client is received, and the data request includes a first URL address.
- step S304 in the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the first URL address is queried.
- the refresh task is already mounted in the cache directory corresponding to the first URL address.
- step S305 it is determined whether the storage time of the content in the cache directory corresponding to the first URL address is earlier than the delivery time of the refresh task.
- step S306 is performed; when the saving time of the content in the cache directory corresponding to the first URL address is later than the refreshing task At the time of the transmission.
- step S306 the source request of the cache directory corresponding to the first URL address is triggered to the source station, and the content in the cache directory corresponding to the first URL address is refreshed from the source station.
- step S307 the content that is refreshed in the cache directory corresponding to the first URL address is sent to the client.
- step S308 the content in the cache directory corresponding to the first URL address is sent to the client.
- a cache directory refresh method as shown in FIG. 4 is applicable to a cache server device, and the method includes the following steps.
- step S401 a refresh task is received, the refresh task including a first URL address.
- step S402 in the directory structure established by the hash table and the hash dictionary tree, the refresh task is mounted under the cache directory corresponding to the first URL address and the delivery time of the refresh task is recorded.
- step S403 a data request of the client is received, and the data request includes a second URL address.
- step S404 in the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the second URL address is queried.
- the refresh task is not mounted in the cache directory corresponding to the second URL address.
- step S405 it is determined whether the content under the cache directory corresponding to the second URL address has expired.
- step S406 is performed; when the content of the cache directory corresponding to the second URL address is not expired, step S is performed.
- step S406 the source request of the cache directory corresponding to the second URL address is triggered to the source station, and the content in the cache directory corresponding to the second URL address is refreshed from the source station.
- step S407 the content that is refreshed in the cache directory corresponding to the second URL address is sent to the client.
- step S408 the content in the cache directory corresponding to the second URL address is sent to the client.
- the refresh task delivered by the source station belongs to a full refresh, and the refresh operation refreshes the normal data in the directory and the dirty data generated by the source station due to the refresh file, resulting in a decrease in the cache hit ratio and an increase in the return source cost.
- the dimension of the effective time period is added, and when the refresh task is sent, the start time (start timestamp) and the end time (end timestamp) can be explicitly specified, if the content in the cache is generated.
- the method includes the following steps.
- step S501 a refresh task is received, the refresh task including an effective time period.
- the refresh task includes the URL address abcd.com/e/fg/h, the effective time period is [m, n], and the delivery time is t1.
- step S502 data refresh processing is performed on the refresh task, and the refresh task is saved on the disk.
- the data of the refresh task is persisted, and the data of the refresh task is refreshed to the directory structure data saved by the disk according to the cache directory corresponding to the refresh task.
- step S503 in the directory structure established by the hash table and the hash dictionary tree, the refresh task is mounted under the cache directory corresponding to the refresh task, and the effective time period and the delivery time of the refresh task are recorded.
- the refresh task is mounted in the cache directory abcd.com/e/fg/h corresponding to the URL address in the memory, and the valid time period [m, n] of the refresh task and the delivery time t1 are recorded in the form of parameters.
- step S504 a data request of the client is received, and the data request includes a URL address.
- step S505 in the directory structure established by the hash table and the hash dictionary tree, the cache directory corresponding to the URL address is queried.
- step S506 it is determined whether a refresh task has been mounted under the cache directory.
- step S507 is performed; when the refresh task is not mounted in the cache directory, step S513 is performed.
- step S507 it is determined whether the refresh task includes an effective time period.
- step S508 is performed; when the refresh task does not include the effective time period, step S510 is performed.
- the cache server device determines whether the refresh task mounted in the cache directory includes an effective time period.
- step S508 it is determined whether the storage time of the content under the cache directory is within the effective time period. When the saving time of the content in the cache directory is within the effective time period, step S510 is performed, and when the saving time of the content in the cache directory is not within the effective time period, step S509 is performed.
- the URL address in the data request includes abcd.com/e/fg/h, and it is determined that the refresh task is mounted in the corresponding cache directory, and the refresh task includes the effective time period [m, n] and the delivery time. T1.
- the storage time of the content in the cache directory is t2, and it is determined whether the storage time t2 belongs to the effective time period [m, n].
- step S509 the content under the cache directory is sent to the client.
- step S508 When it is determined in step S508 that the saving time t2 of the content in the cache directory is not within the effective time period [m, n], the currently saved content in the cache directory does not need to be refreshed, and the content in the cache directory may be directly sent. To the client;
- step S510 when it is determined in step S510 that the storage time t2 of the content in the cache directory abcd.com/e/fg/h is later than the delivery time t1 of the refresh task, it represents the cache directory abcd.com/e/fg/h. of The content has been refreshed, no need to refresh the operation, you can directly send the contents of the cache directory to the client;
- step S513 when it is determined in step S513 that the refresh task is not mounted under the cache directory abcd.com/e/dh/c and the content is not expired, the content in the cache directory may be directly sent to the client.
- step S510 it is determined whether the storage time of the content in the cache directory is earlier than the delivery time of the refresh task.
- step S511 is performed; when the storage time of the content in the cache directory is later than the delivery time of the refresh task, step S509 is performed.
- step S511 the source request of the cache directory is triggered to the source station, and the content under the cache directory is refreshed from the source station.
- step S510 When it is determined in step S510 that the storage time t2 of the content in the cache directory abcd.com/e/fg/h is earlier than the delivery time t1 of the refresh task, after the refresh task is mounted on the cache directory, the content has not been refreshed. At this time, the source request of the cache directory abcd.com/e/fg/h is triggered to the source station, and the content under the cache directory abcd.com/e/fg/h is refreshed from the source station;
- step S513 when it is determined in step S513 that the refresh task is not mounted in the cache directory abcd.com/e/dh/c, but the content has expired, the content in the cache directory needs to be refreshed back to the source station, and the cache directory abcd is triggered.
- the .com/e/dh/c source request is sent to the source station, and the contents of the cache directory abcd.com/e/dh/c are refreshed from the source station.
- step S512 the content that is refreshed in the cache directory is sent to the client.
- the cache server After the cache server refreshes the content in the cache directory corresponding to the URL address in the data request, the cached content is sent to the client.
- step S513 it is determined whether the content under the cache directory has expired. When the content under the cache directory has expired, step S511 is performed; when the content under the cache directory has not expired, step S509 is performed.
- the cache directory corresponding to the URL address is queried and the refresh task is not mounted, the cache directory abcd.com/e/dh/c is further determined. Whether the content below has expired.
- the embodiment of the present application adds a dimension of the effective time period to the refresh task, and when the refresh task is sent You can specify the effective time period.
- the content save time in the cache directory is not refreshed within the effective time range. You can continue to return directly to the client. This not only improves the cache hit rate, but also reduces the total refresh rate. The problem of returning source traffic increases.
- the refresh task performs data persistence and writes to the disk.
- the valid refresh task saved in the disk is determined according to the current time, that is, if the current time is within the effective time period of the refresh task, it is determined that the refresh task is valid. Load all the current valid refresh tasks on the disk into the in-memory directory structure, and only load the still valid refresh task after the cache server device restarts, so that the hash dictionary tree in the in-memory directory structure can be quickly reconstructed and the reconstruction is reduced. After the directory structure is occupied by memory.
- the cached content newly written by the refresh operation will overwrite the data that has not been accessed for a long time. It can be understood that the cached content will cyclically write the entire disk space. If you write a disk after a circle, the previous content will be overwritten, but in the prior art, the refresh task for these contents is still in the memory directory structure, and these tasks are also required to be unneeded.
- the embodiment of the present application eliminates the refresh task mounted in the cache directory where the content that has been covered is located. As shown in FIG. 6, the method includes the following steps.
- step S601 a source request of the cache directory is triggered to the source station, and the content under the cache directory is refreshed from the source station.
- step S602 the first offset of the content after the refresh in the cache directory on the disk is recorded.
- step S603 it is determined whether the current offset amount when the disk performs the write operation is the same as the first offset amount every preset time length.
- step S604 is performed; when the current offset of the disk when the write operation is performed is different from the first offset, the flow ends, Do anything.
- the cache server device detects the current offset when the write operation is performed every preset time period, and determines Whether the first offset is the same as the current offset when the disk performs a write operation.
- step S604 the refresh task in the cache directory is deleted.
- the refresh task mounted in the cache directory needs to be eliminated accordingly. Therefore, the refresh task mounted in the cache directory abcd.com/e/fg/h is deleted, thereby reducing the memory usage of the directory structure and reducing the time taken to load the directory structure in memory during the restart.
- FIG. 7 is a cache directory refresh apparatus provided by an embodiment of the present application, where the apparatus includes:
- the first receiving module 70 is configured to receive a data request of the client, where the data request includes a URL address;
- the query module 71 is configured to query, in a directory structure established by the hash table and the hash dictionary tree, a cache directory corresponding to the URL address;
- the first determining module 72 is configured to determine whether a refresh task is mounted in the cache directory.
- the second determining module 73 is configured to determine, when the refresh task is mounted in the cache directory, whether the saving time of the content in the cache directory is earlier than the sending time of the refresh task;
- the first source module 74 is configured to trigger a return source request of the cache directory to the source station when the save time of the file in the cache directory is earlier than the release time of the refresh task, and refresh the content in the cache directory from the source station.
- the device further includes: a third determining module 75, configured to determine, when the refresh task is not mounted in the cache directory, whether the content in the cache directory has expired;
- the second source module 76 is configured to trigger a return source request of the cache directory to the source station when the content in the cache directory has expired; and refresh the content in the cache directory from the source station.
- the query module 71 includes:
- the query sub-module is configured to query the cache under the domain name in the hash dictionary tree corresponding to the domain name. table of Contents.
- the apparatus further comprises:
- a second receiving module configured to receive a refresh task
- the processing module is configured to mount a refresh task in a cache directory corresponding to the refresh task and record a delivery time of the refresh task in a directory structure established by the hash table and the hash dictionary tree.
- the apparatus further comprises:
- the save module is used to perform data persistence processing on the refresh task, and save the refresh task on the disk.
- the refresh task includes an effective time period.
- the apparatus further comprises:
- a first sending module configured to send the refreshed content in the cache directory to the client
- the second sending module is configured to: when the storage time of the file in the cache directory is later than the sending time of the refresh task, or when the content in the cache directory is not expired, send the content in the cache directory to the client.
- the apparatus further comprises:
- a fourth determining module configured to determine whether the refresh task includes an effective time period
- a fifth determining module configured to determine, when the refreshing task includes an effective time period, whether the saving time of the content in the cache directory is within an effective time period
- a third sending module configured to send the content in the cache directory to the client when the saving time of the content in the cache directory is not within the effective time period
- the sixth judging module is configured to: when the saving time of the content in the cache directory is within the effective time period, or when the refreshing task does not include the effective time period, determine whether the saving time of the content in the cache directory is earlier than the refreshing task Delivery time.
- the apparatus further comprises:
- the apparatus further comprises:
- a recording module configured to record a first offset of the refreshed content in the cache directory on the disk
- a seventh determining module configured to determine, according to the preset duration, whether the current offset when the disk performs the writing operation is the same as the first offset
- the delete module is used to delete the refresh task in the cache directory when the current offset of the disk is the same as the first offset when the write operation is performed.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
- the first device can be directly electrically coupled to the second device or electrically coupled to the second device indirectly through other devices or coupling means.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种缓存目录刷新方法,包括:接收到客户端的数据请求;在由哈希表和哈希字典树建立的目录结构中,查询到URL地址对应的缓存目录;判断缓存目录下是否已挂载刷新任务;当缓存目录下已挂载刷新任务时,判断缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻;当缓存目录下的内容的保存时刻早于刷新任务的下发时刻时,触发缓存目录的回源请求至源站,从源站刷新缓存目录下的内容。减少了缓存服务器磁盘空间的占用,保证了数据刷新的及时性和准确性。
Description
本发明属于互联网领域,具体地说,涉及一种缓存目录刷新方法和装置。
字典树(Trie树),是一种有序的树,用于保存关联数组,其中的键通常是字符串。Trie的强大之处就在于它的时间复杂度。它的插入和查询时间复杂度都为O(k),其中k为key的长度,与Trie中保存了多少个元素无关。字典树的典型应用是用于统计和排序大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。
Hash,一般译做“散列”或“哈希”,就是把任意长度的输入(又叫做预映射,pre-image),通过散列算法,变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,所以不可能从散列值来唯一的确定输入值。简单的说就是一种将任意长度的消息压缩到某一固定长度的消息摘要的函数。
CDN(Content Delivery Network,内容分发网络)是构建在网络之上的内容分发网络,依靠部署在各地的边缘服务器,通过中心平台的负载均衡、内容分发、调度等功能模块,使用户就近获取所需内容,降低网络拥塞,提高用户访问响应速度和命中率。CDN的关键技术主要有内容存储和分发技术。CDN的基本原理是广泛采用各种缓存服务器,将这些缓存服务器分布到用户访问相对集中的地区或网络中,在用户访问网站时,利用全局负载技术将用户的访问指向距离最近的工作正常的缓存服务器上,由缓存服务器直接响应用户请求。
刷新是CDN清除脏数据不可或缺的功能,目前CDN缓存系统是通过针对目录下的每个url执行刷新操作,其具体过程包括:1、CDN缓存系统接收到目录刷新通知;2、根据磁盘已记录的每个目录存储的URL,
进行多次磁盘I/O和字符串比较;3、找出目录下存储的全部URL,逐一做刷新操作。这种处理方式不但需要占用大量的磁盘存储,而且及时性和准确性都不能得到保证。
发明内容
有鉴于此,本申请提供了一种缓存目录刷新方法和装置,解决了文件目录刷新需占用大量的磁盘存储空间并且即时性和准确性较低的技术问题。
为了解决上述技术问题,本申请公开了一种缓存目录刷新方法,包括:接收到客户端的数据请求,所述数据请求包括URL地址;在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;判断所述缓存目录下是否已挂载刷新任务;当所述缓存目录下已挂载刷新任务时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻;当所述缓存目录下的内容的保存时刻早于所述刷新任务的下发时刻时,触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容。
所述方法还包括:当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
所述在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录包括:在所述哈希表中匹配出所述URL地址中的域名,在与所述域名对应的哈希字典树中,查询到所述域名下的缓存目录。
所述接收到客户端的数据请求之前,所述方法还包括:接收到刷新任务;在所述由哈希表和哈希字典树建立的目录结构中,在所述刷新任务对应的缓存目录下挂载刷新任务并记录所述刷新任务的下发时刻。
所述接收到刷新任务之后,所述方法还包括:对所述刷新任务进行数据持久化处理,在磁盘中保存所述刷新任务。
所述刷新任务包括生效时间段。
所述方法还包括:发送所述缓存目录下刷新后的内容至所述客户端;当
所述缓存目录下的文件的保存时刻晚于所述刷新任务的下发时刻时,或者当所述缓存目录下的内容未过期时,发送所述缓存目录下的内容至所述客户端。
当所述缓存目录下已挂载刷新任务时,所述方法还包括:判断所述刷新任务是否包括所述生效时间段;当所述刷新任务包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否在所述生效时间段之内;当所述缓存目录下的内容的保存时刻不在所述生效时间段之内时,发送所述缓存目录下的内容至所述客户端;当所述缓存目录下的内容的保存时刻在所述生效时间段之内时,或者当所述刷新任务不包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻。
所述方法还包括:当重新启动时,根据当前时间确定所述磁盘中保存的有效的刷新任务;在所述目录结构中加载所述有效的刷新任务。
所述触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容之后,所述方法还包括:记录所述缓存目录下刷新后的内容在磁盘中的第一偏移量;每隔预设时长判断所述磁盘执行写入操作时的当前偏移量与所述第一偏移量是否相同;当所述磁盘执行写入操作时的当前偏移量与所述第一偏移量相同时,删除所述缓存目录下的所述刷新任务。
为了解决上述技术问题,本申请公开了一种缓存目录刷新方法,包括:接收到客户端的数据请求,所述数据请求包括URL地址;在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;判断所述缓存目录下是否已挂载刷新任务;当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
为了解决上述技术问题,本申请还公开了一种缓存目录刷新装置,包括:第一接收模块,用于接收到客户端的数据请求,所述数据请求包括URL地址;查询模块,用于在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;第一判断模块,用于判断所述缓存目录下是否已挂载刷新任务;第二判断模块,用于当所述缓存目录下已挂载刷新任务
时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻;第一回源模块,用于当所述缓存目录下的文件的保存时刻早于所述刷新任务的下发时刻时,触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容。
所述装置还包括:第三判断模块,用于当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;第二回源模块,用于当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
所述查询模块包括:匹配子模块,用于在所述哈希表中匹配出所述URL地址中的域名,查询子模块,用于在与所述域名对应的哈希字典树中,查询到所述域名下的缓存目录。
所述装置还包括:第二接收模块,用于接收到刷新任务;处理模块,用于在所述由哈希表和哈希字典树建立的目录结构中,在所述刷新任务对应的缓存目录下挂载刷新任务并记录所述刷新任务的下发时刻。
所述装置还包括:保存模块,用于对所述刷新任务进行数据持久化处理,在磁盘中保存所述刷新任务。
所述刷新任务包括生效时间段。
所述装置还包括:第一发送模块,用于发送所述缓存目录下刷新后的内容至所述客户端;第二发送模块,用于当所述缓存目录下的文件的保存时刻晚于所述刷新任务的下发时刻时,或者当所述缓存目录下的内容未过期时,发送所述缓存目录下的内容至所述客户端。
所述装置还包括:第四判断模块,用于判断所述刷新任务是否包括所述生效时间段;第五判断模块,用于当所述刷新任务包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否在所述生效时间段之内;第三发送模块,用于当所述缓存目录下的内容的保存时刻不在所述生效时间段之内时,发送所述缓存目录下的内容至所述客户端;第六判断模块,用于当所述缓存目录下的内容的保存时刻在所述生效时间段之内时,或者当所述刷新任务不包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻。
所述装置还包括:确定模块,用于当重新启动时,根据当前时间确定所述磁盘中保存的有效的刷新任务;在所述目录结构中加载所述有效的刷新任务。
所述装置还包括:记录模块,用于记录所述缓存目录下刷新后的内容在磁盘中的第一偏移量;第七判断模块,用于每隔预设时长判断所述磁盘执行写入操作时的当前偏移量与所述第一偏移量是否相同;删除模块,用于当所述磁盘执行写入操作时的当前偏移量与所述第一偏移量相同时,删除所述缓存目录下的所述刷新任务。
为了解决上述技术问题,本申请还公开了一种缓存目录刷新装置,包括:第一接收模块,用于接收到客户端的数据请求,所述数据请求包括URL地址;查询模块,用于在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;第一判断模块,用于判断所述缓存目录下是否已挂载刷新任务;第三判断模块,用于当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;第二回源模块,用于当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
与现有技术相比,本申请可以获得包括以下技术效果:降低了同时进行的刷新任务的数量,减少了对磁盘空间的占用,根据客户端的数据请求判断相应的缓存目录是否需要刷新,保证了数据刷新的及时性和准确性。
当然,实施本申请的任一产品必不一定需要同时达到以上所述的所有技术效果。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是本申请实施例的一种缓存目录刷新方法的流程示意图;
图2是本申请实施例的目录结构示意图。
图3是本申请实施例的一种缓存目录刷新方法的流程示意图;
图4是本申请实施例的一种缓存目录刷新方法的流程示意图;
图5是本申请实施例的一种缓存目录刷新方法的流程示意图;
图6是本申请实施例的淘汰过期刷新任务的流程示意图;
图7是本申请实施例的一种缓存目录刷新装置的结构示意图。
以下将配合附图及实施例来详细说明本发明的实施方式,藉此对本发明如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解并据以实施。
图1是本申请实施例提供的一种缓存目录刷新方法,适用于缓存服务器设备,该方法包括以下步骤。
在步骤S101中,接收到客户端的数据请求,数据请求包括URL地址。
该URL地址包括域名和目录,其结构为:域名/一级目录/二级目录/…/n级目录(即domain/path1/path2/…/pathn),例如abcd.com/e/fg/h。
在步骤S102中,在由哈希表和哈希字典树建立的目录结构中,查询到URL地址对应的缓存目录。
该目录结构存储于缓存服务器设备的内存中,包括哈希表(hash table)和哈希字典树(hash trie)两部分,其中,哈希表用于存储域名,哈希字典树用于建立缓存目录,每个域名对应着一个哈希字典树,该哈希字典树存储该域名下的缓存目录。
缓存服务器设备首先在哈希表中匹配出数据请求中URL地址的域名,确定该域名对应的哈希字典树,在与该域名对应的哈希字典树中查询该域名下的缓存目录。在哈希字典树中,代表一级目录的节点是其每个二级目录节点的父节点,根据URL地址的目录层级,在哈希字典树中逐级查询到相应的缓存目录。例如图2所示的目录结构示意图,查询abcd.com/e/fg/h对应的缓存目录的过程如下:A1、根据域名abcd.com的哈希值在内存中的哈希表
20匹配到域名abcd.com的存储位置201;A2、确定与域名abcd.com的存储位置201对应的哈希字典树211;A3、在哈希字典树211的一级节点中查询到代表字符串e的节点a2,在节点a2的子节点中查询到代表字符串fg的节点b3,在节点b3的子节点中查询到代表字符串h的节点c2。
采用上述目录结构可以使百万级的缓存目录所占用的系统内存在200M以下,对响应时间的影响在1毫秒以下,使缓存服务器设备保持较高的处理效率。
在步骤S103中,判断缓存目录下是否已挂载刷新任务。当缓存目录下已挂载刷新任务时,执行步骤S104;当缓存目录下未挂载刷新任务时,执行步骤S107。
缓存服务器设备接收到源站下发的刷新任务时,不会立刻主动向该源站请求刷新相应的缓存目录下的内容,而会将刷新任务挂载到内存中相应的缓存目录,接收到来自客户端的数据请求时再判断是否需要刷新该缓存目录下的内容,在挂载命令中通过参数方式记录刷新任务的下发时刻。缓存服务器设备判断与URL地址对应的缓存目录下是否已挂载刷新任务。
在步骤S104中,判断缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻。当缓存目录下的内容的保存时刻早于刷新任务的下发时刻时,执行步骤S105,当缓存目录下的文件的保存时刻晚于刷新任务的下发时刻时,执行步骤S108。
在步骤S105中,触发缓存目录的回源请求至源站,从源站刷新缓存目录下的内容。
如果缓存目录下的内容的保存时刻早于刷新任务的下发时刻,代表该缓存目录下的内容还没有刷新,该缓存目录下的内容目前属于脏数据。此时触发该缓存目录的回源请求至源站,从源站刷新该缓存目录下的内容,从而淘汰原有的脏数据。
在步骤S106中,发送缓存目录下刷新后的内容至客户端。
在步骤S107中,判断缓存目录下的内容是否已过期。当缓存目录下的内容已过期时,执行步骤S105;当缓存目录下的内容未过期时,执行步骤
S108。
缓存服务器设备对缓存数据设有过期时间,当缓存目录下未挂载刷新任务时,判断该缓存目录下的内容是否已过期,如果已过期则代表该缓存目录下的内容属于脏数据,需要进行刷新,从而触发相应的回源请求至源站,刷新该缓存目录下的内容。
在步骤S108中,发送缓存目录下的内容至客户端。
当缓存目录下的文件的保存时刻晚于刷新任务的下发时刻时,或者当缓存目录下的内容未过期时,代表该缓存目录下的内容已是最新的内容,可以直接返回给客户端。
本申请实施例将缓存服务器设备的主动刷新模式变为缓存目录下内容的被动失效而触发回源来刷新内容的模式,降低了同时进行的刷新任务的数量,减少了对磁盘空间的占用,根据客户端的数据请求判断相应的缓存目录是否需要刷新,保证了数据刷新的及时性和准确性,同时在内存中引入哈希表和哈希字典树组成的目录结构,使得百万级缓存目录所占用的系统内存在200M以下,对于响应时间的影响在1毫秒以下,使缓存服务器设备保持较高的处理效率。
缓存服务器设备在接收到客户端的数据请求之前,需要将本地磁盘存储的内容映射到内存中,在内存中建立相应的映射目录结构,该目录结构由哈希表和哈希字典树组成。缓存服务器设备接收到来自源站的刷新任务,该刷新任务也包括由域名和目录组成的URL地址,域名/一级目录/二级目录/…/n级目录(即domain/path1/path2/…/pathn)。缓存服务器设备接收到刷新任务后,不会立刻向源站刷新相应的缓存目录下的内容,而是在刷新任务对应的缓存目录下挂载刷新任务并记录刷新任务的下发时刻。该挂载命令中包括参数、设备名称、挂载点(即相应的缓存目录)等信息。缓存服务器设备将接收到的刷新任务挂载到相应的缓存目录下,并以参数的形式记录该刷新任务的下发时刻,从而将刷新任务的数据存储到了内存中。而缓存服务器出现异常宕机或重启时,内存中的数据会丢失,因此,在一个实施例中,缓存服务器接收到刷新任务后,对内存中的目录结构的数据进行数据持久化处理,在磁盘中记录目录结构的数据,以防止缓存服务器异常重启而造成的数据丢
失。当缓存服务器出现异常宕机或重启,内存数据丢失时,可以从磁盘中重新加载目录结构的数据。
在一个实施例中,如图3所示的一种缓存目录刷新方法,适用于缓存服务器设备,该方法包括以下步骤。
在步骤S301中,接收到刷新任务,所述刷新任务包括第一URL地址。
在步骤S302中,在由哈希表和哈希字典树建立的目录结构中,在第一URL地址对应的缓存目录下挂载该刷新任务并记录该刷新任务的下发时刻。
在步骤S303中,接收到客户端的数据请求,数据请求包括第一URL地址。
在步骤S304中,在由哈希表和哈希字典树建立的目录结构中,查询到第一URL地址对应的缓存目录。
此时第一URL地址对应的缓存目录下已挂载了刷新任务。
在步骤S305中,判断第一URL地址对应的缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻。当第一URL地址对应的缓存目录下的内容的保存时刻早于刷新任务的下发时刻时,执行步骤S306;当第一URL地址对应的缓存目录下的内容的保存时刻晚于刷新任务的下发时刻时,执行步骤S308。
在步骤S306中,触发第一URL地址对应的缓存目录的回源请求至源站,从源站刷新第一URL地址对应的缓存目录下的内容。
在步骤S307中,发送第一URL地址对应的缓存目录下刷新后的内容至客户端。
在步骤S308中,发送第一URL地址对应的缓存目录下的内容至客户端。
在一个实施例中,如图4所示的一种缓存目录刷新方法,适用于缓存服务器设备,该方法包括以下步骤。
在步骤S401中,接收到刷新任务,所述刷新任务包括第一URL地址。
在步骤S402中,在由哈希表和哈希字典树建立的目录结构中,在第一URL地址对应的缓存目录下挂载该刷新任务并记录该刷新任务的下发时刻。
在步骤S403中,接收到客户端的数据请求,数据请求包括第二URL地址。
在步骤S404中,在由哈希表和哈希字典树建立的目录结构中,查询到第二URL地址对应的缓存目录。
此时第二URL地址对应的缓存目录下未挂载刷新任务。
在步骤S405中,判断第二URL地址对应的缓存目录下的内容是否已过期。当第二URL地址对应的缓存目录下的内容已过期时,执行步骤S406;当第二URL地址对应的缓存目录下的内容未过期时,执行步骤S
在步骤S406中,触发第二URL地址对应的缓存目录的回源请求至源站,从源站刷新第二URL地址对应的缓存目录下的内容。
在步骤S407中,发送第二URL地址对应的缓存目录下刷新后的内容至客户端。
在步骤S408中,发送第二URL地址对应的缓存目录下的内容至客户端。在现有技术中,源站下发的刷新任务属于全量刷新,刷新操作会将该目录下的正常数据和源站由于刷新文件产生的脏数据一起刷新,造成缓存命中率下降和回源成本增加的问题。本申请实施例的刷新任务中增加了生效时间段的维度,在刷新任务下发时可以明确指定生效的起始时间(start timestamp)和结束时间(end timestamp),如果缓存中的内容生成时间点不在这一生效时间段[start,end]范围之内,则都不会被刷掉,还可以继续直接返回给客户端,不仅提高了缓存命中率,也减少了因刷新引起的回源流量增加的问题。如图5所示,该方法包括以下步骤。
在步骤S501中,接收到刷新任务,该刷新任务包括生效时间段。
例如,该刷新任务中包括URL地址abcd.com/e/fg/h,生效时间段为[m,n],下发时刻为t1。
在步骤S502中,对刷新任务的进行数据持久化处理,在磁盘中保存刷新任务。
接收到刷新任务时,将刷新任务的数据进行持久化处理,根据该刷新任务对应的缓存目录,将刷新任务的数据刷新到磁盘保存的目录结构数据中。
在步骤S503中,在由哈希表和哈希字典树建立的目录结构中,在刷新任务对应的缓存目录下挂载刷新任务并记录刷新任务的生效时间段和下发时刻。
将刷新任务挂载到内存中与URL地址对应的缓存目录abcd.com/e/fg/h中,并以参数的形式记录刷新任务的生效时间段[m,n]以及下发时刻t1。
在步骤S504中,接收到客户端的数据请求,数据请求包括URL地址。
在步骤S505中,在由哈希表和哈希字典树建立的目录结构中,查询到URL地址对应的缓存目录。
在步骤S506中,判断缓存目录下是否已挂载刷新任务。当缓存目录下已挂载刷新任务时,执行步骤S507;当缓存目录下未挂载刷新任务时,执行步骤S513。
在步骤S507中,判断刷新任务是否包括生效时间段。当刷新任务包括生效时间段时,执行步骤S508;当刷新任务不包括生效时间段时,执行步骤S510。
缓存服务器设备判断缓存目录中挂载的刷新任务是否包括生效时间段。
在步骤S508中,判断缓存目录下的内容的保存时刻是否在生效时间段之内。当缓存目录下的内容的保存时刻在生效时间段之内时,执行步骤S510,当缓存目录下的内容的保存时刻不在生效时间段之内时,执行步骤S509
例如,数据请求中的URL地址包括abcd.com/e/fg/h,判断出相应的缓存目录中已挂载刷新任务,且该刷新任务中包括生效时间段[m,n]和下发时刻t1。该缓存目录下的内容的保存时刻为t2,判断保存时刻t2是否属于生效时间段[m,n]。
在步骤S509中,发送缓存目录下的内容至客户端。
当步骤S508判断出缓存目录下的内容的保存时刻t2不在生效时间段[m,n]之内时,该缓存目录下当前保存的内容不需要进行刷新操作,可以直接将缓存目录下的内容发送至客户端;
或者,当步骤S510判断出缓存目录abcd.com/e/fg/h下的内容的保存时刻t2晚于刷新任务的下发时刻t1时,代表该缓存目录abcd.com/e/fg/h下的
内容已经被刷新,不需要再进行刷新操作,可以直接将缓存目录下的内容发送至客户端;
或者,当步骤S513判断出缓存目录abcd.com/e/dh/c下未挂载刷新任务并且内容未过期时,可以直接将缓存目录下的内容发送至客户端。
在步骤S510中,判断缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻。当缓存目录下的内容的保存时刻早于刷新任务的下发时刻时,执行步骤S511;当缓存目录下的内容的保存时刻晚于刷新任务的下发时刻时,执行步骤S509。
在步骤S511中,触发缓存目录的回源请求至源站,从源站刷新缓存目录下的内容。
当步骤S510判断出缓存目录abcd.com/e/fg/h下的内容的保存时刻t2早于刷新任务的下发时刻t1时,代表该缓存目录挂载刷新任务后,内容还没有进行刷新,此时触发缓存目录abcd.com/e/fg/h的回源请求至源站,从源站刷新缓存目录abcd.com/e/fg/h下的内容;
或者,当步骤S513判断出缓存目录abcd.com/e/dh/c下未挂载刷新任务但内容已过期时,需要向源站回源刷新该缓存目录下的内容,此时触发缓存目录abcd.com/e/dh/c的回源请求至源站,从源站刷新缓存目录abcd.com/e/dh/c下的内容。
在步骤S512中,发送缓存目录下刷新后的内容至客户端。
缓存服务器对数据请求中的URL地址对应的缓存目录下的内容进行刷新后,将刷新后的内容发送至客户端。
在步骤S513中,判断缓存目录下的内容是否已过期。当缓存目录下的内容已过期时,执行步骤S511;当缓存目录下的内容未过期时,执行步骤S509。
例如,数据请求中的URL地址包括abcd.com/e/dh/c,查询到该URL地址对应的缓存目录并没有挂载刷新任务,则进一步判断该缓存目录abcd.com/e/dh/c下的内容是否已过期。
本申请实施例为刷新任务增加了生效时间段的维度,在刷新任务下发时
可以明确指定生效时间段,缓存目录下的内容保存时刻不在生效时间段之内就不会被刷新,还可以继续直接返回给客户端,不仅提高了缓存命中率,也减少了因全量刷新引起的回源流量增加的问题。
缓存服务器设备接收到的刷新任务包括生效时间段时,为了防止重启时内存数据丢失,将刷新任务进行数据持久化,写入到磁盘中。缓存服务器设备重启时,根据当前时间确定磁盘中保存的有效的刷新任务,即当前时间如果在刷新任务的生效时间段之内,则确定刷新任务有效。将磁盘中当前所有有效的刷新任务加载到内存中的目录结构中,在缓存服务器设备重启后只加载仍然有效的刷新任务,从而可以快速重建内存中的目录结构中的哈希字典树并且降低重建后的目录结构对内存的占用。
由于缓存服务器容量的限制,经过刷新操作新写入的缓存内容会覆盖之前很久没有访问的数据,可以理解为缓存内容会循环写整个磁盘空间。如果写磁盘一圈之后,之前的内容都会被覆盖淘汰,但现有技术中,针对这些内容的刷新任务还在内存的目录结构中,还要对这些任务做不必要的校验。本申请实施例会对已被覆盖的内容所在的缓存目录中所挂载的刷新任务进行淘汰,如图6所示,该方法包括以下步骤。
在步骤S601中,触发缓存目录的回源请求至源站,从源站刷新缓存目录下的内容。
例如,刷新缓存目录abcd.com/e/fg/h下的内容。
在步骤S602中,记录缓存目录下刷新后的内容在磁盘中的第一偏移量。
缓存目录abcd.com/e/fg/h下刷新后的内容写入到磁盘时,记录该刷新后的内容在磁盘中的第一偏移量,通过该第一偏移量确定刷新后的内容在磁盘中的写入位置。
在步骤S603中,每隔预设时长判断磁盘执行写入操作时的当前偏移量与第一偏移量是否相同。当磁盘执行写入操作时的当前偏移量与第一偏移量相同时,执行步骤S604;当磁盘执行写入操作时的当前偏移量与第一偏移量不同时,流程结束,不进行任何操作。
缓存服务器设备每隔预设时长检测执行写入操作时的当前偏移量,判断
第一偏移量是否与磁盘执行写入操作时的当前偏移量相同。
在步骤S604中,删除缓存目录下的刷新任务。
当磁盘执行写入操作时的当前偏移量与第一偏移量相同时,代表磁盘已经完整的写过了一圈,例如在磁盘的第一偏移量位置处写入的缓存目录abcd.com/e/fg/h下的内容已经被其他数据覆盖,不会再有针对该内容的数据请求,在内存空间建立的目录结构中该缓存目录下挂载的刷新任务也需要相应的淘汰掉,因此将内存中该缓存目录abcd.com/e/fg/h下挂载的刷新任务删除,从而减少了目录结构的内存占用,也减少了重启时在内存中加载目录结构所耗费的时间。
图7是本申请实施例提供的一种缓存目录刷新装置,该装置包括:
第一接收模块70,用于接收到客户端的数据请求,数据请求包括URL地址;
查询模块71,用于在由哈希表和哈希字典树建立的目录结构中,查询到URL地址对应的缓存目录;
第一判断模块72,用于判断缓存目录下是否已挂载刷新任务;
第二判断模块73,用于当缓存目录下已挂载刷新任务时,判断缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻;
第一回源模块74,用于当缓存目录下的文件的保存时刻早于刷新任务的下发时刻时,触发缓存目录的回源请求至源站,从源站刷新缓存目录下的内容。
在一个实施例中,该装置还包括:第三判断模块75,用于当缓存目录下未挂载刷新任务时,判断缓存目录下的内容是否已过期;
第二回源模块76,用于当缓存目录下的内容已过期时,触发缓存目录的回源请求至源站;从源站刷新缓存目录下的内容。
其中,该查询模块71包括:
匹配子模块,用于在哈希表中匹配出URL地址中的域名,
查询子模块,用于在与域名对应的哈希字典树中,查询到域名下的缓存
目录。
在一个实施例中,该装置还包括:
第二接收模块,用于接收到刷新任务;
处理模块,用于在由哈希表和哈希字典树建立的目录结构中,在刷新任务对应的缓存目录下挂载刷新任务并记录刷新任务的下发时刻。
在一个实施例中,该装置还包括:
保存模块,用于对刷新任务进行数据持久化处理,在磁盘中保存刷新任务。
在一个实施例中,该刷新任务包括生效时间段。
在一个实施例中,该装置还包括:
第一发送模块,用于发送缓存目录下刷新后的内容至客户端;
第二发送模块,用于当缓存目录下的文件的保存时刻晚于刷新任务的下发时刻时,或者当缓存目录下的内容未过期时,发送缓存目录下的内容至客户端。
在一个实施例中,该装置还包括:
第四判断模块,用于判断刷新任务是否包括生效时间段;
第五判断模块,用于当刷新任务包括生效时间段时,判断缓存目录下的内容的保存时刻是否在生效时间段之内;
第三发送模块,用于当缓存目录下的内容的保存时刻不在生效时间段之内时,发送缓存目录下的内容至客户端;
第六判断模块,用于当缓存目录下的内容的保存时刻在生效时间段之内时,或者当刷新任务不包括生效时间段时,判断缓存目录下的内容的保存时刻是否早于刷新任务的下发时刻。
在一个实施例中,该装置还包括:
确定模块,用于当重新启动时,根据当前时间确定磁盘中保存的有效的刷新任务;
在目录结构中加载有效的刷新任务。
在一个实施例中,该装置还包括:
记录模块,用于记录缓存目录下刷新后的内容在磁盘中的第一偏移量;
第七判断模块,用于每隔预设时长判断磁盘执行写入操作时的当前偏移量与第一偏移量是否相同;
删除模块,用于当磁盘执行写入操作时的当前偏移量与第一偏移量相同时,删除缓存目录下的刷新任务。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
如在说明书及权利要求当中使用了某些词汇来指称特定组件。本领域技术人员应可理解,硬件制造商可能会用不同名词来称呼同一个组件。本说明书及权利要求并不以名称的差异来作为区分组件的方式,而是以组件在功能上的差异来作为区分的准则。如在通篇说明书及权利要求当中所提及的“包含”为一开放式用语,故应解释成“包含但不限定于”。“大致”是指在可接收的误差范围内,本领域技术人员能够在一定误差范围内解决所述技术问题,基本达到所述技术效果。此外,“耦接”一词在此包含任何直接及间接的电性耦接手段。因此,若文中描述一第一装置耦接于一第二装置,则代表所述第一
装置可直接电性耦接于所述第二装置,或通过其他装置或耦接手段间接地电性耦接至所述第二装置。说明书后续描述为实施本发明的较佳实施方式,然所述描述乃以说明本发明的一般原则为目的,并非用以限定本发明的范围。本发明的保护范围当视所附权利要求所界定者为准。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。
上述说明示出并描述了本发明的若干优选实施例,但如前所述,应当理解本发明并非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文所述发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离本发明的精神和范围,则都应在本发明所附权利要求的保护范围内。
Claims (22)
- 一种缓存目录刷新方法,其特征在于,包括:接收到客户端的数据请求,所述数据请求包括URL地址;在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;判断所述缓存目录下是否已挂载刷新任务;当所述缓存目录下已挂载刷新任务时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻;当所述缓存目录下的内容的保存时刻早于所述刷新任务的下发时刻时,触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容。
- 如权利要求1所述的方法,其特征在于,所述方法还包括:当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
- 如权利要求1所述的方法,其特征在于,所述在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录包括:在所述哈希表中匹配出所述URL地址中的域名,在与所述域名对应的哈希字典树中,查询到所述域名下的缓存目录。
- 如权利要求1所述的方法,其特征在于,所述接收到客户端的数据请求之前,所述方法还包括:接收到刷新任务;在所述由哈希表和哈希字典树建立的目录结构中,在所述刷新任务对应的缓存目录下挂载刷新任务并记录所述刷新任务的下发时刻。
- 如权利要求4所述的方法,其特征在于,所述接收到刷新任务之后,所述方法还包括:对所述刷新任务进行数据持久化处理,在磁盘中保存所述刷新任务。
- 如权利要求1-5任一所述的方法,其特征在于,所述刷新任务包括生效时间段。
- 如权利要求2-5任一所述的方法,其特征在于,所述方法还包括:发送所述缓存目录下刷新后的内容至所述客户端;当所述缓存目录下的文件的保存时刻晚于所述刷新任务的下发时刻时,或者当所述缓存目录下的内容未过期时,发送所述缓存目录下的内容至所述客户端。
- 如权利要求7所述的方法,其特征在于,当所述缓存目录下已挂载刷新任务时,所述方法还包括:判断所述刷新任务是否包括所述生效时间段;当所述刷新任务包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否在所述生效时间段之内;当所述缓存目录下的内容的保存时刻不在所述生效时间段之内时,发送所述缓存目录下的内容至所述客户端;当所述缓存目录下的内容的保存时刻在所述生效时间段之内时,或者当所述刷新任务不包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻。
- 如权利要求5所述的方法,其特征在于,所述方法还包括:当重新启动时,根据当前时间确定所述磁盘中保存的有效的刷新任务;在所述目录结构中加载所述有效的刷新任务。
- 如权利要求1所述的方法,其特征在于,所述触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容之后,所述方法还包括:记录所述缓存目录下刷新后的内容在磁盘中的第一偏移量;每隔预设时长判断所述磁盘执行写入操作时的当前偏移量与所述第一偏移量是否相同;当所述磁盘执行写入操作时的当前偏移量与所述第一偏移量相同时,删除所述缓存目录下的所述刷新任务。
- 一种缓存目录刷新方法,其特征在于,所述方法包括:接收到客户端的数据请求,所述数据请求包括URL地址;在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;判断所述缓存目录下是否已挂载刷新任务;当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
- 一种缓存目录刷新装置,其特征在于,包括:第一接收模块,用于接收到客户端的数据请求,所述数据请求包括URL地址;查询模块,用于在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;第一判断模块,用于判断所述缓存目录下是否已挂载刷新任务;第二判断模块,用于当所述缓存目录下已挂载刷新任务时,判断所述缓存目录下的内容的保存时刻是否早于所述刷新任务的下发时刻;第一回源模块,用于当所述缓存目录下的文件的保存时刻早于所述刷新任务的下发时刻时,触发所述缓存目录的回源请求至源站,从所述源站刷新所述缓存目录下的内容。
- 如权利要求12所述的装置,其特征在于,所述装置还包括:第三判断模块,用于当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;第二回源模块,用于当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
- 如权利要求12所述的装置,其特征在于,所述查询模块包括:匹配子模块,用于在所述哈希表中匹配出所述URL地址中的域名,查询子模块,用于在与所述域名对应的哈希字典树中,查询到所述域名下的缓存目录。
- 如权利要求12所述的装置,其特征在于,所述装置还包括:第二接收模块,用于接收到刷新任务;处理模块,用于在所述由哈希表和哈希字典树建立的目录结构中,在所述刷新任务对应的缓存目录下挂载刷新任务并记录所述刷新任务的下发时刻。
- 如权利要求15所述的装置,其特征在于,所述装置还包括:保存模块,用于对所述刷新任务进行数据持久化处理,在磁盘中保存所述刷新任务。
- 如权利要求12-16任一所述的装置,其特征在于,所述刷新任务包括生效时间段。
- 如权利要求12-16任一所述的装置,其特征在于,所述装置还包括:第一发送模块,用于发送所述缓存目录下刷新后的内容至所述客户端;第二发送模块,用于当所述缓存目录下的文件的保存时刻晚于所述刷新任务的下发时刻时,或者当所述缓存目录下的内容未过期时,发送所述缓存目录下的内容至所述客户端。
- 如权利要求18所述的装置,其特征在于,所述装置还包括:第四判断模块,用于判断所述刷新任务是否包括所述生效时间段;第五判断模块,用于当所述刷新任务包括所述生效时间段时,判断所述缓存目录下的内容的保存时刻是否在所述生效时间段之内;第三发送模块,用于当所述缓存目录下的内容的保存时刻不在所述生效时间段之内时,发送所述缓存目录下的内容至所述客户端;第六判断模块,用于当所述缓存目录下的内容的保存时刻在所述生效时间段之内时,或者当所述刷新任务不包括所述生效时间段时,判断所述缓存 目录下的内容的保存时刻是否早于所述刷新任务的下发时刻。
- 如权利要求16所述的装置,其特征在于,所述装置还包括:确定模块,用于当重新启动时,根据当前时间确定所述磁盘中保存的有效的刷新任务;在所述目录结构中加载所述有效的刷新任务。
- 如权利要求16所述的装置,其特征在于,所述装置还包括:记录模块,用于记录所述缓存目录下刷新后的内容在磁盘中的第一偏移量;第七判断模块,用于每隔预设时长判断所述磁盘执行写入操作时的当前偏移量与所述第一偏移量是否相同;删除模块,用于当所述磁盘执行写入操作时的当前偏移量与所述第一偏移量相同时,删除所述缓存目录下的所述刷新任务。
- 一种缓存目录刷新装置,其特征在于,包括:第一接收模块,用于接收到客户端的数据请求,所述数据请求包括URL地址;查询模块,用于在由哈希表和哈希字典树建立的目录结构中,查询到所述URL地址对应的缓存目录;第一判断模块,用于判断所述缓存目录下是否已挂载刷新任务;第三判断模块,用于当所述缓存目录下未挂载刷新任务时,判断所述缓存目录下的内容是否已过期;第二回源模块,用于当所述缓存目录下的内容已过期时,触发所述缓存目录的回源请求至源站;从所述源站刷新所述缓存目录下的内容。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510228135.8A CN106202112B (zh) | 2015-05-06 | 2015-05-06 | 缓存目录刷新方法和装置 |
| CN201510228135.8 | 2015-05-06 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016177283A1 true WO2016177283A1 (zh) | 2016-11-10 |
Family
ID=57218057
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/079816 Ceased WO2016177283A1 (zh) | 2015-05-06 | 2016-04-21 | 缓存目录刷新方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106202112B (zh) |
| WO (1) | WO2016177283A1 (zh) |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108153796A (zh) * | 2016-12-02 | 2018-06-12 | 阿里巴巴集团控股有限公司 | 一种电子红包的数据处理方法、装置和系统 |
| CN109783499A (zh) * | 2019-01-18 | 2019-05-21 | 成都宝瓜科技有限公司 | 一种数据缓存方法、装置和服务器 |
| CN110489420A (zh) * | 2019-08-14 | 2019-11-22 | 深圳前海微众银行股份有限公司 | 一种基于区块链的数据处理方法及装置 |
| CN110990480A (zh) * | 2018-09-30 | 2020-04-10 | 北京国双科技有限公司 | 一种数据处理方法及装置 |
| WO2021037072A1 (zh) * | 2019-08-30 | 2021-03-04 | 贵州白山云科技股份有限公司 | 一种缓存信息的更新方法、装置、设备及介质 |
| CN112861031A (zh) * | 2019-11-27 | 2021-05-28 | 北京金山云网络技术有限公司 | Cdn中url刷新方法、装置、设备以及cdn节点 |
| CN112861030A (zh) * | 2019-11-27 | 2021-05-28 | 北京金山云网络技术有限公司 | Cdn的刷新方法和装置、缓存服务器以及存储介质 |
| CN113497813A (zh) * | 2020-03-18 | 2021-10-12 | 北京金山云网络技术有限公司 | 内容分发网络的内容刷新方法、装置和电子设备 |
| CN114598748A (zh) * | 2021-12-08 | 2022-06-07 | 北京金山云网络技术有限公司 | 缓存资源的刷新方法、装置及系统 |
| CN115733883A (zh) * | 2022-12-27 | 2023-03-03 | 江苏云工场信息技术有限公司 | 一种刷新cdn缓存的方法及装置 |
| CN115883659A (zh) * | 2022-12-15 | 2023-03-31 | 江苏云工场信息技术有限公司 | 一种支持cdn缓存批量刷新的方法及装置 |
| US20240168733A1 (en) * | 2022-11-18 | 2024-05-23 | Stripe, Inc. | Systems and methods for a remotebuild tree cache |
| CN119484501A (zh) * | 2024-10-10 | 2025-02-18 | 北京奇艺世纪科技有限公司 | 同机房回源方法、装置、电子设备及存储介质 |
Families Citing this family (19)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108416017B (zh) * | 2018-03-05 | 2022-11-01 | 北京云端智度科技有限公司 | 一种cdn缓存清除方法和系统 |
| CN108416016A (zh) * | 2018-03-05 | 2018-08-17 | 北京云端智度科技有限公司 | 一种cdn按前缀缓存清除方法和系统 |
| CN108616609A (zh) * | 2018-03-10 | 2018-10-02 | 北京酷我科技有限公司 | 一种iOS网络DNS解析策略 |
| CN109190070B (zh) * | 2018-08-01 | 2021-10-15 | 北京奇艺世纪科技有限公司 | 一种数据处理方法、装置、系统及应用服务器 |
| CN109344353B (zh) * | 2018-09-12 | 2021-10-08 | 福建天泉教育科技有限公司 | 一种可配置化的本地缓存刷新方法及终端 |
| CN109639801A (zh) * | 2018-12-17 | 2019-04-16 | 深圳市网心科技有限公司 | 数据节点分配及数据获取方法及系统 |
| CN111367921A (zh) * | 2018-12-26 | 2020-07-03 | 北京奇虎科技有限公司 | 数据对象的刷新方法及装置 |
| CN110059023B (zh) * | 2019-04-04 | 2020-11-10 | 创新先进技术有限公司 | 一种刷新级联缓存的方法、系统及设备 |
| US10922236B2 (en) | 2019-04-04 | 2021-02-16 | Advanced New Technologies Co., Ltd. | Cascade cache refreshing |
| WO2021007752A1 (zh) * | 2019-07-15 | 2021-01-21 | 华为技术有限公司 | 内容分发网络中的回源方法及相关装置 |
| CN110531930B (zh) * | 2019-08-22 | 2023-01-10 | 苏州浪潮智能科技有限公司 | 存储卷缓存的清除方法及装置 |
| CN112463653B (zh) * | 2020-12-15 | 2024-07-23 | 北京金山云网络技术有限公司 | 数据刷新的方法、装置及电子设备 |
| CN113282539B (zh) * | 2021-05-14 | 2024-09-06 | 北京达佳互联信息技术有限公司 | 信息加载方法、装置、电子设备及存储介质 |
| CN113271359A (zh) * | 2021-05-19 | 2021-08-17 | 北京百度网讯科技有限公司 | 刷新缓存数据的方法、装置、电子设备和存储介质 |
| CN113596105B (zh) * | 2021-07-06 | 2023-12-26 | 深圳市华曦达科技股份有限公司 | 内容的获取方法、边缘节点及计算机可读存储介质 |
| CN115834697B (zh) * | 2022-11-16 | 2024-09-06 | 北京奇艺世纪科技有限公司 | 一种文件存储方法、系统、装置及电子设备 |
| CN116303616A (zh) * | 2023-03-27 | 2023-06-23 | 中国农业银行股份有限公司 | 本地缓存的刷新方法、装置、电子设备及存储介质 |
| CN117194827B (zh) * | 2023-11-08 | 2024-02-27 | 联通在线信息科技有限公司 | Cdn目录刷新的方法及电子设备 |
| CN121239745A (zh) * | 2024-06-28 | 2025-12-30 | 中兴通讯股份有限公司 | Cdn缓存内容刷新的方法、缓存服务器、处理单元、计算机可读介质、计算机程序产品 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102831181A (zh) * | 2012-07-31 | 2012-12-19 | 北京光泽时代通信技术有限公司 | 缓存文件的目录刷新方法及采用该方法的代理缓存服务器 |
| CN104317741A (zh) * | 2014-11-13 | 2015-01-28 | 北京奇虎科技有限公司 | 缓存目录的识别、清理方法和系统 |
| US8954673B1 (en) * | 2012-03-20 | 2015-02-10 | Emc International Company | Using a conditional read request and a hash to determine synchronization of data in a cache at a host with data in storage array |
| US9003127B2 (en) * | 2012-06-13 | 2015-04-07 | International Business Machines Corporation | Storing data in a system memory for a subsequent cache flush |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103685551A (zh) * | 2013-12-25 | 2014-03-26 | 乐视网信息技术(北京)股份有限公司 | 更新cdn缓存文件的方法和装置 |
-
2015
- 2015-05-06 CN CN201510228135.8A patent/CN106202112B/zh active Active
-
2016
- 2016-04-21 WO PCT/CN2016/079816 patent/WO2016177283A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8954673B1 (en) * | 2012-03-20 | 2015-02-10 | Emc International Company | Using a conditional read request and a hash to determine synchronization of data in a cache at a host with data in storage array |
| US9003127B2 (en) * | 2012-06-13 | 2015-04-07 | International Business Machines Corporation | Storing data in a system memory for a subsequent cache flush |
| CN102831181A (zh) * | 2012-07-31 | 2012-12-19 | 北京光泽时代通信技术有限公司 | 缓存文件的目录刷新方法及采用该方法的代理缓存服务器 |
| CN104317741A (zh) * | 2014-11-13 | 2015-01-28 | 北京奇虎科技有限公司 | 缓存目录的识别、清理方法和系统 |
Cited By (21)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108153796A (zh) * | 2016-12-02 | 2018-06-12 | 阿里巴巴集团控股有限公司 | 一种电子红包的数据处理方法、装置和系统 |
| CN110990480A (zh) * | 2018-09-30 | 2020-04-10 | 北京国双科技有限公司 | 一种数据处理方法及装置 |
| CN109783499B (zh) * | 2019-01-18 | 2023-09-22 | 成都宝瓜科技有限公司 | 一种数据缓存方法、装置和服务器 |
| CN109783499A (zh) * | 2019-01-18 | 2019-05-21 | 成都宝瓜科技有限公司 | 一种数据缓存方法、装置和服务器 |
| CN110489420A (zh) * | 2019-08-14 | 2019-11-22 | 深圳前海微众银行股份有限公司 | 一种基于区块链的数据处理方法及装置 |
| WO2021037072A1 (zh) * | 2019-08-30 | 2021-03-04 | 贵州白山云科技股份有限公司 | 一种缓存信息的更新方法、装置、设备及介质 |
| US11853229B2 (en) | 2019-08-30 | 2023-12-26 | Guizhou Baishancloud Technology Co., Ltd. | Method and apparatus for updating cached information, device, and medium |
| CN112861031A (zh) * | 2019-11-27 | 2021-05-28 | 北京金山云网络技术有限公司 | Cdn中url刷新方法、装置、设备以及cdn节点 |
| CN112861031B (zh) * | 2019-11-27 | 2024-04-02 | 北京金山云网络技术有限公司 | Cdn中url刷新方法、装置、设备以及cdn节点 |
| CN112861030B (zh) * | 2019-11-27 | 2024-04-05 | 北京金山云网络技术有限公司 | Cdn的刷新方法和装置、缓存服务器以及存储介质 |
| CN112861030A (zh) * | 2019-11-27 | 2021-05-28 | 北京金山云网络技术有限公司 | Cdn的刷新方法和装置、缓存服务器以及存储介质 |
| CN113497813B (zh) * | 2020-03-18 | 2022-11-25 | 北京金山云网络技术有限公司 | 内容分发网络的内容刷新方法、装置和电子设备 |
| CN113497813A (zh) * | 2020-03-18 | 2021-10-12 | 北京金山云网络技术有限公司 | 内容分发网络的内容刷新方法、装置和电子设备 |
| CN114598748A (zh) * | 2021-12-08 | 2022-06-07 | 北京金山云网络技术有限公司 | 缓存资源的刷新方法、装置及系统 |
| US12386598B2 (en) * | 2022-11-18 | 2025-08-12 | Stripe, Inc. | Systems and methods for a remotebuild tree cache |
| US20240168733A1 (en) * | 2022-11-18 | 2024-05-23 | Stripe, Inc. | Systems and methods for a remotebuild tree cache |
| CN115883659A (zh) * | 2022-12-15 | 2023-03-31 | 江苏云工场信息技术有限公司 | 一种支持cdn缓存批量刷新的方法及装置 |
| CN115883659B (zh) * | 2022-12-15 | 2023-10-03 | 江苏云工场信息技术有限公司 | 一种支持cdn缓存批量刷新的方法及装置 |
| CN115733883B (zh) * | 2022-12-27 | 2023-10-03 | 江苏云工场信息技术有限公司 | 一种刷新cdn缓存的方法及装置 |
| CN115733883A (zh) * | 2022-12-27 | 2023-03-03 | 江苏云工场信息技术有限公司 | 一种刷新cdn缓存的方法及装置 |
| CN119484501A (zh) * | 2024-10-10 | 2025-02-18 | 北京奇艺世纪科技有限公司 | 同机房回源方法、装置、电子设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106202112B (zh) | 2019-07-02 |
| CN106202112A (zh) | 2016-12-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016177283A1 (zh) | 缓存目录刷新方法和装置 | |
| CN101454769B (zh) | 在客户机设备与服务器设备之间同步数据的方法和系统 | |
| US20200257450A1 (en) | Data hierarchical storage and hierarchical query method and apparatus | |
| US9762670B1 (en) | Manipulating objects in hosted storage | |
| US20120317153A1 (en) | Caching responses for scoped and non-scoped domain name system queries | |
| US20110289126A1 (en) | Content delivery network | |
| US8819074B2 (en) | Replacement policy for resource container | |
| US20160188749A1 (en) | Feed Data Storage and Query | |
| CN110399348A (zh) | 文件重删方法、装置、系统及计算机可读存储介质 | |
| CN107153644B (zh) | 一种数据同步方法及装置 | |
| WO2020125630A1 (zh) | 文件读取 | |
| CN102780603A (zh) | 网站流量控制方法及装置 | |
| CN103595797A (zh) | 一种分布式存储系统中的缓存方法 | |
| CN106648442A (zh) | 一种元数据节点的内存镜像方法、装置 | |
| CN116303267A (zh) | 数据访问方法、装置、设备以及存储介质 | |
| CN110008197A (zh) | 一种数据处理方法、系统及电子设备和存储介质 | |
| WO2023093091A1 (zh) | 数据存储系统、智能网卡及计算节点 | |
| CN104281673A (zh) | 一种数据库的缓存构建系统及对应的构建方法 | |
| CN110555744A (zh) | 一种业务数据的处理方法和系统 | |
| US11481378B1 (en) | Method and system for servicing query requests using document-based metadata | |
| EP3958139B1 (en) | Method and system for creating files in a file system | |
| CN115328857A (zh) | 文件访问方法、装置、客户端及存储介质 | |
| CN107103001A (zh) | 基于浏览器获取目标前端资源文件的方法、装置和系统 | |
| US11048728B2 (en) | Dependent object analysis | |
| US7058773B1 (en) | System and method for managing data in a distributed system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16789277 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16789277 Country of ref document: EP Kind code of ref document: A1 |